8 ms·
I don't see the appeal of Nim. We have the choice of C++14, Rust and Go for well supported robust languages with different focuses. C++14 has the best execution
by sqeaky 10y ago
I don't see the appeal of Nim. We have the choice of C++14, Rust and Go for well supported robust languages with different focuses. C++14 has the best execution performance, Rust is the most safe and it seems likely go tries to be the simplest. What does Nim do better than any of these?
Presuming it does do anything better than those learning Nim is hard because the examples are stale and the documentation lacking. I don't mean just the official docs, which might be great, but where are all the answers on SO and community made books or tutorials.
- adamnemecek 10y agoNim is trying to be a better Python I believe.
- baldfat 10y agoI have been following Nim and Racket and it really looks like Racket has been gaining more and more momentum. Really it is a Win/Win both do great things that might be able to fix some of the weakness of Python.
- TylerE 10y agoThe thing that can't be overstated with Nim is how fast it is. We're talking C/C++ level performance - and that's on "normal" code, not some abomination with tons of annotations or other cheats. It's also very unlike Rust in that it's a very low ceremony language. Simple scripts are no more verbose than they would be in Python or Ruby.
- rbehrends 10y agoC++ and Rust don't have garbage collection, Go's type system is very simplistic. Obviously, depending on what you do, this can be either an advantage or a disadvantage. My point is that there are clear differentiating factors. The closest competitor for Nim is probably D, not any of the languages you name.
- sqeaky 10y agoThe article seemed to describe a high speed native language with garbage collection. I guess that does seem similar to D, but D is much closer to any of the languages I listed with more than 15 years of development and a much smaller list of breaking changes. It also isn't anywhere near as popular as the three I mentioned. Why does Nim get the attention that D does not? I think Nim only gets attention around here because its new and not because it brings anything directly useful. As long as it is still "new" there is still so much potential. As for garbage collection, I think you are overestimating its value. There are great resource management schemes in both Rust and C++, and they can each manage much more than just memory. I am only qualified to speak in detail on C++, but if you simply avoid the "new" operator and automatically allocate everything (some say stack allocate), which is the default, then everything is cleaned up for you automatically. Further down the garbage collection route, if your app doesn't need performance then why not stick with Ruby, Javascript or Python, they are all well supported and provide tons of flexibility and libraries. If you need performance, why settle for have measures why not go for C++, Rust or one of the blazing fast fully native languages without GC (even one of the really fast ones with GC like Haskell or Java)? I see the space between them filling up with a ton of languages that seem hard to distinguish. Nim looks like just another, piling into this gap that swallows otherwise decent languages like D, cyclone, darkbasic, pascal, and .Net language that isn't C# and so many other languages that I cannot count them.
- rbehrends 10y ago> The article seemed to describe a high speed native language with garbage collection. I guess that does seem similar to D, but D is much closer to any of the languages I listed with more than 15 years of development and a much smaller list of breaking changes. It also isn't anywhere near as popular as the three I mentioned. Well, when you compare languages, you usually do it by feature set. Both Nim and D are statically typed, garbage collected, imperative languages with first-class metaprogramming features. I'll also add that Nim has also about 9 years of development behind it. It's older than you think. > Why does Nim get the attention that D does not? I think Nim only gets attention around here because its new and not because it brings anything directly useful. As long as it is still "new" there is still so much potential. I see both Nim and D getting comparable attention. They both aren't mainstream languages, so coverage is mostly by enthusiasts and intermittent. People are interested because both are sufficiently different from mainstream languages, not because they suddenly plan to bet their careers on them. > As for garbage collection, I think you are overestimating its value. There are great resource management schemes in both Rust and C++, and they can each manage much more than just memory. I am only qualified to speak in detail on C++, but if you simply avoid the "new" operator and automatically allocate everything (some say stack allocate), which is the default, then everything is cleaned up for you automatically. This would be a long debate. Suffice it to say that for many people the benefit of avoiding GC is unclear. Both C++ and Rust manage shared ownership poorly (i.e. it being inefficient, leading to lots of syntactic noise, or both). Note also that I'm not saying that GC is always better, but that it's a differentiating feature. As for resource management, RAII in my experience is primarily the consequence of poor support for higher order functions or equivalent functionality in a language. (The type of resource management that RAII facilitates is usually better done through higher order functions or a sufficiently expressive macro [1] system.) > Further down the garbage collection route, if your app doesn't need performance then why not stick with Ruby, Javascript or Python, they are all well supported and provide tons of flexibility and libraries. You seem to be have some serious misunderstandings about garbage collection. No, GC is not per se a performance drain, and adding the two orders of magnitude overhead that a typical bytecode interpreter for a dynamically typed language induces is not even in the same ballpark for even poorly implemented GC. [1] And by macros I don't mean C/C++ preprocessor macros, but macros that are properly integrated in the language and its type system, such as in LISP, Nim, D, or Rust.
- coldtea 10y ago>I don't see the appeal of Nim. We have the choice of C++14, Rust and Go for well supported robust languages with different focuses. C++14 has the best execution performance, Rust is the most safe and it seems likely go tries to be the simplest. What does Nim do better than any of these? Well, C++ is bloated and with tons of tricky parts, Rust has lots of ceremony and head-scratching to fit your programs into its "lifetimes" model, and Go is lacking expressive power and has several bad decisions baked in (possible forever).
- sqeaky 10y agoNone of these things say why Nim is good. All of these languages, despite all these failings, have been used to good effect. Why is Nim good, what does it do that makes it better where these fail?
- coldtea 10y ago>All of these languages, despite all these failings, have been used to good effect. That's a pretty low bar.
- sqeaky 10y agoThis isn't a real response or accurate. C++ is used it countless video games, Science simulations, applications and operating systems. Rust is new (only 7 years old), but is being integrated into the renderer for a major browser and has a library packages that is growing. Go about as old as Rust and is used to make a ton of real world services including a large chunk of the services at Google. Nim is older than Go and Rust, and has what to show for it? It sounds like a negative and leading question, but I really don't mean it that way. What are some interesting projects made in Nim? Even hobbyist project can be meaningful.
- nimmer 10y agoLanguages and other projects backed by large companies are known for growing fast. Java, Visual Basic, C#, Go, Rust... Community-driven projects, generally speaking, tend to have slower growths, e.g. Python, Linux.
- ElectronCharge 10y ago"We have the choice of C++14, Rust and Go for well supported robust languages with different focuses." Don't forget Swift. I think it outshines all of the above (and there is active discussion of adopting ownership concepts similar to Rust's). Swift is already highly optimized. I found this article to be very interesting: https://www.cocoawithlove.com/blog/2016/05/19/random-numbers.html https://www.cocoawithlove.com/blog/2016/05/19/random-numbers... TL;DR: 'Both the C and Swift are now the same. I don’t just mean “they take the same time”, I mean they are compiled to literally the same instructions.' Initially the Swift Mersenne Twister code was faster, but he was able to apply an optimization to the C code that made it identical.
- ElectronCharge 10y agoTo whoever downvoted the above without replying: you are intellectually bereft. ;-)
- dom96 10y ago> What does Nim do better than any of these? Metaprogramming, and it's not just about how powerful it is. Metaprogramming in Nim is easy, safe, and powerful. You mention a lot of extremes: Go is simplest, Rust is the most safe, C++14 has the best execution performance. These extremes have trade-offs: Go's lack of generics mean that you end up writing a ton of unsafe boilerplate code, Rust's safety means that you have to spend extra time wrapping your head around lifetimes, C++'s best execution performance means that you have to deal with memory manually and in an unsafe manner. These trade-offs are debatable, but my point is this: what if I want a language that is well balanced? Nim may not be as simple as Go, but it's definitely simpler than C++ and Rust. Nim may not be as safe as Rust, but only when you decide to manage memory manually, which is rarely necessary and when using Nim's GC it is just as safe as Rust. Nim compiles to C/C++ so its performance is identical in many cases. The initial idea behind Nim was to have a small core language with a powerful metaprogramming system for expansion. Perhaps we have strayed from this vision a little bit, but it is still true. And we do aim to refocus towards it.