←back to thread

517 points bkolobara | 2 comments | | HN request time: 0.003s | 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. jabwd ◴[] No.45047441[source]
Though my code complexity is far FAR from what you've been writing it has been a similar experience for me. There are a few footguns and a bug in chrono I still have to find the energy to report or fix; which has been causing a bi-yearly issue, but apart from that happy lil programmer.
replies(1): >>45050344 #
2. burntsushi ◴[] No.45050344[source]
I would be curious to know if you've looked at `jiff`. Does it resolve your bug/footgun issues with chrono?