Because working on the OCaml AST is super simple, and Fez is based on F#, which is lacking First Class Modules, which is the big big thing of OCaml.
And entirely lacking things like First Class Modules and Functors among a few other things. ^.^;
Yes, same thing. js_of_ocaml build from the bytecode layer, which is fantastic for writing out bytearrays of memory code, but pretty horrible for making anything even remotely readable (and sending to the BEAM would not work well for that low level code).
Eh it’s low maintenance this way while being readable, OCaml’s AST is super easy to work with, there is just soooo much of it. ^.^;
Which means you add support for these two features and you are done.
The alternative is starting from zero.
Anyway what happens, this implementation will always work, since OCaml wont change its syntax, while it apparently removes used APIs out of the dark.
It might be that working on the OCaml AST is super easy, adoption something that is nearly done and also not horrible to work with, might be more reasonable.
That’s why a modified lambda representation would be useful. The catch is that lambda doesn’t uncurry your functions, and because you don’t have access to the types anymore ir becomes harder to do it yourself…
Functors != First Class Modules; First Class Modules make Functors significantly more powerful (this is the main difference between OCaml and SML, and is not a feature F# had at least as of a year ago) and First Class Modules work wonderfully well on the BEAM (unlike .NET).
I think it’s pretty much decided that we should fork the OCaml compiler, Bucklescript-style. So I think you should do it, release something that works even if partially and then people like me an collaborate.
Oh no, that part is fine, what I was using was becoming a compiler plugin. A plugin loads me ‘into’ the stock compiler so I can output both elixir, and even generate native code too (like making a standalone beam ‘node’ for example later on would have been a long-term plan). A compiler driver loads the compiler library and does what it needs to manually, but it doesn’t work as a drop-in compiler replacement either, it’s a “new program”.
Yep, a compiler driver is just a standalone program that uses compiler-lib to call the compiler interfaces directly. Not too hard, just more API’s to learn that I’ve not touched yet.
Could you publish something then? Even if it’s your horrible single file so that I can take a look. I wouldn’t know how to start from scratch, but I can help you refactor your file, implement parts you haven’t implemented yet, etc.
It will basically need to be rewritten from scratch, a plugin is more concerned with transforming the AST, a compiler driver will instead consume the AST entirely, which will make some things easier for sure. ^.^
Yes, but re-implementing that with all necessary type checking is not a small task, and something compiler-lib already has in OCaml, which saves a substantial amount of work be re-using code that is already very well tested, featureful, stable, and well written.