Hello,
I spend a few hours this morning on the go-marpa code. The result is a new interface for writing evaluators/semantics:
https://gist.github.com/pstuifzand/5598110. Let me first explain the problem with the first attempt.
The first attempt followed Thin and R2 interfaces of Marpa::R2 mostly. This interface works pretty well for dynamic languages. The way I used that interface in Go made that the user of the library had to do a lot of casting in the actions, because the values on the internal stack where also of the "interface{}" type.
The new code allows the user to write code that manages the stack himself. This makes the code harder to write, but, the code can be written with fewer casts, because the stack can be a more specific type.
In the code in the gist I show an example of how this can be used. The code is a simple adder that parses additions of integers. The `StepRule` method contains a `switch` statement that switches on the rules that the Grammar created for us. This Go feature allows us to have variable cases.
This interface is now more low level. The code in the gist is the code you would have to write to use this interface.