4 ms·
Yeah that’s interesting. Flow uses OCaml, ditto for their Python type checker. Hack is C++, and Relay uses Rust. (Although I think some of the other type checke
by emptysea 4y ago
Yeah that’s interesting. Flow uses OCaml, ditto for their Python type checker. Hack is C++, and Relay uses Rust. (Although I think some of the other type checkers are migrating from OCaml to Rust).
Curious about the perf implications with using a JVM language for a compiler vs native.
- throwawaymaths 4y agoForget about perf. Who wants to import a separate stack to get a sidecar tool. Separately, if you're an elixir user this would mean you can't easily hook it into say compiler callbacks (though if I'm reading this code directly it reads Erlang ast -- I tried doing a typechecker for elixir ast, and decided that reading bytecode was a better choice since it's simpler)
- throwaway81523 4y agoStarting with bytecode seems harder because you no longer know what the expression terms are. So they are harder (impossible?) to typecheck.
- throwawaymaths 4y agoYou type the registers as data flows through them. It's easier, trust me. Both Erlang and especially elixir puts a whole lot of sugar on top of the low level instructions which can make reasoning about data structures harder. And as a bonus it works with all beam languages.
- throwaway81523 4y agoHmm ok, I'll take your word for it. There is another issue too though, which is that the BEAM itself is being replaced with a native-code VM. I don't know if the compiler for that starts with bytecode.
- throwawaymaths 4y agoI think you're confused. Not architecture (x86, arm) bytecode, BEAM bytecode. Erlang compiles down to An intermediate bytecode like java does.