top | item 37609882

(no title)

atlasduo | 2 years ago

I wish more people gave a shot at browser implementations. You see a lot of comments that this in a herculean task, and maybe it is, but it's not _that_ bad.

You don't have to implement all of the functionality of modern web browsers. You don't need battery APIs, game controller APIs, USB, etc. Focus on what is important - HTML, CSS, JS.

Worst case scenario - you will learn something new.

Best of luck on this project!

discuss

order

nicoburns|2 years ago

I think it probably is that bad if you the approach it as this person is currently doing: not using any libraries at all. If you use existing libraries for HTML parsing, CSS parsing, layout algorithms, graphics rendering, etc, then I think I think it's doable.

kelnos|2 years ago

Writing parsers honestly isn't that hard, especially when you have more or less step-by-step instructions for some of the formats, and test suites that independent 3rd parties have written that you can use to help verify your implementation.

Regardless, so what if it's "bad"? OP is using this as a learning experience too. If he wants to write parsers, and thinks that experience will be good for him, then he should write parsers.

I do agree that writing your own parsers isn't strictly necessary if you want to write an independent web renderer/browser. If I were tackling this project, I'd be more interested in and curious about how to write a renderer, and if there's a HTML or CSS parsing crate already written and available on crates.io, I'd probably use it.

Then again, writing a parser would also make me intimately familiar with HTML and CSS in ways that I'm probably not currently, and that might help inform how I build the renderer.

justapassenger|2 years ago

I wrote my own engine 15 years ago, when web was much much much simple.

It’s a Herculean task. What’s important - HTML, CSS, JS are highly complicated, even if you exclude other APIs.

It’s really cool pet project. But don’t expect anything usable as a result.