emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: GSoC 2012 -- Elisp backend for Ragel
Date: Wed, 28 Mar 2012 08:34:43 +0200	[thread overview]
Message-ID: <87bonhkzcs.fsf@Rainer.invalid> (raw)
In-Reply-To: CA+5B0FNeMOGrbUYDYkn50cxQX7UEfh5KkeaZhOZTfozji3=zJQ@mail.gmail.com

Aurélien Aptel <aurelien.aptel@gmail.com> writes:
> Ragel is written in C++ and has no dependency.

It depends on having a working C++ compiler (presumably with some list
of features / standard conformance).

> * every major platform has a C++ compiler

Yes, but it may not be installed.  Or has the wrong version.  Or
whatever.

> * ragel input along with generated code can be tracked in the repo

It is a bad idea(TM) to track both the sources and the result of a
generation from that source in the same repo.  That other projects are
doing that doesn't mean we should follow their example.

> * 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.

It may not be a problem for you.  It probably isn't for me.  I'm still
not saying it won't be a problem for every org-mode user.  You need to
think about possible problems from the user perspective.

>> 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.

Please have a look at Nicolas' code first before making such statements.
I haven't seen ragel output, especially not in ELisp and I don't know
how easy it will be to debug parse errors.  The other thing to keep in
mind is that org-mode doesn't have a formal syntax description, much
less one that follows one of the standard grammars.  This will be a much
bigger fish to fry then 

>> 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?

Fundamentally?  By induction.

>> 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.

I haven't checked.  But all this happens in machine code, not ELisp, so
it is not clear on whether a re-implementation of the regex engine, even
if it is vastly superior to the one Emacs uses now would be a net win.

> Also the underlying FSM implementation uses NFA which can lead to a
> exponential complexity in time [1] for certain patterns.

That trait is shared by all regex engines that allow backreferences.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

  reply	other threads:[~2012-03-28  6:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 13:43 GSoC 2012 -- Elisp backend for Ragel Rustom Mody
2012-03-23 11:12 ` Aurélien Aptel
2012-03-23 11:36   ` Rustom Mody
     [not found]     ` <CAJ+TeoebkVTLs9nrDTH_6xvzvkk1vTEZDL2iHmEAkTUfZRjpjQ@mail.gmail.com>
     [not found]       ` <CAJ+TeoebkVTLs9nrDTH_6xvzvkk1vTEZDL2iHmEAkTUfZRjpjQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-25  4:17         ` Rustom Mody
2012-03-25  6:55           ` Rustom Mody
2012-03-25 10:06           ` Aurélien Aptel
2012-03-25 11:40             ` Nicolas Goaziou
2012-03-25 12:52               ` Martyn Jago
2012-03-27 20:34                 ` Aurélien Aptel
2012-03-27 21:22                   ` Achim Gratz
2012-03-27 22:11                     ` Aurélien Aptel
2012-03-28  6:34                       ` Achim Gratz [this message]
2012-03-29 17:50                         ` Aurélien Aptel
2012-03-29 17:52                           ` Samuel Wales
2012-03-29 19:04                           ` Achim Gratz
     [not found]               ` <87vclsykl6.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-03-27 20:03                 ` Aurélien Aptel
2012-03-26 16:01             ` Bastien
     [not found]               ` <87wr674aii.fsf-mXXj517/zsQ@public.gmane.org>
2012-03-27 20:49                 ` Aurélien Aptel
2012-03-27 22:10                   ` Bastien
2012-03-26 15:53     ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2012-03-21 18:51 Aurélien Aptel
2012-03-21 19:32 ` Aurélien Aptel
2012-03-21 19:34 ` Samuel Wales
2012-03-22 12:22 ` Thorsten
2012-03-24  8:16 ` Nicolas Goaziou
2012-03-26 16:03 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bonhkzcs.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).