by dual_basis · 8y ago · 0 comments
I like Nim syntax the best, and Crystal and Zim are tied for second. I don't mind a small library / ecosystem. The main things I'm interested in are:
- I want to write once and run on Windows / Linux / Mac. (I'm not writing a GUI.) - Concurrency and async capabilities - Safety guarantees (both types and threads) - Speed
I'd be interested in people's recommendations, or links to comparisons between these languages.
The other languages that you didn't mention but are worth evaluating are D and Go. Again, they have advantages and disadvantages that may make them either more or less suited to your application.
D only has advantages.
If so I would like to hear your perspective on it. What would you say to convince a Nim core dev to switch to D? :)
Sure some things in D are 'interesting', but it's also a very, very complex beast, full of bugs (some known, and heaps more not-known).
btw. Do not participate on the D forums either, it's just a propoganda tool for the D Foundation (i.e. they filter (or moderate as they like to call it), anything that says anything negative about d.
In the end, if D has anything interesting, that we can't live without, we can just take it and integrate it one or the many 'proper' programming languages.
Don't waste your time with d. You'll only ever end up wishing you had spent that time on a proper language, that has a well supported ecosphere.
Hardly, or half the posts would be gone :-)
What we do moderate is posts where one person harasses another. This happens only rarely, except we had a recent large volume of such coming from a Tor node. So posts coming from the Tor node need approval from one of the moderators for the time being (until that person goes away).
You can also use the NNTP interface to access the forums, which doesn't moderate in advance (that only happens if you use the web interface to post).
The web forum software is a shell around the NNTP interface. It's a bit difficult to make a HackerNews/Reddit style moderation system work on it because of the way NNTP works.
Also it seems to have a multiple personality disorder.
Mr Bright seemingly wants it to be the next C.
Mr Andrescu seemingly wants it to be the worlds best meta template programming language.
D users are equally split (is it a better C#, a better Python, a better this, a better that??).
It does seem to be very complex, undisciplined vision for a language that aims for mainstream use.
Then you have all the problems with the lack of library support for this or that, lack of support tools for this or that ...etc etc.
If you read the forums, people spend far too much time debugging their code, due to a variety of strange things that occur in the language due to all its different personalities trying to live in the same place.
So don't be decieved - there really are plenty of disadvantages in using D (and perhaps they outweigh the advantages).
But, why do they have to hit 1.0 by the end of the year? Who's the arbiter of this deadline?
> I want to write once and run on Windows / Linux / Mac. (I'm not writing a GUI.)
Portability is Nim's great strength. You can even target some really obscure platforms, as long as they have a C compiler (which they likely will).
> Concurrency and async capabilities
Concurrency in Nim is offered via async await with first-class support for Windows, Linux and macOS (IOCP, epoll and kqueue). It's implemented 100% using Nim's macros, so you can easily dive into its implementation and modify it to suit your use case without having to mess with the compiler source code. It's all implemented in the standard library.
Nim's async has also been used in production for quite some time now. One example is the Nim Forum: https://forum.nim-lang.org.
> Safety guarantees (both types and threads)
Parallelism in Nim is a little different than in other languages. Each thread has its own GC and memory sharing between threads is limited. This ensures safety and performance (no stop-the-world GC).
> Speed
Out of all the language's you've mentioned I would say that they are all pretty similar in terms of speed.
Hope this helps!
Pony has compile time guarantees on not having data races, dead locks, runtime exceptions. It accomplishes this in a different way than Rust. For concurrency/async, Pony is Actor based, which I find to be a joy for modeling concurrent applications.
Here's a high level: https://www.ponylang.org/discover/#what-is-pony
The breaking changes have been minimal since I've started using it. Typically just slight changes to some type signatures. The core parts (Actors, Reference Capabilities, Classes/Traits/Interfaces) are all stable at this point. I'm amazed by how well ponyc (the compiler) works. You just run it and it figures everything out.
If I could change anything in the language right now, I wouldn't mind seeing a couple of the reference capabilities renamed (trn, box, and maybe tag specifically), though I don't have any better names to offer. I'd also like if Actor Behaviour dispatch had a different syntax than Object method invoke.
I've always enjoyed programming in Nim when I've had the chance. It doesn't fit all kinds of projects, but it sounds like it'll fit yours.
Zig is too young to build anything significant with it. But to me, it's the most promising language for embedded and low-level development, and where you need good control of memory management. I've played around with it a lot recently and looking forward to use it more in the future.
Sorry to be unfair but: is being _new_ the prime quality of a programming language?