The Nim programming language
nim-lang.org
nim-lang.org
Nim is to C/C++ as CoffeeScript is to JavaScript. A highly extensible template language atop a portable language with libraries for practically everything.
So why haven't I hopped on the bandwagon? Outside of C++, C, and Fortran - the only way I have ever learned a new language is through using a REPL. How much of Python's and MATLAB's (and maybe even Julia's) success is due to having a brilliant REPL?
I am not complaining, and I do not have any free time to fix it. But man... if Nim just had a killer REPL that allowed me to slowly learn the language properly while not being blocked from my daily work... it would be just killer!
It's a very simple feature that I'm sure can be implemented as a plugin in any IDE/Text editor. The Nim VS Code plugin sort of supports it, but the feature could be improved. (Nowadays, I wouldn't recommend using Aporia for various reasons).
1 - Aporia - https://github.com/nim-lang/Aporia
On https://nim-lang.org/faq.html under "What about editor support?", Aporia is mentioned as the first option. Should it be moved lower in the list?
Anyways I use nim-mode in emacs, and it works great!
Admittedly I'm still doing super basic stuff at the moment.
(Similar to http://play.rust-lang.org or https://play.go-lang.org).
I have the nim-mode and smart-compile packages installed, and I have bound F9 to compile the nim code in the current buffer, and run it in the emacs-inbuilt eshell.
I have configured so that the point and buffer switching 'does the right thing'.
- If the compilation fails, show the compilation buffer in the other window, and do not execute the binary, and keep the point in the code window.
- If the compilation passes, execute the binary in the other window.
- Now if the binary execution ends with showing the eshell prompt, move the point back to the other window (code window).
- If not, that is, if the eshell prompt does not show up, keep the point in the eshell buffer, because that most likely means that some user input is expected.
---
So my nim learning process goes as: type a code snippet, F9, type more, probably cause error, F9, fix that, F9, etc.
Config: [1] [2]
[1]: https://github.com/kaushalmodi/.emacs.d/blob/master/setup-fi...
[2]: https://github.com/kaushalmodi/.emacs.d/blob/master/setup-fi...
https://github.com/wheineman/nrpl
[1] https://hookrace.net/blog/what-makes-nim-practical/#use-as-a...
It's not the same thing but it spares a few key strokes...
And it generates the pom files so you don't have to...
In the Makefile itself I use entr: http://entrproject.org/
Been able to simply and quickly run code in a variety of languages with little friction is a handy thing to have, particularly when writing fragments in multiple languages at the same time.
[1] https://marketplace.visualstudio.com/items?itemName=formulah...
git clone https://github.com/dracula/terminal.app.git terminal-theme* https://github.com/qqtop/nimdataframe
And
Alternatively are there other alternatives to C++ for people who have to submit C++ code into the repository?
I use other languages than C++ on a regular basis and I find it annoying to tedious the language is. So much boilerplate and repetitions.
Are you considering converting the documentation pages to responsive design too?
Also the black and yellow theme looks great on the home page, but that theme loses its continuity on all the other pages. It's as if the home page was designed by a different person, the feature and other landing pages by someone else, and the documentation pages by someone else altogether.
Unless someone volunteers to do this it likely won't happen any time soon.
As for the continuity. Not all pages can have the same "section" style, the documentation page for example is just composed of a list of links and descriptions. Of course, if you have ideas on how to improve the continuity then I'm all ears :)
But they can have the same CSS styling (colors, fonts, responsiveness, etc) that ties the whole site together.
A good example that's at the top of my mind is this: https://hugodocs.info
It works great on desktop as well as phone, and a common theme is seen all across the site.
> the documentation page for example is just composed of a list of links and descriptions.
By the documentation page, I meant a page like this: https://nim-lang.org/docs/manual.html
That's a lot of good info but is not accessible in a good way on phone.
For sort of an equivalent reference, see https://hugodocs.info/templates/base/
It has a similar collection of help pages and the design is responsive too.
> But they can have the same CSS styling (colors, fonts, responsiveness, etc) that ties the whole site together.
> A good example that's at the top of my mind is this: https://hugodocs.info
> It works great on desktop as well as phone, and a common theme is seen all across the site.
I might be missing something but the website you linked has only two pages and I would consider them to lack continuity even more than the current Nim website. The layout for the "docs" page is completely different to the home page.
> By the documentation page, I meant a page like this: https://nim-lang.org/docs/manual.html
Oh I understand where you're coming from a bit more now. Everything under the `docs/` is sort of separate, it's part of Nim's doc gen generator and thus has a different style associated with it. But I can see why you think it loses continuity.
Is there something like that on the Nim website? There's a code example on the home page but after doing a `brew install nim` I don't actually know how to run it. In the Documentation section there are guides about the standard library and so on but I can't find a 'quick start' that'll get my hands just a little dirty without feeling overwhelmed with too much information.
However, as noted in another comment, Nim has a new website up hence the post this time.
From the FAQ:
Why yet another programming language?
Nim is one of the very few programmable statically typed languages, and one of the even fewer that produces native binaries that require no runtime or interpreter.
That's it? That doesn't answer the question at all. In fact, it makes it even less clear. All it says it that there are other programming languages that have similar features. Who cares? High-performance garbage-collected language
Compiles to C, C++ or JavaScript
Produces dependency-free binaries
Runs on Windows, macOS, Linux, and more
And of course, the "Features" button right under the text leads to https://nim-lang.org/features.htmlIn particular, why Nim over Go (or why Go over Nim)?
Is the Python's established presence and resource base (not trivial at all) the only reason one would prefer it over Nim?
And Go doesn't give you access to as many system libraries, for a second. There's cgo, of course, but that has its own can of worms.
I hear the type systems are fairly different as well, which is important to some.
Anyways I'm sorta being pedantic that it obviously has some sort of runtime. Maybe they meant to say not a runtime like a full VM ala Java?
I think this is what D does as well. This means you have to be mindful of what you're doing and if you want few pauses then you need to perform all your allocations ahead of time or disable it entirely in certain sections.
programmable statically typed languages
programmable refers to nim's metaprogramming capabilities.