Re:Ruby vs. Python comes down to the for loop
by Mikeb85 on Friday November 12, 2021 @12:34PM
(#29202104)
Nim is nice but it's not dynamic so replacing a lot of the use cases of Python/Ruby (or R) would be a pain. Like, I'm not going to do any data munging in Nim when the others exist, exploratory programming in Nim is also sub-optimal. That being said, it's a nice language, way easier to write than any other statically typed language I've used, I never used Pascal/Delphi but Nim makes me appreciate that whole family of languages a lot more (Nim is basically a modern Pascal with Python's significant whitespace that compiles to C).
Re:Ruby vs. Python comes down to the for loop
by goodpoint on Friday November 12, 2021 @04:09PM
(#29204556)
Most Python translates into Nim quite easily, actually.
Re:Ruby vs. Python comes down to the for loop
by Mikeb85 on Friday November 12, 2021 @04:24PM
(#29204705)
Not really. Proc vs def, let and var keywords, Pascal style ranges and arrays, etc... I found C# is closer to Nim when it comes to translating code than Python is. The semantics are pretty different, especially since it seems everyone uses numpy in Python for any sort of array maths.
Re:Ruby vs. Python comes down to the for loop
by goodpoint on Sunday November 14, 2021 @12:05PM
(#29218525)
These are two different languages: it's only normal that syntax will be different.
Yet Python is a dynamically typed language and translating it into many statically typed languages requires and almost complete rewrite.
Translating it to Nim is surprisingly easy in comparison.
I'd argue it's the inconsistency. Some things are methods, some things are functions. The name choices are also a bit boneheaded (eg. "dumps"). It's a lot like PHP in these regards.
Ruby, on the other hand, is beautifully designed. But it gives you a bazillion ways to skin a cat, and people love to be "clever" with their cat skinning. In those cases, I appreciate the utilitarian approach and "zen" of Python.
My biggest gripe with Python, though, is the totally 80s feel of the version and package management. It's one of the worst experiences in my daily engineering life. I can never know if complex ML code will work on my system without thirty minutes of patching things up.
I'll gladly use Python to get work done or Ruby for small websites. But I'm looking for a new daily driver for scripting that learns from the last thirty years of mistakes. (Modern language, sensible packaging/dependencies/version switch, optional static typing, and optional static binary output.) Nim, perhaps?