tc39 / proposal-bind-operator

This-Binding Syntax for ECMAScript
1.74k stars 30 forks source link

Conflict with JScript #36

Closed Mouvedia closed 8 years ago

Mouvedia commented 8 years ago

JScript permits to declare event handlers using ::.

function window::onfocus() {
  document.write("window has focus");
}

related: #27

domenic commented 8 years ago

Good thing this isn't a proposal for a JScript language feature :)

Mouvedia commented 8 years ago

I guess it's sarcastic. You probably already know that it's a part of the process to identify "potential “cross-cutting” concerns and implementation challenges/complexity". After all JScript was one of the first implementations and at one point the most used.

domenic commented 8 years ago

But JScript is not an implementation of the modern ECMAScript standard (it has not been updated in many years), so there is no conflict or cross-cutting concern here.

Mouvedia commented 8 years ago

@domenic Iv just tested in IE11 the above code; it was working still. I think that's a problem if you consider that the last version of Trident is not relevant. It is an implementation challenge.

domenic commented 8 years ago

You have to test Edge, not IE11.

Mouvedia commented 8 years ago

We are clearly not in the same mindset Id still consider it relevant if it was only the case for IE8. Anyhow, one way of tackling this is trying to see if the current proposal scope could be reduced. Iv seen a lot of discussion around events and that would match the previous usage by JScript. That would be constructive.

WebReflection commented 8 years ago

@Mouvedia this is like Aribnb coding style guide saying you shouldn't use obj.class because it's a reserved property in IE8 but then you should class A {} because it's transpiled ... JScript doesn't work with anything ES6 so I'm not sure why you think this is a problem.

If you target JScript capable browsers you have to transpile way more than just :: and, once transpiled, there won't be any :: so I don't see what's the challenge/issue.

On top of that, this proposal wouldn't violate in any case anything in there because this proposal doesn't accept function target::property() {} and that's IIRC is all you can do with :: on IE so, regardless you will stil need a transpiler, you'll be good to go without syntax conflicts.

If it's about using old code for JScript via modern ECMAScript capable browsers, then I'm afraid you'll have way more troubles than just this new syntax there.

Mouvedia commented 8 years ago

It's not like nothing ES6 related was implemented in IE11. cf https://kangax.github.io/compat-table/es6/#ie11

@WebReflection This is about syntax. If you are choosing :: you need to study the previous usage in the major implementations of ES and if it has a conventional usage in other languages as well. If you take into account other languages and prior usages you are more likely to come up with something that will pass all stages.

WebReflection commented 8 years ago

last though @Mouvedia about this proposal, since you're interested about events

// instead of JScript proprietary thingy
function window::onfocus() {
  document.write("window has focus");
}

// you can
window::on('focus', () => document.write('window has focus'));

As pattern, is incredibly more useful than just an "on" prefixed event thing from the defunct JScript.

If I were you, I'd be rather excited, than non-supportive ;-)

Best Regards

Mouvedia commented 8 years ago

If I were you, I'd be rather excited, than non-supportive ;-)

I am being constructive here. Maybe you think that reaching stage 0 means that the proposal will definitely be accepted. I am not that confident.

WebReflection commented 8 years ago

It's not like nothing ES6 related was implemented in IE11.

that's not how it works. If you want to use a new feature and you are targeting a browser that doesn't support it you need to transpile such feature so your issue is non existent.

You target IE11 and you don't want to transpile? Good, don't use features that are not supported there.

This is about syntax. If you are choosing :: you need to study the previous usage in the major implementations of ES and if it has a conventional usage in other languages as well

Did you know in VBScript you cannot name a property using _ as prefix, but only as suffix or after first regular char?

Have you ever even cared about this? ;-)

zenparsing commented 8 years ago

@Mouvedia Interesting historical information, thanks! It doesn't seem to affect the status of this proposal however.

bterlson commented 8 years ago

As someone who has in the past worked on JScript (and might be the current owner of JScript language support for all I know :-P) I can safely say this is not a concern. JScript will not get any new language support. Chakra does not support this syntax at all today. In the past it was supported in compat modes, but those no longer exist (and anyway weren't too common).

Want to support JScript? You better transpile or not use new features. If you don't, then great, no conflicting syntax.

hax commented 8 years ago

Anyway, it's a function declaration and not an expression, so no grammar conflict.

Mouvedia commented 8 years ago

@hax is it? What's the identifier if it's a declaration? Looks like to me that it would be anonymous.

WebReflection commented 8 years ago

@Mouvedia point is: this proposal does not conflict with JScript :: syntax. Please get over this, thank you.

Mouvedia commented 8 years ago

@WebReflection Again what needs to be reviewed is "the previous usage in the major implementations of ES and if it has a conventional usage in other languages as well".

You are not starting from a blank slate: the :: operator has a history that needs to be taken into account for this proposal to be accepted. I know the repository is filled with ppl trying to push this no matter what; that doesn't mean you should disregard all issues as irrelevant.

You are starting to be passive agressive so Ill stop commenting, thank you.

benjamingr commented 8 years ago

@Mouvedia the point people are making here is that there is not a single environment in which JScript's :: and ECMAScript's :: will be used at the same time since newer browsers don't support JScript's version and older browsers don't get new features anyway so ECMAScript's :: won't work there anyway.

WebReflection commented 8 years ago

@Mouvedia this is as well my last reply to you.

what needs to be reviewed is "the previous usage in the major implementations of ES and if it has a conventional usage in other languages as well".

There is no usage in any major implementations of ES because JScript was not following the ECMAScript standard.

There is no ECMAScript history of the usage of :: so there is nothing to consider.

Best Regards

bterlson commented 8 years ago

There is history to consider (and JScript was a reasonably accurate ES3 implementation) but examining the history and current browser ecosystem shows that there is no concern in practice. I think this issue can be closed (someone want to make me an admin? :))

zenparsing commented 8 years ago

@bterlson added you as collaborator, not sure if that will do it or not

bterlson commented 8 years ago

@zenparsing you should have a dropdown for what level of access, make sure to select "admin" :)

bterlson commented 8 years ago

I guess I just had to accept. Closing this now.