changes to the breve object API, Java support, API examples
jon klein <[email protected]> Mon, 1 Nov 2004 15:11:57 -0500
| Newsgroups | gmane.comp.breve |
|---|---|
| Message-ID | <[email protected]> |
Hi everybody,
this message is mainly of interest to those who are following the
development of breve and working with any of the source code or
development APIs. The new features, including Java support, will
probably be available in the next release of breve.
In the meantime, those who are developing their own language
frontends, and those who can help out with Java on other platforms
than Mac OS X should read on...
OVERALL CHANGES / EXPLANATION:
-=-=-=-=-=-=-=-
A CVS snapshot of the changes, along with some updated API
documentation is available from:
http://www.spiderland.org/breve/developer.php
My apologies to those who have started writing code with the old
API. As I begin to reintegrate Java support, I realized that the
API in its previous form had a number of limitations. Most
importantly, the API did not allow transparent object bridges
from one language to another.
The changes to the API will now allow objects from other languages
to be directly created and called from within steve. With the
Java support described below, for example, it is now possible--from
within steve--to say:
javaString = new "java.lang.String".
JAVA SUPPORT:
-=-=-=-=-=-=-
Code is now in place to seamlessly instantiate Java objects from
within steve code. With some additional work, it would be possible
to write simulations purely in Java with no steve code at all.
The code currently works only on Mac OS X and does have few other
important limitations: no arguments can be passed to constructors,
and there is no type checking when calling methods.
Any help in getting this code working on Windows and Linux would
be greatly appreciated. It's mainly an issue of linking and
creating a Java virtual machine at runtime.
OBJECT API EXAMPLES:
-=-=-=-=-=-=-=-=-=-
The Java frontend code is a relatively straightforward example of
how the breve object API works. The steve language is also now
using the object API, though it's considerably less straightforward.
CHANGES TO THE BREVE OBJECT API:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- there are a few extra callbacks that now need to be defined.
- some arguments have been added to the callback functions.
findMethod, in particular, now takes argument type information.
If your language frontend does not
- the struct fields named "pointer" are now called "userData".
pointer, while accurate, was about the worst variable name
I could have chosen.
- the struct fields named "class" are now called "object".
this was changed to avoid conflicts with C++ compilers.
- the callback functions now receive the "userData" pointer.
Previously they would be given a structure containing this
pointer.
For example:
// the old way
int (*callMethod)(brInstance *instance, ...);
// the new way
int (*callMethod)(void *instanceData, ...);
- jon klein
_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve