From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Tue, 17 Mar 2015 09:50:41 -0500 Message-ID: <85vbhzsmny.fsf@stephe-leake.org> References: <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 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1426603889 11182 80.91.229.3 (17 Mar 2015 14:51:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2015 14:51:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 17 15:51:18 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 1YXspu-0001gf-PC for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 15:51:14 +0100 Original-Received: from localhost ([::1]:55143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXspu-0003vU-9f for ged-emacs-devel@m.gmane.org; Tue, 17 Mar 2015 10:51:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXspm-0003v7-QJ for emacs-devel@gnu.org; Tue, 17 Mar 2015 10:51:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXspi-0005zj-1W for emacs-devel@gnu.org; Tue, 17 Mar 2015 10:51:06 -0400 Original-Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:55611) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1YXsph-0005zO-Qz for emacs-devel@gnu.org; Tue, 17 Mar 2015 10:51:01 -0400 Original-Received: (qmail 30993 invoked by uid 0); 17 Mar 2015 14:50:58 -0000 Original-Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy2.mail.unifiedlayer.com with SMTP; 17 Mar 2015 14:50:58 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw3 with id 4kqu1q00R2UdiVW01kqxHm; Tue, 17 Mar 2015 14:50:57 -0600 X-Authority-Analysis: v=2.1 cv=TeEF63gh c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=2wGvvwaKUHMA:10 a=IkcTkHD0fZMA:10 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=jrwKn-8xaegA:10 a=emO1SXQWCLwA:10 a=pGLkceISAAAA:8 a=-O5h6phoudtEIzD_EDMA:9 a=QEXdDO2ut3YA:10 Original-Received: from [70.94.38.149] (port=55303 helo=TAKVER) by host114.hostmonster.com with esmtpa (Exim 4.82) (envelope-from ) id 1YXspb-0001Nz-Go for emacs-devel@gnu.org; Tue, 17 Mar 2015 08:50:55 -0600 In-Reply-To: (=?utf-8?Q?=22Aur=C3=A9lien?= Aptel"'s message of "Tue, 17 Mar 2015 10:28:13 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) X-Identified-User: {2442:host114.hostmonster.com:stephele:stephe-leake.org} {sentby:smtp auth 70.94.38.149 authed with stephen_leake@stephe-leake.org} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 69.89.18.3 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:183954 Archived-At: Aur=C3=A9lien Aptel writes: > 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. It doesn't currently do anything; it just explors how to call elisp from the module. It will eventually call the full lexer and parser. >> 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. Right. But I'd like to try calling the ada-mode elisp lexer function anyway; less code to port to the module, and I suspect it's faster. >> emacs_value tokens[] =3D >> { /* name "A" */ >> Fcons (env, ada_grammar_names[245], Fcons (env, env->make_fixnum (= env, 24), env->make_fixnum (env, 25))), >> >> /* COLON_EQUAL ":=3D" */ >> 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. Right. This is a temporary list built as an argument to an elisp call. I want it to be garbage collected after the call, but not during. module_funcall in module.c copies the args (shallow copy only) and does GCPRO1 on the copy (actually on the first element of the copy), then does the actual funcall, followed by GCUNPRO. Is that sufficient?=20 On the other hand, can we eliminate the copy to save time? I think all we need to do is include 'fun' in 'args', as the standard lisp syntax does. --=20 -- Stephe