As someone who uses ML on embedded devices, it is great to see good alternatives in compiled languages. Nim seems like a very useful and pragmatic language in this regard. Certainly a huge step up from the C and C++ which is still very entrenched.
I think that solid libraries for deep learning is something we will see in practically all programming languages. In 10 years a library covering core usecase (of today) will be as standard as a JSON parser and a web sever, for almost any ecosystem.
To be fair to Nim, only Python has the huge ML ecosystem of numpy, scipy, pandas, opencv, pytorch, tensorflow, keres... Doing ML/AI style work in anything but python is really hard!
That said Nim does have the nimpy library that allows for pretty seamless interop with python. Which means you can just import PyTorch, or scipy, or opencv and use them in Nim.
Nim does seem nice. I worry that it will end up like D though... An interesting/cool/neat language with seemingly relatively little adoption. I'm keeping my eye on it though.
the growth of an high performing language for data will probably come from NIM. it has expressiveness like Python and speeds like C. Though the community needs to develop. and drop efforts like deploy to JS etc
I don’t hear much about Nim. Will this language ever take off? It seems this language needs a large corporation backing it, to get a chance to succeed.
What really seems to characterize Nim is its ability to be used as glue language between different codes. C/C++/objective-c/javascript interoperability is native, python interoperability seems to be pretty good. It makes me think a lot to python before it exploded in popularity with machine learning and education
I will just repost my old post, but a lot has happened since then:
Nim comes very close to be the perfect language for me (game development, machine learning etc.). Some things I experimented with including some links to show what I tried as follows:
- Fully controllable and plugable GC: I can decide for myself when the GC runs and for how long. Very important for games. If I do not like the GC I can even write my own or choose one of the many existing ones. See: http://forum.nim-lang.org/t/2646
- Meta-programming, templates, concepts etc.: To be able to write a machine learning library I needed something that can replace simple code (DSL) with more complex code using scalar math, SIMD, SPIR-V, OpenCL or Cuda. I also wanted to be able to automatically generate bindings for scripting. See: http://forum.nim-lang.org/t/2654 and http://forum.nim-lang.org/t/2635 . As I understood by reading the forums they will soon merge in many concept improvements. See: http://forum.nim-lang.org/t/2396
- Nim itself can be used as an embedded scripting language: Nim as a scripting language is used by the compiler to run Nim while compiling to generate new code. Nim as a scripting language can also be used as a more advanced configuration language (like Lua in the beginning). It can be used as an embedded or standalone scripting language as well. See: http://forum.nim-lang.org/t/2647 and https://github.com/komerdoor/nim-embedded-nimscript
- Compiling to C89 code (useful for creating libraries and cross-platform support etc.): I want my games to compile on platforms not supported by GCC or Clang/LLVM (actually I am sure they can support them all after some patching) but with their own C89 compiler. After compiling to C it is easier for me to see what the code will actually do. Still if I really want to I can choose to compile to Javascript, C++, Objective-C and LLVM (not officially included yet) as well. See: https://github.com/arnetheduck/nlvm
- Pretty good functional programming support (as far as compiled code allows for): For this I created a library that use the zero-overhead iterators. There are many alternatives as well and I like to be able to choose between multiple implementations of higher level functionality. See: https://gist.github.com/komerdoor/70d9c25820952624cf797890a1.... . Of course a better implementation is possible by combining this with concepts, generic dynamic method binding and all other of Nim's features. See the following again: http://forum.nim-lang.org/t/2654
- Easy integration of existing C code: I wrote part of my code in C (low-level) and another part in Nim (mid-level).
Some things which may get new Nim users in shock but I learned to love:
- Use of indentation using spaces for grouping like Python: I never really liked this but I cannot ignore that this made my code easier to read and discourages my preference for one-liners (yes I know bad habit and does not work well inside editors and with source-control).
- Multiple ways to write the same identifier (case/underscore insensitive): Liked this from the beginning. I am really consistent to choose a single style but all my C code is written using underscore (ex.: typens_do_something(x)) while in Nim in prefer to use camel case (ex.: typensDoSomething(x)) or fully drop the namespace entirely (ex.: doSomething(x) or x.doSomething()).
- Multiple ways to call methods: Both "abc".toUpper() and toUpper("abc") are the same. There are no namespace conflicts because Nim uses the best match for toUpper like: func toUpper(c: char): char or toUpper(s: string): string. It also makes it easier to add new methods for existing types while still being able to call the methods like if OOP is being used.
- Minimal support for OOP but encouraging composition over inheritance
From your post I was under the impression it was a super-set of python, or was compiling down or up to python ( what a weird thing that would be )
I'm getting older, I remember when Python was the new cool perfect language on the block, but that no real job existed using it. Specially outside of tech hotspot before remote.
Well, I think python has been consistent at no sucking too much. And it payed off. Slowly but surely it took hold on the job market, captured data-science overnight.. and voila.
Language are less of an 'blocker' it seams. with infrastructure being a commodity, and polyglot microservices being trendy... nobody care what your API is made off.
So don't loose hope on Nim. ( and it does look really neat, but I promess myself to digg more into Elm before try out something else )
Very good point. For Python enthusiasts, Nim positions itself nicely as a next step. I don't think Nim will ever reach the heights that Python has amazedly found itself at, but do think there is going to be a bit of "gravitational influence", that keeps giving Nim some public attention.
Eventually, Nim could find itself on the TIOBE top 50 to 30 rankings. That would put it among known languages such as D, Scala, and Haskell. Which might not seem like much, but considering all the new programming languages that are out here now, it is actually quite significant. The competition among newer languages (Rust, Crystal, Zig, Vlang, Odin, Julia...) vying for attention and to replace some of the older ones is fierce.
nim is good, and I was onboard when it was nimrod (liked that name better!). It's very good. Here's where my supposedly polyglot objectivity falls prey to subjective syntax like/dislike. I am not a fan of python's syntax, so nim resonated the same with me. I really love APL/J and Lisp. If Haskell had more uptake in the pragmatic world with a cohesive ecosystem, and more libraries, I would probably be all in. Nim has the ability to --gc:none, so maybe I should take a look again. I found a few libraries, but there didn't seem to be many in machine learning/optimization.
Yeah, Nim is my favourite language currently! The expressivity and succinctness of Python with the speed of C, plus useful metaprogramming constructs. I recommend everyone to give it a go!
Where does nim sit in regards to the future of machine learning? Can we expect clones of pytorch/tensorflow? Is it a suitable language for this?
reply