DEV Community

Discussion on: Back to Lisp Part 1 - Working Inside the Language

Collapse
 
wesen profile image
Manuel Odendahl

Do you have any experience with Lisp (scheme, clojure, common lisp, racket, etc...)? What did you learn from it? What is your favourite feature?

I am currently learning racket, which is amazing. I regret not having looked into it earlier, as it allows you to quickly add proper syntax to the languages you create. Parens and SEXPs tend to scare people away.

Collapse
 
hanshuebner profile image
Hans Hübner

To me, parentheses are one of the best features of Lisp. It is interesting that the s-expression based syntax was seen as an intermediate syntax by John McCarthy, to be eventually replaced by m-expressions that should be more "user friendly". Over the years, though, people who were actually using Lisp found that s-expressions are great, because they contribute a lot to the malleability of Lisp programs. For one, implementing macros is much easier if the "code is data" notion is retained, and not obstructed by another artificial syntactic layer. For another, s-expressions make it easy to write interactive programming support tools in editors, creating natural ways how to format programs and removing the need to interactively parse a complex syntax.

I find this particularly interesting because it underlines the idea that Lisp was not really developed, but rather discovered, and that the appreciation of it grew when people used it. It takes the curious mind to look at Lisp, and I don't really believe that the parentheses are the reason why Lisp is not used more widely.

The reason for the lack of adoption of Lisp has more to do with how programming as an activity has been industrialized. Lisp works best, and caters for, the individual working with the machine in a dialog. The programmer and the system work together to experiment and explore possible solutions. Solutions are often ephemeral, being part of a REPL interaction.

This notion, the dialog between the machine and the programmer, does not fit the model of industrialized software development, in which the source code to programs is the primary artifact that programmers work with. In that model, the system helps create that primary artifact and the dialog between the programmer and the system is about creating the source code that implements the solution, not about the solution itself. In the industrial context, there are many good reason that support the validity of this model. At the same time, Lisp with its REPL and strong interaction of the programmer and the running system, does not fit the model well.

Collapse
 
jeremyf profile image
Jeremy Friesen

I'm learning it by using Emacs. And I started out as a brain stretch and now it's so elegant and composible; with macros really coming into their own as I think and implement.