Begginer questions

Discussion of Common Lisp

Begginer questions

Postby Rui » Fri Aug 15, 2008 7:55 am

Hello all.

Being a begginer in Lisp, I still have some questions related to this language in general. For example:

Common Lisp has several implementations, but what is in fact an implementation of Common Lisp?
What are the major differences between them?
Is there any implementation that is considered to be better than the rest? Why?
When I learn Common Lisp, do I learn implementation-specific code?

Thanks.
Rui
 
Posts: 5
Joined: Fri Aug 15, 2008 7:15 am
Location: Portugal

Re: Begginer questions

Postby marcoxa » Fri Aug 15, 2008 9:16 am

Common Lisp has several implementations, but what is in fact an implementation of Common Lisp?

An implementation of Common Lisp is one that is conforming with the ANSI Common Lisp standard, which you can see in the Common Lisp Hyperspec (usually referred to as the CLHS)

What are the major differences between them?

Whether they have a compiler (all of them do to some extent), whether the compiler goes down to assembly or byte-compiles, whether they come with a full blown development environment, whether they are commercial, free-as-in-freedom or free-as-in-beer :D
Is there any implementation that is considered to be better than the rest? Why?

That depends on your goals. For learning purposes, most implementations will do. If you want a good development environment and good support, the commercial implementations are very good. If you want to deploy embedded CL applications then it depends on your target: ECL deploys as a dynamic library, ABCL targets the JVM etc etc.
When I learn Common Lisp, do I learn implementation-specific code?

Initially no. The main "implementation dependent" developing bits in my experience are relegated to GUI programming and things like COM or other pretty esoteric bits and pieces that CL programmers know but are too ashamed to talk about.

Cheers
--
Marco
Marco Antoniotti
marcoxa
 
Posts: 58
Joined: Thu Aug 14, 2008 6:31 pm

Re: Begginer questions

Postby findinglisp » Fri Aug 15, 2008 9:53 am

Rui wrote:Hello all.

Being a begginer in Lisp, I still have some questions related to this language in general. For example:

Common Lisp has several implementations, but what is in fact an implementation of Common Lisp?
What are the major differences between them?
Is there any implementation that is considered to be better than the rest? Why?
When I learn Common Lisp, do I learn implementation-specific code?

Thanks.


Marco answered many of your questions. I'd just follow up by saying that while today it seems like many languages are defined by a single implementation (e.g. Perl, Python, Ruby, Java, C#, etc.), this was not the way languages used to be.

In the "old days," we had a crop of languages such as C, C++, Common Lisp, Scheme, Fortran, Cobol, etc. All of these have many different implementations. They are all (Cobol, too?) defined by international standards which helps with interoperability between the various implementations. Most implementations also have other specific extensions in addition to the features defined by the standard (e.g. GNU C has a lot of convenient extensions). There are also typically platform-specific differences in the environments (e.g. the libc API for Unix/Linux or Win32 API) that fall outside the realm of the standards but which are important in real-world programming.

In any case, Common Lisp is an example from that older crop of languages. There are many good implementations. Which one you choose will depend on your specific requirements (perhaps operating system--Linux vs. OS X vs. Windows) or the specific libraries that you would like to use, or even if you want to run CL in a JVM (ABCL, for instance).

Personally, I use SBCL on Linux and CLISP on Windows. I also like ECL for embedding. I don't do any work on OS X, so I can't advise you there, and others will probably chime in with their favorites. There are also commercial versions available for all these platforms (LispWorks, Allegro, Corman, etc.).

Dan Weinreb created this nice resource which surveys all the various implementations available:
http://common-lisp.net/~dlw/LispSurvey.html
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

Re: Begginer questions

Postby Paul Donnelly » Fri Aug 15, 2008 3:25 pm

Rui wrote:Hello all.

Being a begginer in Lisp, I still have some questions related to this language in general. For example:

Common Lisp has several implementations, but what is in fact an implementation of Common Lisp?

Just like there are lots of C compilers, there are lots of Common Lisp implementations. We have to say "implementation" rather than "compiler" because there's more to a complete Lisp system than just the compiler—there's at least a standard library, and probably an interpreter too—and because not every implementation actually includes a compiler (although any modern one does).
Rui wrote:What are the major differences between them?

Implementations have varying levels of conformance with the Hyperspec, but they are all close enough that a beginner doesn't need to worry about it. They all implement some features above and beyond what the Hyperspec specifies, such as a FFI to load C code, thread support, or networking. These are strictly optional, and you don't need to worry about them unless you want to use them. In many cases, there are libraries that wrap these implementation-specific things that you can use if you want to write portable code.
Rui wrote:Is there any implementation that is considered to be better than the rest? Why?

Only for particular purposes. Of the free Lisps, ECL would be a good choice if you want to embed CL in a C program. SBCL for fast operation on *nix (Windows port in progress). CLISP for good support on several platforms, fast startup, and low memory needs. And so on for the other free Lisps and the commercial Lisps, neither of which I know much about.
Rui wrote:When I learn Common Lisp, do I learn implementation-specific code?

No, not until you choose to make use of your implementation's extensions. There are a few corners where implementations differ (e.g. how they interpret pathnames), but you can write a lot of code without ever worrying about this.
Paul Donnelly
 
Posts: 148
Joined: Wed Jul 30, 2008 11:26 pm

Re: Begginer questions

Postby Rui » Sat Aug 16, 2008 11:56 am

Thanks a lot for the quick and nice answers.
Rui
 
Posts: 5
Joined: Fri Aug 15, 2008 7:15 am
Location: Portugal


Return to Common Lisp

Who is online

Users browsing this forum: Bing [Bot] and 3 guests