Re:TypeScript Is Surprisingly OK for Compilers
by retrac on Friday August 18, 2023 @11:59AM
(#37177534)
Some crude snippets from a Pascal-C (I never could decide) self-educational compiler/toy I wrote a while ago (in Haskell):
Parser combinators (parser functions that take other parser functions and return more complex combined parser functions) with enough syntactic sugar can express BNF-like grammars directly as code. And ML-style list and pattern matching operations are very expressive for operating on the intermediate representation.
[ Parent
| on HN ]
There are no comments on this comment yet.