Live data from Hacker News

Nim 0.13.0 has been released

nim-lang.org

31–40 of 80 posts

Re: Nim 0.13.0 has been released

#31

Earlier quoted context omitted.

Negative literals/negation/subtraction sharing "-" leads to odd corner cases in the grammars of quite a few languages. I'm rather fond of the J approach: -1 is the application of the negation operator to the literal one. _1 is the literal negative one. This is a very important distinction in J since you can have whitespace-delimited lists of numbers. "-1 2 3" is equivalent to "_1 _2 _3".

This is also true of Standard ML, where unary minus is ~, and APL, where unary minus is ¯

To be most clear: The "high minus" in APL is not the unary negation function; it's part of the syntax for a negative numeric literal.

If X is 1, "-X" computes "¯1", and "¯X" is ill-formed.

Re: Nim 0.13.0 has been released

#32

Earlier quoted context omitted.

I brought it up recently in the #nim irc channel, trying to get a good explanation. The creator still seemed to think it was a good idea, and I could not convince him otherwise.

Yeah, I feel your pain. This is a deal breaker for me. My OS of choice for the last 25 years has a case sensitive filesystem, all the programming languages I learned (well, except PHP) are case sensitive, it is too hard to unlearn. BTW, PHP has weird case sensitivity rules. Case sensitive (both user defined and PHP defined): * variables * constants * array keys * class properties * class constants Case insensitive (b…

Why would you need to unlearn it? Simply write code as you would write it in a case sensitive language.

Re: Nim 0.13.0 has been released

#33
post #19

Earlier quoted context omitted.

Sounds sensible. Case sensitivity makes life harder for beginners and the advantages are minimal (would you really want to have two different variables called VariableName and variable_name in scope?). There are plenty of potential pitfalls (e.g. code that only compiles in Turkey), but the principle is a great idea.

In Python there is a convention for naming classes with `CamelCase` and instances with `snake_case`. It works very well, you can always tell if you are dealing with a class or an instance. Personally I believe code is harder to read than to write, so I favor languages that are easier to read.

Keep in mind that Nim is statically typed and the typing prevents ambiguity: foo.say_hi() and SayHi() are not the same.

Re: Nim 0.13.0 has been released

#37

This is really great little language. I really enjoy using it and executables I get from it can be very small which brings smile to my face.

I like everything Andreas did differently from Python, except the unusual normalization rules for variable names. This is crazy: VariableName == variable_name == VaRiAbLe_NaMe

Actually, VariableName != variable_name

You can write ClassesLikePython and variables_like_python in Nim.

Sometimes people end up having dangerously similar variable names in the same scope, e.g. username and user_name, where an incorrect tab-completion might introduce a bug. Nim would require the developer to choose better names.

Re: Nim 0.13.0 has been released

#38
post #32

Earlier quoted context omitted.

Yeah, I feel your pain. This is a deal breaker for me. My OS of choice for the last 25 years has a case sensitive filesystem, all the programming languages I learned (well, except PHP) are case sensitive, it is too hard to unlearn. BTW, PHP has weird case sensitivity rules. Case sensitive (both user defined and PHP defined): * variables * constants * array keys * class properties * class constants Case insensitive (b…

Why would you need to unlearn it? Simply write code as you would write it in a case sensitive language.

I've been programming Python for a living for the last 8 years or so.

In Python there is a convention for naming classes with `CamelCase` and instances with `snake_case`.

I could do that in a case insensitive language, but I can't do this in Nim because it is not only case insensitive, it violates the "principle of least astonishment" by normalizing variable names in a way that makes `FooBar` equivalent to `foo_bar` or `F_o_O_b_A_r`.

If you can't see the trouble with this, I rest my case.

Re: Nim 0.13.0 has been released

#39
my only complaint with nim is that there exists Pascal code out there that gets rotten and it is not possible to transpile it to nim.

Imagine Nim using LCL (Lazarus Component Library) or mseide code.

I think they should rethink it.

Re: Nim 0.13.0 has been released

#40

I used to play around with it when it was still call "Nimrod" and it was quite good fun. It's easy to learn and the examples were good. A c like language that has a python like syntax was something I had hoped for for some time.

Why was the name changed from Nimrod to Nim? IMO Nimrod sounds better. Nim is the name of a game: https://en.wikipedia.org/wiki/Nim .
Post reply on HN