I love compiler dev, so i can give you a few tips:
It may be hard to compile to rust, due to the borrow checker; but C or javascript are great first backends, i always go with C for my prototypes.
PS: Don’t go with LLVM early on, it has almost no documentation! it’s not worth it, i learned that the hard way.
Even zig replaced their LLVM backend with a C one.
I intend for the language to have a similar borrow checker and type system. Which is why I’m targeting rust. It means I have something to check against when writing the tooling. (Although I’m not sure I’ll get that far. My computer is littered with dead projects).
That’s pretty cool, was this a practice for actual compiler development? Or for fun, or an actual project?
I’m intending to use this for a custom language “OA” that I want to compile to Rust and JS to start with.
I don’t know enough about LLVM to compile directly to machine code although I would like to.
I love compiler dev, so i can give you a few tips:
It may be hard to compile to rust, due to the borrow checker; but C or javascript are great first backends, i always go with C for my prototypes.
PS: Don’t go with LLVM early on, it has almost no documentation! it’s not worth it, i learned that the hard way. Even zig replaced their LLVM backend with a C one.
Also some good libraries for rust:
Here’s a great list of libraries that can help with building it: https://github.com/Kixiron/rust-langdev
Good luck with OA :)
Thanks!
I intend for the language to have a similar borrow checker and type system. Which is why I’m targeting rust. It means I have something to check against when writing the tooling. (Although I’m not sure I’ll get that far. My computer is littered with dead projects).