Friday, September 12, 2008

Making an Executable

Ostia Antica, harbor city of ancient Rome Not infrequently, some poor lisp newb will ask how to make an executable in lisp. The answer of course, is "what do you mean by 'executable?'" If the newb is lucky, somebody will eventually take break from pretending not to know exactly what he means and point him to save-lisp-and-die. But, they will hasten to add, making an executable is really a silly thing to do, so why bother?

Fresh from the mind of Sergey Kolos, Cusp contributor extraordinaire and the man who recently brought us integrated unit testing comes this wild innovation: a menu item called "Create Exe." That's right. In the next version, all Cusp users will have to do is right-click on their project and select "Create Exe." That, my friends, is what user-friendliness looks like.

So buck up, newbs. With luck, the endless discussions on what the meaning of the word "is" is will soon be replaced by the simple advice to "use Cusp."

I wouldn't hold my breath, though.

3 comments:

Anonymous said...

Hooray, now we will have the newbs using a "edit -> compile -> deploy -> test" circle while developing Lisp and nobody can "stop" them!

This REPL thing is useless anyway; *minimizes the REPL pane*.

Do people really code using this REPL-prompt thing? These people should check out Microsoft .NET and C#. Nothing to see here ...

*whoosh* ..the Lispers win again!

Unknown said...

I created that feature for the following reason (well main reason - to encode my experiments with executable creation in easy to use feature, so that I don't need to remember all the little details anymore):

When I started learning lisp I quickly got an idea that you develop a program using repl. However, many (most?) newcomers ask the following question: do I really want to spend time with a language where I cannot create deliverable (executable)? Even though I might never need to create that deliverable I really need that feature to even consider spending any time with a language. And this is the first thing everyone checks - write "hello world function" and make stand alone application that does its magic.

So if we want people to try Lisp, we need to provide them this feature. And this feature should be very easy to use. Even though later they might not need it ever.

Also don't underestimate complexity of save-lisp-and-die: it took me three tries (each - about a day of experimentation) before I was able to put together reliable set of steps to do this on windows. Maybe I am just stupid - or maybe documentation is very cryptic for someone not intimately familiar with lisp inner working.

So there, feature is now available for use. I might play with it couple times and never come back to it again, but I will always have this fuzzy warm feeling that creating executable is just one click away.

Anonymous said...

I'm unable to get the "create exe" to succeed with Cusp. I created a new lisp project with the default settings (main function hello world automatically created.) I used "create exe" with the default settings as well. I get the following uninformative error log. Any ideas?

Thanks!

=== Start Create Exe Log:
--- compilation command:
/home/axelrod/local/eclipse3.5galileo/plugins/sbcl_linux_1.0.20/sbcl/sbcl
--eval
"(defmacro cusp-break (x) `(progn (break) ,x))"
--eval
"(defmacro cusp-watch (x) `(progn (format t \"~a -> ~a~%\" ',x ,x) ,x))"
--eval
"(require 'asdf)"
--load
"/home/axelrod/local/eclipse3.5galileo/plugins/jasko.tim.lisp_0.9.390/lisp-extensions/lisp-unit.lisp"
--load
"/home/axelrod/local/eclipse3.5galileo/plugins/jasko.tim.lisp_0.9.390/lisp-extensions/asdf-extensions.lisp"
--eval
"(com.gigamonkeys.asdf-extensions:register-source-directories '( \"/home/axelrod/local/eclipse3.5galileo/plugins
...
/jasko.tim.lisp.libs_1.1.1/libs/html-template-0.9.1/\" ))"
--load
"/sandbox/aurora/axelrod/new-lisp1/new-lisp1.asd"
--eval
"(asdf:oos 'asdf:load-op \"new-lisp1\")"
--eval
"(sb-ext:save-lisp-and-die \"/sandbox/aurora/axelrod/new-lisp1/new-lisp1a\" :executable t :toplevel 'new-lisp1::main :purify t)"
--- compilation log:
This is SBCL 1.0.20, an implementation of ANSI Common Lisp.
More information about SBCL is available at .

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE] Ignore and continue with next --eval option.
1: [ABORT ] Skip rest of --eval options.
2: Skip to toplevel READ/EVAL/PRINT loop.
3: [QUIT ] Quit SBCL (calling #'QUIT, killing the process).
=== Error.
=== End Create Exe Log.