6 ms·
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 resul
by a_lost_needle 5y ago
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.
- SavantIdiot 5y agoAh, 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.
- a_lost_needle 5y agoYea, 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.
- SavantIdiot 5y agoNever 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.
- a_lost_needle 5y agoYou 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).
- SavantIdiot 5y agoLike 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_lost_needle 5y agoA 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.