Hacker News new | ask | show | jobs
by reubenmorais 738 days ago
Yep: https://searchfox.org/mozilla-central/source/parser/html/jav...

And more info: https://about.validator.nu/htmlparser/

2 comments

Huh, I was curious about how that was done, and it looks like it's a specialized Java to C++ converter: https://github.com/validator/htmlparser/blob/master/translat....

Looking at the source, it seems pretty easy to find Java programs that wouldn't compile correctly, but of course a fully general Java to C++ converter would be a huge undertaking. I guess with OK test coverage of the generated C++ code (which Firefox certainly has), editing the Java code remains doable.

Doesn't GWT transpile to Javascript?
Yes, that sentence is stating two different things:

> The parser core compiles on Google Web Toolkit *and* can be automatically translated into C++

Then I don't understand why GWT was mentioned. Does compiling on GWT have anything to do with the finished C++ code?