1 karma · joined Oct 13, 2017 (9y ago) · 1 submissions
comment 7y ago · link · parent
I used Ocaml to write the a (simple) custom compiler framework, which gave me the benefits of better type safety than Typescript.
Typescript was used with Angular to create everything else (the custom-bytecode interpreter and user-interface. Typescript gives me the advantage of good interop with Javascript libraries, mainly CodeMirror for the editor.
The interop with Ocaml and Typescript was pretty good. I just exported the Ocaml as a Javascript module using Js-of-ocaml with one exported function that starts off the compilation. Then it returns a list of a custom instruction object, which acts as a 5-tuple with all of the instruction fields.