I’d update this to Just Use Rust cause now you get the benefit of a decent package ecosystem and most of the benefits of OCaml. There are some messy lifetimes but something like Rowan and a couple arenas solves this.
As for parsing I think treesitter is pretty solid. You get the benefits of a parser generator but also a fast incremental CST parser.
The extra work required to deal with the lifetime of a graph is pretty unfriendly for a beginner. It's one of the few things for which, though I would be willing to use Rust myself, I might not recommend it to someone else.
As for parsing I think treesitter is pretty solid. You get the benefits of a parser generator but also a fast incremental CST parser.