sxemacs-devel
[Top] [All Lists]

Re: FFI's DSO's & WIIFU

From: Zajcev Evgeny <zevlg@xxxxxxxxx>
Subject: Re: FFI's DSO's & WIIFU
Date: Fri, 12 Nov 2004 10:01:13 +0300
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, berkeley-unix)
Steve Youngs <steve@xxxxxxxxxxx> writes:

>
> Now then...
>
> 1) Without going into technical details, describe what an FFI is.

FFI for SXEmacs is thing which allow you to run non-elisp code in
elisp environment.  Imagine that you have libwww.so which have next
sexy function:

  www_fetch_url(string url, int mode)  - Fetches URL in some manner and returns
                                         resulting buffer.

And we want that function to be available in elisp.  We create
arguments transformation rules, like:

  ("www-fetch-url" "www_fetch_url" (:in string :in integer :out string))

and then just call from elisp:

  (defvar www-fetch-async-mode 1)

  (setq rstr (www-fetch-url "http://sxemacs.org"; www-fetch-async-mode))

and we will got SXEmacs home page in RSTR.

Function arguments are automatically transformated from/to emacs lisp
objects to proper types that ffi function accepts, using ffi arguments
transformation rules.

>
> 2) Tell me what it gives me that DSO's can't (or can't be made to
>    do). 

For example we can implement fullset of unix system calls in
emacs-lisp, whithout need to hack some C things!

>
> 3) How long would it take to get these FFI thingies into shape?
>    (imagine you could hack non-stop uninterrupted, how long?)

haha, actually if using some already implemented ffi library it will
take i think month to adopt it for SXEmacs use.

>
> 4) Can it wait until the windoze code is gone?

Of course.  It can wait as much as needed.

>
> 5) Are they sexy?

Hehe, for me FFI is just another way to extend things without need to
some low level hacking.  Everything that already written in C(actually
not limited to) as library can be used in elisp using sexy ffi.

-- 
lg

<Prev in Thread] Current Thread [Next in Thread>