emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why not zlib-compress-region?


From: Stefan Monnier
Subject: Re: Why not zlib-compress-region?
Date: Fri, 27 Jun 2014 18:07:38 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>> Of course, there's Dave Love's
>> http://www.loveshack.ukfsn.org/emacs/dynamic-loading/
> IIUC this is a completely different thing. Dave's approach is to
> dlopen() specially designed shared objects to add pre-defined
> DEFVARs and DEFUNs; FFI is about _generating_ DEFUNs "on the fly"
> from _any_ (well, almost any) shared object.

It's not that different.  In either case, you need some glue which
describes how to construct the arguments to pass to those dl-loaded
functions and what to do with their return value.

In the case of Dave's approach, this glue is written in C.  In more
modern FFIs (or in Christopher Wellons's approach), this is written in
some DSL.

Writing the glue in C has its advantages: more people know C than know
the binding-DSL, and C lets you do "anything" whereas the typical
binding DSL always has various limitations as to which kinds of objects
it supports, etc...

Of course, writing the glue in C means it needs to be passed to
a C compiler, which means that the user who wants to use a package that
uses such glue will need to have a C compiler installed.  A non issue
under GNU/Linux, but a point of friction under W32.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]