FFI prototype

Ken Causey ken at kencausey.com
Wed Oct 13 10:49:35 PDT 2004


At http://www.kencausey.com/slate/ffiproto2.zip you can find a very
simple prototype of FFI support.

This is only known to work on Linux.  You need libffi (I'm using what
Debian calls libffi3 which comes with GCC, an older version may work,
I'm not sure.) and of course support for dlopen/dlsym/dlclose.

You will want to start with a clean CVS slate checkout.  Make a copy of
the entire directory and use the copy.  Unzip this zip file within the
root of the slate copy and choose to overwrite existing files.

You will then need a VM so download the vm.c, vm.h and little.image from
http://slate.tunes.org/downloads/alpha/ and build it as usual.  Start
this vm up with little.image.  We need to build a new VM and image:

load: 'src/mobius/init.slate'.

VM generate &named: 'ffivm'.

VM buildImage &named: 'ffi.image'.

Then quit slate and build the new VM:

make VM=ffivm

You will need a test library.

cd ffitests
make

Then start up the new VM with the new image:

./ffivm ffi.image

And run the tests:

load: 'src/lib/test.slate'.
load: 'tests/ffi.slate'.
UnitTests FFI suite run.

As noted previously there's not really much here and this is little more
than a prototype of a prototype.  But you asked so here you are.

Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /archives/slate/attachments/20041013/ee0799aa/attachment.pgp


More information about the Slate mailing list