Vaughan McAlley <vaug...@mcalley.net.au> writes: > On 3 December 2013 13:18, PMA <peterarmstr...@aya.yale.edu> wrote: >> I program in J almost exclusively, since the pursuit of my brainstorms >> (music-bound or not) tends to favor handy ad-hoc number crunching. > > +1 but with Lua. I’ve done some useful things. > > Alternatives are Frescobaldi snippets if you know Python, and you can > do a lot with regexes, which is a side-effect of Lilypond’s text file > format. > > David Kastrup wrote: >>Scheme _is_ its scripting language. There is some Lua branch in >>GuileV2, but it's unclear when it will be production quality, unclear >>when LilyPond will run on GuileV2, and unclear whether both efforts >>could be combined. > > That looks really interesting—I’d probably do all sorts of stuff. But > then Lilypond would become a Frankenstein’s monster of extensions in > different languages. So I should probably just learn Scheme. > > Incidentally, when I first arrived on the Lilypond mailing list, I > recognized David Kastrup from the Lua mailing list. So he does know > Lua quite well, even if he keeps it quiet :-)
We've had discussions a few years ago where I did a number of comparisons. Lua is very nice and has some quite endearing traits as an extension language. What I consider probably its best feature is its lack of choices. It has a single data structure implemented efficiently. It has a single numeric type. Instead of symbols and strings it has a single chimera with traits of both: interned strings (actually, as opposed to those of LISP, Guile symbols are pretty much just an interned string as well, but one does not want to use them for string processing as they are not tuned for that). So whenever the question comes up "how do we map our user language to Lua data structures", there is usually just a single sensible answer instead of several different tradeoffs. Now LilyPond works a lot with exact fractions, and teaching that to the number type of Lua is not going to be funny. But Lua falls down in a few areas: it is not a functional language, and LilyPond juggles in and out of Scheme all the time for _expressions_. And it doesn't support template/macro-like manipulation of its parse trees like Scheme does, since everything in Scheme is transparently a list. I've actually used Lua for writing LilyPond code. Nowadays I wouldn't, really. Scheme is a bit less convenient for scripting, so if I had the option to write LilyPond code with a standalone Scheme interpreter and a standalone Lua interpreter, it would likely be a tie. But LilyPond's Scheme knows about music. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user