[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme syntax vs. other languages
From: |
James Harkins |
Subject: |
Re: Scheme syntax vs. other languages |
Date: |
Fri, 08 Jun 2012 18:13:40 +0800 |
User-agent: |
Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
> > D is obviously the wrong fit for an lp extension language, but scheme
> > has a couple of strikes against it right from the start.
>
> Sure, it requires getting into. Not that D doesn't. The rules of
> Scheme syntax can be learnt in one afternoon. The syntax may not
> exactly resemble mathematical notation or plain language, but it is
> simple and regular. If we were out for natural language, our extension
> language for LilyPond would be COBOL.
>
> Scheme has a low lexical and syntactical impact, and the price for that
> is a uniform syntax, and a uniform syntax has few structuring visual
> elements. One payback for that is that you can do syntax
> transformations in a predictable and reliable way.
I'm certainly in no position to argue for another extension language for LP --
just saying up front that isn't the purpose of this e-mail. Just throwing an
opinion into the pot.
In my SuperCollider work, more and more I prefer a coding style that favors
legibility over concision. Many people use SC for live coding, where concision
is more important -- you have to be able to type the code FAST in front of an
audience. As a result, SC is full of syntax sugar, some of it quite lovely,
some of it obscure. You can create a new array with 10 random numbers concisely
like this -- { rrand(1, 10) } ! 10 -- but lately I prefer to write the more
"canonical" syntax Array.fill(10, { rrand(1, 10) }). Someone unfamiliar with SC
can make a reasonable guess what Array.fill does, but ! is opaque.
I find scheme to be impossible to read without an editor that highlights
matching brackets. I can start to make sense out of it once the editor shows me
which () belong together. That's an obstacle -- it pushes learning lisp into
the category of Things I Really Ought to Do Someday If for No Reason Other Than
Building Character. I may yet do that for LP and/or Emacs, but it's
intimidating -- and if it's intimidating for me, I expect it's more so for
other LP users.
But yes, scheme has a lot going for it here.
James
--
James Harkins /// dewdrop world
address@hidden
http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks