79 points · by andybak · 11y ago · 58 comments
It looks like Python, with a little more types.
Fwiw, I'm also a language geek and my favorite language is Factor. If I wanted to evangelize it, I could show how idiomatic Python or Haskell code translated to Factor takes up less than half or a third in size. So that's its USP (Unique Selling Point) -- really short code. What is Nim's USP?
Julia: "fresh approach to mathematical computing", Rust: "safe resource disposal without GC", Go: "C successor backed up by Google", Swift: "Replacement for Objective-C", Clojure: "Scheme on the JVM", Nim: "no idea what to write here"
Is it the Why should I be excited? paragraph: "Nim is the only language that leverages automated proof technology to perform a disjoint check for your parallel code. Working on disjoint data means no locking is required and yet data races are impossible" If I understood what the hell that means, maybe I would be excited. :)
If you took Python but made it perform blazingly fast, and made it suitable for the most demanding of embedded and systems programming applications, in addition to game dev, you'd get Nim.
If on the other hand you're satisfied with Python, then keep using it. It was trivial for me to port a Python elliptic curve implementation to Nim. I'd certainly recommend it over Cython, because Nim is simply designed as one complete system built for writing high performance applications with a sane syntax.
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 741
https://github.com/def-/LPATHBench/blob/master/nim.nimAre there any other up-to-date benchmarks of Nim? In larger programs, performance is often dominated by allocating and garbage collecting memory. It would be interesting to know if Nim performs as well in that discipline as in raw number crunching.
When I say "powerful macros" I really do mean it. I wrote what is essentially the equivalent of C# async await using only Nim's powerful metaprogramming.
const lookupTable = veryComplicatedFunctionCall()
or letting you declare types differently depending on compile time specifications. And then there's the macro system which I haven't really used but seems pretty nice.So maybe "C with a macro system that's safe and does everything you always wanted it to do"?
As someone who does a lot of work on microcontrollers where there's no filesystem to read in configurations from and where small binary sizes count this is all very exciting for me.
In case anyone is wondering: The actual platform was Chumby [1], and Python ran great on it. We had a little twisted [2] application that displayed images and played sound. To display the images we just wrote an image file (after using PIL to manipulate it) to /dev/fb. It was really fun! I just double checked the hardware the chumby: A 350 MHZ ARM9 processor with 64 megabytes of SDRAM. It sounds a little crazy to me now to think of transforming images using PIL in 64 megabytes of ram, but it actually worked quite well.
[0] http://www.scratchbox.org/
I tried pulling the files out of nimcache/*.c, but it is wanting to include nimbase.h.
Is there a way to compile an entire Nim program to a single self-contained .c file (ie. an amalgamation, aka SQLite?)
That would be Kawa (http://www.gnu.org/software/kawa/).
Put that up, and allow integrate CPython 2.7 into Nim's output binaries for use of interfacing with Python2 libraries through Nim code... and you have yourself a serious contender for picking off many Python refugees and some serious traction within industry too.
That's a good point. One could try "faster, safer Python" here, but I agree that it should be discussed and made official, so that anyone seeing Nim's homepage would immediately know what it's about.
-very slow
-GIL
-not enough type checking
Nim fixes those while keeping things which attract people to Python in the first place. It should be enough of a selling point.
I write most of my code in C + Python (and sometimes in Python + C). For me Nim ticks all the boxes, even the minor ones (how syntax looks etc.). I can't wait to give it a try once I am done with my current project.
The killer promoter is of course a book.
I usually wait before starting on new languages so I'm not slowed down by incomplete tooling, missing compiler features etc.
What really gets me going is a 1-2-3 tutorial which explains how to implement something non-trivial like calling c dlls.
Learning the syntax/features of the language should be part of documentation, not a tutorial.
"Hello World" as the core/intro example with nothing else after that (or trivial command-line programs) will not get many adopters.
Show people how to build REST APIs, GUI programs (like a text editor), a small web-server and maybe some other scientific/math example.
Showing just a few features and then saying "go build" will not get normal people to adopt the language. Only "savants" will pick it up.
Give examples/libraries and people will build on those.
The syntax is also not that close to Python. It is obscure in some places and not as readable. If you're going to compare it to Python, do a readability test:
Write the exact same application in Python and Nim and then ask somebody else to compare the 2.
I tried to pick up Nim, but I was fighting against it every time I tried to go beyond a trivial CLI program.
I'll take Pythons slower implementation with 3000 libraries over Nims "C-like" speed where I can't even build a REST API.
I like Nim, but if all the effort of promoters is just promotion, the language will stay where it is.
You geniuses working on Nim for a long time need to share your examples and show the noobs how you built things with decent screencasts/tutorials/lessons.
Something tells me that even just 3 decent examples where real applications are built (eg. a game like Snake using a GUI and game-engine/lib) will get +1000 Youtube hits in no time.
Binding to Python would also be an absolutely killer feature.
> 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.
Just need to represent information about the technical subject clearly.
If the technical merits are there, adopters will come. Technical people are not baffled by $animal . $excrement. Instead, it puts them off.
Edit: I get downvoted a lot, but could someone prove me wrong? What technical concepts (like programming languages) got popular with help of nice graphical design?
Aesthetics are important to technical subjects as well. It shows that a lot of time and consideration have gone into every part of the project, not just the technical side. It's also a good sign of community support/interaction. I will agree that content is the most important, but you shouldn't write off aesthetics so easily, especially when you want people to be interested and adopt your technology.
Interesting article, related to web design and conversion rate:
If you want to play around with the language then great, but I suspect you'll spend more time running into bugs than writing your actual program. Which may be fine; certainly it'll be a learning experience.
For fuck's sake, focus on improving the language and this will come organically. This isn't a competition as to who has the most popular language, and the most popular languages are always going to be total shit.
Just write good code, marketing departments are the bane of the entire IT sphere, you shouldn't be trying to create one for a niche language.
Or not. There are dozens of languages which are good, a couple of decades old, and only known and used by a very small community. They all followed your advice and in effect they "lost" man-centuries of contributions to other languages.
I don't know how well this is going to play out for Nim, but for a project which can't even have its own Wiki page because of how unpopular it is it may well be a good thing.
I don't have statistics to back it up but I would wager that waiting for users to come organically is among the top reasons software projects of any kind fail. Why should programming languages be special in this way?
Separately, "marketing" is of course a term loaded with negatives, but it is essentially about communicating a benefit in a very crowded and competitive environment. That benefit has to be very clearly enunciated and pushed, and if it is a clear and simple message, then it will be effective.
It's a secondary concern that a language is a polyglot at all sorts of use cases, is good at everything. It first has to have users. Users have lots of choice so you're best off giving a small subset of them the idea that this is the perfect tool for their specific use case, and grow from there, than telling everyone this is good at everything, even if that is true.
Unfortunately the best all rounder is often forgotten if she/he's not number one at something.
TL;DR: In a crowded and complex marketplace marketing's segmentation methods are unfortunately needed.
There are only 18 questions on StackOverFlow, for example:
http://stackoverflow.com/questions/tagged/nim
People don't want to burn too many cycles discovering how the language works.
I think it's really good that they're asking, "why aren't more people using our language?". That seems like a great step towards improving it.