Live data from Hacker News

A Parser Combinator library for C

github.com

1–10 of 29 posts

Re: A Parser Combinator library for C

#3
post #2

This is being used from another thing posted here about making your own lisp: http://www.buildyourownlisp.com/ Pretty nice and simple. I'm on Chapter 8 of 16.

I think both the library and the book are written by the same author [1].

[1] http://theorangeduck.com/page/you-could-have-invented-parser...

Re: A Parser Combinator library for C

#7
post #6

What's the difference between this and flex/yacc?

From the readme, a workflow that doesn't make you want to kill yourself.

Also no generated code that requires extra build steps and instantly breaks platform compatibility. That said, inline grammar definition might not be for everyone.

Re: A Parser Combinator library for C

#8
post #6

What's the difference between this and flex/yacc?

From the readme, a workflow that doesn't make you want to kill yourself. Also no generated code that requires extra build steps and instantly breaks platform compatibility. That said, inline grammar definition might not be for everyone.

Hmm. So for people who don't know how to use Unix/flex/yacc?

This is just reinventing an existing wheel.

Re: A Parser Combinator library for C

#9

Earlier quoted context omitted.

From the readme, a workflow that doesn't make you want to kill yourself. Also no generated code that requires extra build steps and instantly breaks platform compatibility. That said, inline grammar definition might not be for everyone.

Hmm. So for people who don't know how to use Unix/flex/yacc? This is just reinventing an existing wheel.

I dunno that that's a fair criticism... by that same argument you could say yacc/bison is for people who don't know how to use C to write a parser. This looks like an attempt to do something along the lines of Parsec from Haskell, but in C.

Edit, because it looks like we hit the max reply depth: It's not like this is ever going to seriously replace Bison, I think it's just someone trying a different approach. It's not like flex/yacc/bison are the absolutely most perfect lexer/parser that can possibly exist. If people didn't try and reinvent the wheel every now and then, we'd still have stone wheels.

Re: A Parser Combinator library for C

#10
post #9

Earlier quoted context omitted.

Hmm. So for people who don't know how to use Unix/flex/yacc? This is just reinventing an existing wheel.

I dunno that that's a fair criticism... by that same argument you could say yacc/bison is for people who don't know how to use C to write a parser. This looks like an attempt to do something along the lines of Parsec from Haskell, but in C. Edit, because it looks like we hit the max reply depth: It's not like this is ever going to seriously replace Bison, I think it's just someone trying a different approach. It's no…

But doing this in C already exists and works well. I don't understand the point of it. Although, in this day and age, rather than use the standard Unix toolset, people invent their own tools as if they are new. "Make" versus "npm" for example.
Post reply on HN