yes we do. while we're bootstrapping with python, we're going to be translating into Rust and long term we're thinking Rust will become the bootstrap. e.g., the python version will go away, we'll have two copies of the code in the codebase: the Rust version and the oh-lang version, side by side. if you already have oh installed, you can compile the oh code (self-hosting); but if you don't, you can use Rust to bootstrap with the code that oh generated in Rust. (this took me a while to get my head around.)
even though Rust syntax makes us pull our hair out every once in a while, we're still going to go with it for these reasons:
even though Rust syntax makes us pull our hair out every once in a while, we're still going to go with it for these reasons:
- native machine code generation, so it should be fast
- very compatible RAII semantics with oh-lang, no need to
deferclean up like we might in Zig. - very compatible error handling with oh-lang, which also wants to return errors, not throw them. Zig also returns errors but is limited to error codes.
- no need for Makefiles or cmake,
cargowill compile/link as needed - fairly mainstream, limited-to-no breaking changes expected
- Rust will compile error for innocuous things like adding a semicolon after a function, when this could have been a warning
- so many syntax inconsistencies, like using
||to capture lambda function arguments or requiring::instead of.to access static class functions/variables, and needing to add::before generic arguments and sometimes after. - Rust types are not supported as first class citizens (inherent associated types!!)
- Rust is not super compatible with the comptime logic oh-lang has, which is more similar to Zig.

Comments
Post a Comment