Rust: The New LLVM
Counterpoints as someone considering writing a language that targets LLVM, and as someone who has used Rust a bunch:- Your compile times will be a lot slower than they would otherwise be. This is a big one for me.- If your type system is materially different than Rust's, you don't gain any benefits since you have to write your own type checker anyways.- LLVM is designed to be easy to machine generate, including having a library API for generating code. Rust doesn't yet.- You can't necessarily re-use Cargo if your language requires type info to link that wouldn't be in the Rust source files generated.- If you have semantic differences in memory model you'll need to give up the advantage of Rust's safety by having your code generate unsafe pointers, for example if you want to have shared mutability in a single-threaded context, which Rust doesn't handle nicely.- If you do re-use Rust's type checker the error messages you get out will be terrible and point into generated Rust code.- Debug info and debugging get even harder.- If you want Rust interoperability you have to replicate Rust's enormous type system in your language's FFI, which is hard if you also have your own type checker, see above.Basically it is a good idea, if your language has semantics and type system very close to Rust.A much better idea IMO is to target LLVM and then write an LLVM plugin that can link to Golang object files and generate Golang struct metadata. Golang's FFI and type system are much much simpler and more likely to be able to graft onto new languages. Also Go's library ecosystem is larger.