15 points · by helveticaman · 17y ago · 30 comments
Of course now that Clojure is out there I don't know if CL really COULD gain traction, most people who want a Lisp for "real work" are going that route, or have gone in other power language directions like Haskell, or so it appears from where I'm standing.
I looked into several options, starting from cl-sdl, but (at least at the time) none of them worked on Linux and Windows with the Common Lisp implementation I used (which was clisp.) I don't remember the details but I spent a good week pounding my head against the wall. clisp has a very good ffi mechanism but you can't use ffi to call into SDL because SDL (on some platforms at least) needs to use its own main() function, so once you're running your Lisp code it's too late.
In the end I decided to implement the graphics part in C and just talk to the Common Lisp backend over a pipe. If you speak Polish you can check out the results on http://www.jfedor.org/pfedor/hobbit.html
Note that this method would not have been possible for anything much more complex, like say an arcade game, and also that in other languages it would typically be trivial (say using pygame in Python.)
Maybe things have changed but I could not make much headway with ASDF so even when I did find the libraries... yeah. And yes I did have cygwin installed which is why I got past some of the problems.
Maybe I'd have made real headway if I were full on in Linux land where sbcl and everything else has much better support, since it's built around the *nix tool chain.
This morning I needed HTML to PDF generation; my first instinct was to use something from Lisp, I found xhtml to pdf generation stuff in CL-TYPESETTING's contrib but it didn't work for me, so I went out and mocked up the application with a web service .. just to find out the remote server shut me down. Next try was to download Perl modules, PDF::FromHTML was broken for me and I didn't know how to fix it (I am not a good perl programmer, btw.) I tend tried the PHP HTML_ToPDF, and it too was too problematic for my tastes. A few hours later, I retooled the app to use a shell pipe:
(let ((file-path (handle-file file))))
(if (and (shell-command
(format nil "html2ps ~a > /tmp/~a" file-path file-path))
(shell-command
(format nil "ps2pdf /tmp/~a /tmp/~a.pdf" file-path file-path)))
(handle-static-file (merge-pathnames #p"/tmp/" file-path)
"application/pdf")))
Ugly but worked.I then played with that for a bit and found it too fickle. Took a second look at the CL-TYPESETTING stuff, my application was now working but still I wasn't confident with it, however, since 7AM this morning, I have had so much exposure to HTML to PDF converters that I knew how they were supposed to function. It took me about 10 minutes to find the problem in the CL-TYPESETTING package (Windows didn't have truetype font it was referencing and the sample usage was buried in a comment at the bottom of the xml-xform.lisp file.)
It would have been very convenient for me to bitch about Perl and its broken PDF::FromHTML module, even though any competent Perl programmer would have told me how to fix it in a jiffy. And the PHP package. It was also convenient to bitch about the web service that blocked me, but I found out they were charging an access fee for the API and I shouldn't have scraped their web page and abused their servers.
Truth is, all languages, tools and platforms suck in small user-dependent ways (they are not DWIM-enabled.) You could waste a life time complaining about them, so the productive thing to do is weigh the language's pros against its cons, and if it's mostly good, then you better learn it well and use it to its full potential.
Lispbox makes it really easy to download and get going with Lisp.
It's true there is no one link, but his examples suffer a related problem -- no links are provided to Jython, IronPython, JRuby, etc., which is misleading if marginally more convenient.
That said, do people typically download releases, even of Perl, Python or Ruby implementations? I've only used distro packages or RCS checkouts of any of those systems. Is this mainly an issue for Windows or Mac users?
I don't disagree with his point, but over a year to make good on his promise doesn't speak well of his argument.
Remember kids, single-implementation languages are the exception in industry, not the norm.
It's actually a two way street: where can I download the ANSI/ISO language specification for Perl, Python and Ruby? Just because it's nimble, interactive and quick to hack doesn't mean Common Lisp is a prototyping language.
You forgot Ada and Pascal ;-)
"single-implementation languages are the exception in industry, not the norm"
If I may dispute this just a little bit, is this really true?
Perl, Python, Java, Ruby, C#, VB(.net) are all "single implementation".
(Though some of these have implementations on different platforms, there is indeed one canonical and dominant implementation(Guido's Python (vs Jython or stackless) , Matz's Ruby (vs Jruby or Rubinius), Micrsosft's C# (vs Mono) ), a canonical download page (googling "$language download" leads to this page)and download links to that page).
Though there are many variants of C and C++ (mostly for embedded devices) , most people (>90% ?) use either VC++ or gcc I think. I don't know about Cobol (never had to work in it Thank God)but I suspect IBM's variant(s ?) is close to having a monopoly.
It would seem that single (or close to single) implementation languages are indeed the norm and multiple implementation languages (with predefined standards and so on) are the exception?
Again I don't think it is a specially useful distinction, just something to think about.
In my (admittedly limited and subjective) experience, languages with a benevolent dictator seem to evolve better than committee/standards driven languages.
I think this (benevolent dictator/single creator vs committee/standards driven design) might be a more meaningful distinction.
And it's up to the rest of the world to bet money on one guy's whims and desires eh? what happens when your benevolent dictator has holes in his understanding of programming languages? Not even Wirth could get away with dictatorship, and Wirth knew what he was doing. Your pet language grows up the moment industry and governments want to use it, and they expect their code bases to work for the next few decades, not until the next big epiphany or mood swing of THE language architect.
Someone has been doing way too much PHP programming lately, you even remembered to use the double quotes ;)
This is a 'problem' for languages with no single implementation that's easily solved by Google. "common lisp download" gives the CLISP site as top hits which is a good CL to start with.
Note the prominent download link on the home page: http://www.plt-scheme.org/
The abundance of Scheme implementations is actually a good thing: there is a scheme for every n-choose-r machine configurations :-)
http://community.schemewiki.org/?scheme-faq-standards#implem...
Step 2: Switch to Clojure.