Most active commenters
  • mmastrac(3)

←back to thread

517 points bkolobara | 11 comments | | HN request time: 0.002s | source | bottom
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 #
1. 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 #
2. 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 #
3. 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?
4. shark1 ◴[] No.45052565[source]
Reviews like yours are increasing my interested towards Rust. Apparently the tools and ecosystem are great, build on solid concepts and foundation.
replies(1): >>45052878 #
5. 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.
6. baq ◴[] No.45052878[source]
Rust has 3 major issues:

- compile times

- compile times

- long compile times

It isn't that big of a deal in small projects, but if you pull dependencies or have a lot of code you need to think about compilation units upfront.

replies(1): >>45053331 #
7. winter_blue ◴[] No.45053331{3}[source]
How is Rust in terms of incremental compile time? Is incrementally recompiling on file in a large project quick? Hopefully link times aren't that bad.

One thing I like about the JVM is hot code reloading. Most of the time, changes inside a method/function takes effect immediately with hot code reloading.

replies(2): >>45053716 #>>45056012 #
8. chiffaa ◴[] No.45053716{4}[source]
Link times are the worst part but solveable with mold[1]/sold. Incremental compilations are usually an order of magnitude (or even two) faster than clean compiles but tbh that can still feel slow. Helped by using something like sccache[2] or even cranelift[3] when debugging. Still not as fast as having a hot-reloadable language but it gets you to a relatively pleasant speed still IME

[1] https://github.com/rui314/mold [2] https://github.com/mozilla/sccache [3] https://github.com/rust-lang/rustc_codegen_cranelift

replies(1): >>45056380 #
9. mmastrac ◴[] No.45056012{4}[source]
We had issues with long compile times at deno. Release builds were brutal, debug builds were OK as long as they were incremental. It was likely one of the largest open-source rust applications, but we were still quite productive.

Most likely you'll have years before it's an issue and there are mitigations.

10. mmastrac ◴[] No.45056380{5}[source]
I've never been successful in getting sccache to really speed up projects, but then again only release builds have _really_ been impossible for me, and that's only when I was working on Deno which was absolutely massive.
replies(1): >>45062887 #
11. chiffaa ◴[] No.45062887{6}[source]
sccache sped up my clean compiles by 2x on some projects, but it's a very YMMV solution most of the time