Earlier quoted context omitted.
Significant whitespace has some real benefits (enforcing proper indentation, no lines wasted for "}" or "end", etc) too. Case insensitive and _ ignoring identifiers not so much -- they just add mental burden, encourage different styles in the same codebase, make things ungreppable without special tools, etc. And for what? If the best one can say about a feature is "people still like the language despite it", it might…
> encourage different styles in the same codebase Actually, case sensitive identifiers encourage this. If a library uses camelCase but your code base uses snake_case then you will be using a mix of camelCase and snake_case in order to use that library. That is a real benefit and is entirely the point of this feature.
Ask HN: Does anyone use Nim language in production?
71–80 of 86 posts
Re: Ask HN: Does anyone use Nim language in production?
#72Earlier quoted context omitted.
Significant whitespace has some real benefits (enforcing proper indentation, no lines wasted for "}" or "end", etc) too. Case insensitive and _ ignoring identifiers not so much -- they just add mental burden, encourage different styles in the same codebase, make things ungreppable without special tools, etc. And for what? If the best one can say about a feature is "people still like the language despite it", it might…
> encourage different styles in the same codebase Actually, case sensitive identifiers encourage this. If a library uses camelCase but your code base uses snake_case then you will be using a mix of camelCase and snake_case in order to use that library. That is a real benefit and is entirely the point of this feature.
Which will be totally fine, as it involves different variables / things pointed at.
Whereas the "case/underscore insensitive" qualifiers lets you have 10 different versions of the same variable name, in the same codebase -- even without using any third party "library".
Besides, the problem of "third party library uses a different style" is easily solved by having a tool like go fmt that enforces a unique single style. End of story.
Re: Ask HN: Does anyone use Nim language in production?
#73Earlier quoted context omitted.
> encourage different styles in the same codebase Actually, case sensitive identifiers encourage this. If a library uses camelCase but your code base uses snake_case then you will be using a mix of camelCase and snake_case in order to use that library. That is a real benefit and is entirely the point of this feature.
This. I can't count the number of times I've used two libraries with different casing just to have my own code end up as a mess of both.. I can see the point though that grepping, and things like editors which highlight the selected variable would have to take these rules into consideration. It's a valid concern but I feel the benefit of clean unified code is more important.
Whereas referencing the exported identifiers from the library with a different style than they are written with in the library's code sounds more satisfactory to you?
Re: Ask HN: Does anyone use Nim language in production?
#74I've just started writing a few scripts I'd normally use Python for (no production) and have been impressed with the speed and binary sizes. Nim in Action (book) is really good and what is missing to get the beginner started. I'd like to see a PyCharm like IDE for Nim as well, but Vim seems to work well.
For those interested in "Nim in Action", its publisher, Manning has a 50% off all e-books sale going through midnight today (27-May). Use code `wm052717lt`. Usually when they have this sort of sale on a holiday weekend, they spin up some new 50% off sale the following day, so check in again Sunday if you missed it today.
Re: Ask HN: Does anyone use Nim language in production?
#75Earlier quoted context omitted.
For those interested in "Nim in Action", its publisher, Manning has a 50% off all e-books sale going through midnight today (27-May). Use code `wm052717lt`. Usually when they have this sort of sale on a holiday weekend, they spin up some new 50% off sale the following day, so check in again Sunday if you missed it today.
Here is another discount code for today: wm052817lt Also here is my referral link (helps me when you buy via this link :) ) https://www.manning.com/books/nim-in-action?a_aid=niminactio...
Re: Ask HN: Does anyone use Nim language in production?
#76Earlier quoted context omitted.
> Very rarely it fails to compile something and you have to rewrite few lines differently This is a huge issue. If you can't trust the compiler, it's not ready to be used for any function that is system critical.
That depends on the frequency. Even gcc has bugs, albeit more rarely than Nim. The great thing about Nim is that you can very easily get in touch with one of the developers (me or Araq) on IRC/Gitter.
Re: Ask HN: Does anyone use Nim language in production?
#77Earlier quoted context omitted.
> Lack of exceptions Go does support multiple return values, commonly (T, error). If you think about it for a while, you will realize a exception is just a type of return value. Regarding generics, the more I used golang, the less I had a need for generics. Also, there is solutions if you insist, such as https://github.com/cheekybits/genny
> exception is just a type of return value No, they are part of the syntax. The compiler (in Nim and other languages) can track which exceptions are allowed to be raised in a procedure and which aren't at compile time: https://nim-lang.org/docs/tut2.html#exceptions-annotating-pr...
type FatalError error
func foo() FatalError {}Re: Ask HN: Does anyone use Nim language in production?
#78Earlier quoted context omitted.
> Lack of exceptions Go does support multiple return values, commonly (T, error). If you think about it for a while, you will realize a exception is just a type of return value. Regarding generics, the more I used golang, the less I had a need for generics. Also, there is solutions if you insist, such as https://github.com/cheekybits/genny
> Go does support multiple return values, commonly (T, error). Sure, and Nim supports multiple return values too. But having to handle this extra value at every function call seems like it would get old really fast. I don't want to worry about every single exception when I am prototyping for example. Also, without stack traces, how do I know where an error comes from? > Regarding generics, the more I used golang, the…
You are free to ignore the returned error, so for example to compare with a situation where you would raise an exception in another language inside a function, but not wrap the call in a try-catch:
val, _ := funcThatCanFail()
> Also, without stack traces, how do I know where an error comes from?
Go does have stack traces
Re: Ask HN: Does anyone use Nim language in production?
#79Earlier quoted context omitted.
This. I can't count the number of times I've used two libraries with different casing just to have my own code end up as a mess of both.. I can see the point though that grepping, and things like editors which highlight the selected variable would have to take these rules into consideration. It's a valid concern but I feel the benefit of clean unified code is more important.
> This. I can't count the number of times I've used two libraries with different casing just to have my own code end up as a mess of both.. Whereas referencing the exported identifiers from the library with a different style than they are written with in the library's code sounds more satisfactory to you?
I can see why you are skeptical of it but once you've used it for a while it becomes second nature. And you can always mix if you want to. The thing is that you can choose how you want to do it. And there are extremely few cases where the casing actually makes the identifiers different (keeping it mind that the first character is type sensitive).
Re: Ask HN: Does anyone use Nim language in production?
#80Earlier quoted context omitted.
For those interested in "Nim in Action", its publisher, Manning has a 50% off all e-books sale going through midnight today (27-May). Use code `wm052717lt`. Usually when they have this sort of sale on a holiday weekend, they spin up some new 50% off sale the following day, so check in again Sunday if you missed it today.
Here is another discount code for today: wm052817lt Also here is my referral link (helps me when you buy via this link :) ) https://www.manning.com/books/nim-in-action?a_aid=niminactio...