Want to Write a Compiler? Just Read These Two Papers
prog21.dadgum.com
prog21.dadgum.com
For the tldr crowd, http://www.cs.indiana.edu/~dyb/pubs/nano-jfp.pdf.
It is strange that modern software engineering en masse took such a huge step backwards in the C++ era of the late 80's and early 90's, with tools falling back to primitive levels and languages becoming much less forgiving. It's only now that we're finally returning to the state of the art from 20 years ago.
Of course, some people bucked the trend and used these somewhat neglected technologies despite a lack of public popularity. Paul Graham is one of them, and he ended up doing pretty well for himself. :)
clos and the meta object protocol - the idea of leaving the language open for the user to change by using a metaclass
hygienic macros
first class continuations
monads
functional reactive programming
the first few developed in the 80's while the last is quite recent
One of the advantages of realizing that compilers are 'nothing special' is that you can start to use them all the time to simplify your work. It lets you think at a higher level.
The fact that only commercial (and expensive) Lisp implementations have all these features is a hint that they're not trivial.
Lisp is suffering because its community is fragmented and it has no leaders. Name a popular language that doesn't have an iconic corporation or person behind it, rallying and focusing the community? That condition is actually quite rare.
I think Allegro has better tools and libraries, but SBCL is certainly suitable for professional work. At this point we're talking about matters of degrees.
Also, I think that Lisp isn't really suffering. As far as I can tell there has been increasing interest in Lisp. Even without that trend continuing, Lisp is such a masterpiece (and it continues to develop with new innovations), that it is almost definitely here to stay, regardless of whether it becomes a trendy language to use again. The advantages in performance (say SBCL's for example) and expressiveness over other dynamic languages like Ruby and Python afford Lisp developers an actual advantage, as opposed to a merely perceived one.
SBCL port to Windows is a work in progress. And what you're saying about tools is more or less that they doesn't exist... yet. And comparing what you need to know and set up to start working with open source Lisp and other environments is... not fair.
So what? Lots of software gets written without ever touching Windows. I've based my entire career on it. An environment can certainly be mature and commercial quality without being multi-platform.
> And comparing what you need to know and set up to start working with open source Lisp and other environments is... not fair.
I do wish that SBCL had a "everything you need to know in 10 minutes or less", but it comes with ASDF and ASDF-INSTALL pre-configured. I mean, the amount of stuff you need to know to start working with Java is pretty darn daunting as well, given that you need massive assistance frameworks, and there is no good central package repo. The reason more people go into Java is that they have colleges introducing them to it.
Yes, more could be done. But I think commercial, professional work is possible right now given the state of SBCL.
Except most people doesn't want to write "lots of software", but software that fills certain requirements, often customers' requirements: run on Windows, do threads, have a rich GUI, minimize to tray, detect screensaver, interface to word processor, customer's database, customer's crappy ERP, etc.
>the amount of stuff you need to know to start working with Java is pretty darn daunting as well,
I've done both starts (Java and Lisp) and I can't disagree more.
>But I think commercial, professional work is possible right now given the state of SBCL.
It depends on your requirements. For some environments that's not true at all.
Which is true of nearly every commerical software environment out there. Why does Lisp get such a brutal grading compared to something like MS's CLR or Cocoa? Those are definitely commercially viable platforms that also don't meet these requirements.
Did I say GUI? GUI. GUI. GUI. Web apps are nice, free you from slavery, all that. But for a lot of tasks there is no other practical option than desktop apps, and that's what a lot of people use, even if they don't write blogs or appear in hip news, so they're invisible.
I appreciate your concern, but you seem somewhat ignorant to the number and quality of software libraries available to most common lisp implementations. There are excellent GTK bindings and Objective-C bindings. I'm not sure about what's available on the Windows site (although I guess I should learn, given the events of this week).
And as for the community, you have me there. The Lisp community is indeed fractured and weird. But, uh, at the end of the day I think this is a wash. People do great things in unusual languages all the time. It's not like EngineYard or I have a massive Erlang community bolstering our efforts on Fuzed and Vertebra, but we're making progress and doing what I consider to be good work.
And I actually think skill in generalised, simple, macro-type compilers is more useful, generally, than knowing the ins and outs of optimizing compilers, but that's just me.
For the sake of discussion, what are some of the important things for optimizing compilers that you can't do with this approach? I'm having trouble finding any -- both in a literal sense of possibility, and from a practical standpoint.
No doubt there are clever ways to leverage Lisp macros in compilers beyond this approach. But most people who like Lisp macros wouldn't bother. They'd just do it the easy way.
Edit: my understanding of what DaniFong is getting at is that in Lisp programming, there is no longer a barrier between application development and compiler development. This makes possible a lot of powerful things that you can't do when the application is written in a fixed language by different programmers than the ones who write the compiler. It's a different point, but one I find very interesting. It's not obvious what belongs to application development and what belongs to language development once this technical (and organizational) barrier is removed.
But when you might macros and the language itself, what you find is that you already have the pieces of what you need for a serious compiler: a symbol table, built in, a way to manipulate the parse tree, an easy way to do local expansions, and most importantly, a fully featured language.
You can do this with existing Lisps by a a few methods: making first class runtime macros, for example, or by saving the source code and working over it in passes.
Does this explain it?