Very cool - writing a browser has been on my own project todo list for going on 10 years now; like you I also write everything myself with few exceptions.
The problems I when would muse about it were (very broadly):
- Text rendering, but really layout/shaping, especially for complex scripts like Arabic.
- JavaScript, which unfortunately seems like a necessity for the modern age.
- The very relaxed parsing of HTML/CSS. It's surprising just what browsers will tolerate in terms of malformed syntax yet still get a functional website out of it.
My goal was always going to be to get Wikipedia working also.
The affirmed absence of 'AI' usage certainly adds to this project's respectable status among this post aswell.
Very cool - writing a browser has been on my own project todo list for going on 10 years now; like you I also write everything myself with few exceptions.
Maybe you'd like to follow a book building a browser? :-)
One of the ideas is to allow readers to build along in their own programming language, or using AI. The main material is more about the building blocks and what needs to be done; the C coding can be skipped.
Text rendering, but really layout/shaping, especially for complex scripts like Arabic.
There are lots of problems involved: parsing TTF, rasterizing the glyph shapes, line layout in CSS, avoiding floats, multiple styles (line-height, vertical-align, decorations, etc), just to make something quite simple.
I'm not doing text shaping, so Arabic will look strange. Also no RTL like Arabic and Hebrew, and no support for CJK scripts yet (that should be easier, using the Google Noto font. Needs a huge builtin map from codepoints to which fonts have those glyphs; each TTF file has at most just 2^16 glyphs, which isn't enough.)
JavaScript, which unfortunately seems like a necessity for the modern age.
Indeed, it's a pity that React sites won't work at all without Javascript. Doing a Javascript interpreter is very doable; I strongly recommend Crafting Interpreters as an excellent book that builds an interpreter for a language that is very similar to Javacript.
But the bigger piece is doing all the DOM bindings and web APIs.
The very relaxed parsing of HTML/CSS. It's surprising just what browsers will tolerate in terms of malformed syntax yet still get a functional website out of it.
You'd be surprised! The HTML5 spec is actually very comprehensive about how to handle errors cases as well. Take a look:
I'm not handling all of the edge cases, only the standard <!DOCTYPE html> stuff i.e. I don't handle quirks in any special way. I guess most of those quirks are meant to handle older web pages and the way they rendered in IE back then.
My goal was always going to be to get Wikipedia working also.
That's a great goal, and it helps a lot to scope down what needs to be built.
(small hack in that screenshot: the flex and grid layouts are getting replaced with blocks instead)
I'm thinking of doing an Advent of Code series for next year, to build a very minimal browser just for Wikipedia but with lots of shortcuts :-) For example, using a local HTTP proxy to avoid having to handle TLS, which is quite a big of work to get working.
This sounds awfully like the self-soothing mantra slop-kiddies everywhere tell themselves.
Plenty of people have a deep understanding of software/hardware, as that's the context here. I personally can take you from usermode, through the kernel (both NT and Linux), down to the hardware interface, explaining the vast majority of systems along the way, and critically, as they relate to performance concerns.
So can plenty of others who actually know+understand things.
Not unique to gamedev; during the boom at the turn of the millennium the bar to entry to programming was dropped on the floor to fill demand.
The vast majority of programmers today don't even understand the basics of how-computer-work - not just microarchitecural considerations but even how to interface with the kernel efficiently / understand the performance considerations of their target platform.
Ask your average programmer how to say, simply perform I/O efficiently as possible on NT given some workload characteristics. One needs to first understand this before they can begin making concessions in favour of other demands (abstraction, flexibility, ect) and very few programmers can even get beyond the starting line.
IPv6 was obsolete by the mid-2000s, majorly due to the advent of roaming. It was designed on the rather fanciful assumption that its deployment would simply supersede IPv4, that every software/hardware vendor would cooperate, and we'd have a pure v6 network which would also replace the traditional L2/L3 layers.
Ofcourse legacy compatibility trumps all, along with the ubiquity of NATs and roaming and we're now just in the sunk-cost phase, being left saddled with a horribly bloated protocol (128-bit addresses was a marketing choice; not engineering) that solves no problems.
Those rates are peanuts considering that a decade ago saturating 40G, per core, was more than reasonable via standard userspace networking, with atleast a few copies in the datapath.
As someone who has implemented various transport protocols (both standard and custom) the biggest hurdle in layering atop IP will not be the gauntlet of WAN routers, surprisingly, rather consumer NAT devices.
One interesting case for a particular Netgear family of routers was that, while the traffic would survive end-to-end it was not without corruption - very specific corruption which took the form of zeroing the first 4 bytes. Given this aligns with where the src/dst ports would normally be, I suspect it was being treated as TCP/UDP albeit without the actual translation path taken.
The problems I when would muse about it were (very broadly):
- Text rendering, but really layout/shaping, especially for complex scripts like Arabic.
- JavaScript, which unfortunately seems like a necessity for the modern age.
- The very relaxed parsing of HTML/CSS. It's surprising just what browsers will tolerate in terms of malformed syntax yet still get a functional website out of it.
My goal was always going to be to get Wikipedia working also.
The affirmed absence of 'AI' usage certainly adds to this project's respectable status among this post aswell.
reply