Hacker News new | ask | show | jobs
by Ericson2314 3491 days ago
This seems well done, the sort of design I'm pushing for Rust and Haskell.

The money question is: does it work with cross compiling? This is a proper phased design so it should, but that doesn't mean it doesn't.

1 comments

Well what macros only ever do is generate OCaml ASTs, so the should work whatever the compilation target is.
Things like the ^ quoting get more complex. You need to quite the target's version of the module.
Oh I see what you mean. For now, we have made the choice to compile static code to OCaml bytecode, whatever the compilation target is. While this enables the use of macros regardless of the target (e.g. it works in `ocamlopt`, the native compiler), it does make it necessary to compile a module to bytecode if you want to lift it. It's not a big deal with an adapted build system, but a distant future we might support native compilation of macros on some architectures.