On the other hand, if you look at, say, ANSI Common Lisp, it's not at all some kind of perfectionistic attempt at divine elegance. It's a pragmatic compromise resulting from years, decades, of actual use on real computers.
Just browse around the SBCL compiler source code and you'll see that this stuff is developed by people who definitely aren't afraid of the messy practical reality of hardware:
https://github.com/sbcl/sbcl/tree/master/src/compiler/x86-64
Generally spend some time within the Lisp community and see how many people you see fretting over Platonic archetypal shapes and compare to people solving actual problems and using the language as just a nice way to program a computer.
Emacs is another example that demonstrates the spirit of actual Lisp programming as opposed to armchair theorizing about lambda calculus fundamentals.
At present, there are only a few Schemes that are practical: Chicken, Guile, Chez, and Gambit seem to be the big players, with Cyclone, Chibi, and Bigloo bringing up the rear.
It's also kind of funny that a handful of major, practical implementations is considered a low amount. Number of Python implementations? Between one and three, depending on definition. Number of Javas? 2 or 3 again. Number of Clojure implementations? One. Javascript? Half a dozen at most.
Seems to me like the problem is standardization between these implementations, not overall number.
At least three:
- Clojure on the JVM: https://github.com/clojure/clojure
- ClojureScript (JavaScript): https://github.com/clojure/clojurescript
- Clojure on the CLR: https://github.com/clojure/clojure-clr
Not at all.
>It started out as a pure Scheme, then "took a practical turn" as the parent said.
False.
PLT Scheme, like all serious schemes, started out as Scheme extended for practical use.
Racket, what PLT Scheme became, isn't an extended Scheme: it is a different language with its own semantics. That's not good, bad, or pedantic, but it is true.
>You can still make it act like a pure Scheme with a #lang directive.
No, you can make it use RnRS. The difference is that in actual Schemes, the language you write in is extended RnRS, not an entirely different language.
At the end of the day, calling Racket a Scheme is like calling Java a C: they look similar, but they are radically different under the surface.
Ultimately, Scheme is a language family, and Racket is further away than most or all of the other members, but there's considerable distance between Guile and Gambit as well (to pick some other examples).
Full disclosure: I'm a core developer of Racket, but not all of us have the same perspective on this question.
Most of the feature set was designed via backroom political horse trading ("We'll let you include pet feature X if you support us for our pet feature Y".) There is no coherent overall plan or design to it at all.
(Source: personal communication from a member of the committee that designed it.)
It's based on actual use on real computers of the late 1970s and early 1980s -- e.g. the file opening mechanism is a complex abstraction designed to support filesystem paradigms that nobody has used for 30 years, yet there is no standard way to open a TCP socket.
I heartily recommend Clojure (clojure.org) as an alternative: a modern, pragmatic Lisp designed for 2016-era software engineering.
CL is still very good at what it does: all current implementations have solved many of the problems you mentioned, and there are a lot of libraries that will run across implementations.
CL is a beast, but clojure is a mess. Scheme is elegant, but has a radically different, more ALGOL mentality than CL, at least in some respects. Some of it is good, some is bad. I love it, but there are things that I would rather program in CL any day.
IMHO, clojure has neither the practicality of CL nor the elegance of Scheme. It has its advantages, but it's not ideal.
But Clojure has the cons operator anyways. This also means that clojure's `read` violates one of read's important guarantees: the structure you read in will be identical to the structure you wrote out.
Then there's the macro system. Given, it's better than CL's in some respects (it does what you want by default), but there are problems. Like not being able to use macros inside the packages that they're defined it. It's just generally less clean than Scheme's solution, and less versatile than CL's.
And then there's all the things its inherited for Java: and object system that isn't properly OO, a lack of TCO (which would be fine, if it weren't for the fact that the language so very clearly wants to have TCO)
At the end of the day, Clojure's fine. It's not terrible or anything. I just disagree with some of its design decisions, just like with Racket.
But I do object to it being called The One True Lisp for practical use, because that's nonsense. Scheme and CL are both quite practical, and while most Schemes/CLs don't have the Java interop that makes Clojure so full of nice libraries, most of them do have a C FFI. And the C FFIs they have (at least in the Schemes I've seen) are some of the nicest around.
I don't really care about having conses the way CL has them, and seqs feel like a very nice abstraction over the concept, though I also tend to use the idiomatic map-heavy style anyway.
Clojurescript has the staged macro issue, but JVM Clojure doesn't.
I wouldn't even say that Clojure has an object system, and wouldn't want one. Lacking TCO is a shame.
Lisp trusts the programmer to be responsible with mutability and not to abuse it. The trust is not misplaced; the sky doesn't fall.
Stacktrace in Clojure with no possibility to restart also make me sad.
Clojure generally added incompatibilities, since it is fully incompatible to any other Lisp before in fundamental ways. Clojure was designed with zero backwards compatibility. Lisp concepts were removed, renamed, redesigned. Even identifiers with the same name are doing completely different things. If it did something similar to what Lisp did, Clojure sure has it renamed and redesigned.
I doubt that you ever had talked to anyone from the ANSI CL committee. It would also have been easy to find out that Common Lisp was designed by a few core people (the gang of five) with lots of community input from 1980 to 1984. This part is well documented. 1984 the first version of Steele's book Common Lisp the Language was published. The ANSI Common Lisp standardization was started later in 1986, when the core of Common Lisp was already defined. Even there the major extensions were designed by small groups with community input. See for example how CLOS was designed by a few people (Daniel G. Bobrow, Linda G. DeMichiel, Richard P. Gabriel, Sonya E. Keene, Gregor Kiczales, and David A. Moon.) and by providing a complete reference implementation (PCL).
Common Lisp, on the other hand, has no standard way of opening a TCP socket at all, because TCP was uncommon when it was designed. It relies entirely on (poorly documented, often unmaintained) third party libraries to do that.
As for your doubts, you can doubt all you like, that changes nothing. I am well aware of the history of ANSI CL, and I'm not sure what point you are trying to make with all the namedropping.
Clojure says nothing about creating TCP sockets, since Clojure implementations (all three) need to call the hosting systems call or emulate it somehow. The JVM Clojure uses a different call than the CLR Clojure.
Which makes it worse than Common Lisp, which has widely used socket support with usocket and some others.
> Common Lisp, on the other hand
Is a real language standard with many different implementations.
> It relies entirely on (poorly documented, often unmaintained) third party libraries to do that.
Each Common Lisp implementation has a documented and maintained way to open a TCP socket. Additionally there are compatibility layers like usocket
https://common-lisp.net/project/usocket/
> I am well aware of the history of ANSI CL,
Then why are you writing obviously wrong things?
The 'standard way' to create a TCP client socket in Clojure:
(java.net.Socket. ^String host (int port))
For the .net version: (System.Net.Sockets.TcpClient. ^String host (int port))
It directly calls the functionality from the platform it is hosted on.Common Lisp, on the other hand, has no such standard way, as TCP was not common when it was designed. It relies on a hodgepodge of poorly documented third party libraries, or vendor-specific extensions to do this.
Clojure is, by definition, a JVM hosted language. The .net version is non-canonical.
So Clojure the language has no documented standard way to open a socket. One has to use the host environment (JVM, .net, ...) interface to do so. It means also that Clojure/JVM source code trying to open a socket will not run on Clojure/CLR without changes.
That's not a 'standard'. It's the definition of 'implementation specific'.
That's different from SBCL, which has a documented and maintained way to create sockets, which works similar over all the platforms it runs on - natively.
http://www.sbcl.org/manual/#Networking
For a portable way to create sockets over many Common Lisp implementations use usocket:
His later books go into this too: how academics rewrite history in favor of the ideas they created, but "tinkerers" create history.
I believe he uses the example of the Wright brothers. Were they physicists? No, they were engineers and tinkerers. And what is amazing is that people still argue about the physics of how planes fly!!! Practice often precedes theory.
Whether there's a similar phenomenon in computing is an interesting question. Computing is sort of special because the finished product, a program, is probably the closest thing to a pure idea that you will find in engineering (as opposed to a plane or a telescope). It is created almost entirely in the human mind.
On the one hand, you could say that what you learn in school is idealized and gives academics too much credit. To use a recent example, what was the contribution of Phil Katz vs. academic research in compression? That would make for an interesting essay I would love to read.
What about BitTorrent, or BitCoin? I believe plenty of academics were trying to create systems like BitTorrent, and publishing papers about them, but Bram Cohen said he pulled a bunch of magic numbers out of his butt and dealt with router quirks, and made it work. But certainly he also used computer science.
I like this essay, "Notes on postmodern programming": https://scholar.google.com/scholar?cluster=16064138633971247...
Some excerpts:
The word “algorithm” is often claimed as the central concept of computer science [35] “Algorithm”, however, leaves out large amounts of the discipline of programming: components, patterns, protocols, languages, data structures [76].
There is equal acceptance of high and low culture: Visual Basic and Haskell are equally of interest, as there is no reason to applaud the one and disparage the other
Postmodern programming rejects overarching grand narratives. As a result, it favours descriptive reasoning rather than prescriptive. Rather than working top down from a theory towards practice, postmodern programming theories are built up, following practice.
The QuickLisp package manager has been around for a few years now.
And if that's not practical, I don't know what is.
Clojure is a modern Lisp with the explicit goal of being a practical and pragmatic Lisp intended for getting real-world software engineering tasks done, not just a grand walled garden with beautiful and pure ideas but without standard libraries for stuff like, say, "opening a TCP socket".
Clojure has no ISO standard library for opening a TCP socket.
I don't see the difference.
Usocket: Common Lisp socket library:
https://common-lisp.net/project/usocket/#implementations
Walled garden? I can make a native executable for Windows using any one of several Lisp implementations. No framework or VM or whatever required.
Clojure saves some people from programming the JVM in Java; good for them.