←back to thread

517 points bkolobara | 1 comments | | HN request time: 0.001s | source
Show context
nneonneo ◴[] No.45045282[source]
Last year I ported a virtio-host network driver written in Rust, entirely changing its backend, interrupt mechanism and converting it from a library to a standalone process. This is a complex program that handles low-level memory mappings, VM interrupts, network sockets, multithreading, etc.

What’s remarkable is that (a) I have very little Rust experience overall (mostly a Python programmer), (b) very little virtio experience, and (c) essentially no experience working with any of the libraries involved. Yet, I pulled off the refactor inside of a week, because by the time the project actually compiled, it worked perfectly (with one minor Drop-related bug that was easily found and fixed).

This was aided by libraries that went out of their way to make sure you couldn’t hold them wrong, and it shows.

replies(1): >>45046182 #
mmastrac ◴[] No.45046182[source]
I've been writing Rust code for a while and generally if it compiles, it works. There are occasional deadlocks and higher-level ordering issues from time-to-time, but modulo bugs, the compiler succeeding generally means it'll run a decent amount of your project.
replies(3): >>45047441 #>>45052565 #>>45052620 #
1. AlanYx ◴[] No.45052620[source]
It's a lot like Haskell in that respect. Once you get something to compile, it tends to work more often than not.