CLISP

Discussion of Common Lisp

CLISP

Postby FNTP » Tue Jul 22, 2008 5:00 am

Hello everyone,this is my first post on the lisp forums and hopefully one of many :)
I'm very new to lisp and very much loving the language,but I am facing a little problem which I am sure can be solved easily.
I've been using Common Lisp with CLisp as a compiler from the command line but recently decided to use a text editor and compile my programs.
Here is where I'm having problems.My programs compile just fine with no errors and create the .fas file but I cannot figure out how to run the program.
Any Help would be appreciated :)
FNTP
 
Posts: 2
Joined: Tue Jul 22, 2008 4:56 am

Re: CLISP

Postby Ramarren » Tue Jul 22, 2008 5:22 am

Common Lisp doesn't have a concept of program as such. You just start an environment, load the code, and run a function you want. If you are on Linux and really want to launch "programs", you can investigate cl-launch. Or perhaps creating executables.

But these are not the usual ways to develop and run Lisp code. One usually uses a Lisp aware editor (Emacs with SLIME, VIM with Limp, Eclipse with Cusp, or something, but Emacs/SLIME is usually recommended), and use it to send code from files to running Lisp instance.
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Re: CLISP

Postby FNTP » Tue Jul 22, 2008 5:31 am

Alright thanks for the reply i got it figured out :)
FNTP
 
Posts: 2
Joined: Tue Jul 22, 2008 4:56 am

Re: CLISP

Postby Dave » Wed Jul 23, 2008 2:19 am

Ramarren wrote:Common Lisp doesn't have a concept of program as such. You just start an environment, load the code, and run a function you want. If you are on Linux and really want to launch "programs", you can investigate cl-launch. Or perhaps creating executables.

But these are not the usual ways to develop and run Lisp code. One usually uses a Lisp aware editor (Emacs with SLIME, VIM with Limp, Eclipse with Cusp, or something, but Emacs/SLIME is usually recommended), and use it to send code from files to running Lisp instance.


Hi.

I am new to lisp but I've done some programming before. I have emacs + slime set up and I'm reading Practical Common Lisp to learn more. The reply above is interesting because things like how to create and run executables was one of the first things I would have wanted to know about. As I searched for the advantages of lisp over other languages the answers weren't so clear cut as they tend to be with e.g. C++, such as the speed and size of executables. They tended to be things like the experience of using lisp. Having read the comment above I get the impression that lisp can't be approached relying on experiences with other languages. At the least I find this intriguing.
Dave
 
Posts: 4
Joined: Sun Jul 20, 2008 5:12 am

Re: CLISP

Postby donkey » Wed Jul 23, 2008 7:41 am

There are quite certainly other advantages to learning Lisp other than the experience itself. Advantages over other languages are quite a few, depending on what the "other" language is. However, with other languages having borrowed heavily from Lisp's inheritance (Lisp is 50-year old after all...), it's hard to point a finger towards something you absolutelly cannot find in any other language.

Not having the notion of executable file as such is not really something done only so as to distinguish Lisp from other languages. From my experience, it actually has a lot of advantages, including the incredible ease of code loading and unloading.

The recommended way of development is, indeed, to use SLIME or something similar to feed code to the Lisp interpreter. Due to ASDF, this also makes a very good way to distribute applications (and also very flexible).

As far as approaching Lisp goes, experience from other languages is certainly helpful, but used selectively. For instance, I found my familiarity with the intimate details of the C compilers very useful when profiling my Lisp code, even though Lisp isn't C and SBCL is not GCC, and my acquaintance with dynamic typing from Objective-C to be equally helpful.
donkey
 
Posts: 11
Joined: Sun Jun 29, 2008 11:05 am

Re: CLISP

Postby findinglisp » Wed Jul 23, 2008 10:31 am

Part of the confusion is caused by Lisp's use of the term "compiler." While Common Lisp implementations do include a compiler, it's not the same as a C compiler where it spits out raw machine language that gets linked into a native binary. It's more like the compiler in Python where it produces a .pyc file when it executes the script for the first time. Thereafter, you still need to invoke the main Python binary on that script, however. Lisp is the same way, where FASLs are basically like .pyc files. You still have to invoke the main Lisp binary and tell it to load and execute the FASL. Most Common Lisps also provide a way to dump a whole memory image so that you can even dispense with loading FASLs, but again you still have to invoke the main Lisp binary and tell it to load and execute the memory image. Finally, some Lisp implementations also have a way to essentially take that dumped memory image and link with with the main Lisp binary itself, producing the equivalent of a single-file, native binary.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
findinglisp
 
Posts: 440
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX


Return to Common Lisp

Who is online

Users browsing this forum: No registered users and 5 guests

cron