Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust's sphere of necessary domain knowledge is higher than average. That's not a downside relative to the goal it has in mind, but it is a trade-off. When you're an indie developer working on a side project, there's a strong impulse to let go of a lot of the specific quality controls and customizations that you can use in a team setting where you're paid to know how to operate the inner workings, and instead look for something that is "prosumer" and lets you hack out a solution.

It's kind of the difference between "I want to make a camera" and "I want to mod a camera". Making means controlling the design from the beginning, and Rust is one of the best available tools for that. But modding is more like what you do when you want to bodge together some pieces of I/O and data processing. Apps dealing with audio and graphics in any fine-grained sense tend to want the latter: they aren't actually dealing with resource management issues that often, especially not in the "weekend hack" stage, they just need low latency device access and a fast-enough inner loop. And those requirements imposed a massive, non-obvious barrier to entry on stuff with a substantial VM runtime: writing bindings, remapping ABI semantics, etc. You had to learn a lot of concepts, possibly more than are needed for writing useful Rust code, to overcome that. Rust demands just that you use certain kinds of documented idioms to get through a typical coding problem, while fighting with compilers and linkers to create bindings is a no-mans-land of debugging the meaning of each error message, silent failure or crash, requiring you to know two languages, the build system, the binary formats, and the OS you're targeting simultaneously.

For a long time, C++, for all its faults, was the prosumer's tool of choice for coding near to the metal while still leveraging existing tech, because it was what the toolchains actually supported directly, which let you get ypur weekend hack working piecemeal, while using something else introduced unacceptable levels of overhead.

But I think there are now justifications to use Rust in some cases and Zig or Nim in others. I've kicked the tires on all three, and can vouch for Nim feeling productive in the sense of being both relatively C-friendly as a build environment(lots of features for high-permissiveness hacking) and also occupying a "default to high-level methods" mindset. D could have gotten there in an alternate reality, I think, but it was trying really hard to be big-systems code instead of hacker's glue, which has saddled it with an awkward design story. The things D wanted to do well, Rust now mostly occupies.



I like all of this thinking. I don't deal a lot with ABI and integrating Rust into things, just another programmer that has been writing a Go (and Python) over the last few years and gradually becoming disaffected with its constraints and design, though Go is still a great language to get things done with and much safer than say Python or other dynamic languages. I will say this, though, as an older programmer, even when scratching an itch, it is often worth Doing It The Right Way. It feels freeing to rush ahead, know you are making technical debt, but get a thing to seemingly work.

If you or anyone else ever has to maintain it that technical debt almost always comes calling and it can often be unpleasant. For personal projects, oh well, you move on, maybe you can throw it out. For even small professional projects you are now in the "Find Out" phase of technical debt. So I am just in this mindset of writing meaningful things and saving experiments for truly throw away code, which still has its place. I am gonna go ahead with Rust as my next 5+ year language, a role Go and Python filled. I think my litmus for Python vs. Rust is if it will take me more than a day (estimate) to write, I am going to suck it up and use Rust.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: