[rust-dev] Is there a Parsec equivalent in Rust?

2014-06-11 Thread Akira Hayakawa
Hi, Haskell's Parsec is really a good tool to parse languages. Scala also has the equivalent. What about Rust? -- Akira Hayakawa ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-12 Thread Meredith L. Patterson
I have been meaning to write Rust bindings for Hammer ( https://github.com/UpstandingHackers/hammer), my C parser-combinator library which is loosely inspired by Parsec and gratuitously rips off Scala's packrat parser implementation. There is an issue open for it ( https://github.com/UpstandingHack

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-12 Thread Ian Daniher
Might be worth checking out https://github.com/kevinmehall/rust-peg. On Wed, Jun 11, 2014 at 2:43 AM, Akira Hayakawa wrote: > Hi, > > Haskell's Parsec is really a good tool to parse languages. > Scala also has the equivalent. > > What about Rust? > > -- > Akira Hayakawa > _

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-12 Thread Rick Richardson
I am by no means a SWIG expert. But would it be possible to work around the missing discriminated union functionality by supplying a typemap and using that to generate a set of Enums? That would would likely result in a more Rust-ish interface as well. On Thu, Jun 12, 2014 at 8:50 AM, Ian Danihe

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-12 Thread richo
On 11/06/14 15:43 +0900, Akira Hayakawa wrote: Hi, Haskell's Parsec is really a good tool to parse languages. Scala also has the equivalent. What about Rust? Largely offtopic, but I've spent the last few days thinking seriously about working on a ragel backend for rust, which while orthagona

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-12 Thread Corey Richardson
We have a ragel backend. https://github.com/erickt/ragel On Thu, Jun 12, 2014 at 3:28 PM, richo wrote: > On 11/06/14 15:43 +0900, Akira Hayakawa wrote: >> >> Hi, >> >> Haskell's Parsec is really a good tool to parse languages. >> Scala also has the equivalent. >> >> What about Rust? >> > > Largel

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-12 Thread richo
On 12/06/14 15:31 -0700, Corey Richardson wrote: We have a ragel backend. https://github.com/erickt/ragel Ask and ye shall receive. Amazing! \o/ ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-12 Thread Steve Klabnik
It's not possible to directly write a Parsec port because we don't have HKT and therefore monads. Ragel is probably the best bet for now. ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Is there a Parsec equivalent in Rust?

2014-06-13 Thread Meredith L. Patterson
That seems a bit excessive. C doesn't have higher-kinded types or monads either, *and* it's strict, but we cloned Parsec effectively enough. Neither parser combinators nor PEG/packrat *require* monads, or even lazy evaluation for that matter; they're just easier to implement that way. You can even