From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Subject: Re: GSoC 2012 -- Elisp backend for Ragel Date: Wed, 28 Mar 2012 00:11:08 +0200 Message-ID: References: <87vclsykl6.fsf@gmail.com> <87sjgtoi1o.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:51442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCebh-0000CU-C3 for emacs-orgmode@gnu.org; Tue, 27 Mar 2012 18:11:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCebf-00048E-8q for emacs-orgmode@gnu.org; Tue, 27 Mar 2012 18:11:12 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:59316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCebf-000484-0v for emacs-orgmode@gnu.org; Tue, 27 Mar 2012 18:11:11 -0400 Received: by obbta14 with SMTP id ta14so496021obb.0 for ; Tue, 27 Mar 2012 15:11:09 -0700 (PDT) In-Reply-To: <87sjgtoi1o.fsf@Rainer.invalid> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Achim Gratz Cc: emacs-orgmode@gnu.org On Tue, Mar 27, 2012 at 11:22 PM, Achim Gratz wrote: > It needs yet another tool to fully build org-mode from scratch, which > needs to be installed, bug-free and configured correctly. =C2=A0Right now= all > one really needs to have to build org-mode is a working Emacs (even make > is optional). Ragel is written in C++ and has no dependency. * every major platform has a C++ compiler * ragel input along with generated code can be tracked in the repo * the generated code is portable since it's elisp (doesn't need to be regenerated on different platforms) * the parser is a confined part of org-mode I don't think this is a problem. >>> =C2=A03) FSM implementation into code is inherently very simple anyway >> >> Well I've never done it for big language but I did not find it that >> easy. Mistakes are easily made e.g. you end up accepting more thing >> that the language does in order to simplify the code, etc. > > Which is just as easily done by specifying the syntax incorrectly. I think the fix will be shorter and simpler in the syntax because it's easier to reason on an abstract definition when it comes to language. When you're neck-deep in your handwritten implementation trying to figure what you did wrong, it can take a long time. > No, you can (for a suitably restricted set of languages) formally proof > that the implementation and the specification is identical for any > input. How would you do that programmatically? > The assumption that an FSM running in ELisp is faster than a bunch of > regexp has not been actually tested or has it? I haven't tested anything yet. If I remember correctly, the emacs regex API doesn't provide a way to compile patterns and thus have to be compiled at each call. Also the underlying FSM implementation uses NFA which can lead to a exponential complexity in time [1] for certain patterns. 1: http://swtch.com/~rsc/regexp/regexp1.html