3 ms·
For most common-lisp implementations you can just save the current state as an executable, along with specifying an entry-point. Obviously doing this from your
by aidenn0 5y ago
For most common-lisp implementations you can just save the current state as an executable, along with specifying an entry-point.
Obviously doing this from your dev environment is a bad idea, so most people write a script that loads the system and dumps the image. Or you can use one that someone else has already written.
Not all lisps work this way (most notably ECL does not), and you can use ASDF's program-op to create an executable directly from a package definition, which should work on any implemntation supported by ASDF.
- tehjoker 5y agoThanks, the saving the dev environment part was the part that scared me. It certainly helps to have someone tell you you're not crazy. Maybe I'll give it another try sometime!
- aidenn0 5y agoOne of the things I've learned with powerful tools is that, by their nature, they empower you to do bad things almost as much as they empower you to do good things. It's even alluded to in the ruby bare-words example in this famous talk[1] 1: https://www.youtube.com/watch?v=3se2-thqf-A https://www.youtube.com/watch?v=3se2-thqf-A
- foobarbaz33 5y agoYou can just run make when you are ready to make a clean build and executable. Same as any other language.
- _ph_ 5y agoNothing to worry about. Yes, the minimal executable you get with SBCL is a bit fat, but for any real-world application which do some actual work, the size is a non-issue. Especially, as the executables are starting up very fast, as no dynamic linking is necessary, most of the code are static references. For any sizable Lisp project you would have an ASDF-file to load the system, with that you can create an easy build-script or even a make-file, which loads your program via ASDF and then builds the executable, it is described well here: https://stackoverflow.com/questions/14171849/compiling-common-lisp-to-an-executable https://stackoverflow.com/questions/14171849/compiling-commo... For consistancy, I would recommend to build the executable from the freshly loaded source, not a lisp image which has been used to develop in.