[ragel-users] porting to python

Adrian Thurston adrian.thurston at esentire.com
Tue Oct 13 20:22:33 UTC 2009

The -F0 code style would probably be easier, but it doesn't cover all 
ragel programs, whereas -T0 will always work. The flat tables are a 
problem when working with long-sized input.

I forgot about the offside rules in python ... they will definitely 
cause extra work, but it won't be fatal (unless you consider tedium to 
be fatal). Some of the code respects formatting rules for the sake of 
those who choose to read the output, but not all the details are looked 


Rustom Mody wrote:
> just downloaded the ragel sources and started looking around.
> Not yet found my way too much but here are a few initial questions.
> Is T0 the easiest or F0?
> Also Python has a very specific problem: it does not use a definite
> block constructor marker like {} in C(like) languages but uses
> indentation instead.
> The small problem is that this means that we may have to add indents
> to a piece of code to nest it correctly.
> The bigger problem is that we need to know how much indent to add.
> By contrast in a normal block structured language, when we want to
> generate code inside say an while, we generate the head of the while
> (while and condition) emit the '{' emit the code and finally a closing
> '}'
> Here by contrast we need to know the entire stack of indents, add 1 to
> it, and right-shift the code that much.
> Does this seem doable?
> On Sat, Oct 10, 2009 at 5:42 AM, Adrian Thurston <thurston at complang.org> wrote:
>> Maybe a couple of days of work. It would depend on how many of Ragel's code
>> styles you would like to support. If you wanted to do just -T0 that could be
>> half a day maybe. I might be biased though, since I arguably know ragel the
>> best.
>> Try emailing the people that helped out with the code generators.
>> $ head *codegen.{h,cpp} | sort | uniq | grep '@'
>> Also track down Daniel Tang http://saiyr.blogspot.com/
>> -Adrian
>> Rustom Mody wrote:
>>> Hello.
>>> What do you think would be the scale of work in porting ragel to
>>> python? (ie adding python generation)
>>> Thanks,
>>> Rustom
>>> PS Please CC me in addition to the list
>>> _______________________________________________
>>> ragel-users mailing list
>>> ragel-users at complang.org
>>> http://www.complang.org/mailman/listinfo/ragel-users
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users

More information about the ragel-users mailing list