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: Sat, 14 Feb 2015 18:35:25 -0600 Message-ID: <85oaowggfm.fsf@stephe-leake.org> References: <838ugdf251.fsf@gnu.org> <54D80098.3020209@cs.ucla.edu> <54D85304.1030600@cs.ucla.edu> <54D9AC29.2020603@cs.ucla.edu> <54DA8539.1020905@cs.ucla.edu> <87zj8ktq8f.fsf@lifelogs.com> <54DD6413.1000403@cs.ucla.edu> <83wq3m436s.fsf@gnu.org> <54DDEB4D.5040300@dancol> <83egpt4zz6.fsf@gnu.org> <54DE12E9.5040606@dancol.org> <85twypiiug.fsf@stephe-leake.org> <83zj8g3n16.fsf@gnu.org> <857fvkik49.fsf@stephe-leake.org> <83lhk0wkfl.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423960586 24018 80.91.229.3 (15 Feb 2015 00:36:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Feb 2015 00:36:26 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 15 01:36:15 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 1YMnC0-0002nS-GO for ged-emacs-devel@m.gmane.org; Sun, 15 Feb 2015 01:36:12 +0100 Original-Received: from localhost ([::1]:33187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMnBz-0004b7-Mn for ged-emacs-devel@m.gmane.org; Sat, 14 Feb 2015 19:36:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMnBj-0004b1-IN for emacs-devel@gnu.org; Sat, 14 Feb 2015 19:36:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMnBg-000375-Al for emacs-devel@gnu.org; Sat, 14 Feb 2015 19:35:55 -0500 Original-Received: from gproxy6-pub.mail.unifiedlayer.com ([67.222.39.168]:54758) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1YMnBg-00034e-3V for emacs-devel@gnu.org; Sat, 14 Feb 2015 19:35:52 -0500 Original-Received: (qmail 3809 invoked by uid 0); 15 Feb 2015 00:35:46 -0000 Original-Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy6.mail.unifiedlayer.com with SMTP; 15 Feb 2015 00:35:46 -0000 Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmgw3 with id sQbe1p00N2UdiVW01Qbh5B; Sat, 14 Feb 2015 17:35:46 -0700 X-Authority-Analysis: v=2.1 cv=SqADtp+0 c=1 sm=1 tr=0 a=CQdxDb2CKd3SRg4I0/XZPQ==:117 a=CQdxDb2CKd3SRg4I0/XZPQ==:17 a=DsvgjBjRAAAA:8 a=f5113yIGAAAA:8 a=TeMFXEv2S7AA:10 a=9i_RQKNPAAAA:8 a=hEr_IkYJT6EA:10 a=jrwKn-8xaegA:10 a=0HtSIViG9nkA:10 a=mDV3o1hIAAAA:8 a=LMySSArav9gABXAy_JEA:9 Original-Received: from [70.94.38.149] (port=51308 helo=takver) by host114.hostmonster.com with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.82) (envelope-from ) id 1YMnBS-0002jR-FU for emacs-devel@gnu.org; Sat, 14 Feb 2015 17:35:38 -0700 In-Reply-To: <83lhk0wkfl.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Feb 2015 18:02:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (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: 67.222.39.168 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:183075 Archived-At: Eli Zaretskii writes: >> From: Stephen Leake >> Date: Sat, 14 Feb 2015 09:32:54 -0600 >> >> Emacs ada-mode does indentation in two steps; first it parses the source >> code, and the parser actions are lisp functions that eventually call >> put-text-property to store information about the syntax and/or semantics >> on many identifiers. Then the indentation code uses those text >> properties to compute indentation. >> >> I have a generalized LALR parser implemented in elisp that is fast >> enough for many user's Ada files, but some users have much bigger files, >> and it takes them 10 seconds to parse. So I need a faster >> implementation. So far my benchmarking says I can get close with a >> machine compiled parser. >> >> So the module would contain the generalized LALR parser; the actions of >> the parser would still be calls to the lisp functions. > > But this means your mode is in Lisp to begin with, and it just calls > functions implemented in C to work faster. So you could leave the > calls to put-text-property in Lisp, and have the functions implemented > in the module return the information required to compute the arguments > to put-text-property. Or am I missing something? The parser actions are callbacks; when the parser recognizes a complete grammar sentence (ie a statement, function declaration, etc), it calls an action (which in this case is a lisp function), then resumes parsing. Each file contains many grammar sentences, so there are many calls to lisp functions from within the C parser. (Actually, the parser is in Ada, but that's a separate issue). I could redefine the parser actions to store the required info in a list, and at the end of parsing return that list, and then process the list in elisp. But I've already tried that with the parser in an external process; just processing the returned list is too slow. I need direct calls. -- -- Stephe