Posts

Showing posts with the label visual studio integration

Problems with fslex and fsyacc

Back in 2004, we wrote a mini Mathematica implementation in OCaml in only four days. For fun, we decided to port this OCaml program to F#. Incredibly, porting just the lexer and parser from OCaml to F# has taken longer than it took us to write the entire original OCaml code! The reason is simply that OCaml has an incredibly powerful and mature suite of compiler tools for generating lexers and parsers whereas F# does not. Given that our original OCaml lexer and parser for Mathematica source code were written using ocamllex and ocamlyacc , it seemed obvious to translate the code into fslex and fsyacc . However, there are some serious problems with the F# versions of these tools: Incomplete : the F# tools were only ever intended for the F# compiler itself and not for wider use. Consequently, features are missing, e.g. in the regular expression implementation in  fslex . Unintegrated : there are Visual Studio support for these tools and, consequently, development is cumbersome compar...