Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a Compiled Lisp Program

I'm guessing this is not rocket science, but how can I run a compiled lisp file? I am using emacs and SLIME under Windows. From the SLIME menu it is straightforward to compile the file and, once it does, it spits out a wx64fsl in the same directory as my lisp source. How do I load/run this file? I've been running files by eval-ing whole blocks of code and I've been told that running the compiled version performs far better.

like image 525
vpiTriumph Avatar asked Apr 23 '12 01:04

vpiTriumph


People also ask

How do I compile and run a Lisp program?

Step 1: After logging into a CUIT machine, enter "lisp" after the $ shell prompt and then hit <return>. Another way is to run lisp via emacs: Meta-x run-lisp (i.e. hit 'esc' followed by 'x', type "run-lisp" and you'll be in lisp mode from which you can load files of lisp code...)

How do I run a Lisp program in Ubuntu?

With CLISP under a unix (like Ubuntu) you can simply add a shebang to the top of your file #!/path/to/clisp and in Ubuntu that would be #!/usr/bin/clisp and it will execute the code as a script. You need the file to contain proper Common Lisp file like: #!/usr/bin/clisp (princ "Hello, world!")

How do you run a Lisp interpreter?

Double click on the icon to launch the interpreter. The prompt of LISP interpreter is [n]> where n is a sequence number. You may write LISP program directly on the prompts. The interpreter will execute the program right away.


1 Answers

From the SLIME REPL:

  1. ,cd to change directories into the one with your lisp file
  2. (load (compile "filename.lisp"))

OR from the SLIME Menu:

SLIME > Compilation > Compile \ Load

So basically it was embarrassingly easy and there was even a menu option for it, I was just initially confused by the nomenclature. Hopefully this will help someone in the future.

like image 94
vpiTriumph Avatar answered Oct 20 '22 23:10

vpiTriumph