Single Executable Binary just like Go Lang?
I love how Go makes single executable binary for an app I make in it by default. Makes deployment on the servers very easy. Does Mojo has any plans to add a similar feature?
8 Replies
mojo build | Modular Docs
Builds an executable from a Mojo file.
Not it does not, builds done that way have a bunch of dynamic libraries attached to it.
Static linking isn't supported right now, however this is a frequently requested feature.
Ah, good to know. Static linking would definitely be nice
Static linking would be the .exe pointing to sitting libraries?
I think it'd be best if you could grab everything an end user would need, particularly for an application for non-tech-savvy people, and get it all into that single application file, that'd be the ultimate. @Ryulord Is that sort of what Go does?
static linking is when the compiler puts the compiled library code inside the executable so that the executable is standalone. The alternative, dynamic linking, has the executable look for other files (.dll or .so) when you start it and it tries to use those, which means you need to be sure that they're installed, the correct version, and in the right path, which is a pain.
Ahh, so my assumption was correct, just, inverted... Lol.
There's nothing like that for Python, huh... I've seen some really convoluted instructions on how to do it, with each case basically requiring an entirely different methodology.
It would be a boon to Mojo if it could, perhaps some system of classification for libraries, allowing them to either be compliable, or not, or perhaps some kind of system of credit somehow, if your library ends up in a commercial product. I'm guessing that's all covered somewhere in the fine print. I'd love if a library I made brought in some residuals.
There's nothing stopping you from charging to use your library. People can only legally use your code if you let them or if it's fair use. There are even non-commercial licenses if you want other open-source/non-profit folks to be allowed to use it but businesses
100%. My view in a moral sense is... I'd want the little fishies to use my library for free, to make as much money as they get sales, and for the whales to have to share, even a fraction of a percent could probably be enough to cut out the supplemental cashier duty. 🙂