From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Fri, 17 Oct 2014 01:09:54 +0200 Message-ID: References: <87y4t9m76w.fsf@lifelogs.com> <83lhopb1bp.fsf@gnu.org> <83oatjapq2.fsf@gnu.org> <838uknae9a.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1413501024 2074 80.91.229.3 (16 Oct 2014 23:10:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Oct 2014 23:10:24 +0000 (UTC) Cc: Eli Zaretskii , Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 17 01:10:19 2014 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 1XeuBS-0006FU-2B for ged-emacs-devel@m.gmane.org; Fri, 17 Oct 2014 01:10:14 +0200 Original-Received: from localhost ([::1]:54972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeuBR-0004D5-ER for ged-emacs-devel@m.gmane.org; Thu, 16 Oct 2014 19:10:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeuBD-0004Cb-TF for emacs-devel@gnu.org; Thu, 16 Oct 2014 19:10:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XeuBC-0001Jf-OQ for emacs-devel@gnu.org; Thu, 16 Oct 2014 19:09:59 -0400 Original-Received: from mail-qc0-x234.google.com ([2607:f8b0:400d:c01::234]:34861) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XeuB9-0001J3-RX; Thu, 16 Oct 2014 19:09:55 -0400 Original-Received: by mail-qc0-f180.google.com with SMTP id x3so3567868qcv.25 for ; Thu, 16 Oct 2014 16:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=pTRdjvffVM20LZkQn1o/IhgV6k87jFVIgQixML3gbHQ=; b=DyMperbx26LaN3XhU5a/1GUloUgIKBZsMUjKv4nEEauBhdxnsyYvcgfT44XGm6rkbs kFkm7T387thqUFNo1teN7gHUeY6mltKsGExAD8hBNhyO7rzYV+i0OARy1RKjDrH/g8W0 gDZaJrFXQceDjBmlVl0UO+khxVsZ5Gu39NEs6hJXZ4JKhBc3HwXiLAGFRuxuOLAsu6Sm 534bOhpfW0u4WypyDj9NKU9F1NVR9bNZFK0SSgtu1wjQ9Mq/XpEmliBFExmgn+KZqpjU PrvD/3YN5mbBkh9NvS2qRTdhdPlxm3niCmlL5gCRKHgSunJBVv9K4vlLOAKNy4YOxEB1 IaGQ== X-Received: by 10.224.163.78 with SMTP id z14mr6861657qax.69.1413500994822; Thu, 16 Oct 2014 16:09:54 -0700 (PDT) Original-Received: by 10.140.95.34 with HTTP; Thu, 16 Oct 2014 16:09:54 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: Gbv7f0ZMNIentN-JDlbMuHswS6Q X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c01::234 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:175495 Archived-At: On Tue, Oct 14, 2014 at 8:11 PM, Stefan Monnier wrote: >> - should we provide a destructor mechanism in the GC? > > You mean "finalizers"? Sounds fine, yes. The GC code already has code > that does similar things to handle various kinds of "weak" pointers. I will look into it, thanks. >> - should we add a new generic lisp type for opaque pointers? > > Fine by me, yes. Ok. I think this new type needs an unique module identifier field in order to differentiate one module type from another (per-module type predicates). This field can be a random int, it can be computed from the module struct directly, a short fixed size string (eg the module name + version), the opaque type size, or a mix of all of these... (I'm thinking out loud) >> - how should modules be packaged? > > As GNU ELPA packages, of course. Several headers are needed in order to build a module, and they have to be the one your current Emacs was built with (eg config.h). I think this means Emacs should copy those in the system include dir when installing. Can we generate a config.h from a built emacs binary? Also the whole thing has to be portable (build commands, paths, ...). Well it's going to be a nightmare to get right. In the mean time I wrote a basic YAML parsing module [1] using libyaml. You can read yaml from a file, a buffer or a string. I've tried to use direct access to lisp types (string, buffer) when reading yaml streams to prevent too much copying/type conversion overhead. I haven't done much error checking yet so it's not very robust but it works: (require 'yaml) (yaml-parse-string "--- invoice: 34843 date : 2001-01-23 bill-to: &id001 given : Chris family : Dumars address: lines: | 458 Walkman Dr. Suite #292 city : Royal Oak state : MI postal : 48046 ship-to: *id001 ") => (#s(hash-table data ("invoice" "34843" "date" "2001-01-23" "bill-to" #s(hash-table data ("given" "Chris" "family" "Dumars" "address" #s(hash-table data ("lines" "458 Walkman Dr.\nSuite #292\n" "city" "Royal Oak" "state" "MI" "postal" "48046")))) "ship-to" #s(hash-table data ("given" "Chris" "family" "Dumars" "address" #s(hash-table data ("lines" "458 Walkman Dr.\nSuite #292\n" "city" "Royal Oak" "state" "MI" "postal" "48046"))))))) (I have edited the output to make it more readable) 1: https://github.com/aaptel/emacs-dynamic-module/blob/master/modules/yaml/yaml.c