Hacker News new | ask | show | jobs
by sph 1089 days ago
There is more to software engineering than just memory safety.
3 comments

The question is not whether Nim is better than Rust, the questions are:

Does a C++ developer have reasons to switch to Rust

and

Does a C++ developer have reasons to switch to Nim

Why switch? Is it that weird to know and use more than a language?

In case of adoption, both answers are yes, because Rust and Nim don't occupy the same niche. The reason why Nim has not caught like wildfire is that its niche is often shared with Python or Go, which have a much larger mind share.

Which is why asking this question from the memory safety point of view misses the mark.

It is not. I use 3 languages on a weekly basis for work, and 2 more for hobby stuff.

It's about use cases- frontend, jvm, systems/low-level, realtime/sockets, ML. There could be more overlap, but for reasons they don't.

Sure, but does nim have any breakthrough innovations in any of those other areas?
Do you need breakthrough innovations to adopt a language? Listen, I like Rust and it has its niche for some of my projects, but not all projects should be written in Rust. Least of all because it is an innovative language. That works well as a marketing slogan, not as a factor to decide which language is more apt for the project at hand.

Do I need memory safety? If yes, Rust is the best choice.

But other times I need quick iteration times (Python, or maybe Nim) or immutability, or painless concurrency (Elixir), or meta-programming (Lisp & derivatives). I don't spend any time to ask myself whether a language is innovative, when I got deadlines and results to deliver.

> Do you need breakthrough innovations to adopt a language?

No, but the question wasn't "why has literally nobody on earth adopted nim?" (Which would obviously be false). The question was "why isn't it as popular as rust". There are thousands of languages out there. To be at the top of the pack, nim would have to really stand out somehow. Nim hasn't, so its a little bit niche somewhat mid-popularity language. Which is totally fine, not everything has to rule the world. However that is the reason why it is not ruling the world.

> To be at the top of the pack, nim would have to really stand out somehow. Nim hasn't, so its a little bit niche somewhat mid-popularity language.

I'm not sure about this argument. If Mozilla had created and pushed Nim instead, would it be as popular as what they did for Rust? I'm sure the marketing department would have found some angles to push for Nim. Maybe it would have been memory management options or that its somewhat like a compiled version of Python. I'm sure corporate minds would have figured something out. So if we could see alternate dimensions, where Nim was under Mozilla, it might be nearly as popular.

As it is, some would argue that Rust is somewhat niche, reserved for cases where memory safety without a GC is both necessary and critical. Rust ranks 20th on the TIOBE index. While nothing to sneeze at, nobody knows if it will go higher on the charts or fall back down.

> If Mozilla had created and pushed Nim instead, would it be as popular as what they did for Rust?

In my opinion, definitely not. I knew people excited about and working in Rust back in ~2016 when very few people knew about Rust. They proselytized me, I converted others, et cetera. It's all grassroots spread and has nothing to do with Mozilla marketing.

And that grassroots marketing spread rapidly and easily because of Rust's killer unique features.

Yes, many actually.
Yes, so if we get away from the elevator pitch, Rust provided:

* Cargo for managing dependencies and a sensible module system

* Option/Result based error handling without using null

* Zero (runtime) cost abstractions like iterators and async