Levente <leventel...@gmail.com> writes: > Okay. > > > I really don't want to offend, and be smart. I don't really know lilypond > internals either, but a question is in my head. > > How does Lua compares to Guile? > > I used Lua a as extension language, and I find it pretty straight forward.
Its syntax is not functional (statements and expressions are different) and not self-delimited (the end of any Scheme expression is well-defined) and LilyPond uses Guile for a lot of expressions. Lua does not offer the tools necessary to implement lexical closure across language barriers. LilyPond is rather thoroughly rooted in Scheme/GUILE: the integration with the language is very thorough and cohesive. If you take a look at LuaTeX for comparison, you cannot pass information from TeX input to Lua without pulling it through a catcode regime, and you cannot get info from Lua to TeX (short of poking around in its internal arrays, and even then you are out of luck accessing the table of equivalents, TeX's rudimentary idea of dynamically scoped data, anywhere but at the top) other than printing TeX code into TeX's input and then returning from a \directlua call. And if anything goes wrong, the error messages are cryptic and not related to error location. Part of that is of course LuaTeX's fault. But one actual problem for integration indeed is that Lua cannot see input other than as full text whereas Lisp/Scheme's representation of a program is basically the parse tree before evaluation. That allows layers of integration/manipulation that are just not there with languages not having a natural structured representation of their own programs. I think that most applications using GUILE as an extension language are not as tightly interwoven into their host application as LilyPond is. You'd have to redesign a note typesetter from the ground up, including its input language and most of the internals, to have something like Lua work as an extension language. And it would end up sufficiently different from LilyPond that it would make no sense calling it "LilyPond". -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user