Need more data to compute a meaningful answer. What do you want our of your next language?
I'm looking for a well-rounded language, which is versatile in the same direction as, e.g., Python is. Ideally, it would also enable expanding one's own set of programming skills and knowledge/practice of interesting paradigms (i.e., a mind-shift of sorts). Nice to have's: - a rich library ecosystem (like Python and Go, for instance) - as close to C as possible, in terms of speed
Ask HN: Next programming language to learn: Nim vs. D?
11–20 of 27 posts
Re: Ask HN: Next programming language to learn: Nim vs. D?
#12Re: Ask HN: Next programming language to learn: Nim vs. D?
#13It's hard to pick between those two in particular. Nim is more fluid syntactically; D is more precise. D is also older and I would generally consider it more mature. (After trying both, I went with D. But in the future I want to use Zig for some of the lowest level code.)
Re: Ask HN: Next programming language to learn: Nim vs. D?
#14Couple of reasons why I think Nim is an awesome language:
1. Syntax: It's beautiful. If you like Python syntax, you'll like this. On the other hand, it's much more concise, without losing readability.
2. Static type check, with a sprinkle of type inference only when assigning the initial value.
3. Proc/operator overloading: Have procedures (functions) named the same handle different data types differently. And the same with operators.
4. Support: Great support over Gitter, GitHub issues, Nim Forum, etc. Great devs! (though, I incorrectly thought earlier that that wasn't the case :))
5. Makes me feel home: Hacking/coding in Nim comes the closest to coding in Emacs Lisp. In Emacs, if I want to understand what a function does, I look at its source code. I can do the same in Nim.
6. Editor support: The nim-mode Emacs major mode and ob-nim Org Babel package are awesome!
7. Documentation: Check out the Nim the index.html to search anything, and also Devdocs.
8. Whitespace: Tab not allowed, yay!
9. Not as easy as installing go/rust toolchains locally (without admin rights), but not difficult either.
10. The nimble tool (equivalent of pip) works great for building/distributing Nim projects.
.. and much more! Computer science experts can talk about more benefits of Nim from systems programming point of view (GC, etc.).
For my use case, where I use Nim as Python/Bash replacement, CLI utility development, it looks excellent so far.
In plain terms, it's joy coding in Nim :)
Re: Ask HN: Next programming language to learn: Nim vs. D?
#15Earlier quoted context omitted.
I'm looking for a well-rounded language, which is versatile in the same direction as, e.g., Python is. Ideally, it would also enable expanding one's own set of programming skills and knowledge/practice of interesting paradigms (i.e., a mind-shift of sorts). Nice to have's: - a rich library ecosystem (like Python and Go, for instance) - as close to C as possible, in terms of speed
Nim is like a fast version of Python and Crystal is like a fast version of Ruby. Rust and Go also have some use in the same space, but they all differ in the details as in whether the GC exists and is enabled by default, is optional, or doesn't exist. Coming from Python, I found Nim to be the best for my mild systems programming needs. I haven't tried Crystal as it doesn't work on Windows (last I checked). Go is too…
The idiomatic approach to solving problems in Python and Nim are different. I came from a strong Python background and now I prefer Nim to Python as a general purpose language and especially for writing scripts.
Nim is highly productive and with excellent type safety.
The compiler is relatively fast though maybe not as fast as D and certainly not as fast as Go. The compiler is a lot faster than Rust/Crystal/Pony and there is current work being done on incremental builds which should make it even faster.
If you take a look at these benchmarks the Nim and D fastest versions are faster than Rust and on par with the fastest C++.
Significantly, the fastest D version has double the lines of code as the fastest garbage collected version of Nim though the Nim version performs slightly faster.
The fastest garbage collected version of Nim has exactly the same lines of code as Python.
https://github.com/frol/completely-unscientific-benchmarks#l...
Re: Ask HN: Next programming language to learn: Nim vs. D?
#16It's hard to pick between those two in particular. Nim is more fluid syntactically; D is more precise. D is also older and I would generally consider it more mature. (After trying both, I went with D. But in the future I want to use Zig for some of the lowest level code.)
Other than maturity, what are the reasons you've chosen to go with D (and are now choosing to pursue Zig)?
When I left Nim, it was because I had serious concerns about the project being able to tame its rapid accumulation of features. I had no faith in all the things it advertised to actually work correctly. The dev process I witnessed was "cave in to toxic people who whinged a lot." D has a lot of warts from being around longer, but in the end, what I want to write code in anger with is something that can boast a well-engineered compiler, and D has not one compiler but more than one.
That was years ago. To win me back you'll have to market a demonstration of similar stability.
Zig is in a different category from any other option because its design allows me to tackle a piece of low-hanging fruit: a modernization of old C libraries that does not reinvent the universe, create a new ABI, introduce a runtime, or otherwise disrupt the original context. I can write basically the same kind of code in the same kind of style, but the language automatically pushes my attention to more edge cases and undefined conditions, and the compiler simplifies the build process, removing the preprocessor noise that tends to appear in substantial libraries.
Re: Ask HN: Next programming language to learn: Nim vs. D?
#17Re: Ask HN: Next programming language to learn: Nim vs. D?
#18It's hard to pick between those two in particular. Nim is more fluid syntactically; D is more precise. D is also older and I would generally consider it more mature. (After trying both, I went with D. But in the future I want to use Zig for some of the lowest level code.)
Re: Ask HN: Next programming language to learn: Nim vs. D?
#19Earlier quoted context omitted.
Nim is like a fast version of Python and Crystal is like a fast version of Ruby. Rust and Go also have some use in the same space, but they all differ in the details as in whether the GC exists and is enabled by default, is optional, or doesn't exist. Coming from Python, I found Nim to be the best for my mild systems programming needs. I haven't tried Crystal as it doesn't work on Windows (last I checked). Go is too…
Apart from some syntactic commonalities and expressiveness, Nim doesn't have a lot in common with Python. The idiomatic approach to solving problems in Python and Nim are different. I came from a strong Python background and now I prefer Nim to Python as a general purpose language and especially for writing scripts. Nim is highly productive and with excellent type safety. The compiler is relatively fast though maybe…
On a practical level, they are close enough to let you convert Python code to Nim with reformatting and replacing instead of doing a complete rewrite.
Re: Ask HN: Next programming language to learn: Nim vs. D?
#20Both and Chapel.