5 ms·
Well no language is perfect, but Nim can be used in almost every domain because of it's compilation targets(C, C++, JS) and it's fast compile times(who needs in
by sp33der89 5y ago
Well no language is perfect, but Nim can be used in almost every domain because of it's compilation targets(C, C++, JS) and it's fast compile times(who needs interpretation when compile times are that fast!):
* Shell scripting, I still assume most people will just use Bash tho: https://github.com/Vindaar/shell https://github.com/Vindaar/shell
* Frontend: https://github.com/karaxnim/karax https://github.com/karaxnim/karax or you could bind to an existing JS library.
* Backend: For something Flask-like: https://github.com/dom96/jester https://github.com/dom96/jester or something with more defaults https://github.com/planety/prologue https://github.com/planety/prologue
* Scientific computing: the wonderful SciNim https://github.com/SciNim https://github.com/SciNim
* Blockchain: Status has some of the biggest Nim codebases currently in production https://github.com/status-im?q=&type=&language=nim&sort= https://github.com/status-im?q=&type=&language=nim&sort=
* Gamedev: Also used in production: https://github.com/pragmagic/godot-nim https://github.com/pragmagic/godot-nim and due to easy C and C++ interop, you get access to a lot of gamedev libraries!
* Embedded: this is a domain I know very little about but for example https://github.com/elcritch/nesper https://github.com/elcritch/nesper or https://github.com/PMunch/badger https://github.com/PMunch/badger for fun Nim+embedded stuff!
Most of the disadvantages come from tooling and lack of $$$ support.
- tyingq 5y agoI looked at the emitted JS when the last Nim story came out. It needs some work there. Lots of globals with names that would likely collide with other existing JS.
- dom96 5y agoYeah, we definitely need to resolve this and it sounds like a fun project! If you or someone else has the time for this I (and I'm sure the rest of the community too) would love to help lead you in the right direction :)
- rgrmrts 5y agoI haven’t used nim outside of some hello world toying a few years back. Is compiling actually that fast? I thought the nim compiler compiled to C and then called gcc (or whatever system compiler), isn’t that slow in practice? Any large nim projects that anyone can point me to would be helpful too, I’ll give the compiler a shot later today!
- kevin_thibedeau 5y agoWhen using Nim for "scripting" it is recommended to use TCC for rapid compilation. It is genuinely fast.
- sp33der89 5y agoThe proof is in the link! > Fast compile times: a full compiler rebuild takes ~12s (Rust: 15min, gcc: 30min+, clang: 1hr+, Go: 90s) [2]. The compiler is really big and self-hosted too. For large nim projects check out: https://github.com/mratsim/Arraymancer https://github.com/mratsim/Arraymancer or https://github.com/treeform/pixie https://github.com/treeform/pixie (personal faves).
- rgrmrts 5y agoThanks for the links, I’ll check those out.
- pathsjs 5y ago> who needs interpretation when compile times are that fast! Well, interpretation is pretty useful for a REPL. And a REPL is not just useful to avoid compilation, but also as a way to explore a new API. And, most importantly, to preserve the results of long computations when you do not know yet what to do with it. If computing a value takes half an hour, you certainly don't want to recompute it each time you change something. Rather, you keep an open session, such as a REPL or a notebook, and keep computing with the already existing value
- short_sells_poo 5y agoThis is exactly right. What is the REPL story with NIM? Having used a REPL, I cannot even imagine doing research & analytics without one. FWIW, this comparison between R, Pandas and Nim dataframes is quite encouraging: https://gist.github.com/Vindaar/6908c038707c7d8293049edb3d204f84 https://gist.github.com/Vindaar/6908c038707c7d8293049edb3d20... This is one of the aspects that self professed R/Python datascience contenders often get wrong. The very bare minimum is a well supported and thought out dataframe library. Without that, the language is basically dead in the water. Nim seems to have a very well thought out API that also avoids many of the annoying aspects of Pandas (e.g. the huge waste coming from eagerly computing each vectorized operation into separate arrays).
- sp33der89 5y agoMy statement was mostly an exaggeration, than an absolute truth. REPLs are really nice, but it's story with Nim is less nice. There is: https://github.com/inim-repl/INim https://github.com/inim-repl/INim and the builtin `nim secret`. There is also a Jupyter kernel: https://github.com/stisa/jupyternim https://github.com/stisa/jupyternim
- pietroppeter 5y agoI did quench (most of) my thirst for a Repl building a notebook system (plug): https://github.com/pietroppeter/nimib https://github.com/pietroppeter/nimib Based on that and using a book theme, scinim getting started documentation is being built, e.g.: https://scinim.github.io/getting-started/basics/data_wrangling.html https://scinim.github.io/getting-started/basics/data_wrangli...
- DennisP 5y agoAlso one of Ethereum's proof-of-stake clients is written in Nim: https://nimbus.team/docs/index.html https://nimbus.team/docs/index.html
- michaelsbradley 5y agoDirect link: https://github.com/status-im/nimbus-eth2 https://github.com/status-im/nimbus-eth2
- enthus1ast 5y ago* Backend: For something Jinja/Twig-like: https://github.com/enthus1ast/nimja https://github.com/enthus1ast/nimja