[Vm-dev] Slang & FFI

David T. Lewis lewis at mail.msen.com
Mon Aug 24 15:47:21 UTC 2015


>
> Just had a curious thought I could not find the answer from poking
> around...
>
> Is Slang able to make use of the FFI interface?  I see things like
> file primitives with C-code scaffolding around system calls, and
> wonder if this C-code could be reduced by Slang calling directly to
> system functions through FFI, with scaffolding written in Slang?
>
> Does that make any sense?
> cheers -ben
>

IMO, that is probably not a productive approach. The advantage of plugins
(slang) is that they are reliable and stable, and they let the C compiler
worry about low level things such as data structures and word alignment.
FFI interfaces are free of the requirement to compile one's own VM
plugins, but they are relatively fragile and dependent on low level
platform and compiler differences.

If you combine the two, you get the worst of both worlds - a relatively
fragile and platform-dependent interface that still requires you to
compile your own plugins.

Dave




More information about the Vm-dev mailing list