5 ms·
This is a very nice wiki. I am implementing an ML dialect myself, and studying the implementation of MLkit, MosML, and Mlton has been very enlightening. I work
by Athas 9y ago
This is a very nice wiki. I am implementing an ML dialect myself, and studying the implementation of MLkit, MosML, and Mlton has been very enlightening. I work with the maintainers of the former two, but my compiler has ended up being more like Mlton in its design.
- rwmj 9y agoSo am I! What parser are you using? I'm using a recursive descent (ie hand written) parser and it has some troubles parsing ML completely.
- Athas 9y agoI am using Happy, which is a yacc-alike for Haskell. I found it mostly straightforward (however, I use the OCaml/Haskell/F# style of lexically distinguishing infix operators from variable names).
- user2994cb 9y agoJust out of interest (I worked on a table-driven parser for SML a couple of decades ago) - what bits of ML syntax is giving you trouble? I remember one bit that (theoretically) needed unbounded lookahead, and user-defined infix operators were fun.
- rwmj 9y agoThere's a difficult problem with precedence and unary operators. For example: set_field !list_end 1 cons cannot be parsed. Anyway since then I rewrote the lexer to work like the sibling comment and I'm still getting that working.