Software Secret Weapons™


 
Lisp
by Pavel Simakov on 2006-03-25 21:52:37 under Lambda, view comments
Bookmark and Share
 


Lisp has been long named a secret weapon of software engineering. As we collect software secret weapons here – we must talk about Lisp. One very good friend of mine is a Lisp believer. He is a great inspiration for my curiosity about Lisp. I am not a convert yet, but I take my notes.

If you are a serious Java, C++, Delphi programmer you might have been wondering what the buzz is all about. It is quite hard to listen to Lisp person explain Lisp powers. He will keep saying that you have to learn Lisp to understand it...

You might not understand all the powers, but you can definitely understand the principles. Some of these concepts are hard to grasp and hard to use. But is makes is so much exciting...

  • List structure of program code
    A fundamental distinction between Lisp and other languages is that in Lisp, program code is not simply text. S-expressions that represent structure of Lisp program in memory can be manipulated by Lisp macros at runtime.
  • Functional programming language
    In comparison to imperative programming, strict functional programming languages, like Lisp, do not have variable assignment or memory allocation. These things occur automatically when functions are invokes and parameters are passed in and out of functions. We have grown to appreciate automatic garbage collection in Java and .Net, but "no assignment operator"... This is quite a distress. Writing code without assignment operastor forces you to rethink state management and variable scoping all the way to primitive Turing machine...
  • Parentheses
    As with XML, opening and closing parentheses ensure that source code text is well-formed.
  • Lexical or dynamic scoping
    Lisp allows you to select whether you want to use lexical or dynamic scoping. Different kinds of variable scoping have been discussed in depth elsewhere .
  • Dynamic typing
    Lisp uses exclusively dynamic typing. Different kinds of type checking are discussed elsewhere.
  • Closures
    A function that references an outer lexically scoped variable is called a closure. I have discovered a good example of using closures in Javascript Closures. In Java limited support for closures exists. The Java inner-classes are pretty much closures.
  • Lambda functions
    Under this topic also fall functions as first-class objects and curried functions.
  • Tail recursion
    Tail recursion is a kind of optimization. It allows writing recursive code that does not use call stack. Applied properly, tail recursion claims to provide enormous performance boost.
  • Common Lisp Object System (CLOS)
  • Lisp reader
    Lisp reader is responsible for parsing an input into S-expressions that represent a structure of Lisp program. The reader is customizable allowing direct conversion of foreign languages into native Lisp code. For example: use “enable-sql-reader-syntax” to adopt Lisp reader to reading SQL.
  • Macros
    Lisp macros allow you to define operators that are implemented by transformation. The definition of a macro is essentially a function that generates Lisp code. A program that writes programs.
  • Memory management
    As in Java or .Net memory management in Lisp is automatic. All memory allocated is automatically freed when it is no longer referenced. Non-deterministic finalization issues exist in Lisp as well.
  • Products that utilize Lisp
    • Emacs, the extensible, customizable, self-documenting real-time display editor.
    • AutoCad, computer-aided drafting (CAD) software package for 2D and 3D design and drafting.
    • Yahoo! Store web-commerce site and Paul Graham’s story behind it
    • Orbitz, a major travel booking site.
  • Great Books on Lisp

Comment (1)

  • Comment by Happy — July 10, 2008 @ 10:46 am

    It is true that Lisp has some weaknesses, what are the way forward and is there any high level model to improve the structure of the language.


Leave a comment


 
Dog Emotional 2010 Calendar Dog Emotional Mousepad Dog Fashionable 2010 Calendar Dog Fashionable Mousepad

Copyright © 2004-2010 by Pavel Simakov
any conclusions, recommendations, ideas, thoughts or the source code presented on this site are my own and do not reflect a official opinion of my current or past employers, partners or clients
SourceForge.net Logo