[ragel-users] porting to python

Rustom Mody rustompmody at gmail.com
Mon Oct 12 16:03:00 UTC 2009


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
>




More information about the ragel-users mailing list