Oooo, wow collect looks so much cleaner. I can't wait to get home and play with it!
A. Where are you that you are not already at home??
And B. I wonder how many people are using nim at work, and what sort of workplaces that might be?
71–80 of 130 posts
Oooo, wow collect looks so much cleaner. I can't wait to get home and play with it!
A. Where are you that you are not already at home??
And B. I wonder how many people are using nim at work, and what sort of workplaces that might be?
Earlier quoted context omitted.
choosenim is still supported :-) The idea is more like the gcc -std flag (gcc -std=gnu++11 for example). to emulate certain versions to ease upgrading.
Do you think the gcc -std flag would exist if every distribution of gcc included a command to easily download alternate versions and swap them out depending on project configuration? -std seems more like a bandaid around a difficult install/config than a feature, in my opinion. Obviously nim is free to make implement whatever options they want, but it seems to me like every second spent triaging/fixing/etc bugs about…
That is, if we had a GCC version manager that worked the same way things like choosenim or rustup or pyenv or rvm or what have you work, I can guarantee you GCC will ship with an -std flag, because you can bet someone needs to compile a C89 codebase and wants the latest and greatest compiler smarts to do it. Same deal for Clang, or Visual Studio, or `zig cc`, or whatever.
Great example of this (that I just had to deal with this week, lol) is Wine, which mandates C89-compliant code, and yet absolutely benefits from any compiler optimization improvements introduced with newer versions of GCC.
Earlier quoted context omitted.
I haven't played with nim for a few months, but only parameters with var will get mutated. I suspect you want to use someone else's cursed function and don't want to poison your blessed code
I see. I know nothing about Nim but I do see in their example they used var when declaring the function. This way seems like it's hidden to the consumer of the function but hopefully editor tooling helps with this.
var arr1 = [4, 2, 3, 6]
sort arr1
# Doesn't work
let arr2 = [4, 2, 3, 6]
sort arr2
You'll get a warning about the latter from the compiler (and nimsuggest for editors).Earlier quoted context omitted.
It uses a rather primitive garbage-collector though, right?
It really doesn't! It's GC story is pretty great, because you can choose out of several GC's, one of them being good for real-time systems: https://nim-lang.org/docs/gc.html Recent versions also use this fancy thing: http://www.gii.upv.es/tlsf/
When I say 'primitive GC', I mean Boehm, which is obviously decades behind the state of the art, but easy to get off the ground. GNU Guile uses it, for instance. Serious garbage collectors are tremendously complex, and are something less popular languages unfortunately tend to lack. I believe even D is miles behind Java.
Can't say I know much about Go's GC.
Edit Oops I misread, TLSF isn't a GC, it's an allocator. It sounds then like Nim doesn't have a proper real-time solution, does it? useRealtimeGC is actually a leaky reference-counting system?
As someone who's heard of Nim, can someone who's used it tell me a little bit more about its benefits and how it compares to other common languages like JavaScript, Python, etc?
This is my person opinion here: Nim is part of the "new generation of system programming languages" from the last decade or so. Some other examples in this category include Zig, D lang, Go lang, Swift, Rust, etc...
The whole idea is to provide "modern high level" language features and ergonomics while still producing efficient low level code.
For Pythonistas, The familiar syntax is attractive to Python programmers looking for a more performant language (data science is a prime example.)
Nim is also attractive to lispers looking to move to a more traditional Algol or C like language while still keeping much of power and flexibility that they are used to from macros.
These comments make a lot more sense now.
Earlier quoted context omitted.
Personally I stopped using exercism, when it started to require me to work for Google for free and would not let me log in, if I did not. It's not an ethical platform, unfortunately.
What do you mean by 'work for Google for free?' I don't see that being required anywhere on the site.