News for hackers. Stuff that matters.
Re:Safari is the new IE by HugoDaniel on Saturday September 09, 2017 @01:32PM (#15208088)
meh, desktop Safari is actually a very good browser. It is the fastest of all browsers in macos for a bunch of operations and their support for ES6 features beats all the other browsers (99% in https://kangax.github.io/compat-table/es6/ ).

Also one could argue that if Apple did not invest so much in WebKit then chrome would have had a harder time achieving its current usage and would probably be a very different browser than what it is today.

My 2cents

Re:Safari is the new IE by ko27 on Saturday September 09, 2017 @01:52PM (#15208220)
> their support for ES6 features beats all the other browsers

That's really grasping for straws. All modern browsers almost fully support ES6 features. Tail optimization are more controversial because they can actually lead to a performance decrease in some cases.

Far more important are things like custom elements and service workers on which Safari is lagging behind.

Re:Safari is the new IE by zghst on Saturday September 09, 2017 @03:18PM (#15208697)
It's not really important if the community is ambivalent on using it. Who here opts for using custom elements (and the extra work) over a library like Vue, React or Angular?

Is there even a consideration on how these new features become just another tool to spy on people?

To me it is far more important that Apple take its time letting these APIs mature and being reviewed for security and performance than blindly implementing anything that Google demands.

Re:Safari is the new IE by geocar on Saturday September 09, 2017 @01:57PM (#15208247)
> Tail optimization are more controversial because they can actually lead to a performance decrease in some cases.

How exactly can the tail-call elimination optimization decrease performance?

Sounds more like an implementation problem.

Re:Safari is the new IE by lvh on Saturday September 09, 2017 @02:27PM (#15208443)
Both TCO and PTC can decrease performance easily for a bunch of reasons. TC39 addressed this[0] when considering explicit tail call sites. Reasons vary from Windows ABI (Chakra) to something as simple as "now I have to figure out if this is really a PTC" -- and if your function has a PTC but that only gets invoked once, it's not hard to see how the extra analysis pressure doesn't weigh up to the elided stack frame. JS engines were already extremely optimized, it's not like you're taking a CS student's first lisp interpreter and adding TCO. (Fortunately, some of the litmus tests for whether you can apply PTC are encapsulated within strict mode, and the compiler stages definitely know that for free already.)

[0]: https://github.com/tc39/proposal-ptc-syntax#performance

Re:Safari is the new IE by geocar on Saturday September 09, 2017 @02:52PM (#15208576)
I remain unconvinced that just because it's difficult for a couple of JavaScript implementations, that we're still not talking about an implementation problem.

How exactly does anyone think that v8 doing something badly, is proof that something cannot be done well?

Re:Safari is the new IE by lvh on Saturday September 09, 2017 @03:09PM (#15208645)
I don't know which "anyone" you're referring to, but the argument I made about analysis pressure isn't implementation-specific, and neither are the concrete issues raised in both the TC39 notes I linked and elsewhere (they affect Chakra primarily, and *Monkey/V8 secondarily). The parts of a JS implementation (or really, any JIT) that decides to inline portions of code, attempt to detect loops and unroll them,... are already central to those implementations. I hope it's not difficult to see why a change that directly impacts that might have negative consequences elsewhere. Indeed, _because_ this is implicit and part of the spec, implementations can't take the simple multi-staged path they did before: they _have to_ do the PTC dance. I've heard no argument why the PTC mode should be intrinsically faster than the non-PTC mode (yes; you elide a stack frame at the cost of a whole-function analysis pass -- heuristically, "stack frame" isn't the expensive one of the two). This is why STC was proposed: it allows an impl to decide at _one_ location how to handle a function, in an obvious-to-the-parser way. No other code paths are affected. To contrast with PTC: even a compiler that knows with epistemological certainty that a particular call will happen only once or even never, _still has to do the PTC dance_.

However, you're asking me to prove a negative. I've given arguments, which apparently you find unconvincing. The people you are disagreeing with (not I) are responsible about 85% of the JavaScript engines on the Internet, an incredibly competitive space with billions in funding. I submit that they are probably neither incompetent nor lazy. (Evidence for "not lazy": the V8 team implemented it and turned it off.) If you are convinced that it's a (presumably fixable) implementation problem, I'm sure they'd love a patch or at least something more actionable than your insistence that they're doing it wrong.

Re:Safari is the new IE by geocar on Saturday September 09, 2017 @04:23PM (#15209001)
> I hope it's not difficult to see why a change that directly impacts that might have negative consequences elsewhere.

Sure, but at the risk of repeating myself: That sounds like an implementation problem.

> I've heard no argument why the PTC mode should be intrinsically faster than the non-PTC mode

There's a simple one: Hitting the stack less means you hit less memory.

> The people you are disagreeing with (not I) are responsible about 85% of the JavaScript engines on the Internet, an incredibly competitive space with billions in funding. ... I'm sure they'd love a patch

Happy to oblige. I'll implement TCO on V8 for a billion dollars in a way that beats these benchmarks.

> However, you're asking me to prove a negative.

And you're making straw men instead: At the beginning of your response, it's not even clear you read my complaint, but at the end, it's quite clear.

The simple answer would probably have been "yes, it's about an implementation, but it remains unknown where else we can go", but instead you doubled down...

Re:Safari is the new IE by lvh on Saturday September 09, 2017 @05:25PM (#15209232)
I'll repeat myself: it is not an implementation problem that a compliant implementation needs to do necessarily more work. You say:

> there's a simple one: Hitting the stack less means you hit less memory.

But I explicitly acknowledge this in my comment:

> (yes; you elide a stack frame at the cost of a whole-function analysis pass -- heuristically, "stack frame" isn't the expensive one of the two)

(Completely ignoring that there are already plenty of optimizations where a compliant interpreter may avoid the stack frame already anyway, so it's not even true that PTC must be faster for that reason.)

You keep picking on V8, but remember that there is so far only 1 major JS implementation that managed to do this without impact. It would seem that it's more probable that it's the other way around: it's an implementation detail that JSC had it easy.

> And you're making straw men instead: At the beginning of your response, it's not even clear you read my complaint, but at the end, it's quite clear.

I'd be happy to address this point, but I genuinely don't know which straw man I've supposedly built.

Re:Safari is the new IE by geocar on Saturday September 09, 2017 @06:15PM (#15209439)
> > > I've heard no argument why the PTC mode should be intrinsically faster than the non-PTC mode

> > there's a simple one: Hitting the stack less means you hit less memory.

> But I explicitly acknowledge this in my comment!

Not really sure what your point is. If you agree that's an argument as to why tail-call elimination should be intrinsically faster, I'm not sure why you'd say it isn't.

I can't shake this feeling you think you're having a very different argument than I am.

> remember that there is so far only 1 major JS implementation that managed to do this without impact.

Which for some reason you think means this isn't an implementation issue.

Re:Safari is the new IE by lvh on Saturday September 09, 2017 @06:26PM (#15209481)
> But I explicitly acknowledge this in my comment!

I did not put an exclamation mark there, but a colon, pointing out the specific reason why PTC can end up slower.

Re:Safari is the new IE by maratd on Saturday September 09, 2017 @01:45PM (#15208175)
> their support for ES6 features beats all the other browsers

This is deceptive. They purposefully do not support critical features that other browsers do support. As a developer, if there's one browser that consistently gives me headaches, it is Safari.

https://developer.mozilla.org/en-US/docs/Web/API/FormData/ge...

Re:Safari is the new IE by geocar on Saturday September 09, 2017 @01:55PM (#15208235)
As a user, I hate having to open Chrome[1] because of some "critical feature". Honestly, I sometimes wish you "developers" would find some other way to implement your application.

[1]: http://i.imgur.com/NcPu5IU.png

Re:Safari is the new IE by zghst on Saturday September 09, 2017 @02:04PM (#15208288)
Honestly, there are so many libraries out there that abstract away issues like this. By building an app from scratch, custom rolling logic, you automatically opt-out of the good tools that negate all of the tiny differences in browsers. I've had my share of Safari issues, but over time, the amount of libraries I've co-opted into my dev strategy has helped me bypass the majority of browser issues.
Re:Safari is the new IE by junkculture on Saturday September 09, 2017 @11:22PM (#15210402)
I agree. Not only is it the fastest, it's also the most reliable. I have Firefox thrashing about more often than not, and I refuse to use Chrome or its google infected variants.

Brave seems promising but doesn't yet have extensions.

Re:Safari is the new IE by nolok on Saturday September 09, 2017 @01:51PM (#15208207)
I do not know enough about Safari to agree or disagree with your general point, but I find this part to be really irrelevant:

> Also one could argue that if Apple did not invest so much in WebKit then chrome would have had a harder time achieving its current usage and would probably be a very different browser than what it is today.

The same can be said on an even larger scale about microsoft and IE 5 and 6; that doesn't mean in anyway that years later they were not a pain stopping the web from going forward. In other word, I don't see how that has any impact on the conversation at end (neither for or against the point made).

EDIT: Not sure why the downvotes.

Apple invested a lot into Safari (and thus webkit which lead to chrome). Doesn't change in any way if Safari is or isn't holding the web back currently, which is why I say it's irrelevant to paren't countering argument.

And in fact, we have a previous examples since we lived the same scenario with Microsoft who invested a lot into IE 5/6 (and leading into DHTML, XMLHttpRequest, ...), which then definitely hold the web back.

This is, literally, the same argument. I don't see how I can be downvoted for stating that obvious fact unless you think that IE 6 didn't hold the web back after a while.

Re:Safari is the new IE by johncolanduoni on Saturday September 09, 2017 @01:58PM (#15208257)
Chrome's renderer started as a fork of WebKit. Last time I checked nobody was able to fork any version of IE.
Re:Safari is the new IE by nolok on Saturday September 09, 2017 @02:17PM (#15208369)
That's not my point.

Thread says "Safari is holding the web back". Parents answers "Safari created the tools that lead to big parts of the modern web".

My answer is: so did IE 5/6. That doesn't mean after a while and for a long time they weren't holding the web back, it's a side fact that has no relevance.