[ragel] Ragel for Golang
Adrian Thurston
thurston at colm.net
Sat Jul 1 03:30:26 UTC 2017
Hi,
So the state of golang code production is a little complicated ....
In ragel version 6 there is support. This was coded into the binary and
is implemented by cloning and specializing all the code generators. All
the other languages are supported this way.
While cloning worked, it resulted in an unmaintainable mess over time.
Adding features to the code generator required updating the codegens for
all the supported langs, some of which suffered bitrot. It became a huge
pain.
So for ragel 7 I started working on a new translation framework that
would make it easier for adding other languages. I succeeded in the
backend, but still had clone issues in the frontend parser (distinct
lexers are required for each language). I ended up stopping this effort
because I couln't see a straightforward path with the frontends and
didn't want to be in the same position as with ragel 6. Also, I
personally don't use any host langs other than C and ASM so I had a hard
time justifying additional effort.
Enter some new recent insights and I can actually see a path towards
out-of-tree host lang support in the frontend as well as backend. I'm
currently exploring that route. If successful (expected) I will add the
support necessary for other people to maintain their own host languages.
So in the meantime you can use ragel 6 and wait for ragel 7 out-of-tree
host language support. I'll probably provide a few examples, one of
which likely will be golang.
-Adrian
On 2017-06-29 15:42, Krish I wrote:
> Hi!
>
> I am fascinated with state machines and I recently found out about Ragel.
> I would also like to revise my compiler knowledge from school.
>
> As I am currently learning Golang, can I add support for Golang in Ragel, if one does not exist already?
>
> Also, I would love to have a pure-go implementation rather than a C-binding and would like to know if that is possible.
>
> This will be a personal hobby projects and I can dedicate 2 hours 4 to 5 days a week if that is possible. I am also alright with MIT license, if that makes any difference.
>
> Best,
> Krish
>
> _______________________________________________
> ragel mailing list
> ragel at colm.net
> http://www.colm.net/cgi-bin/mailman/listinfo/ragel [1]
Links:
------
[1] http://www.colm.net/cgi-bin/mailman/listinfo/ragel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20170630/c21d1b25/attachment-0002.html>
More information about the ragel-users
mailing list