Earlier quoted context omitted.
Just the general disdain for crypto here at HN.
I still see more crypto/blockchain adoration here than disdain, although the tables might be turning slowly now. HN users are much like magpies: once an idea shoots up, you can't swing a cat without hitting a zealot. If you are ambivalent or skeptic, you'll be furiously explained into the corner. Then, when the fad fizzes out and its inevitable drawbacks are publicized by more and more sources, the "told you so" camp…
Nim 1.6.2
121–130 of 162 posts
Re: Nim 1.6.2
#122Earlier quoted context omitted.
I like Nim, and probably will learn it at some point. But no, Nim is not everything "python should/want to be". The name case insensitivity and the implicit imports on the global namespaces are perfect examples of stuff that are better in Python.
If you have 'myvar' and 'myVar' in some code there are three things you could do. 1) The compiler gives you an error, this would be my preferred solution though I'm not aware of any language that does that. 2) These end up referring to the same variable with no error. Nim's solution. 3) These are actually different variables with no error. The common solution. Again, I would prefer (1) but I think that (2) is a safer…
Re: Nim 1.6.2
#123Earlier quoted context omitted.
I still see more crypto/blockchain adoration here than disdain, although the tables might be turning slowly now. HN users are much like magpies: once an idea shoots up, you can't swing a cat without hitting a zealot. If you are ambivalent or skeptic, you'll be furiously explained into the corner. Then, when the fad fizzes out and its inevitable drawbacks are publicized by more and more sources, the "told you so" camp…
In the web3/blockchain space, HN is known as a prime example of a place you should go to ground yourself, because HN hates it with passion.
Re: Nim 1.6.2
#124Earlier quoted context omitted.
If you have 'myvar' and 'myVar' in some code there are three things you could do. 1) The compiler gives you an error, this would be my preferred solution though I'm not aware of any language that does that. 2) These end up referring to the same variable with no error. Nim's solution. 3) These are actually different variables with no error. The common solution. Again, I would prefer (1) but I think that (2) is a safer…
As much as I hate it for correctness, 2 is better than 3 indeed. No sane developer encodes meaning in the case of the name of the variables, in the overwhelming majority of cases it's a typo.
Re: Nim 1.6.2
#125Earlier quoted context omitted.
Cool thanks for the info. Nim having selective imports solves any annoyances I would have. But you mentioned all the reasons it was ok in Nim. But the answer is always that the compiler knows. That isn’t why I personally dislike this type of import. I dislike it as a user. I find it super annoying not knowing where an identifier is coming from. I love having ‘fmt.Printf()’ instead of ‘Printf()’. Trivial example I kno…
There's a reason why wildcard/selective[1] imports are favored in Nim. It's because of the uniform function call syntax[2]. In short, this: split("a string", " ") is exactly the same thing as this: "a string".split(" ") `split` here is a normal function, not any kind of method. This means that you can chain normal functions as if they were methods on objects: "a string".split(" ").join("\n") now, if you imported modu…
Thanks for giving the insight.
Re: Nim 1.6.2
#126Nim is everything Python and Go should be/want to be, as far as language features and semantics go (haha). It has their easy-to-learn properties, but has a better type system, the generics system and macros are arguably more useful, and more usable than what is offered in either language. It deserves far more attention than it currently gets.
As someone learning programming, should I try nim for my first compiled language, instead of C++? I know it's likely harder to find answers in the Internet, but at the same time it looks easier, coming from Python and JS. If nim picks up pace in a few years and I already have a sense of it, it may be a good for prospects too.
One advantage over C++ is that you don't need to learn make, IDEs or a complex build system. The nim compiler and the nimble package manager just takes care of building for you. "nim c main.nim" and off you go, ending up with a single executable, no matter how many imports, modules, etc you have.
I do recommend this as a gentle introduction: https://nim-by-example.github.io/ and recommend you use VS Code with the Nim extension by saem.
Re: Nim 1.6.2
#127Genuinely curious - why should I care about Nim? There are already a plethora of general purpose languages (both compiled and interpreted). Also, is anyone using Nim today? What's the adoption?
Re: Nim 1.6.2
#128Earlier quoted context omitted.
I suppose the makers of Nim named that flag for a reason - giving up memory safety by disabling bounds/overflow checks should be never be the default for networked software in a production setting, so benchmarking in that mode would paint an unrealistic picture. What you want are comparable compiler flags across languages, say "optimized for performance, yet retaining safety" and "go as fast as possible and disable a…
"disable all brakes" is misleading. All the basic memory safety stays, static typing is still there, non-debug assertions are still checked. Removing debugging features is reasonable for such benchmarks, especially if comparing with languages that don't have them.
Re: Nim 1.6.2
#129Earlier quoted context omitted.
As much as I hate it for correctness, 2 is better than 3 indeed. No sane developer encodes meaning in the case of the name of the variables, in the overwhelming majority of cases it's a typo.
In the C world ALL_CAPS very often signify preprocessor macro identifiers (or some other "class" of identifier), but, yeah..they may all be "insane". ;-)
Re: Nim 1.6.2
#130Earlier quoted context omitted.
I like Nim, and probably will learn it at some point. But no, Nim is not everything "python should/want to be". The name case insensitivity and the implicit imports on the global namespaces are perfect examples of stuff that are better in Python.
If you have 'myvar' and 'myVar' in some code there are three things you could do. 1) The compiler gives you an error, this would be my preferred solution though I'm not aware of any language that does that. 2) These end up referring to the same variable with no error. Nim's solution. 3) These are actually different variables with no error. The common solution. Again, I would prefer (1) but I think that (2) is a safer…
ForMid = 4 # padding for middle box in px
And: FormId = 3 # ID of the form in the user process
Should definitely not be resolved as the same variable.