Search code examples
lisplanguage-features

What features is lisp lacking?


I have read that most languages are becoming more and more like lisp, adopting features that lisp has had for a long time. I was wondering, what are the features, old or new, that lisp does not have? By lisp I mean the most common dialects like Common Lisp and Scheme.


Solution

    • Pass-by-reference (C++/C#)
    • String interpolation (Perl/Ruby) (though a feature of CL21)
    • Nice infix syntax (though it's not clear that it's worth it) (Python)
    • Monadic 'iteration' construct which can be overloaded for other uses (Haskell/C#/F#/Scala)
    • Static typing (though it's not clear that it's worth it) (many languages)
    • Type inference (not in the standard at least) (Caml and many others) (though CL does some type inference, unlike Python)
    • Abstract Data Types (Haskell/F#/Caml)
    • Pattern matching (Haskell/F#/Caml/Scala/others) (in CL, there are libs like optima)
    • Backtracking (though it's not clear that it's worth it) (Prolog)
    • ad-hoc polymorphism (see Andrew Myers' answer)
    • immutable data structures (many languages) (available through libraries, like Fsets
    • lazy evaluation (Haskell) (available through libraries, like clazy or a cl21 module)

    (Please add to this list, I have marked it community wiki.)

    This just refers to the Common Lisp and Scheme standards, because particular implementations have added a lot of these features independently. In fact, the question is kind of mistaken. It's so easy to add features to Lisp that it's better to have a core language without many features. That way, people can customize their language to perfectly fit their needs.

    Of course, some implementations package the core Lisp with a bunch of these features as libraries. At least for Scheme, PLT Scheme provides all of the above features*, mostly as libraries. I don't know of an equivalent for Common Lisp, but there may be one.

    *Maybe not infix syntax? I'm not sure, I never looked for it.