At 05:33 AM 9/27/00 +0000, Perl6 RFC Librarian wrote:
>Perl should be embeddable, and we should make it easy for people to
>embed it by making the API as simple as possible.
I've some notes on this that I never got together for an RFC. What I was
thinking we would want would be routines to:
* Create an interpreter
* Destroy an interpreter
* Run a string
* Register a callback function in the embedding app. (I was thinking in the
HOST package)
Getting/setting values and messing with perl variables in general were
things I specifically wanted left *out* of the embedding API. (No,
seriously) The target programmer was one who not only didn't know perl's
API, but actively disliked the language and was forced to provide an
interface to their Big Application but wanted nothing to do with it.
The sequence would look like:
interp = Perl_Create((char *)switch_set);
Perl_Register(interp, &open_file, "open_file", return_type, parameter_list);
status = Perl_Run(interp, some_code);
Perl_Destroy(interp);
And that would be *all* the person providing the embedded perl would need
to know to provide an interface complete with hooks into the host application.
There's nothing wrong with getting fancier--that's perfectly fine, but then
you'd shade over into using the XS (or whatever) API set as well.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk