Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Still easily implemented with combinators the whole way down. It’s building an ast, that’s it. Once you have a tree, you can do whatever you want with the result before passing it to a compiler for a language. Here though, just serialization stuff.


Ah, I see. I can't reply to that thread anymore, but it sounds like a combinator is like a first-class YACC grammar in the functional language that obviates the need to write the parser. That's really cool, thanks. I'll read up on it more.


Yea, that’s pretty accurate. So now I’m curious what you thought the site was named after?

Edit: It’s not that accurate. It’s just math used in a way to compose parsers using parsers.


Never gave it a moment's thought. Now after Googling it, I still wouldn't know because I don't program LISP (well I haven't since 1986, but that was only an intro in college). Interesting to read about it.


You can use most of the concepts in any language that allows first class functions, closures, pattern matching and types. Combinators are just ways to compose a function to create a new function that executes some aspect upon a set (usually).


Like grandma used to say: "There's nothing combinators can't solve. Except consumption. Rest in peace Grandpa Neddie."

I'm dense: what's a combinator?


A functional programming technique that allow you to declaratively define your language when using parsers as values. If you have a good functional language implementation, the code look very similar to someone able to read BNF. And then you run it, and get out an AST the back end.

edit: Forgot partial application. Not strictly required, but super handy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: