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: Tue, 17 Mar 2015 10:28:13 +0100 Message-ID: References: <83pp9cwky8.fsf@gnu.org> <85a90ggf2d.fsf@stephe-leake.org> <54E0A40F.5080603@dancol.org> <83sie7un20.fsf@gnu.org> <54E0D181.2080802@dancol.org> <83r3trulse.fsf@gnu.org> <54E0D7E0.305@87.69.4.28> <83h9unukbg.fsf@gnu.org> <54E0DEF8.7020901@dancol> <83egpruiyp.fsf@gnu.org> <54E0FF93.2000104@dancol.org> <833865vp4d.fsf@gnu.org> <54E2355A.90@87.69.4.28> <83vbj1u020.fsf@gnu.org> <54E24CA4.9020601@dancol.org> <83h9uk7ddb.fsf@gnu.org> <54E382A5.5030408@dancol.org> <85a8zcu8gn.fsf@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1426584510 9666 80.91.229.3 (17 Mar 2015 09:28:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2015 09:28:30 +0000 (UTC) Cc: Emacs development discussions To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 17 10:28:30 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 1YXnnT-0000WK-EL for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 10:28:23 +0100 Original-Received: from localhost ([::1]:53495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXnnS-0006FJ-B1 for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 05:28:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXnnN-0006Cv-4p for emacs-devel@gnu.org; Tue, 17 Mar 2015 05:28:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXnnL-0004sW-Ug for emacs-devel@gnu.org; Tue, 17 Mar 2015 05:28:17 -0400 Original-Received: from mail-ig0-x230.google.com ([2607:f8b0:4001:c05::230]:37734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXnnL-0004sH-Lz for emacs-devel@gnu.org; Tue, 17 Mar 2015 05:28:15 -0400 Original-Received: by igcqo1 with SMTP id qo1so5647399igc.0 for ; Tue, 17 Mar 2015 02:28:14 -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=JzsmelE8V61obsCAsZYsYI5jFc9ze09SHNG35OxYcrQ=; b=X1IwUbKPUjpIRnF2OOclXp8hoWyvR+8PLsChYr0JmgiG3aSfG9u1TMQEaP26HvVjf+ dPw/gccGYuyBg2FEkph1T4XbGpyWTqj2zuWgpA7SA/stw91KIcHuNwsQNgahfpjEmesb CU+SbpzBa97m4q3v/DZg43VqaCfmMjQUi6wcVeKTGnupVgqhZ0Q42lt9nOFYcKkAQnZI orKtGkzxOn72VfTo7NPspvvkJKwsEB78D5LLPJ5cGGbozfkZ4f+4c4XcUoxoW0WrZTqA jIX8QPrPb//eL4/V+BhK7aCpPEN/j8d++Q4vqQ1xh3O/aAe5bvNWzXblHkv2jT6DUpqx xAhA== X-Received: by 10.107.133.16 with SMTP id h16mr77062553iod.31.1426584494285; Tue, 17 Mar 2015 02:28:14 -0700 (PDT) Original-Received: by 10.36.44.197 with HTTP; Tue, 17 Mar 2015 02:28:13 -0700 (PDT) In-Reply-To: <85a8zcu8gn.fsf@stephe-leake.org> X-Google-Sender-Auth: Gxs_DsyNEko2UnSTYW6SU73XKXw X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::230 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:183946 Archived-At: On Mon, Mar 16, 2015 at 7:02 PM, Stephen Leake wrote: > I've implemented a test module that calls two Ada mode parser actions > (see below). > > The real module will call the actual parser and build the action args > from the parse results. > > I did not have to modify anything in the Emacs C code to make this work, > so it shows this module design is adquate for my use case so far. Good! I'd be interested in performance comparison between the pure elisp version and this module version. I suspect it's not going to be much unfortunately. You module doesn't seem to be resource intensive (as of now) anyway. > I still need to implement the lexer level, which will either need to > call the current elisp lexer, or access the buffer text directly. No buffer or string access yet, sorry. I guess you can work around it by retrieving each character as an int but that's neither practical nor efficient. > Any comments on the coding style? I don't think I need GCPRO on any of There's no GC protection in the module API yet. I think there are some place of your module that might not be safe. See below. > the static emacs_values, because they are all declared at global level > in elisp. I had not thought about that: global refs can be defined in pure elisp. That indeed removes the need for registering global values via the module API. I'm still not sure I understand what Daniel had in mind for global/local value registration, I'm kind of waiting for his reply to move forward. I'll try reading more thoroughly the JNI document he linked in a previous message in the meantime. > emacs_value tokens[] = > { /* name "A" */ > Fcons (env, ada_grammar_names[245], Fcons (env, env->make_fixnum (env, 24), env->make_fixnum (env, 25))), > > /* COLON_EQUAL ":=" */ > Fcons (env, ada_grammar_names[ 81], Fcons (env, env->make_fixnum (env, 26), env->make_fixnum (env, 28))), > > /* expression "1" */ > Fcons (env, ada_grammar_names[194], Fcons (env, env->make_fixnum (env, 29), env->make_fixnum (env, 30))), > > /* SEMICOLON ";" */ > Fcons (env, ada_grammar_names[ 95], Fcons (env, env->make_fixnum (env, 30), env->make_fixnum (env, 31))) > }; ^^^^ all those conses can be GC'd if any of the code afterwards can call the GC. It might not be the case right now put it probably will at some point. I'm not sure about this but if you call a pure-elisp function the GC will trigger.