4 ms·
I try to keep very few programming rules, but one which has emerged over time is "no python unless absolutely necessary" (precisely because of the thing you hin
by pmarreck 2y ago
I try to keep very few programming rules, but one which has emerged over time is "no python unless absolutely necessary" (precisely because of the thing you hinted at- the dependency problem, which I've run into one time too many, but also, the whole concept of there being only 1 way to do things which is kind of enforced just always rubbed me the wrong way)
But yes, in theory, that might be nice! There's also the Python-powered shell, Xonsh, which I can't use either.
- frfl 2y agoDependency problems are mainly resolved with uv - try it. 1 way to do things - not sure what you mean. It's a general purpose language, if you dont like something there's probably a different library that may do it the way you like (eg, don't like exceptions, use a library that mimics rust style Result values; don't like oop, don't do oop, functional programming is certainly possible in python), or easy enough to start creating your own private utility libraries that do things your way. Xonsh was okay. Idk if I'd use it again. I'd probably just use python to invoke external cli programs using subprocess. I used xonsh for scripting before. I recall it having a slightly slow start up - I launch shell frequently so that's a no-go for me to use as my default shell. --- And I looked at alternative scripting languages. Racket, D (has a single file script mode), ocaml, etc. Honestly python seemed good enough, even with its warts, especially with uv to manage deps without a whole formal project needing to be setup for a script. Stwp up from bash. Most of my use cases are fine with argparse + subprocesses + a unix shebang at the top + "chmod +x", with uv handy if I need a external library.
- mbirth 2y agoBtw: MicroPython is also available as a binary for all the usual operating systems. I’ve once made a few scripts and some .sh and .cmd files to launch them using the bundled micropython binary.
- pmarreck 2y agoRacket intrigued me, what did you find with it?
- soegaard 2y agoIn that case, also check Zuo. https://docs.racket-lang.org/zuo/index.html https://docs.racket-lang.org/zuo/index.html Zuo is used to build Racket. It can be distributed as a single C file, which makes it extremely to integrate in new projects.