ParserCombinator.jl icon indicating copy to clipboard operation
ParserCombinator.jl copied to clipboard

(Long-term) integration with Flow.jl?

Open TotalVerb opened this issue 9 years ago • 1 comments

I had a thought. Mike Innes's Flow.jl is looking promising: https://github.com/MikeInnes/Flow.jl. The package seems general enough to deal with any kind of Julia code, which is far more powerful than alternatives like TensorFlow.

Something that sort of bugs me when using ParserCombinator as a CFG-parser is the syntax. I sort of dislike writing, and even more dislike reading,

x = Delayed()
y = Star(x)
x.matcher = Seq(e"(", y, e")")

or similar. It would be cool if that could be written

matcher(@flow function()
    x = Seq(e"(", Star(x), e"))
end)

letting Flow.jl figure out what the graph looks like. What are your thoughts? I'd be happy to work on a prototype when/if I get the time.

TotalVerb avatar Aug 03 '16 00:08 TotalVerb

sure, if you can get it to work without changing things too much (don't want to break what people already have).

although your example isn't exactly fair. you should be comparing

x = Delayed()
x.matcher = Seq(e"(", Star(x), e")")

and

matcher(@flow function()
    x = Seq(e"(", Star(x), e")")
end)

(if there was a reason for the separate Star(x) then it looks like a bug)

(sorry for not replying sooner)

andrewcooke avatar Aug 15 '16 20:08 andrewcooke