Earlier quoted context omitted.
I am excited about Nim because it compiles to C that can run on an ARM microcontroller. I believe this was a possibility at some point, but I don't know if this is a priority for Araq. So (personally) I see it as a (potential) "C replacement for embedded systems".
I'm just trying Nim for the first time. How do you compile to totally self-contained C? I tried pulling the files out of nimcache/*.c, but it is wanting to include nimbase.h. Is there a way to compile an entire Nim program to a single self-contained .c file (ie. an amalgamation, aka SQLite?)
Nim Advocacy and Promotion Strategies
51–59 of 59 posts
Re: Nim Advocacy and Promotion Strategies
#52Nim is very, very close to being the most competitive language in my toolkit. If JSON were handled more elegantly, like Python, I'd probably be completely sold. Binding to Python would also be an absolutely killer feature.
Re: Nim Advocacy and Promotion Strategies
#53I find it disturbing that languages are now adopting promotion strategies because not enough people are using them. For fuck's sake, focus on improving the language and this will come organically. This isn't a competition as to who has the most popular language, and the most popular languages are always going to be total shit. Just write good code, marketing departments are the bane of the entire IT sphere, you shoul…
That's not true. Being the first few people means that the tools are not developed, common questions aren't answered, books aren't written, getting help is difficult, etc. There are only 18 questions on StackOverFlow, for example: http://stackoverflow.com/questions/tagged/nim People don't want to burn too many cycles discovering how the language works.
Re: Nim Advocacy and Promotion Strategies
#54Earlier quoted context omitted.
I'm just trying Nim for the first time. How do you compile to totally self-contained C? I tried pulling the files out of nimcache/*.c, but it is wanting to include nimbase.h. Is there a way to compile an entire Nim program to a single self-contained .c file (ie. an amalgamation, aka SQLite?)
You copy the nimbase.h file along with the nimcache/*.c files. That's it. The compiler doesn't do it because it's a waste of time/space copying a file which you most likely can include from somewhere else, and it's not a generated file.
Re: Nim Advocacy and Promotion Strategies
#55Earlier quoted context omitted.
You copy the nimbase.h file along with the nimcache/*.c files. That's it. The compiler doesn't do it because it's a waste of time/space copying a file which you most likely can include from somewhere else, and it's not a generated file.
Good to know. It would be nice if there was an option for the compiler to build a single .c file that was totally self-contained, for distribution purposes.
Re: Nim Advocacy and Promotion Strategies
#56Earlier quoted context omitted.
Good to know. It would be nice if there was an option for the compiler to build a single .c file that was totally self-contained, for distribution purposes.
I don't know anybody who redistributes source code as a single C file, but you could try concatenating the files into one. Usually people redistributing source code don't mind having several files bound together by some make|build script. The nim compiler has the --genScript switch to make one. Most people willing to get something redistributable prefer a binary static|dynamic library or final executable.
SQLite pioneered this approach, called an Amalgamation. It offers some noticeable advantages:
https://www.sqlite.org/amalgamation.html
It is gaining some followers:
https://github.com/vinniefalco/Amalgamate
http://stackoverflow.com/questions/2719311/tool-to-create-an...
http://lua-users.org/lists/lua-l/2008-08/msg00594.html
> Usually people redistributing source code don't mind having several files bound together by some make|build script.
A single .c file is easier to integrate into various build systems. For example a Visual Studio project, or another Makefile without needing a separate script. It's just cleaner.
> Most people willing to get something redistributable prefer a binary static|dynamic library or final executable.
These aren't portable like a C source file is.
Re: Nim Advocacy and Promotion Strategies
#57Alright, then show me! For example, the beginner tutorial was linked a while ago ( http://nim-lang.org/tut1.html ) and I wouldn't criticize it at all, because it's well written, but it doesn't show me why I would care about Nim when there are dozens of languages I could choose instead. It looks like Python, with a little more types. Fwiw, I'm also a language geek and my favorite language is Factor. If I wanted to eva…
Nim is like writing C at the speed of Python, and running Python at the speed of C. If you took Python but made it perform blazingly fast, and made it suitable for the most demanding of embedded and systems programming applications, in addition to game dev, you'd get Nim. If on the other hand you're satisfied with Python, then keep using it. It was trivial for me to port a Python elliptic curve implementation to Nim.…
Are there any other up-to-date benchmarks of Nim? In larger programs, performance is often dominated by allocating and garbage collecting memory. It would be interesting to know if Nim performs as well in that discipline as in raw number crunching.
Re: Nim Advocacy and Promotion Strategies
#58Alright, then show me! For example, the beginner tutorial was linked a while ago ( http://nim-lang.org/tut1.html ) and I wouldn't criticize it at all, because it's well written, but it doesn't show me why I would care about Nim when there are dozens of languages I could choose instead. It looks like Python, with a little more types. Fwiw, I'm also a language geek and my favorite language is Factor. If I wanted to eva…
Re: Nim Advocacy and Promotion Strategies
#59Alright, then show me! For example, the beginner tutorial was linked a while ago ( http://nim-lang.org/tut1.html ) and I wouldn't criticize it at all, because it's well written, but it doesn't show me why I would care about Nim when there are dozens of languages I could choose instead. It looks like Python, with a little more types. Fwiw, I'm also a language geek and my favorite language is Factor. If I wanted to eva…
Put that up, and allow integrate CPython 2.7 into Nim's output binaries for use of interfacing with Python2 libraries through Nim code... and you have yourself a serious contender for picking off many Python refugees and some serious traction within industry too.