* Andre Poenitz <[EMAIL PROTECTED]> [010502 09:36]:
> > I've tried to look into embedding python into lyx, it seems possible as
> > the interpreter was designed for embedding though I haven't yet figured
> > out how to do it exactly.
> 
> Ok, before we seriously start this kind of implementation I would really
> like to have this "Which scripting languange?" argument again.

Ok, before we serious start this kind of discussion on "Which scripting
language?" why don't we agree that the best thing is for scripting
language to be optional and let the user choose?

After all, we do it with GUI, we decided not to decide on anything and
to let the users use what fits them better. The same could be with
scripting language, after all the hooks for scripting language is
another LFUN and another calling name e.g. lisp-script. The
implementation is even simpler than GUI and will avoid such a lengthy
discussion on the merits of each language. After all, those who are
supposed to program those scripts are users, we might need to write some
of the scripts, but the scripts are not an important part of LyX, just
an add-on.

The basics of embedding a language is to have a way to call scripts of
this language: ExecutePythonScript(string const & filename)
And then we need to expose the lyx actions and queries to the scripting
language, this entails an extension to LyXFunc that can also query. We
need actions like "word-forward" (which we have now) and queries like
"character-get" (which we dont have). So the exposing part is equal for
all languages, and the wrappings of these for the specific language are
specific to the language.

Notice that in my patch I started a new subdirectory src/embed/ for this
exact reason.

My reason to use Python is because it's a language I like. I do not
really like lisp or scheme or their other variants. It's pretty hard to
argue on the basis of I like this language or that language, and I
believe most of us have language that we prefer to script in. 

It will be hard to quantify the "betterness" (for lack of the correct
word) of a language to implement some script.

-- 
Baruch Even
http://baruch.ev-en.org/

Reply via email to