Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
tao
A statically-typed functional language with generics, typeclasses, sum types, pattern-matching, first-class functions, currying, algebraic effects, associated types, good diagnostics, etc. (by zesterer)
I have some thoughts about this: https://github.com/zesterer/chumsky/issues/20#issuecomment-9...
TL;DR: The best approach, in my view, is to detect whitespace in the lexer and emit fake delimiter tokens for the parser so that the parser-level syntax is still context-free.
Unfortunately, I haven't found a ton of "easily-digestible" and, at the same time, comprehensive guides on compiling functional languages. Generally you'll find a mix of blog posts/class notes/papers covering a single step.
Some resources I like:
- Andrew Kennedy's 2007 paper Compiling with Continuations, Continued [1]. This one is the most clear IMO
- Andrew Appel's Compiling with Continuations book (a bit outdated though... assembly code is for VAX)
- Matt Might's series [2]
- MLton's source and documentation [3]
[1] https://www.microsoft.com/en-us/research/wp-content/uploads/...
[2] https://matt.might.net/articles/closure-conversion/
[3] http://mlton.org/
I've been developing both throughout the development of Tao, my own hobby language. It's since developed quite an extensive syntax (see here for an example: https://github.com/zesterer/tao/blob/master/examples/99.tao), so you can count it as evidence that chumsky scales to complex grammars: https://github.com/zesterer/tao