Programming This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
11-27-2006, 10:48 PM
|
#1
|
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853
Rep:
|
Making Lisp Binaries
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.
Last edited by indienick; 11-27-2006 at 10:49 PM.
|
|
|
11-28-2006, 03:57 AM
|
#2
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515
|
what you use? clisp.
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.
good to see another lisp fan though
|
|
|
11-29-2006, 01:13 PM
|
#3
|
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853
Original Poster
Rep:
|
thanks for the response.
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?
|
|
|
11-29-2006, 01:16 PM
|
#4
|
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012
Rep:
|
I heard that SBCL can make binaries relatively easy, but I don't have any experience with that.
|
|
|
11-30-2006, 02:52 AM
|
#5
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515
|
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.
|
|
|
11-30-2006, 08:34 AM
|
#6
|
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012
Rep:
|
You can also try ECL, it seems geared toward making small native binaries.
|
|
|
11-30-2006, 11:05 AM
|
#7
|
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853
Original Poster
Rep:
|
ECL, eh?
thanks for the replies tuxdev.
|
|
|
11-30-2006, 11:06 AM
|
#8
|
Member
Registered: Sep 2006
Posts: 248
Rep:
|
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.
|
|
|
11-30-2006, 11:29 AM
|
#9
|
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853
Original Poster
Rep:
|
yeah, ECL definitely looks like what I'm looking for.
thanks again, tuxdev.
|
|
|
All times are GMT -5. The time now is 11:23 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|