From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Sat, 03 Oct 2015 22:30:26 -0600 Message-ID: <87mvvzdzml.fsf@tromey.com> References: <55F5DD8C.70506@dancol.org> <55F62C16.4000105@dancol.org> <55F64F04.9030002@dancol.org> <55F6E43E.9030502@dancol.org> <55F70C4E.8030805@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1443933086 19421 80.91.229.3 (4 Oct 2015 04:31:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Oct 2015 04:31:26 +0000 (UTC) Cc: Paul Eggert , Tom Tromey , Emacs development discussions , Philipp Stephani , Stefan Monnier , Daniel Colascione , Stephen Leake To: =?utf-8?Q?Aur=C3=A9lien?= Aptel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 04 06:31:14 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ziax6-0007X5-VV for ged-emacs-devel@m.gmane.org; Sun, 04 Oct 2015 06:31:13 +0200 Original-Received: from localhost ([::1]:41125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ziax5-0003xN-TL for ged-emacs-devel@m.gmane.org; Sun, 04 Oct 2015 00:31:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ziawq-0003xF-3V for emacs-devel@gnu.org; Sun, 04 Oct 2015 00:30:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ziawm-00060H-Q4 for emacs-devel@gnu.org; Sun, 04 Oct 2015 00:30:55 -0400 Original-Received: from gproxy7-pub.mail.unifiedlayer.com ([70.40.196.235]:58282) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Ziawm-000602-Gg for emacs-devel@gnu.org; Sun, 04 Oct 2015 00:30:52 -0400 Original-Received: (qmail 5150 invoked by uid 0); 4 Oct 2015 04:30:45 -0000 Original-Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy7.mail.unifiedlayer.com with SMTP; 4 Oct 2015 04:30:45 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id QyWW1r0082f2jeq01yWZTR; Sun, 04 Oct 2015 04:30:44 -0600 X-Authority-Analysis: v=2.1 cv=Zs1+dbLG c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=zstS-IiYAAAA:8 a=IkcTkHD0fZMA:10 a=PnD2wP_eR3oA:10 a=meFa6WQr8mcA:10 a=5lJygRwiOn0A:10 a=pGLkceISAAAA:8 a=lz-RkDwogw_8lusslBEA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=FH6erHEOpndB4V2cXFWCLvxnXErtoQ4ttaG5F3zsWHM=; b=leJdx6ltY5dnHENmwg944SMvIXlWppcMTvGnP7OgBdWbcmsoayWFgoRCtFU9ZxXAAsJrBp8uIZ8bKIYrov3uOwFpUf3h/+4YkN5AeyueAJwfPrxRY4EW9AqfresuFQP8; Original-Received: from [65.128.91.114] (port=54805 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.84) (envelope-from ) id 1ZiawR-0001t9-Li; Sat, 03 Oct 2015 22:30:31 -0600 X-Attribution: Tom In-Reply-To: (=?utf-8?Q?=22Aur=C3=A9lien?= Aptel"'s message of "Sat, 26 Sep 2015 16:56:59 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 65.128.91.114 authed with tom+tromey.com} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 70.40.196.235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:190841 Archived-At: >>>>> "Aur=C3=A9lien" =3D=3D Aur=C3=A9lien Aptel writes: [ module progress ] Tonight I tried to use the module code to write an FFI module using libffi. I found some holes that make this difficult to do. Aur=C3=A9lien> As for the finalizer, I wanted to add a function in the API: Aur=C3=A9lien> Or we can have a full "method table" with printer function a= nd other Aur=C3=A9lien> things we might need in the future. Although It's a bit over= kill with Aur=C3=A9lien> just finalizer/printer... It would be great to be able to make new types from C. That would let me wrap up various C objects I'd like to return opaquely to Lisp. Wrapping pointers would be good enough (for now I am using bit vectors) but having more control would be much better. Overkill here is better. You'll want to extend this vtable over time, for example to add a GC mark function. I don't particularly care if the vtable is exposed or private. Of course, if you can add types from C, why not from Lisp? But I guess I could write a module to allow that :) Here's my list of other things that I noticed. Note that my module isn't working yet, so take it with a grain of salt. * I found the emacs_runtime / emacs_env split strange. I don't know what the purpose of this is. Also there doesn't seem to be a way to free an emacs_env, which I suppose makes sense in a way; though shouldn't they simply be GC'd as well? * module-call never frees "args". * For error handling for now I ended up just calling Emacs stuff directly. Tom