ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it possible to compile Lisp code into an executable binary?
I know the COMPILE-FILE function creates a *.fasl (Fast Load) file, but I want to create a binary executable, so, suppose I make a hello world program, like so:
Code:
;;;; helloworld.lisp
;;; Print's hello world on the screen
(format t "Hello, World!~%")
if - in the REPL - I go:
Code:
CLISP> (compile-file #p"helloworld.lisp")
All I get is helloworld.fasl.
Is there any way I can generate something like "helloworld" that I can just run? Even if I have to write a script that takes the *.fasl or *.lisp file and throws it through several built in translators, compilers and/or assemblers?
I really like Lisp, and I've written alot of extremely useful programs in it, I just want to be able to compile binaries for my friends and such, and provide downloadable pre-compiled binaries on my soon-to-be-available website...just so that the end user doesn't necessarily need to have a Lisp REPL installed.
I looked into it and it's quite a lot of hassle.
I believe you'd have to change lots of code and put loads of
type definitions and pragmas in. I think there's an issue with macros too.
I don't think it's straightforward.
Not in clisp anyway.
google it though.
and I know what you mean, it's so rare to see/hear about/find other lispers.
but you say it's quite a hassle? poop.
would another Lisp implementation perhaps ease the make-a-binary-executable process a little easier? like CMUCL or SBCL or Allegro?
Well, I am a lazy person and it seemed to spoil the pleasure of
lisp programming to worry about type definitions and such.
I think there were other implementations more suited than clisp
but then clisp is quite full featured.
As far as I know LISP is a very fast with it's interpreter. I do not really think that there is any point in compiling the code unless you want to publish to code. (But you do)
I am pretty sure that installing the a free interpreter on linux systems is fairly easy (apt-get or yum or whatever) and problem solved.
I used to struggle with this and I could not find any usable ideas out there. Maybe I wasn't looking hard enough.
There is one solution I can think of if you can't compile it.
Create a package that contains the REPL and the app itself too. No need for compiling, fairly easy to install and your friends can use it.
Last edited by vargadanis; 11-30-2006 at 11:11 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.