From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Zajcev Evgeny Newsgroups: gmane.emacs.devel Subject: Re: FFI Date: Sun, 18 Apr 2010 22:53:57 +0400 Message-ID: References: <87sk6tonv8.fsf@mid.deneb.enyo.de> <20100418053925.GA7294@tomas> <878w8lb2s0.fsf_-_@mail.jurta.org> <8739yt9nks.fsf@mid.deneb.enyo.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1271623092 2761 80.91.229.12 (18 Apr 2010 20:38:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 18 Apr 2010 20:38:12 +0000 (UTC) Cc: Juri Linkov , joakim@verona.se, emacs-devel@gnu.org To: Florian Weimer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 18 22:38:10 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O3bEF-0000vi-0K for ged-emacs-devel@m.gmane.org; Sun, 18 Apr 2010 22:38:09 +0200 Original-Received: from localhost ([127.0.0.1]:39771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3bDz-0001ZQ-88 for ged-emacs-devel@m.gmane.org; Sun, 18 Apr 2010 16:36:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O3ZdI-0008Qf-Lf for emacs-devel@gnu.org; Sun, 18 Apr 2010 14:54:16 -0400 Original-Received: from [140.186.70.92] (port=43396 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3ZdH-0008Q3-AO for emacs-devel@gnu.org; Sun, 18 Apr 2010 14:54:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O3ZdF-0003hv-Ck for emacs-devel@gnu.org; Sun, 18 Apr 2010 14:54:15 -0400 Original-Received: from mail-bw0-f225.google.com ([209.85.218.225]:34665) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3ZdF-0003hh-2e for emacs-devel@gnu.org; Sun, 18 Apr 2010 14:54:13 -0400 Original-Received: by bwz25 with SMTP id 25so4020590bwz.8 for ; Sun, 18 Apr 2010 11:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:to:cc:subject :references:from:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=lO4QmEOcXvmeo9H2Z3ozhfiTr+5RpxWjNVTHeJKzIeI=; b=TQXn35buDXjdQ81UVYr+6LGCFTJ6uwIBMQyLBPXT17lHQdioa6cQuYj9/DYx0+9Y8B 9QT+xMMTmtgaHsWIUTLYYENFUZ2CLujyupRtOTidcsQapwC14C0zL6d7pkdgI5hfdCeA gKqFRq5EnQOn37GzD2stGonb06VKq65Inix8g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:cc:subject:references:from:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=BSSUWmpup+lv1cAOxkVFSi3YrYKyFcHM0/pR2DsbBwWXSsrWhzUUwsAOMc2EC6pFhe f9kvxIn2WghuE0KqLbzYb2wxt59JvkF/WF4w+PGpdZ9zlmOamKunXJxEQv/no2BOokP9 9zd+o/Dm8yVdfvDWXco5dh4FDOV0gY6zs8qQE= Original-Received: by 10.204.6.212 with SMTP id a20mr3730905bka.22.1271616850931; Sun, 18 Apr 2010 11:54:10 -0700 (PDT) Original-Received: from macbook-air-0000-0000.local (ppp91-77-56-27.pppoe.mtu-net.ru [91.77.56.27]) by mx.google.com with ESMTPS id 13sm2777266bwz.15.2010.04.18.11.54.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Apr 2010 11:54:07 -0700 (PDT) Original-Received: by macbook-air-0000-0000.local (sSMTP sendmail emulation); Sun, _d Apr 2010 22:53:58 +0300 In-Reply-To: <8739yt9nks.fsf@mid.deneb.enyo.de> (Florian Weimer's message of "Sun, 18 Apr 2010 10:22:59 +0200") User-Agent: Gnus/5.1008 (Gnus v5.10.8) SXEmacs/22.1.11 (darwin) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Sun, 18 Apr 2010 16:36:10 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123855 Archived-At: Florian Weimer writes: > * Juri Linkov: > >> If using its implementation in GNU Emacs is not possible due to legal >> reasons, then maybe at least it would be a good idea to implement >> FFI in GNU Emacs compatible with SXEmacs. In this case all existing >> library bindings will be readily available for GNU Emacs. > > This is only true if Emacs also implements all SXEmacs types, so it is > a bit more ambitious than just implementing the FFI. I think I can port SXEmacsen FFI to GNU Emacs with small blood. SXEmacsen FFI does not uses lisp types (it does actually, but this is another question), so you can create almost any data accessible from FFI with only numbers, floats and strings. Let me show live example: (setq db (sqlite-open "~/mtest.db")) ==> # (sqlite-execute db "CREATE TABLE PARAMS (NAME VARCHAR(256) NULL, VALUE VARCHAR(1024) NULL)") ==> t (sqlite-execute db "INSERT INTO PARAMS (NAME,VALUE) VALUES (?, ?)" '("nthoteh" "HRCHRCCR")) ==> t (sqlite-rows db "select * from params") ==> (("nthoteh" "HRCHRCCR")) (sqlite-close db) ==> 0 As you can see there are only strings, and numbers (boolean type is done via dinamic type/value translators implemented in ffi) thanks -- lg