Leave a comment

Comments 26

vatine December 20 2009, 16:49:12 UTC
Lua is (almost) Greenspun by design. Although Greenspunning C takes a bit of effort.

Reply

maradydd December 20 2009, 17:13:58 UTC
Postgres actually did a halfway decent job of it, though some of their list-walking functions work backward.

Reply

vatine December 20 2009, 17:38:39 UTC
If you've ever looked at the VAX instruction set, you'll possibly be surprised to see an essentially-Greenspun microcoded CPU (there's definitely list-walking instructions in there and all sorts of BIZARRE things).

One of the few CPUs I know of where "optimize for lowest instruction count" tends towards generating slower and larger code than either "optimize for smallest code size" or "optimize for fastest execution" (also the inly CPU I know of to have had a "optimize for instruction count" compiler, but taht may be by-the-by).

Reply

(The comment has been removed)


allonymist December 21 2009, 10:29:42 UTC
Greenspun's tenth rule is a trap: to admit you follow it, you must evince dangerous lispish tendencies. But to deny you follow it, you must point to all your code and say, "Inquisitors! I defy you to find the tiniest spot of lisp in my unblemished codebase!"

Really, though, "Lisp" in this context means "Lisp at its best." Take a few months off your job, stay away from romance and fun, and just read the Common Lisp manuals and The Art of the Metaobject Protocol, and you too will understand Lisp At Its Best. And you will realize why List At Its Best probably can't be yours.

And if you start hassling other languages for not being Lisp At Its Best... why, is that really Lisp's fault? really?

Reply

maradydd December 21 2009, 14:19:05 UTC
What I did to Lua is decidedly not Lisp at its best. But it got the job done.

Reply

(The comment has been removed)

kragen December 22 2009, 19:55:51 UTC
Do you think ML and Prolog are the same attractor?

Reply


kragen December 22 2009, 19:59:08 UTC
Lua very intentionally omits 95% of the feature set of Common Lisp, so that you can use it in environments where you only have room for the half of Common Lisp you're using. There are off-the-shelf libraries for a lot of those features, though, so you don't have to use an informally-specified, bug-ridden version.

Reply

maradydd December 22 2009, 20:17:50 UTC
I grok that, though it's mind-boggling to me that a language with first-class functions wouldn't have either list slicing a la Python or cons/car/cdr. Presumably this is because the built-in listlike object is the associative array (which gives the whole thing an uncomfortably PHP-like feel), but it still leaves me wondering where the tools that fit in my hands so well have gone.

And the whole business of indexing from 1 is just ridiculous. This is computer science, not biology.

Reply

lightning_rose December 27 2009, 17:45:47 UTC

There's always Pascal, where you can index an array from where ever the heck you want. :)

Reply

maradydd December 27 2009, 17:59:43 UTC
Strangely, I never learned Pascal. I would have, if I'd taken the Computer Math II class that my high school offered (Computer Math I, aka "BASIC programming", was a required course for honors students), but the year I planned to take it (junior year), only four students signed up -- and one, my then-boyfriend, moved to Utah just before the school year started, so there weren't enough students to justify paying a teacher for it. I could have tried again my senior year, but I wanted to take both second-year chemistry and second-year physics, so there was no room in my schedule.

Computer Math I was also the course where I kept getting in trouble for finishing the assignments within the first few minutes of class and spending the rest of the hour either playing Wing Commander, exploring the network, or writing BASIC programs that annoyed other people. Halfway through the semester I got pulled aside and asked "okay, since you obviously already know everything on the syllabus, what do you really want to be doing in here?" I said, "I hear ( ... )

Reply


Leave a comment

Up