Hacker News new | ask | show | jobs
by curquiza 1228 days ago
Hello!

For me, "built in Rust" can be a real marketing argument. Indeed, Rust is a language that has proved its safety in the past. Building a technical product in Rust guarantees stability and safety (no memory issues in general) and performance (no garbage collector issue), so it brings more trust to the users.

2 comments

FWIW milli does use unsafe in places.

Also I would recommend not conflating no GC and performance. There are lots of reasons for Rust being fast and many have nothing to do with no GC. The main reasons a lot of languages with GC are slower is due to allocating on the heap as opposed to the stack, and in general Rust does a lot of static linking and the compiler has the full amount of information to optimize calls without needing to move stuff to the heap. That's the main perf win.

Actually there are times when GC is more efficient than than automatically freeing memory because GC can batch cleanup work.

I am the co-founder and maintainer of the engine, and I confirm we have some localized unsafe blocks for when we interface with the C library: LMDB.

However, I prefer having a few unsafe blocks that I can review carefully than a single one encapsulating the primary function.

> Actually there are times when GC is more efficient than than automatically freeing memory because GC can batch cleanup work.

Where can I read about these details of software performance? Can you recommend a book?

Safety yes, but stability? It's crash early model wrt stack overflows and out-of-memory errors seems to trade off availability for safety. Not proficient in Rust as a user nor as a developer, so an honest question.
> It's crash early model wrt stack overflows and out-of-memory errors seems to trade off availability for safety

It's worth noting that while you can catch these kind of errors in C, very little software actually does so. The only software I'm aware of that does this is SQLite. Your C software will more than likely crash in OOM and StackOverflow situations too.

> while you can catch these kind of errors in C

Tbh C would have never crossed my mind as an alternative for Rust in this case. I guess that says something.

So Zig then?
I'd have chosen JVM for safety, ease of deployment, stability and performance, and Java for maturity of the toolchain (fully aware that required memory would be a concern). With that in mind, can you pitch Zig to me?