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!
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.
Ah, but what if one your clients needs to use, let us say, Excel...
My mistakes with the training course code would have been fixed if the company would have bought Excel licenses fof our customer workstations.
And I just remembered it was DDE (dynamic data exchange), not OLE. OLE was much better specced than DDE. Like I said, it was way back when. But the basic rule (don't test using both a home-grown client and server) still applies.
Good job! You should consider contributing to a similar small browser - Dillo @ https://dillo-browser.org/ , and help to build a complete tiny browser.
You realise that it's only a toy implementation aimed at learning and not a full implementation.
The parsing of HTML alone is way more complex than your actual implementation not mentioning at lot of things like the rendering or network (outsourced to Qt).
Still a nice achievement that get you to understand why making a browser is a very complex task.
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.
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 :-)
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.)
I think the one that made the biggest news cycle splash this last month was the FastRender experiment https://github.com/wilsonzlin/fastrender from Cursor, but I've also seen some others posted this last month. Simonw's blog seems to be tracking some under the browser-challenge tag https://simonwillison.net/tags/browser-challenge/ such as one-agent-one-browser and HiWave.
This is actually really pretty cool as I was targeting a ~10k loc for golang from the ~20k loc of rust (given how golang has networking binaries and other stuff)
I guess this is really cool. I was always really averse to C++ preferring golang. I think I am ken-thompson pilled for the most part lol.
Anyways its really great to see people my age working in similar ideas. Somehow it gives us I guess a more sense of connection like I am not alone doing these things and I guess its pretty cool feeling seeing others do similar stuff and learning from them!
I have starred your repo and good luck for college too man! Hope to communicate with ya.
Edit: Another comment here as someone here mentioned that you used LLM, which LLM did you end up using and how'd you use it. For me personally, the most (success?) that I found which could generate a hackernews without any styles and anything was via their computer-use agent model (which I am thinking of downloading & working with kimi-cli to add more styling and other stuff as well in golang just out of curiosity)
I don't really mind if you used LLM, but I am curious as to how in this instance.
Hi there! I'm so glad to meet someone my age working on a similar path.
Your project sounds really fascinating as well. To be honest, I wasn't familiar with the concept of "porting" until I looked it up through Gemini just now—it's such an interesting approach! You mentioned that you couldn't quite get it to work despite countless efforts, but I believe that only proves how incredibly difficult and ambitious your attempt was.
During this project, I also faced constant failures and had to compromise on many things because of the sheer complexity. My engine doesn't support JS yet, and only handles a handful of CSS properties—and even those aren't perfect. But as people like us always do, we learn and grow through these failures. I truly hope you’ve gained a lot of growth and insight through your project as well.
About LLMs: I used Claude. The key was using it as a mentor, not a code generator:
-Asked WHY things work, not just HOW
-Got help understanding concepts
-Debugging assistance when stuck
But I designed the architecture and solved problems myself.
Thanks again for the star and your kind words! Let’s keep in touch and keep building.
I used Claude AI as a learning assistant throughout the project.
I had AI help me with:
- Initial layout calculation logic (the layout concept was new to me)
- Catching edge cases in the parser
- Recent refactoring for code quality
But I designed and coded myself:
- The overall rendering pipeline architecture
- CSS parser from scratch
- Debugging
- All architectural decisions
As for understanding - I don't know what understanding exactly is.
But I think it means how familiar you become with a concept. By that definition,
yes, I understand how the rendering pipeline, parsers, layout tree etc work.
First time using C++, so I needed guidance on concepts I'd never seen before.
But the learning, problem-solving, and persistence were mine.
Based on what?
In fact, the commit messages sure make it seem like someone who only knows how to use git to to take snapshots, exactly like when one turns off their brain and vibe codes, and after chatting enough with the chatbot to get their next feature seemingly to work make some sort of "updated bla" commit with no reference to the extremely detailed code change they just made.
You seem to have gotten used to perfect written commit messages by Claude. Many people, especially those starting out with, or not heavily using, git, do write messages like that. (edit: To be honest sometimes I too make temporary "wtf" commits; I just later squash them and no one knows.) That can actually be seen in this very repo by the refactor ones. And, the commits themselves are actually where I'm basing it. Small changes (vibe coders tend to forget a vcs exists; why we see 20k LOC first commits), commented-out code parts (have you ever seen AI commenting out code?), plain code comments (again compare to what refactor commits introduce).
I am not sure on what you are basing this. Even the post itself looks written by an LLM.
I might be wrong, things are always evolving and it is going to be more and more difficult to spot. But I was genuinely asking OP, and I don't have the intention of undermining their achievement! (it stays cool even with use of LLM)
The fact that literally the Creator behind Redis has to go and point this out straight up proves this.
Also Antirez, I am in high school and I can literally write it in writing that there's literally no school with such homework assignments imo. I have written a comment about seeing the curriculum of one of my other friends and my anecdotal evidence talking to friends.
There's literally zero doubt in my mind that there's no such homework assignment.
I am in High school & in my school for some reason CS isn't taught but I still taught one of my friends CS from my tuition you can say.
I looked at his book and wanted to teach him python. You can say its senior high school and what I taught him was what keywords mean in python and operators mean in python etc.
A lot of it was just semantic. Could be the fact that it was first chapter and he came to me when his exam was just some few days later.
I swear but the hardest thing I observed in that book was probably some SQL from what I heard or maybe some minor Java or the fact that it had file access within python or atleast that's what I observed.
The OP's comments are clearly weird and feel like something which should be ignored.
This project is really really cool imo. (Heck I was trying out literally the same thing too but over golang out of curiosity but really didn't land anywhere and the fact that the creator of this was able to still is pretty impressive even if they used LLM or not!, on which I haven't felt any clarification but I just wanted to point how both are really really cool!)
To combine with the "but did he build a cpu" thread, back-in-the-day the term project for MIT 6.004 was "build a CPU with TTL", with a very open-ended "performance race" extra credit project at the end. (At least one of the highest scorers went on build a network performance hardware company and sold it to Broadcom :-)
(If the "build a CPU" part doesn't impress, it was common to build an entire compiler toolchain to go with it; also it was long enough ago that a web browser really was a weekend project :-)
Like EtherNet/IP, where the IP somehow stands for "Industrial Protocol".
My mistakes with the training course code would have been fixed if the company would have bought Excel licenses fof our customer workstations.
And I just remembered it was DDE (dynamic data exchange), not OLE. OLE was much better specced than DDE. Like I said, it was way back when. But the basic rule (don't test using both a home-grown client and server) still applies.
this could go into a sagan's "If you wish to make an apple pie from scratch, you must first invent the universe."
_simple_ http server is a few lines of code in Python. It's an easy way to add remote access to application. Just ask any advanced LLM.
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.
You realise that it's only a toy implementation aimed at learning and not a full implementation. The parsing of HTML alone is way more complex than your actual implementation not mentioning at lot of things like the rendering or network (outsourced to Qt).
Still a nice achievement that get you to understand why making a browser is a very complex task.
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 :-)
(Speaking as someone who also started writing my own long ago, and it's far from complete.)
Can you name/link to a few examples? I know about Ladybird:
https://github.com/LadybirdBrowser/ladybird/
but haven't noticed other initiatives.
> might be what ends up breaking their browser monopoly.
This post is a toy project, not a full-fledged browser engine, which is a large beast (even when you _don't_ do everything from scratch)
Your project feels phenomenal. Definitely starred.
I was actually trying to create a browser (in golang) myself as well (using LLM assistance) & I really couldn't do it after countless efforts.
https://github.com/SerJaimeLannister/golang-browser Much of it was just curiosity towards if LLM's could port the rust project by emsh https://emsh.cat/one-human-one-agent-one-browser/ into golang & this has led to some really insightful discussions between me and emsh on bluesky
This is actually really pretty cool as I was targeting a ~10k loc for golang from the ~20k loc of rust (given how golang has networking binaries and other stuff)
I guess this is really cool. I was always really averse to C++ preferring golang. I think I am ken-thompson pilled for the most part lol.
Anyways its really great to see people my age working in similar ideas. Somehow it gives us I guess a more sense of connection like I am not alone doing these things and I guess its pretty cool feeling seeing others do similar stuff and learning from them!
I have starred your repo and good luck for college too man! Hope to communicate with ya.
Edit: Another comment here as someone here mentioned that you used LLM, which LLM did you end up using and how'd you use it. For me personally, the most (success?) that I found which could generate a hackernews without any styles and anything was via their computer-use agent model (which I am thinking of downloading & working with kimi-cli to add more styling and other stuff as well in golang just out of curiosity)
I don't really mind if you used LLM, but I am curious as to how in this instance.
Your project sounds really fascinating as well. To be honest, I wasn't familiar with the concept of "porting" until I looked it up through Gemini just now—it's such an interesting approach! You mentioned that you couldn't quite get it to work despite countless efforts, but I believe that only proves how incredibly difficult and ambitious your attempt was.
During this project, I also faced constant failures and had to compromise on many things because of the sheer complexity. My engine doesn't support JS yet, and only handles a handful of CSS properties—and even those aren't perfect. But as people like us always do, we learn and grow through these failures. I truly hope you’ve gained a lot of growth and insight through your project as well.
About LLMs: I used Claude. The key was using it as a mentor, not a code generator:
-Asked WHY things work, not just HOW
-Got help understanding concepts
-Debugging assistance when stuck
But I designed the architecture and solved problems myself.
Thanks again for the star and your kind words! Let’s keep in touch and keep building.
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.
Well done.
I had AI help me with:
- Initial layout calculation logic (the layout concept was new to me)
- Catching edge cases in the parser
- Recent refactoring for code quality
But I designed and coded myself:
- The overall rendering pipeline architecture
- CSS parser from scratch
- Debugging
- All architectural decisions
As for understanding - I don't know what understanding exactly is. But I think it means how familiar you become with a concept. By that definition, yes, I understand how the rendering pipeline, parsers, layout tree etc work.
First time using C++, so I needed guidance on concepts I'd never seen before. But the learning, problem-solving, and persistence were mine.
Thanks for asking!
https://github.com/beginner-jhj/mini_browser/commits/main/
I might be wrong, things are always evolving and it is going to be more and more difficult to spot. But I was genuinely asking OP, and I don't have the intention of undermining their achievement! (it stays cool even with use of LLM)
Also Antirez, I am in high school and I can literally write it in writing that there's literally no school with such homework assignments imo. I have written a comment about seeing the curriculum of one of my other friends and my anecdotal evidence talking to friends.
There's literally zero doubt in my mind that there's no such homework assignment.
This is super impressive.
I looked at his book and wanted to teach him python. You can say its senior high school and what I taught him was what keywords mean in python and operators mean in python etc.
A lot of it was just semantic. Could be the fact that it was first chapter and he came to me when his exam was just some few days later.
I swear but the hardest thing I observed in that book was probably some SQL from what I heard or maybe some minor Java or the fact that it had file access within python or atleast that's what I observed.
The OP's comments are clearly weird and feel like something which should be ignored.
This project is really really cool imo. (Heck I was trying out literally the same thing too but over golang out of curiosity but really didn't land anywhere and the fact that the creator of this was able to still is pretty impressive even if they used LLM or not!, on which I haven't felt any clarification but I just wanted to point how both are really really cool!)
(If the "build a CPU" part doesn't impress, it was common to build an entire compiler toolchain to go with it; also it was long enough ago that a web browser really was a weekend project :-)