4 ms·
As long as there's no need to ship standalone binaries without shared libraries.
by sayanarijit 4y ago
As long as there's no need to ship standalone binaries without shared libraries.
- mgunyho 4y agoIndeed, Python would be a good language to implement this in terms of ease of development, but it's very difficult to distribute a standalone binary (which I wanted to do). The built-in curses support of Python is also not cross-platform I think.
- nibbleshifter 4y agoStandalone Python apps as binaries tend to be poorly performant, and huge (due to shipping an interpreter, stdlib, deps, etc) in my experience. Assuming you get it working at all.
- jonnycomputer 4y agoI'd prefer an informative rebuttal if people disagree with nibbleshifter, because I want to learn.
- nibbleshifter 4y agoI'm also kind of hoping someone comes along and says I'm wrong with a solution that doesn't suck tbh.
- chrismorgan 4y agoIt’s a funny thing I’ve noticed about scripting languages: they’re generally easier to get going with yourself, but they’re horrible for distribution/deployment, and if you have to integrate code written in other languages (even C libraries with Python bindings, or similar—things like wxWidgets or GTK), that rapidly escalates to a nightmare. Meanwhile, ahead-of-time compiled languages like Rust and Go are simply a breeze to distribute/deploy.
- mgunyho 4y agoThat's true, although I think in the case of Go, it is a central design decision to make single-binaries easy so it's more of an exception to the rule. 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.
- sayanarijit 4y agoLua is only a configuration language without luarocks. With luarocks, we're back to the root of the argument - dependency vs standard library.
- mixmastamyk 4y agoThere are several working options for packaging Python apps, some existing for twenty years. Sure, while a little more complicated than compiling a static executable, it is hardly a "nightmare." It's basically writing a config file, and adding another stanza to a Makefile or modern equivalent. 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?
- sayanarijit 4y agoThat static executable will basically contain the whole python interpreter with a huge standard library. Maybe makes sense for a gui app, but I'd avoid installing a whole python interpreter for each of my little cli tools. Don't forget the startup time overhead of first loading a whole interpreter into memory, then loading a python program into the interpreter.
- mixmastamyk 4y agoThere are multiple options for these requirements as well. I understand that solutions are sometimes clumsy, but the end-user won't know the difference.