Nim (formerly Nimrod) 0.10.2 released
nim-lang.org
nim-lang.org
Can anyone give me some insight as to why it's not as hyped, if at all? I'm rather unfamiliar with Nim, and it's seems to have a smaller community, but it feels like it should be getting all sorts of love considering its speed of execution.
Thanks in advance for the help!
Not to start a language flamewar but I'd like to see hard numbers before I believe that in the general case Nim is faster than Rust.
I haven't looked at your link in details but the fact that one C++ implementation manages to outperform all the others (including other C and C++ implementations and of course Rust and Nim) by more than one order of magnitude leaves me perplex. It means there must be a huge room for improvement in a lot of those tests. Also the timing code is implemented in the tests themselves using each language's primitives which seems a bit risky to me when comparing language performances.
Also the unsafe rust version has exactly the same performance as the safe one which is weird. After looking at the unsafe version it appears that all the unsafe blocks are just here to remove the bound checks on the vector indexing and that's it. That seems like a weird choice for optimization, I'd have tried to make the recursive function iterative first, for instance. At least it goes to show that that particular check is not too expensive and it's better to stick to safe code when possible.
As does the cached Javascript version. All of the implementations in the path benchmarking by fiat use a naiive algorithm (recompute the cost for each recursive traversal). The C++ and Javascript cached versions are supposed to show that algorithm choice is much more important than language choice (and do some memoization of the cost calculation).
https://github.com/logicchains/LPATHBench/blob/master/jscach...
This uses a "pruning" algorithm and is a different algorithm than all the other implementations use. It shouldn't be used to compare the different languages, as it's just not doing the same work.
Examples of features that rustc uses today for optimization beyond those available in C are the "nonnull" and "dereferenceable" attributes (along with some custom optimization passes to make non-null pointer optimizations stronger than what LLVM provides out of the box). An example of a feature beyond C that it could use, but does not today, is custom type-based alias analysis.
This in turn means that Nim does not have as many resources (it is developed completely voluntarily in people's spare time) so development is slower.
But how can you get a major company to get behind Nim when the all want to have their own programming language?
I don't know how relevant that is, but Rust has Mozilla (and Samsung?) and Go has Google plus some Unix / Plan 9 people behind it. But Nim? There are probably other factors as well.
When you miss some of these elements the barriers to entry go way up and the community is limited to people who can tolerate the environment without it. That's true regardless of how good or proven the base technology is. Hype and institutional use accelerates this cycle by forcing it onto developers - you end up with more people early on who say "yes, i put this into production and i can tell you how it worked."
I've never used Nim and I should probably give it a try but it seems that the "garbage collected, parallel oriented" niche is somewhat more cluttered with the likes of Go, the various languages built on top of .Net or the JVM, the lisps, the haskells... Not all target exactly the same use cases but there's a lot of overlap here and it's harder to stand out.
Nowadays the term "GC" almost implies "tracing GC", so "non-tracing GC" need to be well explained. Or need to adapt some new term to explain new concept. Currently, Nim's GC explanation just looks like incremental RTGC that is not really attractive to existing RT app programmers.
"Normal" languages live on a different time scale: it takes many years to gather enough users to even have a chance of generating a bit of hype. For most languages that moment never comes: they are good, solid languages with decades of development behind them and completely obscure and unknown. Others become well-known in certain areas while still being unfamiliar for the "general public".
Take a look at Haxe, Opa, Elixir, Cobra or Io for example. They are all very interesting (each for its own reasons), mature and productive - and completely unknown. Out of those only Elixir gets mentioned here sometimes.
Anyway, a choice of language should never be based on "hype" alone. Of course, language popularity is an important factor, but most often limiting yourself to popular languages is a case of premature optimization: it's quite likely that in your project the language popularity won't make a difference (especially in small/short-lived projects) and that "raw" language features are more important than hype. (Of course that's not always the case: bigger or long-lived projects benefit from language popularity very much, for example by having easier time finding replacements for developers who went away and so on)
Pike is a bit of a special case due to its history though. I first learned it in the 90ties, when I joined an effort to port some MUD from LPC - Pike's predecessor - to Pike. At the time both LPC and Pike looked very weird to me, coming from mostly static, compiled languages like C and Pascal. A "mixed" datatype (like void* in C) with type predicates was something new to me, built-in mappings and other high-level datatypes were too. I don't remember the details, but I think both Pike and LPC had an unusual object system, closer to prototype-oriented languages like Self, JS, Io or Lua than to "normal" class-based ones (but I may be wrong on this). Anyway, it's another good example of solid and mature but unpopular (to the point of obscurity) languages.
The economic realities of software development require disposable human resources.
The "economic realities" are /symptomatic/ of the impedance mismatch of an 'industrial scale' demand on the consumer side and an arts and crafts production side.
> most .. projects fail.
It is a minor miracle that they can even be attempted and many even succeed.
Haxe has the small niche of flash type games, and I think it is doing fine in that area. But to expect it to be as popular as a general purpose language is not warranted.
Io is not "slow", although the level of dynamism it provides has obvious performance downsides. It's generally "fast enough" and - in my experience - a bit faster than CPython. Slower than JITed Lua though. It does, however, solve the C10k problem with its coroutines, actors and futures, which are implemented transparently for the user and with niceties like automatic deadlock detection (on runtime). It's not exactly anything new, but it was new when Io first appeared (I mean the implementation as a language feature, not the concept which is probably 3x as old as even I am). It has also very nice C FFI and very flexible, easily modifiable syntax and optional lazy evaluation which makes it great for developing DSLs.
That being said I don't "expect" these languages to be popular. For the most part, for most developers out there, it genuinely makes no sense to know them. I'd like them to be more popular, but I'm not stressing over this. I know them and I think I can use them to my advantage where it makes sense and that's enough for me personally.
And last time I checked, Io was slower than CPython and offered nothing more than a little more ideological OO purity. It didn't have any killer feature.
In my opinion, this happens when a single author is responsible for most of the implementation of a language.
Another example of this is the Crack language, which is still essentially controlled by one person, despite people declaring it "ready for writing useful code".
Two things make non-commercially funded languages successful. Firstly, they have a team of core developers (even if that is just 3-4 people), who often disagree with one another. Secondly, ad hoc contributions, which don't quite fit with the original aims for the language, are encouraged so long as they don't revert important core design decisions.
Julia and D are prime examples of successful languages along these lines. They both have more than one core developer, and they both have the feel of an ecosystem with many use cases, rather than a very focused language with strict design goals.
Experts seem to agree that both Nim and Crack are very competent, interesting languages. So I believe they have a very bright future when the main developers are happy that the core language is just about right, and when the guiding principles are understood well enough that a core group of developers can continue that vision.
Note that what I am saying has nothing to do with the main authors encouraging external contributions. In the case of both of the languages I mention, they both do that actively. And Nim certainly has other developers actively contributing.
Followup: I want to explain why this is so important. As a developer looking to use Nim (or any other language for that matter), I want to know the language is production ready, so that my code won't break. And if I have issues that need resolving in Nim before my project works, I want to know that I am not waiting on one individual to fix them. I need to know there is a core group of identifiable people I can go to who can answer my queries, escalate my queries and ultimately resolve my issues. Of course these things are also important for the members of the Nim development community itself, not just users of the language.
But most good maintainers I know listen to critique of the people who use their stuff.
More devs are good for another reason than disagreeing, if one doesn't work on the code anymore, there are others who can.
If you look at the Julia issue tracker, you'll see an enormous amount of discussion between and with core devs about language design decisions.
It's good to have someone primarily responsible for the compiler, someone responsible for libraries, another for GC, another for the package manager, etc. I'm not suggesting every core dev needs to be intimately involved with every line of code or design decision. It's more about how the development process feels to outsiders. After all, the question that was asked was about why Nim is not being hyped, rather than why is it not a fantastic language (it is fantastic).
It is great to hear about two other (albeit nameless) individuals working on the compiler though.
I understand, that, if things the language uses are implemented in that language itself, the language design breaks them. But if not?
A language like Java could probably work without GC, give the dev a "free" method and be done with it. The whole language would look the same syntactically.
Fred Brooks would like a word...
More seriously, this is the important part:
> like-minded individuals who understand and agree on the core design goals,
A team who agrees on the big picture, but can work together to sort out the small details, is really important.
There's also balances between doing things quickly and doing things right. Sometimes, slowing down a bit gets you a significantly better end product. Sometimes it's just a slowdown.
I am very optimisitic about the Nim community, it's still small but it is open and friendly, so I think all the potential for growth is there, especially now that the compiler itself is reaching maturity
I've seen more than one time discussions on the Nim forum die of a sudden death after Araq just joined and said something against the idea being discussed. I've never seen something like in the Julia mailing list. Like wbhart, I think this happens mainly because there isn't just one core developer.
Where is Rumpf? MIT?
http://web.mit.edu/nimrod-lang/arch/i386_linux26/doc/tutoria...
As far as I know, Andreas Rumpf does not work for MIT or any academic institution if that's what you're implying. It is rather curious that the MIT website has a copy of Nim's documentation.
What I'm saying is that it can be misleading how much academic institutions are "behind" academic projects. If you talk to most academics, you'll discover that they believe their academic institutions are doing everything they can to discourage their projects (academics can be somewhat sarcastic).
Some of the Julia core devs are academics and write papers on Julia, yes. Their salaries are paid by those institutions. They may have students who can do some coding for them (so long as they write a thesis too). But being an academic is a very demanding lifestyle. With few exceptions, you are paid to write papers, teach, do administration and apply for grants, not to write code.
While it may be a demanding lifestyle, you are also paid to do research. And research could include developing new programming languages.
Nim, and many of the other interesting languages mentioned in this thread are not.
I'm not sure if this is a cause or effect.
> Lacks reliable independent secondary sources to establish notability as required by WP:GNG. Every source is WP:PRIMARY. Every one of them. Googling turned up posts to online discussion forums but nothing useful. Additionally, I note that the decision to delete at the previous AfD was unanimous for the same reasons.
> Perhaps think of it this way: a language becomes notable when people who haven't been involved in its creation start writing about it. If/when this language gets to that point you'll have no problem creating an article. At the moment, though, there just hasn't been enough uptake to get the coverage we need for notability.
The problem is that most sources about Nim are by Araq or not reliable enough.
That doesn't mean a language is not itself notable.
Anyway, there's plenty about Nim that is not primary:
http://goran.krampe.se/2014/10/13/here-comes-nim/
https://www.btbytes.com/notebooks/nimrod.html
http://picheta.me/articles/2013/10/about-nimrods-features.ht... (by Dominic Picheta but external to Nim website)
http://steved-imaginaryreal.blogspot.co.uk/2013/09/nimrod-re...
http://vocalbit.com/posts/exploring-type-classes-in-nimrod.h...
http://blog.ldlework.com/a-cursory-look-at-meta-programming-...
http://joshfilstrup.com/posts/2014-10-27-2014-monads-in-nim....
http://ziotom78.blogspot.de/2014/01/experiments-with-nimrod....
http://progopedia.com/language/nimrod/
https://geetduggal.wordpress.com/2014/03/03/consider-nimrod/
http://www.drdobbs.com/open-source/nimrod-a-new-systems-prog... (by Andreas Rumpf - but definitely an indicator of notability)
http://lambda-the-ultimate.org/node/4749
http://ivoras.net/blog/tree/2013/Oct-2013-10-05.what-i-like-...
http://www.infoq.com/presentations/nimrod (by Andreas Rumpf, but a sign of notability)
http://rosettacode.org/wiki/Category:Nimrod
http://gradha.github.io/articles/2014/11/swift-string-interp...
http://togototo.wordpress.com/2013/08/23/benchmarks-round-tw...
http://felsin9.de/nnis/nimrod/nimrod-gpn14.pdf
http://learnxinyminutes.com/docs/nim/
http://stackoverflow.com/questions/tagged/nim?sort=votes&pag...
http://gradha.github.io/articles/2014/03/nimrod-for-cross-pl...
https://impythonist.wordpress.com/tag/nimrod/
https://github.com/trending?l=nimrod
http://maniagnosis.crsr.net/2013/12/letterpress-cheating-in-...
That doesn't mean that the best resources aren't on the Nimrod website itself. But penalising a language for having excellent primary resources would be a bit crazy in my opinion.
Basically Nim cannot ever become notable unless there are press releases about it or peer reviewed papers written on it. And without a company like Google garnering/writing press releases and none of the authors of Nim are at academic institutions... Well this is awkward.
Statistics (on an x86_64 Intel Core2Quad Q9300):
Lang Time [ms] Memory [KB] Compile Time [ms] Compressed Code [B]
Nim 1400 1460 893 486
C++ 1478 2717 774 728
D 1518 2388 1614 669
Rust 1623 2632 6735 934
Java 1874 24428 812 778
OCaml 2384 4496 125 782
Go 3116 1664 596 618
Haskell 3329 5268 3002 1091
LuaJit 3857 2368 - 519
Lisp 8219 15876 1043 1007
Racket 8503 130284 24793 741I've been wanting to learn one of the up and coming languages (Rust, D, Go, etc.). Would Nim be a good choice?
There are tutorials for newcomers: http://nim-lang.org/tut1.html https://nim-by-example.github.io/
Edit: Fixed tutorial link
But, please make a zipped portable version available for Windows. You don't have to include a binary version of Nim (although that would be nice) but do put the required MinGW pieces off a subdirectory under Nim as was done with earlier releases. This allows unzipping to a thumb drive, xcopy installs, and using Nim anywhere without having to permanently install on specific systems. Also, it makes things really easy for a quick demo when showing someone else Nim on their machine.
(FWIW: The sad state of Windows is that almost every installer out there, MinGW included, means crapping in your system to some extent and never knowing what went on nor being able to removed all traces of what was installed. With each installed application you have to make a conscious decision whether it's worth the unpredictable OS pollution to install the application on a particular machine ... because you know with each install that your headed to that inevitable last one where you have to wipe the entire OS and start over.)
I know myself and my compatriots bail at any language that forces Cygwin or MinGW and has its own installer on top of that. I'll never get to try OCaml, Haskell, Kitten [which looks really interesting but relies on Haskell], and a number of other new languages just because of the install burden.
IMO, if trial and adoption are your goals then as little friction as possible to get to "hello world" is a good route. (And an unzip to the directory of your choice then a double click on "Test_Hello_World.bat" are about as good as you could get.)
This is a huge point, and a huge downside about Windows, even in recent versions. E.g. some time ago I installed some utility EXE and suddenly my Skype stopped working - in a really weird way - the UI itself changed, IIRC it did not show the login screen, though it did start the app. But could not use it since I had no way to log in. Had to roll back to a previous system save point or some such to undo the damage. The Windows registry (being a single point of failure [1], plus not getting cleaned out or updated completely (i.e. not all the registry keys getting updated) on installs/uninstalls due to buggy (un)installers), and DLL hell [2] are major causes for this.
An example from the above link:
var gId = 0
proc genId(): natural {.writes: [gId].} =
gId += 1
return gId
To quote the article: "Here the effect systems shows its strength: Imagine there was a genId2 that writes to some other global variable; then genId and genId2 can be executed in parallel even though they are not free of side effects!"The effect system can also be used for exception tracking, specifying what kind of exceptions are function may throw. It can moreover be extended to work with user-defined effects.
Other issues crop up due to the open-world assumption. This is especially true in the presence of separate compilation when trying to reason about global behavior. Example: does function f() in file f.c modify global variable g in file g.c? The compiler may not be able to prove that one way or another at compile-time (consider if file f.c was already compiled to object code f.o, and only g.c was being recompiled), and so it must assume that f() may modify g. This particular example can be solved with link-time optimization, but you get the idea of how complicated the real world can get.
[1] Horwitz, "Precise flow-insensitive may-alias analysis is NP-hard," TOPLAS 1997.
Nim looks like a worthwhile language, and I'm looking forward to learning it.
I tried Golang, because it was sold to me as something I would love since I am a long time Python developer. I strongly dislike Golang. It doesn't have much in the way of letting me model my programs like I am used to. I am told "that's wrong, do it the Go way". This is too much friction. Once I am done thinking how to solve my problem algorithmically, I do not want to then figure out how to rethink my algorithm just for the sake of the maintainer's of Golang.
I tried Rust. I think Rust is beautiful (mostly). However, Rust has a far too fundamentalist view on memory safety. And that's not to downplay the importance of memory safety. But there's just too much friction. I want to sit down an implement my algorithm. I don't want to stop and spend just as much time thinking about the particulars that Rust demands.
When I found Nim I almost couldn't believe it. The core language was simple, clean and immediately absorbable. I was able to start writing basic Nim programs after just perusing the language docs for a few minutes while the compiler compiled. I read that Nim had powerful meta-programming facilities and this started to turn me off. I had heard that macros were generally a negative force in the world but only knew them from Lisp. Then I learned that Nim's macros are just functions that take and AST tree, perform modifications to that AST and return an AST tree. Wow that's pretty simple. Oh hey the generics "just work" like in C#. Woah, Nim even supports inheritance!
Nim is definitely the next language for me. In thinking about it, I find that I agree with one of Jonathon Blow's sentiments that we have been seeing a number of new up and coming languages but they are all Big Idea languages. Big Idea languages who's ideas have yet to be vetted and proved out over the course of a decade or two. They all incur too much friction.
Nim seems like a competent, low-level systems language with a helpful repertoire of well-implemented modern tunings to features that are all mostly established in the field. It doesn't try to revolutionize systems languages. It tries to bring us a modern refinement by bringing us a highly performant yet relentlessly productive take on what has already been shown to work.
Please don't be offended if you see me around evangelizing its existence.
http://sitereview.bluecoat.com/sitereview.jsp?url=http://nim...
Edit: They reclassified it, should be unblocked now.
As for the topic at hand: I beleive nim, nimrod, are key words that might be flagged for inappropriate content. They are similar to "nimph", "nimphomaniac", etc.
I really like that change. Those always looked so archaic to me.
As far as web frameworks go I have written one called Jester (https://github.com/dom96/jester). I'll be releasing version 0.1.0 of it soon.
when version == A
const numLeds = 10
type LedArray = array[LedState, numLeds]
And then have the number of Leds and the size of the array being passed around typechecked and having all of this done at compile time seems really interesting and useful. And it seems easy to just allocate everything statically or on the stack and then turn off the garbage collector.Nimrod is actually a little interesting. Until the 1980s, Nimrod was just a Biblical figure, a powerful king/great hunter figure. Possibly because it was used in an ironic sense for bad hunters (perhaps beginning with Elmer Fudd), it came to mean the opposite of its original sense and generalized to "idiot."
http://www.etymonline.com/index.php?term=Nimrod
EDIT: Sorry about that...I accidentally said Perforce instead of BitKeeper. Perforce on the brain. :) Thanks nocman.
It's always hard naming things in a language that isn't your first.
And also the name of a biblical king and mighty hunter.
Although it honestly wouldn't surprise me if the difference between typing three or five characters to compile is a huge deal in programmer land. Just like how a few tenths of a second of extra loading makes an enormous difference in customer satisfaction with the Google:
http://www.nytimes.com/2012/03/01/technology/impatient-web-u...
Either way, Nim is short and sweet.
Rust is designed for systems projects where GC is not a good idea, such as web browsers, or kernels, etc. One of its core design philosophies is to manage memory safely and efficiently.
While Nim is garbage collected primarily it can also be used without a GC. However, the many scenarios where going GC-less may be beneficial such as games, web browsers, or kernels where the application cannot afford any pauses during runtime is alleviated by the real-time aspect of Nim's GC which allows you to specify exactly when and for how long you would like it to run (http://nim-lang.org/gc.html).
In this sense Nim is betting on you using the GC for those applications whereas Rust is betting on not using a GC and providing you with tools to manage your memory manually more safely.
As far as the new crop of languages go, I think Rust and Go both offer better refinements of older languages than Nim does. If you're going to come out with a new language, the syntax of it should be cleaner and easier to read than what you are replacing (in this case, seemingly C/C++/Java) or there's not much point.
But ultimately this is personal preference, which is why I worded my comment that way. Instead of people simply disagreeing they have so far down voted me to -3 and counting. HN is overrun with a groupthink mob lately. I have tested this on a number of occasions posting comments that I knew were pandering to the mob, and today posting one I thought probably would go against the grain and the results are totally predictable. It's very sad.
I revised the one you responded to so you may want to check that now.
As far as more details of what I don't like about Nim, that would have been easy to ask directly; I find the syntax of:
echo("Hello world!")
To be outdated and ugly. I also find the case statement to be awful to read the way they've done it, I far prefer the set of cases to be indented from the case statement itself. And the "of" on each line is redundant cruft.
This is a brand new language and it holds on to what to my eyes is the worst cruft of old languages.
> echo("Hello world!")
Would you prefer System.out.println("Hello world!"); instead?
> I far prefer the set of cases to be indented from the case statement itself.
You can in fact do that, it is however optional.
> And the "in" on each line is redundant cruft.
Not sure what you mean here. "in" is only used in for loops.
This is why I didn't get into details originally because I knew I would get this kind of response.
You know full well that's exactly the opposite of what I mean. You're being an asshole for no reason.
> Not sure what you mean here. "in" is only used in for loops.
I meant the "of"s, of course.
I apologise if I came out sounding like an asshole, but I honestly am not sure what syntax you would prefer. Any chance you could show me?
Would you rather puts instead of echo?
I'm struggling to think how different it could be.
Remove the parens? print instead of echo? It's a fairly minor point. I'm fairly very sensitive on issues of visual clutter in syntax and this doesn't bother me in the slightest.
> I far prefer the set of cases to be indented from the case statement itself.
As mentioned elsewhere this is optional but I do agree
> And the "of" on each line is redundant cruft.
I suspect there might be a good reason for needing a keyword here. I would have to dig deeper to be sure though.
Anyway - I can tolerate both of those. Any language with significant white-space and no curly-brackets is off to a good start aesthetically in my books. Skimming through the tutorial shows remarkably few horrors even when doing some moderately advanced stuff e.g. http://nim-lang.org/tut2.html#generics
echo("Hello")
echo "Hello"
"Hello".echo
"Hello".echo()
Or something different? cout << "Hello";
beats all of the above by a wide margin. It's essentially an ASCII-art ideographic representation of what the computer is supposed to do. proc `<<`(f: File, s: string) =
f.write(s)
stdout << "Hello World"
There you go :) echo "Hello"
Is the way ? :)This:
> I find this language pretty ugly. And [...] that's enough reason to not use it.
is the worst possible way of choosing a language to use. It's simply stupid to dismiss languages which may suit your current problem on the grounds of aesthetics. I can't imagine a single situation where "disregarding technical advantages" of a language would be even remotely related to the right thing to do.
And this:
> syntax of it should be cleaner and easier to read than what you are replacing
is another pile of misconceptions: no, designing your syntax by comparison to other languages instead of designing it to fit your semantics is NOT a good idea; there of course IS a point in creating languages even if syntax is not "better" in any way (because semantics matter too) and no, you should NOT try to make your syntax "easy to read" but rather simple and consistent, which will make it easy to read without you even trying. At least "easy to read" to those programmers who are able to work with more than one syntax flavour; the rest will have a hard time reading anything anyway, so there's not much you can do about them.
I made learning all the languages I can a hobby of mine quite a few years ago and I since learned many very, very different syntaxes: look at Prolog, Forth, Scheme and J for the most basic examples. And what I learned is that they all work and work well, despite not being "clean and easy to read" for people who don't know them. It's normal; what's wrong however is trying to make your ignorance into some kind of generally applicable law and judging languages based on it instead of first learning a bit about them.
Now, I'm sorry for being rude, and a little ranty, but I found your suggestion that I'm a part of "groupthink mob" rather offensive.
> Maybe it's just me but I find this language pretty clean and nice looking. And regardless of its technical disadvantages it may have, that's enough reason to use it. There are too few languages out there, and we really need more like Nim.
... I still would have down-voted you.
It's a content free comment that doesn't constructively contribute anything. It's the kind of comment I'd expect to be top-voted in an /r/programming thread.
Can you elaborate?