LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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

Reply
 
Search this Thread
Old 11-27-2006, 11:48 PM   #1
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
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 11:49 PM.
 
Old 11-28-2006, 04:57 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,312

Rep: Reputation: 175Reputation: 175
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
 
Old 11-29-2006, 02:13 PM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Original Poster
Rep: Reputation: 65
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?
 
Old 11-29-2006, 02:16 PM   #4
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
I heard that SBCL can make binaries relatively easy, but I don't have any experience with that.
 
Old 11-30-2006, 03:52 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Debian, Mint, Puppy
Posts: 3,312

Rep: Reputation: 175Reputation: 175
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.
 
Old 11-30-2006, 09:34 AM   #6
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
You can also try ECL, it seems geared toward making small native binaries.
 
Old 11-30-2006, 12:05 PM   #7
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Original Poster
Rep: Reputation: 65
ECL, eh?

thanks for the replies tuxdev.
 
Old 11-30-2006, 12:06 PM   #8
vargadanis
Member
 
Registered: Sep 2006
Posts: 248

Rep: Reputation: 30
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 12:11 PM.
 
Old 11-30-2006, 12:29 PM   #9
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Original Poster
Rep: Reputation: 65
yeah, ECL definitely looks like what I'm looking for.
thanks again, tuxdev.
 
  


Reply

Tags
compile, lisp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LISP or COMON LISP Compiler for Debian carspidey Programming 3 04-19-2006 08:46 AM
Which Lisp Should I Learn? flamesrock Programming 3 09-16-2005 03:38 PM
Lisp phoenix7 Programming 4 09-24-2004 08:40 AM
Maxima and lisp fettouhi Fedora 0 05-21-2004 08:35 AM
Lisp, emacs-lisp aizkorri Programming 1 09-04-2002 07:16 PM


All times are GMT -5. The time now is 01:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration