lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Just an idea: ragel backend in lightning


From: Reini Urban
Subject: Re: [Lightning] Just an idea: ragel backend in lightning
Date: Mon, 10 Mar 2014 16:30:31 -0500

On Mon, Mar 10, 2014 at 3:50 PM, Bruno Loff <address@hidden> wrote:
> I think this would be pretty interesting. Take the library RAGEL:
>
> http://www.complang.org/ragel/
>
> which basically takes a regular expression and outputs the finite-state
> automaton that recognizes it.

Ian Piumarta's peg or why's greg is even better than ragel for this.
https://github.com/nddrylliog/greg

> This FSA can then be converted to a C program, or C# or etc RAGEL has
> several backends.

> It would be awesome and actually quite natural if one were to use lightning
> as a backend. Then the regular expression gets converted directly into
> machine code, at runtime! If well done the efficiency should be unbeatable.
> It seems that .net has something like this, but I'm not sure how well-done
> it is. (e.g. not clear whether it compiles to machine code or virtual
> machine code, would need to read more about it).
>
> I may implement this someday, someone definitely should :-)

This is idea is so good Ian Piumarta (again) already did it.
See maru http://piumarta.com/software/maru/
which is an even simplier parser, which directly emit's assembly,
without any parser generator or jit library in between. This most complicated
part is the parser anyway.

With a library like lightning you can support more architectures, but you
usually write another grammar for a new architecture.
-- 
Reini Urban
http://cpanel.net/   http://www.perl-compiler.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]