Saturday, February 7, 2026
Show HN: A toy compiler I built in high school (runs in browser) https://ift.tt/3HWt2kE
Show HN: A toy compiler I built in high school (runs in browser) Hey HN, Indian high schooler here, currently prepping for JEE, thought itd be nice to share here. Three years ago in 9th/10th grade I got a knack for coding, I taught myself and made a custom compiler with LLVM to try to learn C++. So I spent a lot of time learning LLVM from the docs and also C++. It's not some marvelous piece of engineering, I designed the syntax to be a mix of C and what I wished C looked like back in 9th grade. It has: - Basic types like bool, int, double, float, char etc. with type casting - Variables, Arrays, Assign operators & Shorthands - Conditionals (if/else-if/else), Operators (and/or), arithmetics (parenthesis etc) - Arrays and indexing stuff - C style Loops (for/while) and break/continue - Structs and dot accessing - extern C interop with the "extern" keyword Some challenges I faced: - Emscripten and WASM, as I also had to make it run on my demo website - Learning typescript and all for the website (lol) - Custom parser with basic error reporting and Semantic analysis was a PITA for my undeveloped brain (I was 15) - Learning LLVM from the docs Important Learnings: - Testing is a very important aspect of making software, I skipped it - big regret - Learning how computers interpret text - Programming in general was a new tour for me - I appreciate unique_ptrs and ownership Github: https://ift.tt/U6kByN9 Its on my github and there's a link to my web demo ( https://vire-lang.web.app/ ), it might take some time to load the binary from firebase. Very monolithic, ~7500 lines of code, I’d really appreciate any feedback, criticism, or pointers on how I could’ve done this better. https://vire-lang.web.app February 7, 2026 at 10:49PM
Subscribe to:
Post Comments (Atom)
Show HN: A luma dependent chroma compression algorithm (image compression) https://ift.tt/gft0OKb
Show HN: A luma dependent chroma compression algorithm (image compression) https://ift.tt/mY4payZ February 4, 2026 at 04:43PM
-
Show HN: Stickerbox, a kid-safe, AI-powered voice to sticker printer Bob and Arun here, creators of Stickerbox. If AI were built for kids, w...
-
Show HN: An AI logo generator that can also generate SVG logos Hey everyone, I've spent the past 2 weeks building an AI logo generator, ...
-
Show HN: Music player for big local collections with mpd support mpz is a C++/Qt music player focused on UX, with derectory tree and playlis...
No comments:
Post a Comment