all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: "Aurélien Aptel" <aurelien.aptel+emacs@gmail.com>,
	"Leo Liu" <sdl.web@gmail.com>,
	"Emacs development discussions" <emacs-devel@gnu.org>
Subject: Re: Why not zlib-compress-region?
Date: Fri, 27 Jun 2014 18:07:38 -0400	[thread overview]
Message-ID: <jwvtx76m2p0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <53AD8EA8.9090805@yandex.ru> (Dmitry Antipov's message of "Fri, 27 Jun 2014 19:32:56 +0400")

>> 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	other threads:[~2014-06-27 22:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  9:20 Why not zlib-compress-region? Leo Liu
2014-06-26 12:07 ` Dmitry Antipov
2014-06-26 13:27   ` Stefan Monnier
2014-06-26 14:03     ` Leo Liu
2014-06-26 16:43       ` Stefan Monnier
2014-06-27 12:50         ` Aurélien Aptel
2014-06-27 13:28           ` Stefan Monnier
2014-06-27 15:32             ` Dmitry Antipov
2014-06-27 22:07               ` Stefan Monnier [this message]
2014-06-28  6:50                 ` Eli Zaretskii
2014-06-28 12:51                   ` Stephen J. Turnbull
2014-06-28 13:16                     ` Eli Zaretskii
2014-06-28 16:30                       ` Stephen J. Turnbull
2014-06-28 17:00                         ` Eli Zaretskii
2014-06-28 17:41                           ` Eli Zaretskii
2014-06-29  3:58                           ` Stephen J. Turnbull
2014-06-29 21:03                           ` Stefan Monnier
2014-06-28 18:06                         ` Paul Eggert
2014-06-28 14:07                   ` Richard Stallman
2014-06-27 19:48         ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvtx76m2p0.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=aurelien.aptel+emacs@gmail.com \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.