lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Provide Scheme sandbox. (issue 5453045)


From: dak
Subject: Re: Provide Scheme sandbox. (issue 5453045)
Date: Thu, 08 Dec 2011 14:39:56 +0000

On 2011/12/08 11:32:28, Ian Hulin (gmail) wrote:

Hi David,
A Scheme sandbox is a good idea, in fact it is *A Very Good Idea*.

However, before we focus down on this solution, might it not be a
good thing to consider this:
get LilyPond in its build to provide a library of all its scheme stuff
defined
in C++.
Then in our sandbox we open a Guile REPL loading the library as an
extension,
and then provide a stub lily.scm to do the stuff main.cc does in code
e.g.
(define-module (lily)), and all the stuff LilyPond does in
initialization when
it runs its first pass through lily.scm  (like scheme-level
command-line
options, building the rest of the (lily) module by loading the
component
scm/*.scm files, etc. before doing its second-pass call to actually
start
running procedure lilypond-main in lily.scm).

The stub version of lily.scm could then output the guile repl
prompt, and some instructions on how to set trace and breakpoints,
and then tell the user how to start compiling your Lily source from
there.

Why would you want to compile your Lily source from there?

Anyway, nobody is keeping you from typing

#{ \include "myfile.ly" #}

at the Guile prompt.  And if you want to set trace and breakpoints,
take a look at ly/guile-debugger.ly

The sandbox has the advantage of starting right in the lilypond-module
instead of guile-user.  One could make guile-debugger.ly do the same,
but since guile-debugger.ly is mostly a write-only project and I have
no idea who uses it for what purpose, I decided that a simple sandbox
that actually runs _inside_ of Lilypond instead of an outside module
would be preferable to most people.

And obviously, nobody thinks as guile-debugger.ly as being Scheme
tutorial level stuff since it is only mentioned in CG.

If we could get to this scenario, we have a LilyPond available as a
true extension available in scheme rather than the current rather
messed-up status of an embedded app which is trying to be extensible
via guile.  To conclude, I support what you want to provide, but
have a good long think about how you provide it, as you're getting
into the messy area the Lily/Scheme interface, and this may be a
bigger ask than you originally envisaged.  Cheers, Ian

It is only a bigger task if you _want_ it to be a bigger task.  Guile
is an extension language for Lilypond, and for some reason you seem to
think that you need to turn Lilypond into an extension of Guile in
order to be allowed to talk to Guile.

Obviously, I disagree.


http://codereview.appspot.com/5453045/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]