4 ms·
My questions! I have never written a line of Nim but am enticed: >Nim allows you to use snake_case even if the identifier has been defined using camelCase, and
by hellofunk 11y ago
My questions! I have never written a line of Nim but am enticed:
>Nim allows you to use snake_case even if the identifier
has been defined using camelCase, and vice versa.
Can you also just write it all lowercase, and same synonym effect? i.e. snakecase
> The default garbage collector is real-time so it allows you
to specify the amount of time it should spend on collecting memory.
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?
> This applies to languages such as C++,
Pascal and Ada. But these languages still require platform specific code when dealing with more specialised features of the operating system, such as creating new threads ...
Not true any more for C++, since the new C++ standard 5 years ago, which contains cross-platform standard library tools for multithreading.
>The speed of a programming language is one characteristic that is often used to compare multiple programming languages
Since this statement is in the book, it would be nice to see Nim programs participating in the online benchmarks game.
>Table 1.2 Common programming language features
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.
- dom96 11y agoHello, thank you for the questions and feedback! > 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 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!
- hellofunk 11y ago>> 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. 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.
- hellofunk 11y ago>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). 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.
- dom96 11y agoThis Forum thread in particular should answer some questions: http://forum.nim-lang.org/t/1122 http://forum.nim-lang.org/t/1122 There are also many others: https://www.google.co.uk/search?q=garbage+collector+gc+site:http://forum.nim-lang.org 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 :)