Hacker News new | ask | show | jobs
by bglusman 1161 days ago
I admit for a long time this was my primary motivation to learn Rust, but, sadly, I haven't come across problems in years that were CPU bound/where I needed something like Rust... Rustler still looks like a great fit if needed, but, depending on the use case, if I were CPU bound and needed to write my own code/not just use a Rust library, I'd be as or more likely to look at using Zig and Zigler[0], for much faster learning curve, and from what I've read, easier tighter integration into elixir, including I think language server integration. Some discussion here[1] though I forget if I listened to this one or not.

[0]https://github.com/ityonemo/zigler [1]https://podcast.thinkingelixir.com/83

2 comments

Efficient PLs are useful for latency sensitive applications too, not just CPU bound ones. Though, that doesn't widen the number of cases by much...
I haven't come across problems in years that were CPU bound/where I needed something like Rust

This is where Rust falls short of C#: scaling to the issue at hand. C# can build you a beautiful app at a high-level but also lets you dick with pointers and assembly at a low level. Rust insists on defaulting to pass-by-move and an arcane trait system that hold it back from being usable in large projects.

If Rust had gone for a traditional OOP system, the "everything must be OOP/use inheritance everywhere" crew would have messed up the ecosystem pretty quickly. The traits concept is refreshing and traits + structs encourage composition over inheritance. I think it has been a huge plus for the language and the ecosystem.
I really like the trait system, but “refreshing” might not be the correct word given that it is pretty much what Haskell had for I don’t even know how many years.
Composition is objectively superior to inheritance, and that's all traits are: https://en.m.wikipedia.org/wiki/Composition_over_inheritance