I want to learn some language from Lisp family. It may be CL or Scheme and try to use it for web programming. Just for fun. I have significant C++ experience (prefessional development).
But I want my choice be modern language without legacy (in language itself and library), because I want learn good design patterns from the start.
I can't decide what is better: CL or Scheme. CL has much greater and standartized library and frameworks (Weblocks), but I heard that it has MUCH of legacy in its syntax and libraries. Scheme is another: simple, concise syntax but poor library. I'd prefer CL if it has no legacy.
I don't like to learn another monster like C++. Is it true that CL is like C++ in Lisp family? And Scheme is like, say, C# or Java - "revised" C++.
Edit: I want to write in functional style, OOP may be, but optional.
Even if you never write a 'real' program in Lisp, it is absolutely worth learning. There are many programming techniques originally pioneered in Lisp that, knowing them, will help you write better code in Python, Perl, Ruby, ML, Haskell, and even C++.
You have two main dialects to choose between: Scheme and Common Lisp. They each have advantages and disadvantages, but the differences between them are tiny compared to the differences between them and other languages, so if you want to start learning Lisp, it doesn't matter which you choose.
LISP. One of the old languages, LISP, has lost its fame and started its journey to death. The language is being rarely used by developers these days.
Scheme has been invented in the mid 70s.
CL has been developed starting 1982. The first definition was published 1984: Common Lisp the Language.
That Scheme has no legacy or is more modern is a myth. Scheme has been defined before Common Lisp by almost a decade. Scheme still had legacy like s-expressions, cons cells, symbols, car, cdr, cons, and more. That Scheme has legacy makes it a member of the family of Lisp languages which has its roots in the first Lisp from 1958.
Scheme's initial goal was to be a small clean language that is closer to lambda calculus, than traditional Lisp. Thus lexical binding as a default in a Lisp language was a first.
Unfortunately it was a toy language in many other respects. It had only a very small set of features, features you would need for writing programs, like a useful form of error handling.
Common Lisp's design goals a decade later were different. It was designed to write commercial software, large software, performant software. Another goal was that it was in the tradition of the main line of Lisp dialects (here Maclisp), so that programmers who had already large libraries or programs would not start at zero.
Common Lisp added from day one a lot of features that were thought useful:
and much more.
in the mid 90s a revision of CL was published. It added:
Since CL started bigger as Scheme, some design decisions make CL better to use than Scheme. For example Scheme has only primitive argument lists and that alone makes libraries harder to use.
Scheme had more revisions of its standard, but the basic design decisions remained and the community was struggling with basics like error handling, records, object system, etc. R6RS turned out to be controversial and I would agree with the critics. I think R6RS is extremely disappointing, both in its direction and its contents.
There are two other point of views: semi-standards and individual implementations.
The Scheme community produced a lot of semi-standard extensions. That should be viewed as a success.
The implementations OTOH diverged widely for Scheme. There was a is little consensus about them. There are many very small implementations and many large implementations.
CL implementations OTOH already contain a large language, so they don't start small. Keyword arguments are just there. Same for the object-system. Over time several applications have made sure that they can run mostly unchanged on many of the implementations. Additionally individual implementations have added a lot of features like Unicode support, threads, concurrent execution, etc etc.
So current Lisp implementations can have a lot of features.
Both Common Lisp and Scheme share the legacy of Lisp: symbols, s-expressions, car, cdr, cons, cons cell based lists, ... and more.
Common Lisp has some parts that are not so great, but are defined in the standard. One example is that CL symbol names are uppercase internally. The idea of 'sequences' is not extensible in the standard. And more. Individual implementations handle many of the limitations of the CL standard. So for example in most implementations the I/O system is written with CLOS, conditions are based on CLOS, there are extensible sequences for SBCL, and more.
CL may be a huge language, but it is no C++. Many parts are surprisingly well designed and easy to use. Many problems also can be repaired by the user, since Common Lisp is a programmable programming language. You don't like the built-in LOOP? Use ITERATE, if you like that more or even write your own.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With