[squeak-dev] Re: [ANN] Squeak on Android

Andreas Raab andreas.raab at gmx.de
Tue Jan 19 08:53:38 UTC 2010


Andreas Raab wrote:
> 1) Write generic bridge to Java (using JNI). That's a sizable chunk of 
> initial work, but once it's done you will be able to interact seamlessly 
> between Squeak and Java.

And now that I've been thinking about it, it actually even seems more 
reasonable because you can leverage the FFI to do it. What I'd do is to 
add a new calling convention called 'java' and then use the FFI to spec 
it along the lines of:

JAssetManager>>open: fileName
   "public final InputStream open (String fileName)"
   <java: JInputStream 'android.content.res.AssetManager.open' (JString)>

(see 
http://developer.android.com/reference/android/content/res/AssetManager.html#open%28java.lang.String%29)

and then provide the necessary level of primitive coercion via having 
the FFI recognize the <java:> calling convention and dispatch to a 
JNIPlugin which implements the necessary glue code. Being able to ride 
on top of the FFI really simplifies implementing all of the type 
manipulation so you can concentrate on the glue code itself. I'd say 
this cuts down on the required time significantly (to the point where I 
might even spend another weekend looking at it).

Cheers,
   - andreas




More information about the Squeak-dev mailing list