frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I built a small browser engine from scratch in C++

https://github.com/beginner-jhj/mini_browser
83•crediblejhj•5h ago
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!

GitHub: https://github.com/beginner-jhj/mini_browser

Comments

xacky•1h ago
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.
skybrian•47m ago
I think this is cool as long as you don't use it to do your banking, and it needs to be running in a VM or on a Raspberry Pi or something. The Internet is dangerous. Something something don't write your own crypto.

Also, there's a big difference between running a handmade browser that I wrote and trusting one that some stranger wrote. I guess I'm going to have to try writing my own someday :-)

noo_u•1h ago
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!
rustyhancock•1h ago
The real full stack engineering
ge96•1h ago
But did they make their own CPU?
aruametello•51m ago
... did they mine their own minerals?

this could go into a sagan's "If you wish to make an apple pie from scratch, you must first invent the universe."

zabzonk•1h ago
In my experience, not a good idea to write both the client and the server for a given protocol which use each other. Far too easy to misunderstand the protocol. I remember doing this for a training course I wrote for OLE (later COM) years ago. The client and the server worked perfectly together, just not with correctly implemented OLE clients and servers.
luskira•1h ago
this is so cool man congrats!
lifetimerubyist•1h ago
Cursor is a 30 billion dollar corporation that couldn’t do this with practically unlimited compute for their AI.

Well done.

lasgawe•1h ago
This is one of the hardest projects of its kind. Congrats! looks cool.
samiv•1h ago
Since when does homework feature on the front page of HN? I find this very odd...
antirez•1h ago
Probably more complex project than projects 99% of what software developers with a real job do daily.
ikamm•1h ago
Nowhere in the post does OP say this is a homework assignment. All they said was that they are a high school senior.
dag11•1h ago
What high school CS class (or even college class) is assigning a project to implement a minimal web renderer?

This is super impressive.

lotusw0w•33m ago
Name one college/university program with homework as impressive as this. This is a serious request
grougnax•53m ago
This might be the hardest thing ever in computer science, kudos!
solusipse•14m ago
lol
pipeline_peak•44m ago
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•24m ago
How much was coded with an LLM and how much do you understand?
forgotpwd16•6m ago
[delayed]
vintagedave•24m ago
> 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.

olliem36•23m ago
Did you use GPT 5.2 Codex? lol
butz•19m ago
Good job! You should consider contributing to a similar small browser - Dillo @ https://dillo-browser.org/ , and help to build a complete tiny browser.
robshippr•10m ago
Incredible job here. Really took a lot of work to get this done. Keep it up.