Posted by Daniel Lyons
Wed, 06 Feb 2008 08:50:00 GMT
I have never used such a frustrating development environment as scsh.
As much as I desperately want to like it, and should like it, for all the right reasons,
- The interactive version is basically unusable. The REPL blows.
- The built-ins seem fragile, especially the very-cool
awk which I can’t seem to get to work.
- DrScheme has library functions which should be present in scsh, but aren’t (
fold-files comes to mind, probably because I’ve spent three hours trying to replicate the functionality in scsh and being unable to.)
- Scsh is built on Scheme-48, which seems to be not particularly widely used compared to PLT and Bigloo/Chicken, so it’s missing SRFIs. Plus, loading SRFIs seems to be wonky (
load doesn’t work, but the command line switch -l does, and it seems obnoxious that I’d have to use absolute paths for either.)
Scsh would be just perfect if someone had ever finished that port of it to PLT. As it stands right now, it sucks having two different Scheme environments on my machine: the really nice DrScheme one and then two different flavors of hell with Emacs, Hen mode for Chicken and run-scheme with scsh.
What to do, what to do.
Tags lisp, scheme, scsh | 2 comments
Posted by Daniel Lyons
Tue, 05 Feb 2008 04:35:00 GMT
“Lisp was not the product of a concerted design effort. Instead, it evolved informally in an experimental manner in response to users’ needs and to pragmatic implementation considerations. Lisp’s informal evolution has continued through the years, and the community of Lisp users has traditionally resisted attempts to promulgate any “official” definition of the language.”—Structure and Interpretation of Computer Programs, Abelson and Sussman, page 3.
The rocking sensation you probably did not feel a couple weeks ago was the release of Paul Graham’s Arc. Many people made many remarks about Arc being a massive letdown. I must admit I shared the sense of disappointment. After so many years of promises, and reading and respecting Paul Graham, and then, almost nothing, a tiny language atop a tiny Scheme. It hardly seems like anything to get worked up about.
The Lisp world is an interesting place these days. By and large, people have an opinion about Lisp based on experiences with Common Lisp and Scheme, which I think account for the vast majority of Lisp users. Yet, as Abelson and Sussman observe above, there never really was a Lisp consensus in the past, and today there are far more interesting variants of Lisp in the wild with few users. I think we expected Arc to represent a turning point in Lisp’s evolution towards a more Pythonic development model, the benevolent dictator, with a programming language aesthete in the driver’s seat. There are two important lessons here.
The first lesson is that we do not need Paul Graham to tell us what makes a compelling Lisp. We can mix-and-match our own stuff. Consider SRFI 26, Notation of Specializing Parameters without Currying:
(map (cut * 2 <>) '(1 2 3 4))
That’s almost as compact as this (hypothetical and untested) Arc code:
(map [* 2 _] '(1 2 3 4))
And of course it would be possible to create a reader macro for many Schemes which would achieve the same trick. But the SRFI-26 syntax also permits arbitrarily nested expressions with arbitrarily many variables—does Arc?
This SRFI has been around for six years and is supported by PLT (DrScheme), Kawa, Guile, Chicken, SISC and Gauche implementations, which is most of the ones you’d ever care to use.
Swindle has been around an equally astonishing amount of time, and is nothing but a bunch of Scheme sources that go atop any old Scheme (though bundled with DrScheme). And that gives you damn near 100% CLOS compatibility, based in part on Tiny-CLOS which is also very portable.
This is just what I’ve been looking at lately. There are a ton of compelling Lisps out there, far more fascinating than Arc; in addition to the ones I mentioned last time there’s also Nu, L# and Clojure.
My advice to you: do what Paul has done. Evolve your own Lisp. Pick Lisp or Scheme as your basis if you want to be able to share, or another language if you want to exploit some power it has. Try to keep your modifications portable or use a portable starting basis. Publish your changes.
The second lesson is, of course, to not be disappointed in Arc. We’re disappointed in Arc because we were expecting something “better” than Lisp, or something other than Lisp. Paul delivers a pile of macros. Well, that’s all you’re ever going to get with Lisp. It’s only a let down because we were expecting some kind of magic. But Paul doesn’t have a monopoly on this magic, we all have it. That’s part of the beauty of Lisp. Maybe it’s a disappointment that Paul really can’t do any better than we can, but remember it also means we can do as well as Paul.
Tags arc, lisp, scheme | 4 comments
Posted by Daniel Lyons
Thu, 31 Jan 2008 08:24:00 GMT
The world seems to be a little bit less optimistic today, because Arc has been out for 24 hours and has not yet changed the world.
In case you can’t tell, I like Lisp a lot. Seeing a Lisp machine work recently changed my opinion of Lisp a bit. I had been looking forward to Arc as a Lisp-2 with dirty macros and a lot of opinionatedness, basically as a tiny Scheme which celebrates all that’s gross about the other half of the Lisp family. But now that it’s here I’m not sure I see the point. It’s not that I don’t love Paul Graham, either. I just feel like something is awry.
There are, as it turns out, a number of minor Lisps out there which attempt to address some aspect of what makes Lisp annoying:
- Qi attempts to bring advances in functional programming back to Lisp.
- Lush tries to push Lisp into the multimedia/science sector.
- Scsh attempts to blend Unix and Scheme together.
- newLisp is a refresher and a shot at bringing Lisp to the web.
- Liskell is a Lisp syntax for Haskell with macros.
The problem, essentially, is that the Lisp machine was not a machine programmed in Lisp. It was a comprehensive environment which blurred the distinctions between language, operating system, hardware and editor. To use Emacs is to accept that the editor and the language/OS/hardware will be separate. To use Common Lisp on a modern OS is to accept that the language and the OS are separate. This goes against the nature of Lisp as fully realized on the Lisp machine. It feels inauthentic.
Of the five above, I have the most interest in the Scheme shell because I see it bringing back the tight integration between Lisp and the OS. Scsh not only brings a concise process spawning/piping and IO redirecting sublanguage to Scheme, it also bridges most of the POSIX APIs. It’s way more than just a shell, covering territory you’d traditionally need C for at the low level, the shell for process control, and a scripting language for logic. Instead you get all three for the price of one. I’m very intrigued.
This of course makes me wish I knew more Scheme. Which is an awkward position to be in as a Lisp partisan of so many years. This quote from Lambda the Ultimate helps:
An hygienic macro is one where the meanings of symbols that aren’t parameters to the macro are bound at the definition site rather than the expansion site.
Another user points out that you can accomplish variable capture with a hygienic macro as well as an unhygienic one, but there are problems you can run into with an unhygienic one that you can’t solve with gensym.
I wish I were less tired so I could be more coherent about all this, but it’s been a hell of a day, a hell of a week, and a hell of a month.
Tags lisp, scheme, scsh | 1 comment