| ▲ | Show HN: I built a small browser engine from scratch in C++(github.com) | ||||||||||||||||||||||||||||||||||||||||
| 102 points by crediblejhj 6 hours ago | 28 comments | |||||||||||||||||||||||||||||||||||||||||
Hi HN! Korean high school senior here, about to start CS in college. I built a browser engine from scratch in C++ to understand how browsers work. First time using C++, 8 weeks of development, lots of debugging—but it works! Features: - HTML parsing with error correction - CSS cascade and inheritance - Block/inline layout engine - Async image loading + caching - Link navigation + history Hardest parts: - String parsing(html, css) - Rendering - Image Caching & Layout Reflowing What I learned (beyond code): - Systematic debugging is crucial - Ship with known bugs rather than chase perfection - The Power of "Why?" ~3,000 lines of C++17/Qt6. Would love feedback on code architecture and C++ best practices! | |||||||||||||||||||||||||||||||||||||||||
| ▲ | userbinator 9 minutes ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||
Interesting to see everyone seemingly writing their own browser lately. Ironic to think that AI assistance, from Google itself, might be what ends up breaking their browser monopoly. (Speaking as someone who also started writing my own long ago, and it's far from complete.) | |||||||||||||||||||||||||||||||||||||||||
| ▲ | vintagedave an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
> I had to implement recursion, which I wasn't familiar with. The amount of learning this person has done is incredible. Kudos. I also appreciated seeing they used AI and tutorials yet fixed bugs themselves, as a way to demonstrate they understood I the code. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | robshippr an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
Incredible job here. Really took a lot of work to get this done. Keep it up. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | grougnax 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
This might be the hardest thing ever in computer science, kudos! | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | butz an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
Good job! You should consider contributing to a similar small browser - Dillo @ https://dillo-browser.org/ , and help to build a complete tiny browser. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | noo_u 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
This is a really awesome project! If you have time/interest, you could try to build a simple http server now, that your browser could communicate with. Then you could try to implement a simple version of TCP/IP, and look into how lower level networking works. Great job! | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | xacky 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
I follow a lot of the alternate browser engines and am always looking for new ones outside of the big three. You should use your experience to get a career in the browser tech world as we are dangerously close to the Chromium only web. | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | lasgawe 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
This is one of the hardest projects of its kind. Congrats! looks cool. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | lifetimerubyist 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
Cursor is a 30 billion dollar corporation that couldn’t do this with practically unlimited compute for their AI. Well done. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | samiv 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
Since when does homework feature on the front page of HN? I find this very odd... | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | pipeline_peak an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
We need more projects like this. People making all sorts of libraries for HTML/CSS parsers, render trees, layout models etc. I don’t want to see a world where everything runs on top of Chromium and we all just unwittingly submit to it. | |||||||||||||||||||||||||||||||||||||||||
| ▲ | quentindanjou an hour ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
How much was coded with an LLM and how much do you understand? | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
| ▲ | luskira 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||
this is so cool man congrats! | |||||||||||||||||||||||||||||||||||||||||
| ▲ | olliem36 an hour ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||
Did you use GPT 5.2 Codex? lol | |||||||||||||||||||||||||||||||||||||||||