Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would a practical approach be parsing the source into clang's AST format. Then let it make the actual executable.
 help



You'd more likely want to emit LLVM IR rather than try to match clang's internal AST. That's essentially what most new language projects do now (Rust, Swift, Zig all use LLVM as their backend). You get optimization passes and codegen for multiple architectures for free, and the IR is well-documented. The tradeoff is you skip learning about the backend, which is arguably the most interesting part.

Right that's what I meant ... the .ll file. Thanks



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: