Writing in Rust looks like casting spells in an Infocom game.
Gnusto rezrov!
https://en.m.wikibooks.org/wiki/C_Programming/stdlib.h/itoa
I get the others, but that ones a pretty standard type converter, the opposite of the C standard atoi
Different tools for the same job. One is explicitly integer to string conversion the other is sting formatting.
You can technically use the latter, but some prefer a function which explicitly does one thing and one thing only.
C kind of gets a pass for this stuff because C was old and in the early days they were limited by token size. But to still be using this term today in a new language seems fairly derisible.
This is the sort of thing that I meant by “doing things properly rather than half-heartedly”. You could make something like this by reimplementing half the libraries in an inferior fashion, full of bugs, cross-platform inconsistencies and missing functionality. Or you can take an extra dependency. Even in Python, the recommendation would be firmly to add dependencies like appdirs for dirs and I dunno what for the rest.
Is that really all that different from Python?
> Because of Python’s conservative nature when it comes to backwards-compatibility, when a module is added to the stdlib its API becomes frozen.
So it sounds like they do do something fairly similar, but just a different mindset on adding libraries
You can do a lot with pythons stdlib, and a lot of popular libraries (requests, for example) largely are just usability wrappers for underlying stdlib stuff.
Whereas with Rust, you have a very minimal std, and things you want to achieve are imported specifically.
I don't think it's an inherent feature of scripting languages that they are hard to distribute. I'm pretty sure it's possible to package up a tiny Lua interpreter (or e.g. QuickJS) and all necessary scripts into a standalone file.
Reminds me of the idea regularly pushed here that you need a virtualenv even for thirty-line scripts. I read these kind of takes here often and am a bit baffled by them. Maybe it is because developers have lost administrator skills over time, that this feels like an insurmountable challenge?
Granted, a few of these things apply to Rust stuff as well (e.g. resources and manifests can’t quite be done out of the box without extra tools), but most of them are inapplicable, and the remainder tend to have better solutions than I observed in Python-land. And a lot of the pain that I’m describing of the Python stuff isn’t that it’s hard to do anything, but more that I’ve found it all just exceptionally error prone and unreliable.
Don't forget the startup time overhead of first loading a whole interpreter into memory, then loading a python program into the interpreter.
Assuming you get it working at all.
Having over fifty dependencies for something like this is not in any way terrifying—you’re just starting with a different set of expectations and understandings of how things are done. It’s a natural and reasonable outworking of (a) using the right tools for the job, (b) doing things properly rather than half-heartedly (most obviously where terminal interactions are involved), and (c) Rust’s deliberately thin standard library.