Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Ryosuke Niwa
On Fri, Jun 13, 2014 at 2:05 AM, Ryosuke Niwa  wrote:

> On Fri, Jun 13, 2014 at 1:53 AM, Anne van Kesteren 
> wrote:
>
>> On Fri, Jun 13, 2014 at 10:32 AM, Ryosuke Niwa  wrote:
>> > I understand your concern and sentiment but I'm having a hard time
>> imagining
>> > what kind of problems/concerns would TC39 have with these interfaces
>> that
>> > are clearly prefixed with DOM.
>>
>> That if they end up as objects in JavaScript engines they end up
>> leaking outside of browsers affecting other parts of the JavaScript
>> ecosystem. (And actually, we do run new APIs by TC39 for review, so if
>> these have passed for review on public-script-co...@w3.org, perhaps
>> calling out this implementation tactic, that might be sufficient.)
>>
>
> If that were the concern, we can simply add a private API that WebCore
> uses to enable these objects at run time.
>

Having said that, it would be much cleaner to improve our binding code and
do it in WebCore.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Ryosuke Niwa
On Fri, Jun 13, 2014 at 1:53 AM, Anne van Kesteren  wrote:

> On Fri, Jun 13, 2014 at 10:32 AM, Ryosuke Niwa  wrote:
> > I understand your concern and sentiment but I'm having a hard time
> imagining
> > what kind of problems/concerns would TC39 have with these interfaces that
> > are clearly prefixed with DOM.
>
> That if they end up as objects in JavaScript engines they end up
> leaking outside of browsers affecting other parts of the JavaScript
> ecosystem. (And actually, we do run new APIs by TC39 for review, so if
> these have passed for review on public-script-co...@w3.org, perhaps
> calling out this implementation tactic, that might be sufficient.)
>

If that were the concern, we can simply add a private API that WebCore uses
to enable these objects at run time.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Anne van Kesteren
On Fri, Jun 13, 2014 at 10:32 AM, Ryosuke Niwa  wrote:
> I understand your concern and sentiment but I'm having a hard time imagining
> what kind of problems/concerns would TC39 have with these interfaces that
> are clearly prefixed with DOM.

That if they end up as objects in JavaScript engines they end up
leaking outside of browsers affecting other parts of the JavaScript
ecosystem. (And actually, we do run new APIs by TC39 for review, so if
these have passed for review on public-script-co...@w3.org, perhaps
calling out this implementation tactic, that might be sufficient.)


-- 
http://annevankesteren.nl/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Ryosuke Niwa
On Fri, Jun 13, 2014 at 1:27 AM, Dirk Schulze  wrote:

> >> On Jun 13, 2014, at 10:17 AM, "Anne van Kesteren" 
> wrote:
> >>
> >> On Fri, Jun 13, 2014 at 10:12 AM, Ryosuke Niwa 
> wrote:
> >> What I'm saying is that we can implement it in JavaScriptCore for
> >> performance and we still make it look like a regular DOM object with
> >> wrappers to preserve the semantics.
> >
> > I understand that, but given that it is in the JavaScript engine at
> > that point, they cannot realistically standardize on a different
> > abstraction later on. And I got the impression typed arrays caught
> > them off guard, so giving them a heads up this time around might be
> > good.
>
> Blink is slowly moving the DOM into the JS engine. That doesn't make the
> DOM part of ECMAScript or needs approval of TC39. I do not think that typed
> arrays can be compared to DOMPoint or DOMMatrix. But DOMPoint to the plans
> of implementing DOM in JSC.
>
> I am interested in implementing the geometry interfaces into JSC. I wonder
> if we could generate the code from IDL as well. I do not think that this is
> possible with our code generators today. Is it?
>

I bet we can make sufficient improvements to our code generator such that
these objects are as fast as pure JavaScript objects but I don't think it
does so today as far as I looked at.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Ryosuke Niwa
On Fri, Jun 13, 2014 at 1:16 AM, Anne van Kesteren  wrote:

> On Fri, Jun 13, 2014 at 10:12 AM, Ryosuke Niwa  wrote:
> > What I'm saying is that we can implement it in JavaScriptCore for
> > performance and we still make it look like a regular DOM object with
> > wrappers to preserve the semantics.
>
> I understand that, but given that it is in the JavaScript engine at
> that point, they cannot realistically standardize on a different
> abstraction later on.


What kind of abstraction layer are you thinking of?  As far as I looked at
the working draft, DOMPoint, etc... are regular DOM objects specifically
created for DOM APIs.  I can't think of use cases for these kinds of
objects without DOM.

I feel like we're talking past each other so let me rephrase it again.  All
I'm saying is that whether something is implemented in JSC or WebCore is a
pure implementation detail.  We should be able to do whatever the heck we
please to do as long as our implementations adhere to respect
specifications.  Heck, JSC and WebCore could be a single project called
WebKit that can't be separately built.

And I got the impression typed arrays caught them off guard, so giving them
> a heads up this time around might be good.


I understand your concern and sentiment but I'm having a hard time
imagining what kind of problems/concerns would TC39 have with these
interfaces that are clearly prefixed with DOM.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Dirk Schulze


>> On Jun 13, 2014, at 10:17 AM, "Anne van Kesteren"  wrote:
>> 
>> On Fri, Jun 13, 2014 at 10:12 AM, Ryosuke Niwa  wrote:
>> What I'm saying is that we can implement it in JavaScriptCore for
>> performance and we still make it look like a regular DOM object with
>> wrappers to preserve the semantics.
> 
> I understand that, but given that it is in the JavaScript engine at
> that point, they cannot realistically standardize on a different
> abstraction later on. And I got the impression typed arrays caught
> them off guard, so giving them a heads up this time around might be
> good.

Blink is slowly moving the DOM into the JS engine. That doesn't make the DOM 
part of ECMAScript or needs approval of TC39. I do not think that typed arrays 
can be compared to DOMPoint or DOMMatrix. But DOMPoint to the plans of 
implementing DOM in JSC.

I am interested in implementing the geometry interfaces into JSC. I wonder if 
we could generate the code from IDL as well. I do not think that this is 
possible with our code generators today. Is it?

Greetings
Dirk

> 
> 
> -- 
> http://annevankesteren.nl/
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Anne van Kesteren
On Fri, Jun 13, 2014 at 10:12 AM, Ryosuke Niwa  wrote:
> What I'm saying is that we can implement it in JavaScriptCore for
> performance and we still make it look like a regular DOM object with
> wrappers to preserve the semantics.

I understand that, but given that it is in the JavaScript engine at
that point, they cannot realistically standardize on a different
abstraction later on. And I got the impression typed arrays caught
them off guard, so giving them a heads up this time around might be
good.


-- 
http://annevankesteren.nl/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Ryosuke Niwa
On Fri, Jun 13, 2014 at 12:59 AM, Anne van Kesteren 
wrote:

> On Fri, Jun 13, 2014 at 9:53 AM, Ryosuke Niwa  wrote:
> > I think Phil and Ben are suggesting to implement these types in JSC like
> we
> > did for typed arrays.
>
> If you were to do that you probably want to ping TC39 this time around.
>

I'm not certain if we're suggesting to change the semantics although that
might make sense.

What I'm saying is that we can implement it in JavaScriptCore for
performance and we still make it look like a regular DOM object with
wrappers to preserve the semantics.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Benjamin Poulain

On 6/13/14, 12:53 AM, Ryosuke Niwa wrote:
On Thu, Jun 12, 2014 at 11:42 PM, Dirk Schulze > wrote:



On Jun 13, 2014, at 8:36 AM, Filip Pizlo mailto:fpi...@apple.com>> wrote:

> Why can't these data structures be implemented as JavaScript
built-ins that behave "as if" they were DOM objects?

I am not sure. What do you have in mind? How could it look like?


I think Phil and Ben are suggesting to implement these types in JSC 
like we did for typed arrays.
Yeah, sorry, I kind of jumped to the conclusion than the DOM prefix 
implied WebCore objects with wrappers, etc.


If they are built-ins, that would be a nice tool for 2D/3D work. It 
would suck a bit to have the DOM prefix on basic types but I can live 
with that.


Benjamin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Anne van Kesteren
On Fri, Jun 13, 2014 at 9:53 AM, Ryosuke Niwa  wrote:
> I think Phil and Ben are suggesting to implement these types in JSC like we
> did for typed arrays.

If you were to do that you probably want to ping TC39 this time around.


-- 
http://annevankesteren.nl/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Implement Geometry Interfaces

2014-06-13 Thread Ryosuke Niwa
On Thu, Jun 12, 2014 at 11:42 PM, Dirk Schulze  wrote:

>
> On Jun 13, 2014, at 8:36 AM, Filip Pizlo  wrote:
>
> > Why can't these data structures be implemented as JavaScript built-ins
> that behave "as if" they were DOM objects?
>
> I am not sure. What do you have in mind? How could it look like?
>

I think Phil and Ben are suggesting to implement these types in JSC like we
did for typed arrays.

- R. Niwa
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev