News for hackers. Stuff that matters.
Re:Maintaining an Independent Browser Is Expensive by baddox on Sunday December 03, 2017 @01:51AM (#15836360)
I wonder: who could even feasibly introduce another browser today? The task seems almost impossible.
Re:Maintaining an Independent Browser Is Expensive by adventured on Sunday December 03, 2017 @06:19AM (#15837104)
Amazon and Facebook could both launch entirely new browsers. Spotlight it constantly on Amazon.com or across Facebook's properties as with Chrome on Google.com.

Facebook already has far more cash and profit than they know what to do with. $38 billion currently, rapidly climbing. They'll add ~$20 billion to that in 2018. They could do a new browser just for kicks if they wanted to, and they have the vast global reach to generate some uptake.

Whether either could claw meaningful share away from Chrome is an entirely different question.

Samsung, Tencent and Alibaba all have the resources to launch entirely new browsers if it made sense.

Re:Maintaining an Independent Browser Is Expensive by nojvek on Sunday December 03, 2017 @08:00AM (#15837395)
Hiring talent to build browsers is not as easy as throwing money.

The bottleneck is engineers who have the know how to build it.

Building your own browser could be a shitty business decision if you can't compete with Chrome for ad dollars.

A browser makes sense if you can bundle it with an OS.

Android : chrome, ios: safari and Windows: Edge

Facebook makes a shit ton of money from ads people click on chrome.

Re:Maintaining an Independent Browser Is Expensive by rwmj on Sunday December 03, 2017 @06:31AM (#15837140)
Alibaba already have their own browser of a sort (https://en.wikipedia.org/wiki/UC_Browser). As I understand it, it's some kind of thin mobile browser which renders on the server side.
Re:Maintaining an Independent Browser Is Expensive by kinlan on Sunday December 03, 2017 @07:54AM (#15837378)
There are multiple versions of UC browser. My understanding of it is:

- uc mobile on Android now uses the blink engine, it used to use Webkit. - uc mini ( I think that's the name) has server renderer but it's "uc engine" is a derivative of gecko (not checked recently)

Re:Maintaining an Independent Browser Is Expensive by bergie on Monday December 04, 2017 @06:12AM (#15843073)
Samsung actually has a browser: http://www.samsung.com/global/galaxy/apps/samsung-internet/

Quite similar to Chrome, but has support for ad blockers etc.

Re:Maintaining an Independent Browser Is Expensive by Mountain_Skies on Sunday December 03, 2017 @09:47AM (#15837737)
Amazon sort of has their own browser called Silk. It's based on Chromium so it's not a built from the ground up endeavor but has been customized on their Fire devices to 'enhance' the browsing experience in a way that seems to benefit Amazon.
Re:Maintaining an Independent Browser Is Expensive by remir on Sunday December 03, 2017 @01:24PM (#15838718)
Samsung makes their own browser on Android.
Re:Maintaining an Independent Browser Is Expensive by gruez on Sunday December 03, 2017 @01:54PM (#15838871)
it uses webkit/blink underneath, so that doesn't really count.
Re:Maintaining an Independent Browser Is Expensive by jopsen on Sunday December 03, 2017 @02:14AM (#15836439)
mozillia research is sort of doing it with gecko.

But yeah, from scratch is hard... Google didn't even do that, they started from webkit.

Re:Maintaining an Independent Browser Is Expensive by mercurial on Sunday December 03, 2017 @02:41AM (#15836499)
With Gecko ? It's their original engine. You probably mean Servo (the experimental Rust engine).
Re:Maintaining an Independent Browser Is Expensive by erikbye on Sunday December 03, 2017 @03:21AM (#15836602)
I guess it's not wrong to call it their original engine, just remember it's a two-decades-old development that started at Netscape.
Re:Maintaining an Independent Browser Is Expensive by gsnedders on Sunday December 03, 2017 @04:11AM (#15836748)
Well, arguably started at DigitalStyle.
Re:Maintaining an Independent Browser Is Expensive by robin_reala on Sunday December 03, 2017 @05:35AM (#15836978)
Can you expand? I thought I had a good grasp of Mozilla’s history but this is the first time I’ve heard of them.
Re:Maintaining an Independent Browser Is Expensive by dev_tty01 on Sunday December 03, 2017 @08:49AM (#15837553)
Re:Maintaining an Independent Browser Is Expensive by gsnedders on Sunday December 03, 2017 @12:02PM (#15838378)
So my understanding is following Netscape's acquisition of DigitalStyle, the decision was made to replace Netscape's existing layout engine with something based on what DigitalStyle had in their editor (which, unlike Netscape's existing one, supported things like reflow), and it was this combination that was open-sourced. Notably, it was only really the layout engine that was replaced: the HTML parser and the JS VM survived unchanged, hence the name NGLayout for what became Gecko.
Re:Maintaining an Independent Browser Is Expensive by Klathmon on Sunday December 03, 2017 @11:09AM (#15838138)
And webkit started from KHTML
Re:Maintaining an Independent Browser Is Expensive by captainmuon on Sunday December 03, 2017 @04:35AM (#15836802)
I would first target a subset of HTML, for example static documents instead of web apps. You would have a specification like AMP which restricts what elements you can use. If a document used the full spec, I would fallback to another engine (e.g. WebKit). You could have full documents in iframes inside limited documents (but cross-frame scripting might be hard to get right in that case).

Also, I would try to make it as modular as possible. E.g. layout engine, css engine, js engine etc. as libraries, use the system codecs instead of bundling own codecs, and so on.

And it would help to have an extensive test suite, which you could take from other browsers.

Re:Maintaining an Independent Browser Is Expensive by krapp on Sunday December 03, 2017 @04:58AM (#15836868)
The difference between static web documents and web apps isn't the set of HTML they use, it's just that the latter are designed to deeply integrate javascript (and/or, to futureproof this comment, WebAssembly) into their UI, rather than do all of the logic on the server between requests.

The only way to ship a browser that doesn't render "web apps" would be to simply not support scripting of any kind. That would permanently break much of the web unless you offered a way to opt in to scripting the way current browser users who run script blockers can. But then you just have a regular browser with script blocking turned on by default.

Having different engines for "static" and "web app" documents, and defining a proprietary standard for the former as a restrictive subset of HTML would be unnecessarily complex and hostile to web developers.

Re:Maintaining an Independent Browser Is Expensive by captainmuon on Sunday December 03, 2017 @05:46AM (#15837021)
There is a subset of web pages that only use a subset of features - Hacker News is an example, but better examples would be Wikipedia, many news sites, documentation of all kinds, and so on. You have basically static HTML, and use JavaScript for 1) progressive enhancement and decoration (what used to be called "DHTML"), 2) ads, and 3) more and more for client side rendering. You can't do much about 3 right now, but I would offer support for 1 and 2. I would definitely offer scripting, but just not all features.

You could autodetect a "lean html" site, or you could use a marker such as "<html lean>" like AMP does.

I don't think this is hostile to developers at all, unless AMP is already hostile. You would have a subset of the web platform, yes, but if you only use that you are likely to have a faster and leaner website - even without a new engine. I would view it as a guideline or a best practice, rather than a restiction.

Side note: I think the co-mingling of documents and apps is the source of a lot of problems today. Why can ads inject arbitrary javascript into my website?! On mobile, I am regularly redirected to annoying ads that proclaim my phone is infected, and make my phone vibrate and make noise. A news article shouldn't be able to do that!

Re:Maintaining an Independent Browser Is Expensive by krapp on Sunday December 03, 2017 @06:23AM (#15837114)
>I would view it as a guideline or a best practice, rather than a restriction. >I would definitely offer scripting, but just not all features.

That's a restriction. If site authors have to abide by that or else not have their content render in your browser, you're restricting their freedom to publish the content they want or make their own decisions about what code they choose to write.

But if you still have a "backup engine" that will run it anyway, then what's the point?

>I don't think this is hostile to developers at all, unless AMP is already hostile.

I would think Chrome was hostile if it gave preference to AMP over standard HTML. Those aren't decisions that browsers should make.

>Why can ads inject arbitrary javascript into my website?!

Because that's what the site authors decided to publish. Like it or not, that's the way the web is intended to work - you request a URL, you get back whatever the server decides that URL points to. Changing that dynamic would change the web at a fundamental level.

Re:Maintaining an Independent Browser Is Expensive by captainmuon on Sunday December 03, 2017 @07:49AM (#15837354)
I think you are misunderstanding me. I was just trying to answer "how could you concievably write a web browser engine if you are not Apple/MS/Google/Mozilla". My answer is: focus first on the happy path. There are a ton of websites that could be rendered with a simpler browser engine - I believe also faster and with less memory. Fall back transparently to an established engine if necessary. This is similar to how a tracing JIT compiler makes assumptions about the types of variables, and if these are violated (because the language is dynamic), falls back to the legacy path, an interpreter.

I further think, if you sell it right, you could get people running sites like blogs, documentation, wikis, to opt in to "strict" or "lite" or "document" mode, but that is an orthogonal issue.

Re:Maintaining an Independent Browser Is Expensive by eadmund on Sunday December 03, 2017 @02:16PM (#15838960)
> > Why can ads inject arbitrary javascript into my website?!

> Because that's what the site authors decided to publish. Like it or not, that's the way the web is intended to work

I'd argue that the web wasn't intended to involve executing code, but rather it was originally envisioned to be a means of viewing documents.

Re:Maintaining an Independent Browser Is Expensive by krapp on Sunday December 03, 2017 @08:13PM (#15840747)
>I'd argue that the web wasn't intended to involve executing code, but rather it was originally envisioned to be a means of viewing documents.

That's fair - but it doesn't imply that it was intended to not execute code, so much as that it wasn't feasible to consider at the time. The web wasn't originally intended to display images either, but it evolved over time. Certainly, in either case, javascript was never intended to carry the burdens it's been made to, but people found it useful to have a Turing capable language as part of the web, and here we are for better or worse.

And the web in the near future when WebAssembly takes off is going to execute binaries compiled from arbitrary languages, of which javascript will be only one option. That's going to be awesome in both senses of the word. Not what the web was originally intended for, and certainly not the best of all possible worlds, but I would argue that it's still better than static documents alone, in terms of the possibilities it provides to publishers and users.

And maybe the pendulum will swing the other way at some point. Maybe people will choose to write lighter pages and not use unnecessary code. But if they don't, that's still their choice to make, not yours or a browsers to make on their behalf. And unlike with C, C++, Java, etc, you can turn javascript off if you want and still use some of the web.

Re:Maintaining an Independent Browser Is Expensive by baddox on Monday December 04, 2017 @01:34AM (#15841909)
It’s true that we can look at most websites and generally agree on which ones are “light” (e.g. HN or Wikipedia) and which ones are “heavy” (e.g. Gmail or SoundCloud), but that doesn’t mean it would be easy to define a specification that would allow all and only light websites to be built.

An extremely light and content-focused spec like Gopher would exclude a lot of websites that we would consider light. Terms used to describe light subsets of web capabilities, like “DHTML,” do not appear to be well defined.

My initial attempt would be to exclude XHR/fetch, dynamic URL/history manipulation (window.history), and loading resources from other domains. But the latter would probably exclude things I don’t oppose (like CDNs) and things I don’t necessarily support but which would surely drastically impede adoption (like third party ads/analytics services).

Can you propose a better and more viable spec?

Re:Maintaining an Independent Browser Is Expensive by reificator on Sunday December 03, 2017 @07:14AM (#15837266)
> I don't think this is hostile to developers at all, unless AMP is already hostile.

I think the prevailing opinion on Hacker News is exactly that.

Re:Maintaining an Independent Browser Is Expensive by baddox on Monday December 04, 2017 @01:39AM (#15841943)
My impression is that HN’s hostility toward AMP is caused less by the spec itself and more by Google’s leverage of its market power in search to incentivize AMP adoption, as well as its “web-breaking” behavior (like sending you to ugly and self-serving google.com/amp/whatever URLs).
Re:Maintaining an Independent Browser Is Expensive by tree_of_item on Sunday December 03, 2017 @10:23AM (#15837934)
I don't see how a subset of HTML could be hostile. AMP is not Google Search.
Re:Maintaining an Independent Browser Is Expensive by krapp on Sunday December 03, 2017 @08:15PM (#15840758)
A subset of HTML isn't hostile. A browser that defaults to only rendering that subset is hostile, because it relegates any content which doesn't conform to that proprietary spec to second-class status.
Re:Maintaining an Independent Browser Is Expensive by baddox on Sunday December 03, 2017 @05:49AM (#15837031)
That sounds like a much more graspable technical goal, but you would effectively be competing not with modern browsers but rather with the web as a whole, which is a much more difficult social/political goal.

If at the same time you could encourage widespread adoption of your HTML subset, then you may be onto something. This is essentially what Google did with AMP, their incentive being their caching network and apparent favoring in search results.

Re:Maintaining an Independent Browser Is Expensive by tree_of_item on Sunday December 03, 2017 @01:33PM (#15838762)
Not sure why you're downvoted, this is a good plan of attack.
Re:Maintaining an Independent Browser Is Expensive by nrhk on Sunday December 03, 2017 @02:10AM (#15836417)
Well you could also fork Chromium I guess.
Re:Maintaining an Independent Browser Is Expensive by Vinnl on Sunday December 03, 2017 @03:31AM (#15836634)
Except that that doesn't really broaden the ecosystem, unfortunately.
Re:Maintaining an Independent Browser Is Expensive by rlanday on Sunday December 03, 2017 @03:11PM (#15839281)
Given enough time, it does. People used to talk about a “WebKit monoculture” on mobile back when both Safari and Chrome were built on WebKit (although, they enabled different features and used different JavaScript engines). After Google forked WebKit to create Blink, WebKit and Blink started to diverge with different development priorities resulting in different improvements being made and different features being implemented. So as time goes on, and code gets added, removed, and rewritten, much of the commonality eventually disappears over time.
Re:Maintaining an Independent Browser Is Expensive by colehasson on Sunday December 03, 2017 @02:59AM (#15836547)
And with Puppeteer/Devtools programmers can stay in text editors.