3 ms·
Syntactic indentation has been very polarizing since at least Python 0.9 (and maybe others) in the late 80s. Like ()s in Nim, Haskell also has a "both brackets
by cb321 6y ago
Syntactic indentation has been very polarizing since at least Python 0.9 (and maybe others) in the late 80s. Like ()s in Nim, Haskell also has a "both brackets or whitespace" kind of vibe.
But, yeah, choice lets different parts of code bases differ. No two ways around that. A ton of people had knee-jerk resistance to Python's lexical style but "got over it" eventually.
There really is a lot more to Nim than just this (its generic/template/macro metaprogramming, user-defined operators, GC options, speed, etc.). Many, many things can be done as libraries that would require direct compiler support in other languages. I would encourage you to give it a try.
- GordonS 6y ago> There really is a lot more to Nim than just this I've actually just been skimming some tutorials and docs, and wow, you're not wrong! I'm impressed - Nim seems to be rammed with features, but also easy to get started with (as long as you ignore some of the more advanced stuff). I've recently been trying to find time and motivation to start learning Rust, but I have to say that (even with horrible indentation syntax :p ) Nim looks really compelling too...
- cb321 6y agoIf a little CLI app to do something useful (instead of say, some shell script/batch file or something) is your entry point then you might try cligen [1]. Everyone is different, but from many and varied reports (e.g. in this very thread [2]), it is hugely more probable that you get up & running with some basic skills in like 30 minutes to 4 hours or so with Nim than you would with Rust. Nim really seems to "scale up gracefully" for most. [1] https://github.com/c-blake/cligen https://github.com/c-blake/cligen [2] https://news.ycombinator.com/item?id=25596285 https://news.ycombinator.com/item?id=25596285
- blackrock 6y agoNim’s available argument parser library needs some more maturity, as compared to Python. Python has a great argparse library, and it would be good if Nim could emulate that.
- cb321 6y agoWell, cligen is pretty mature/featureful, less work to use and well maintained and is the most common recommendation in Nim. If you happen to like more verbosely specified CLI interfaces like Python's argparse there are at least two pretty close to the Python argparse -- therapist [1] and nim-argparse [2]. There is much more to any programming language than its stdlib. { If you find these insufficiently "drop-in compatible", well, you can write your own port of argparse.py that is closer. :-) That is probably a good exercise. } [1] https://maxgrenderjones.bitbucket.io/therapist/latest/therapist.html https://maxgrenderjones.bitbucket.io/therapist/latest/therap... [2] https://www.iffycan.com/nim-argparse/argparse.html https://www.iffycan.com/nim-argparse/argparse.html
- blackrock 6y agoI did entertain that idea. But it would’ve detracted my efforts from my actual goal. therapist looks interesting. I’ll take a look at this. Thanks.