by dom96 · 10y ago · 0 comments
> Can you also just write it all lowercase, and same synonym effect? i.e. snakecase
Yes, the first character is case sensitive, but the rest is not. foobar == fooBar == foo_bar == foo_Bar but FooBar != fooBar.
> Since Nim compiles to C, which is not garbage collected, does Nim just automatically add its own C-based GC library behind the scenes (no small task), or is it actually just adding calls to free for you?
Nim adds its own Nim-based GC library behind the scenes. In fact, it supports multiple GCs (which can be changed via the --gc flag).
> Not true any more for C++, since the new C++ standard 5 years ago, which contains cross-platform standard library tools for multithreading.
Is this standard well supported by now? I'll change it to 'C' in any case.
> Since this statement is in the book, it would be nice to see Nim programs participating in the online benchmarks game.
I agree, maybe you can convince them to include it: http://benchmarksgame.alioth.debian.org/play.html#languagex :)
> A little misleading or perhaps just incorrect to place a No in C++'s box for metaprogramming. Entire books have been written on C++ metaprogramming.
Somebody else raised this point. Will correct.
Hope this helps!
>Is this standard well supported by now? I'll change it to 'C' in any case.
The standard is 5 years old this year and nearly every major compiler has supported it for years, and the big ones supported it before the standard was officially in place. So changing it to C would be much more accurate.
That's not to say that each platform's unique tools, i.e. Apple's own GCD for multithreading, are not still available and widely-used. But C++ lets you not worry about platform-specific multithreading any more, and it's quite nice! In addition to multithreading primitives in the standard, there are also higher-level task-based tools like futures and promises that are cross-platform also.
I will be spending some time reading about this, since it's definitely the most disruptive aspect to Nim, considering that GC in a systems language is not a "solved problem" in general. Coming from C and C++ I'd most need to know exactly how the GC was working to be comfortable with the idea.
There are also many others: https://www.google.co.uk/search?q=garbage+collector+gc+site:...
Also, feel free to ask questions about the GC in the Nim forum or on IRC. That way other Nim developers can chip in and offer better answers than I ever could :)