A few examples of Lisp code typography (2013)
kazimirmajorinc.com
kazimirmajorinc.com
As others have already remarked here, since about the 1980s, there appears to be an increased level of nameing, consistency and better indentation, all contributing to an overall increased level of "prettiness".
The core concepts were already there, of course, and that's timeless beauty.
Sure, 1960's LISP doesn't look that nice nowadays, but it's day and night if you compare it to e.g. the contemporary FORTRAN IV.
I'd agree that "beauty of syntax" is relative and subjective. It's a fascinating observation that Lisp grew prettier over the years.
But the philosophical or mathematical beauty of the core concepts of Lisp, I feel like they're closer to eternal and objective beauty, if there is such a thing. It's like they're low-level universal primitives, not only of human thought but thought itself. If we're to ever communicate with an extraterrestrial intelligence, they would probably grok Lisp.
Using square brackets in place of some parens is something some of the Racket professors started doing. I assumed it was because they thought it would be helpful to teach high school students in http://htdp.org/ . I defer to them on teaching, but I think it looks ugly, is harder to type, and seems like it's more confusing in code examples (people thinking it's significant, when it's not).
One thing I did do is make an Emacs mode, https://www.neilvandyke.org/quack/ , in which typing square brackets instead inserts parentheses when appropriate. This is helpful on US keyboards, on which parens require a multi-key press but square brackets do not.
https://dl.acm.org/doi/pdf/10.1145/800017.800513
Interlisp used it in the 70 already.
(define test
(let ([a 1]
[b 2])
(+ a b)))In Racket, you write `(define (foo arg1 arg2) (+ arg1 arg2))`. Why isn’t `(foo arg1 arg2)` evaluated as a function? It’s a list and it isn’t quoted, so it should be evaluated. However, `define` is a macro (I think, might be a special form), so that list isn’t evaluated and doesn’t have to be quoted. That violates the basic tenant of “unquoted forms wrapped in a list are evaluated as fiction calls.”
In Clojure, you write `(defn foo [arg1 arg1] (+ arg1 arg2))`. The [] is a reader macro, a vector literal. It communicates that it’s not a function call but simply data (in this case, a vector containing two symbols).
Maybe I’m just used to it but I find this stuff really helpful.
I find the example from Friedman the most readable by far. It is probably also the only one that is typeset with proportional fonts. A few of the superficial things about Lisps I am fond of are the kebab case and space delimitedness (same as shell, which also has some Lisp qualities afterall). They all come nicely with proportional fonts. However I do really prefer proportional fonts for code in general. Also operating with italics, bold is preferrable for me to color.
Whatever the case, "foo" became associated with "bar" via WWII slang "FUBAR"; WWII also gave us "foo fighters" in the UFO sense. War is like the internet in that it brings together people of different backgrounds who otherwise might never interact, so it's not surprising that with things like foo, FUBAR, and Kilroy, WWII had something resembling a predecessor of modern meme culture. It entered hacker culture via the MIT TMRC culture in the 1950s. Their railroad layout had a "foo counter" which was a digital clock which would display the word instead of the time when certain scram switches were pressed. When MIT people began cultivating an interest in programming computers for its own sake, they brought "foo" with them and it spread into the greater hacker meme diaspora.
There's nothing quite as hacker-y as the word "foo", and the strong association with hacker culture goes back as long as hacker culture was a thing, and even before. It still reminds us to not take things so seriously, mess around, and have a little fun.
Must have been some 20 odd years since I first read it. Wonderful book.
To be clear, though Ruby’s massive popularity was entirely due to the advent of Rails.
Ruby is a fantastic language — Smalltalk object model with GC and a usable syntax! — but the English documentation was nonexistent or incomplete — even after the “Pragmatic Programmers” book massively increased the Ruby audience — and the core team was all Japanese, so there wasn’t ever much of a constituency for the core language outside of Japan.
The unfortunate thing is that Rails soured a lot of people on Ruby. (People don’t understand that a lot of what they encounter with Rails is dialect, not the thing itself. Ruby makes it easy to build dialects.)
- Practical Common Lisp (aimed at people who know how to program in a more mainstream language already) [1]
- Paradigms in Artificial Intelligence Programming (my personal favorite) [2]
- Common Lisp: A Gentle Introduction to Symbolic Computation (aimed at absolute beginners of programming) [3]
I highly recommend the r/lisp Reddit community. Reddit as a platform has its issues, but the Common Lisp community there is very responsive and very helpful.
Lastly, you might be interested in checking out Kandria [4], a game written entirely in Common Lisp, to be released imminently on Steam.
[1] https://gigamonkeys.com/book/
[2] https://github.com/norvig/paip-lisp
Along those lines there is a classic side scroller with mouse aiming called Abuse[1] that was written in Lisp. The source code is in the public domain now[2].
> Is there a reason why some well-known Lisp hackers are Japanese?
Perhaps, they trained in the 5th gen computing environment begun in 1982 by Japan's MITI (Ministry of International Trade and Industry). "It aimed to create an "epoch-making computer" with supercomputer-like
performance and to provide a platform for future developments in
artificial intelligence."
https://en.wikipedia.org/wiki/Fifth_Generation_Computer_Syst...Many years ago at an event I met people from a commercial Lisp vendor in California. They had also business cards in Japanese, because a bunch of customers came from there.
Especially today, since Lisp rather than being a single thing, is a family of languages. I mean, there's some truth to "JavaScript being a Lisp", so you can see that it's a bit open ended.
If you're looking for an embedded Lisp, then I would concentrate on finding one that simply appeals to you. That is, find one that integrates easily, or has a particular feature that you like, or any of many things that may catch your eye.
Once you pick one, then simply "learn that". Consider GIMP originally started by integrating SIOD (Scheme in One Defun), which is a simple Scheme interpreter. They have since moved on to TinyScheme (of which I'm unfamiliar).
But, SIOD has been around forever. SIOD begot SCM which begot GUILE, which is specifically designed to be embedded. It's also pretty large.
ECL, which stands for Embedded Common Lisp is, well, a Common Lisp. Scheme and Common Lisp are both Lisps, but quite different from each other.
That's why rather than saying "pick this", simply find one you like and learn that. The landscape is wide and rich.
For me implementing a Lisp piece by piece helped me better understand its core ideas.
With Common Lisp I think the standard road is Gentle Introduction followed by Practical CL followed by PAIP.
Like prose? Books have not many symbols nor syntax highlighting. You have to read the actual words to know what it's talking about.
Honestly, I would understand criticising the noise of parens. Not of their contents.
This style also encourages blocks to be compact so they almost fit right into your fovea. The spread-out "C" style that emphasizes the curly braces on their own line seems so backwards, emphasizing precisely the thing you don't care about.
Really? I like the curly braces on their own line precisely because that's what I do care about. I want to see the block structure - the context, if you will - before I think about the individual lines.
But the jury is still out whether using indentations instead of syntactic markers is a good choice for a programming language.
The symbols are meaningless by themselves, except that the same symbol can be used in multiple places. BUT the syntactic structure of a program is NOT meaningless. It in fact defines the "meaning" of the program - in as far as the symbols used are arbitrary.
Therefore if you can express the program structure separately from the symbols, you make the program easier to comprehend.
Nowadays, indentation does a bunch of heavy lifting when it comes to readability. Modern Lisp-inspired languages (such as Clojure, but also some dialects of Scheme) also use other symbols in addition to parenthesis (like square brackets). Usually they are interchangeable, but I found that it can sometimes help.
I find it difficult to read LOOP macros. And some versions of LET. But they are bastions of readability if you compare with languages like_c<with<templates>>(T) and_macros(void);{}
I ask just to understand the Hacker News platform.