I am partway through developing my first commercial application with Nim, and
I'd like to commend the development team (@Araq and friends) on their work, and
note some attributes of Nim which are important to IoT that I have not seen
mentioned elsewhere:
1. Binary size. THIS IS REALLY IMPORTANT! Languages like Go (which is touted
as an IOT language) produce binaries around 1-2Mb whilst a similar binary in
Nim is around 180kb. When you are making an application for an IoT device with
8Mb of flash there are only a handful of suitable candidates (C/C++, Lua and
Nim).
2. Compile to C and link with C modules. THIS IS MAGICAL :-) I can write Nim
applications for OpenWrt on MIPS and use the system compiler to generate the
binary. Again, wonderful, and was really easy to set up.
3. Quality libraries. This is the feature that finally got me to switch from
Lua. Lua libraries (I'm looking at you lua-socket) are full of bugs, and never
work the way they should. This virtue may be somewhat due to the strictness of
the Nim language which I personally have difficulty with, so it's a reason to
persist.
4. Ease of importing C modules. Many system libraries are only available in
C, Nim requires much simpler wrappers than languages like Lua (in some cases
Nim only requires an importc declaration).
I find the complexity of the Nim language a bit of a barrier, but the benefits
are worth persisting. Nim is powerful enough to run a web server whilst being
granular enough to perform USB and serial I/O. This really is a game-changer
for IoT!
Thanks for your hard work Nim developers, and contributors. ( also special
thanks to GitHub user euantorano for providing nim-serial ).