Live data from Hacker News

Nim Version 1.6.6 Released

nim-lang.org

41–50 of 116 posts

Re: Nim Version 1.6.6 Released

#41
post #31

Earlier quoted context omitted.

This is exactly what Nim does. If you try to define both my_var and myVar it will error out. The benefit is to avoid confusing variables or procs named my_var, myVar and myvar.

If you define them both yes, but you're still free to use them both. var my_var = 1 myVar += 1 echo(my_var) Will happily compile and give you 2. I'd prefer an error in that case because while I'm not liable to make that mistake but I could easily mistype long_variable_name as long_variablename without noticing and then cause myself problems when I try to grep.

  nim --styleCheck:error c x
This enforces the same capitalization style in your code:

  x.nim(1, 5) Error: 'my_var' should be: 'myVar'

Re: Nim Version 1.6.6 Released

#42

For all those who are really interested in the language and have at least a small amount of experience with it already: Nim is ripe for contributing! While the main team works on bigger things drawing v2 closer, there's still lots of issues of various magnitude and lots of housekeeping bits that can be done while getting yourself acquainted with the project's structure. Here's a few links for your consideration: * ht…

What's on the roadmap for v2?

https://github.com/nim-lang/RFCs/issues/437

Re: Nim Version 1.6.6 Released

#43
post #37

Earlier quoted context omitted.

I mean, it really might be fine. I've written maybe 20 lines of Nim in my life, what do I know. I just look at it and see a foot and a gun pointing at it. The arguments for it sound to me like "it's fine, there's a safety and a clever mechanism that prevents shooting yourself in the foot". Maybe it's all fine, but I'd for one feel more comfortable if the gun wasn't pointing at the foot in the first place.

This is the opposite of a footgun. Imagine if DNS was case sensitive and GMAIL.COM belonged to a domain squatter. Nim prevents that. It's that simple.

This is an interesting take, I do see the value. If I was trying to prevent this type of aliasing, I'd have the compiler throw an error if there were two aliased variables names (xyz and XYZ for example), rather than merging them automatically.

Re: Nim Version 1.6.6 Released

#44

A bit off-topic, but I'd like to see a language à la rust+gc, with pattern matching, traits, and the functional stuff rust got right, but without all the worries of lifetimes, and maybe some easier trait management (function signatures become very ugly imo). I've heard the claim that lean is going in this direction.

Lean the theorem proving language?

Re: Nim Version 1.6.6 Released

#45

A bit off-topic, but I'd like to see a language à la rust+gc, with pattern matching, traits, and the functional stuff rust got right, but without all the worries of lifetimes, and maybe some easier trait management (function signatures become very ugly imo). I've heard the claim that lean is going in this direction.

It sounds to me like you might enjoy SML or OCaml.

Re: Nim Version 1.6.6 Released

#46

A bit off-topic, but I'd like to see a language à la rust+gc, with pattern matching, traits, and the functional stuff rust got right, but without all the worries of lifetimes, and maybe some easier trait management (function signatures become very ugly imo). I've heard the claim that lean is going in this direction.

Absolutely, I think there is a huge opportunity here. A rust+gc lang which has seamless ffi with rust would be a killer in my opinion.

Re: Nim Version 1.6.6 Released

#47
post #24

Earlier quoted context omitted.

Yeah I can see how it might seem scary. It takes you out of your comfort zone and it's easy to start thinking uncomfortable things have to be scary. I've been using Nim for a couple of years now, and I've never run into a safety issue with it.

I'm all up for new, exciting, slightly scary but promising concepts in programming. Rust's borrow checker. Python extremely-dynamic syntax. Nim's "Python syntax, native code, GC" premise. Exploring different ways to write the same name does not excite me.

Reading through the GitHub issue, it seems like the one place it makes sense in my eyes is that you can refer to stuff in external libraries with your convention even if the library uses a different one. I'm not sure if there's something I'm not thinking of, but to me it'd make sense if the library boundary was the only place it let you do it.

Re: Nim Version 1.6.6 Released

#48
post #37

Earlier quoted context omitted.

This is the opposite of a footgun. Imagine if DNS was case sensitive and GMAIL.COM belonged to a domain squatter. Nim prevents that. It's that simple.

This is an interesting take, I do see the value. If I was trying to prevent this type of aliasing, I'd have the compiler throw an error if there were two aliased variables names (xyz and XYZ for example), rather than merging them automatically.

That's what --styleCheck:error is for.

Re: Nim Version 1.6.6 Released

#49
post #34
post #6

Earlier quoted context omitted.

Style insensitivity is a safety feature, not a problem. It prevents bugs where a developer mistakes one variable or proc for another having similar names. For example in another language you might have variables isReady, isready, is_ready and use the wrong one, leading to a bug. Nim does not allow defining 3 different variables like that.

I love Nim and wish it would take off and become as common as python. Case sensitivity isn't affecting that for me. But it still really irks me. There are times when you might want to use the same variables in different cases (math), and the assumption that you wouldn't seems like nannying to me. Also, fundamentally, it's a very english-centric view and encourages that by default. I'd prefer case assumptions weren't…

In math, most variables are a single letter, so style sensitivity wouldn't really apply.

Re: Nim Version 1.6.6 Released

#50

There is a question of getting rid of style sensitivity in Nim 2: https://news.ycombinator.com/item?id=31238375 This whole question generates a lot of controversy for some reason

It’s probably my biggest gripe with nim. I hope they drop it and provide a tool like gofmt to get everyone’s code into the same style.

gofmt doesn't seem to ensure consistency in naming styles.
Post reply on HN