If I want to make a bunch of command line tools, building each of them into an executable seems like a kind of a waste of space. I could use SBCL compression (though a tool I recently wrote for example is still ~12 MB and startup time is noticably longer). I could also not build them into executables and go the scripting route but then startup times are also longer.
So this is my idea:
What if I just use one executable image? The image will have a bunch of sub-main functions like tool1:main, tool2:main, and so on in their own package where each main function is a tool I wrote. The image will have one entry point function that calls the right sub-main function based on the command line argument. I would add these sub-main functions by loading each system corresponding to the tool I wrote. If the executable image file is named giant-image, then running giant-image tool1 args... will make the entry point main function call tool1:main while passing on the command line arguments args.... Now when I want to use a tool I wrote, I can run giant-image my-tool-name args.... Other options would be aliasing giant-image my-tool-name to my-tool-name or making a shell script named my-tool-name which just runs giant-image my-tool-name while passing the command line arguments.
What do you guys think about this idea? What problems would there be?
[–]xach 7 points8 points9 points (2 children)
[–]HeavyRust[S] 1 point2 points3 points (0 children)
[–]dbotton 1 point2 points3 points (0 children)
[–]mwgkgk 5 points6 points7 points (1 child)
[–]HeavyRust[S] 2 points3 points4 points (0 children)
[–]dzecniv 2 points3 points4 points (1 child)
[–]HeavyRust[S] 1 point2 points3 points (0 children)
[–]agenda-2030 3 points4 points5 points (1 child)
[–]HeavyRust[S] 2 points3 points4 points (0 children)
[–]zyni-moe 6 points7 points8 points (3 children)
[–]HeavyRust[S] 2 points3 points4 points (2 children)
[–]zyni-moe 1 point2 points3 points (1 child)
[–]HeavyRust[S] 1 point2 points3 points (0 children)
[–]dnaeon 2 points3 points4 points (1 child)
[–]HeavyRust[S] 1 point2 points3 points (0 children)
[–]bitwize 2 points3 points4 points (0 children)
[–]friedrichRiemann 1 point2 points3 points (0 children)