[Vm-dev] Slang & FFI
eliot.miranda at gmail.com
Mon Aug 24 21:06:23 UTC 2015
On Mon, Aug 24, 2015 at 6:20 AM, Ben Coman <btc at openinworld.com> wrote:
> Just had a curious thought I could not find the answer from poking
> 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?
Yes it makes sense but it isn't a benefit. You're saying that the FFI can
provide the marshalling that is written manually in plugins. But given
that the plugins are already written it doesn't really get us anything.
You'd have to introduce a specification language between the plugin's
primitive interface and given C calls that Slang would translate into
suitable marshalling code to cut out the human author. Seems to me that's
a lot of effort to auto-generate a small amount of code. I think more
interesting is writing direct to the FFI.
But people have discussed taking a functional interface written w.r.t. the
FFI and autogenerating a plugin for it, to provide the security and
encapsulation benefits. Thing is, would it be part of Slang or part of the
FFI? Perhaps it could use elements of both. But I'm not sure there's
enough use cases to justify the effort.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev