321 points · by dexterpe · 8y ago · 171 comments
(Also, after seeing the below 350-line function that's part of a 3113-line file, I now know that whenever I'm yelling at CSS layout behaving weirdly, there's someone with a much, much more frustrating job.)
https://github.com/servo/servo/blob/master/components/layout...
EDIT: for anyone who doesn't know, https://servo.org/ is Mozilla's ambitious project to rewrite their browser from scratch with concurrency thought in from the beginning, supported by Rust's unique approach to safe concurrency. Parts of it have already made it into Firefox: https://bholley.net/blog/2017/stylo.html
Browser authors are on the receiving end of over 20 years of standards all written by people who were not, personally, the ones implementing them, plus a healthy dollop of "code that worked in this one browser once and become a de facto standard", for which the way tables format themselves in all their myriad ways comes to mind, based around whatever was convenient in already-crufty codebases now long dead.
And then all these nightmares get together and interact. And the end users expect this to be fast. And web developers expect to be able to reach into the middle of this epically complicated data structure and tweak a style and have what may literally be the entire page rerender, and they expect that to be fast and easy. And using a language that was never written to be fast. (If anything, Javascript was written to be implemented quickly, if you read the story about where it came from. There was no time to be worrying about how well it could be JIT'ed 10ish years later.)
I don't spend a lot of time wondering why my browser is so slow; I often find myself wondering how it manages to be so fast. The spec for a browser is insane. I definitely believe that a future of browsers will be a combination of web assembly and a much more raw rendering layer that will offer access to font rendering and the OpenGL primitives, and a non-trivial number of the biggest websites will eventually implement their own renderers. I say "a" future because the current web rendering system will be around to the end of my prognostication powers. But I suspect this bypassing of the "legacy" renderer is also ultimately inevitable. Give it about 5 years or so.
At my job, our group recently refactored a file from over 30000 lines down to 17000. I've also seen, on multiple occasions, single methods in Smalltalk applications that exceeded 32KB and therefore broke the compiler! (The egregious sins of Smalltalk shops were weirdly parallel. The egregious sins of Smalltalk vendors were also weirdly parallel, come to think of it.)
Frankly what went wrong was that print media designers got involved and used flash and JS to turn static text into virtual pamphlets etc.
Let put a end to the madness, and say "after 2020, not more in the old apis" and do a clean standard. Then take advantage of the fact html/js have tags that could declare versions, and when a old page show, use the old rendered, and when a new, use the clean one.
By then, most PC/mobile devices are powerfull enough to have 2 renders alive and the transition will be fast for more big/popular sites.
There are multiple versions of ECMAScript, analogous to whether your compiler supports C++11/14/17/etc. It doesn't make sense to say "let's all use ES8" because ES8 is back-compatible (I think). It's up to the browser to decide what to support, and you have the same issues in C++ where some compilers don't fully support feature X.
Then, which APIs do you deprecate? How do you define "old"? Anything prior to stable is a good rule of thumb, but since JS can be loaded locally, people will use whatever they downloaded and that they know works. Some people advise not to use auto-updating CDNs precisely because a patch might break your page. And remember it's mostly down to the API developers to ensure compatibility across major browsers, not vice versa.
There's nothing wrong with vanilla JS. Really we just need to get people to be less excited about using frameworks for tiny projects that don't require them. Or you have problems like e.g. some text transition that requires loading every single version of the typeface.
I don't think that's true. At least, all the browser standardization processes I've been involved in included several people who would be responsible for actual implementation.
In my ideal world, browsers are spec'd in a functional language, and optimized mechanically (perhaps based on ad-hoc human guidelines).
It will be interesting to see if they keep merging in changes from the head of the open source browser or if they continue to diverge over time.
Secure job though, with predictable repeatable work.
I'd be surprised if you found the red/yellow/green logo image in chromium
https://news.ycombinator.com/item?id=9724409
That's a disingenuous phrasing, though.
Hmmm... I seem to have missed out on some super-Venezuela levels of hyperinflation happening to the yuan at some point here. You think that'd be the real news.
Similar to when people use 2-800 instead of 200-800: Best to just be clear.
I really don't know currency conversions and maybe it is $360 million ....
I pointed out that when Netscape decided to rewrite their browser, with all the knowledge they had of how browsers work, they spent three years doing it, and that was a decade and a half previously when the web was orders of magnitude more simple.
I sometimes wonder how out of context he was. Or I was? What did he think a browser was? Were we speaking at massive cross-purposes? Did he mean we should grab some other web engine and find a way to use that? Even so, a half-day to get something going? And just what introductory programming textbooks was he reading?
Where was I going with this? Somewhere along the lines of how "write a browser" clearly can mean massively different things to different people, or maybe that there can be an enormous gulf of context and understanding there somewhere. To this day, I still don't know. Never will.
Getting a first cut of really basic HTML rendering--essentially saying, here's a string that's X color and Y font, display it--is probably doable in a day if you have robust implementations of everything else. I have to imagine your director thought that doing HTML rendering was "all" you'd have to do. Of course, what makes building browsers especially hard is there is very tight integration between all of these different components, so that you have to maintain all of these pieces.
In the old days of Chrome you'd occasionally see WebKit engineers griping about how Chrome was taking all the credit for just repackaging WebKit. I remember wondering about this at some point and noticing the code was roughly 50-50 Chrome/WebKit in terms of size (which is a fraught measurement always but hopefully gives you the idea). To be sure the HTML-rendering part of a browser is a central piece of it, but the Chrome part included stuff like v8, the Windows port of WebKit, the network stack, the multiprocess architecture, all the browser widgetry like tabs, bookmarks, and the fancy URL bar, and so on. So I guess even for people who are close to this it's hard to say what making a browser entails.
Here's an image from the announcement:
https://mmbiz.qpic.cn/mmbiz_png/LB4LpUCAfNwtCCCtSYiaL9o2B7wy...
Classic - he mentions not wanting to rip off state funds and government agencies multiple times. Thats exactly what he did though ;) I hope this isn't the last anyone ever hears from Chen Benfeng - "The special expert of the National Thousand Talents Program”.
I'm shocked with that much funding, this startup would choose to either or both a) plagiarize, b) falsely advertise, and they didn't even do it well. I'd say the effort is worth $36 without the million.
Both of these actions (plagiarism, fraud) have ethical and legal implications, but it sounds like they are getting away with this by admitting to the public what they did.. That makes me think the investors were already aware/supportive of the whole stunt.
Is this what the startup scene is like in China? I certainly hope not.. but still, it will take heck a lot more innovation from this company for people to ever trust them again.
I wouldn't chalk this particular instance up to anything more than loose capital ending up in fraudster hands, as occasionally happens when it's sloshing around to such a degree as it is these days.
Meaning they send your browsing data to Chinese government agencies?
I want that too.
Just if someone else need their national browser too - I am here with my Sciter (https://sciter.com) - it is an independent implementation of HTML/CSS and universal Web browser can be made from it with 6-9 months ETA.
Umm, Webkit spun out of Safari, so that would make Chrome the "clone" of Safari.
Which is rather your point. Chrome has made a lot of changes to Webkit over the years, and these days appears to be putting more effort into it than Apple is.
Culture is bigger than any individual.
IP & Copyright are not part of Chinese history or culture and were largely impositions from The west within the last 50 years.
Something like 90% of all business software running in China is stolen.
Additionally, Marxist ideas of collective ownership have left their mark.
https://www.cio.com/article/2444480/it-organization/understa...
It's more like someone wanna wash their cash..
Besides this cliche was said for the US (back when it copied European inventions in the 18th and 19th century to bootstrap its industry) and Japan in the 60s and 70s (which started by copying western products).
Funny how those two places turned out...
They clearly sold it as their own rendering engine, not just a UI shell. Although I guess due to vague wording it wouldn't necessarily preclude being a fork of Blink.
(I say this as a fan of KDE, and a user of Konq back in the KDE2x/Mandriva days.)
There's plenty wrong with taking money on the promise that you're developing a browser from scratch, then doing the above.
Apple Safari ‘found to be’ Konqueror...
C Also: copy 80% of a successful product and innovate/improve another (core) 20% is a very smart business approach.
Kudos an good luck to the Chinese for the attempt to disrupt monopoly in this space.