cztomsik
Joined 9 years ago
Joined 9 years ago
consider me optimist now, but just few months ago, even frontier models were dumb, doing stupid mistakes all the time, all of them were so dumb I'd never expect anything to change in just few months.
BTW: cheers, we should grab a beer some day :)
BTW: It was already discussed many times in rustc repo, and it's clear that there's no serious downside for apps, but no action was taken. I am sharing this in a hope to make some peer pressure...
I've been also very skeptical about Rust in the past, and all my points still hold (traits vs. accidental complexity, no introspection, barely usable macros, borrow checker awkward to use with arenas, orphan rule) but what's changed is that I won't be writing any of that myself, and LLMs are good in generating all sorts of glue and they are incredibly good at figuring out what's wrong, they just never get tired. so lots of Zig benefits are simply not relevant IMO.
one extra thing - Zig doesn't have interfaces, we often use comptime duck-typing and it works great, until it doesn't. it's not common but when you hit such case, it really sucks. I've realized that during my `serde` rabbit-hole and I had to revert the whole feature and scratch it. it was not obvious to me when I started but it's now clear to me that Rust really is higher-level PL than Zig. another example is Zig IO, I think it's screaming for interfaces, yet Zig is trying to pull all sorts of awkward hacks just to avoid it. it's sort of like when Go was avoiding generics but we all knew it's inevitable.
my current theory about Rust is that it might be bearable for my sorts of projects, given specific code guidelines. sort of like people writing C-style C++.
That said, I've been re-evaluating my choices lately.
Also, Clojure specifically is mem-safe because of the host VM and concurrency saf(ish) thanks to persistent data structures and core.async. It might be somewhere between 3 and 4, maybe together with Elixir. Unfortunately I never had enough time to play with it but I definitely will.
1. JS is mem-safe, single-threaded, and there are lots of training data. Easily my first choice. I'd put Python here as well, although I don't like it personally. Both should be used with "avoid external deps" in your AGENTS.md
2. Go might be a good second choice. Simple language, IMO good primitives for concurrency, well-designed std, therefore smaller potential for supply chain attacks.
3. Elixir/Erlang, little training data but rising. Safe language, safe concurrency, immutable, scalable, there are some many advantages... It has been avoided because it's different but that could change drastically in the age of LLMs.
4. Rust is probably next choice, along with C++, because while Rust is safer, the language is quite complex. C might be here too, there is a lot of training data, but every project is different and the language is very unsafe.
5. Zig, I really like the language, but it is terrible for LLMs, mainly because it's constantly changing, and the std is also under-featured and IMO weirdly designed. It's a fun language for hobby hacking, which I believe is not going anywhere, it's just not going to be something you will be payed for.
- Rust is huge, many options, many programming styles
- typical Rust project has lots of transitive dependencies
- there is nothing in Rust that disallows using system libraries or linking to them
- it's not even true that the program is going to be mem-safe because there could still be unsafe {} either in the repo, or in any of the transitive deps. not to say that safety is broader than just mem-safety.
if you think "written in Rust" says anything, I'd argue that you might give it a try and find out yourself. I did that, and I am glad I am out. the reason why I am telling you is because I've been click-baited (into Rust) before, and it took me few years to realize all of this, and to make a move.