<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>23225</bug_id>
          
          <creation_ts>2013-09-12 13:22:56 +0000</creation_ts>
          <short_desc>Let&apos;s start using class, not interface</short_desc>
          <delta_ts>2017-12-06 10:30:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>arun</cc>
    
    <cc>bruant.d</cc>
    
    <cc>bugs</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>jonas</cc>
    
    <cc>marcosscaceres</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>robin</cc>
    
    <cc>w3c</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>93289</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-12 13:22:56 +0000</bug_when>
    <thetext>We could keep interface around for where we now use [NoInterfaceObject] I suppose. Maybe also introduce &quot;extends&quot; rather than &quot;:&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93290</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-09-12 14:36:42 +0000</bug_when>
    <thetext>What&apos;s the point?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93292</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-12 14:53:05 +0000</bug_when>
    <thetext>Communicate intent better over the long term. We&apos;re defining what JavaScript calls classes, naming them something else makes specifications harder to read, which is bad for developers. 

It might also give people writing specifications a better clue as to what they have to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93293</commentid>
    <comment_count>3</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-09-12 15:02:37 +0000</bug_when>
    <thetext>Current editor&apos;s draft of WebIDL still sticks to interface; is this a JSIDL proposal, and if so, can you include a link to the right conversation about this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93294</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-12 15:07:13 +0000</bug_when>
    <thetext>This is the conversation. I think rather than dropping IDL wholesale, it&apos;ll be easier to improve it incrementally in the direction of something that better matches a theoretical JSIDL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93297</commentid>
    <comment_count>5</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-09-12 16:13:54 +0000</bug_when>
    <thetext>Is that theoretical JSIDL defined anywhere, at least some of it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93298</commentid>
    <comment_count>6</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2013-09-12 16:21:44 +0000</bug_when>
    <thetext>(In reply to Olli Pettay from comment #5)
&gt; Is that theoretical JSIDL defined anywhere, at least some of it?

http://w3ctag.github.io/jsidl/jsidl.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93340</commentid>
    <comment_count>7</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-09-13 09:12:02 +0000</bug_when>
    <thetext>(In reply to Anne from comment #4)
&gt; This is the conversation. I think rather than dropping IDL wholesale, it&apos;ll
&gt; be easier to improve it incrementally in the direction of something that
&gt; better matches a theoretical JSIDL.

I&apos;m not entirely convinced that incremental improvement is the best strategy in this specific case.

A lot of drafts out there are using WebIDL. If we do incremental improvements by removing stuff, we&apos;ll break them (they&apos;ll get fixed over time, but it won&apos;t be pleasant). If we do it by keeping existing constructs alive, we&apos;ll end up with a crufty language. Not everything needs the same upgrading strategies as the web.

If we get something new and nicer, people can switch over wholesale.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93346</commentid>
    <comment_count>8</comment_count>
    <who name="Marcos Caceres">marcosscaceres</who>
    <bug_when>2013-09-13 11:19:26 +0000</bug_when>
    <thetext>Are these going to be *real* JS classes (ones that can be extended by other JS objects) or continue to be magical host objects?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93350</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-13 13:13:45 +0000</bug_when>
    <thetext>Marcos, host objects is a thing of the past since ES5.

Robin, maybe. If proposed changes have implementation impact (and I&apos;m sure some will), gradual change seems easier to cope with given that IDL is already implemented. 

I think attacking this on both fronts is what will get us to better JavaScript. Slowly fixing IDL and trying to re-imagine IDL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93353</commentid>
    <comment_count>10</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-09-13 15:26:37 +0000</bug_when>
    <thetext>What would
Foo implements SomeClass mean in the new JS terms?
That at least sounds odd, and I&apos;d expect
SomeClass to be actually an interface, not a class.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93354</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-09-13 15:54:08 +0000</bug_when>
    <thetext>I would expect that to be a straight copy of the members, just as it is now. I think we want to keep interface for that and that would mean [NoInterfaceObject] could go away.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93358</commentid>
    <comment_count>12</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2013-09-13 16:09:00 +0000</bug_when>
    <thetext>I don&apos;t think we should allow

X implements SomeClass;

we should only allow

X implements SomeInterface;

I.e. classes should always have &quot;interface objects&quot; (aka &quot;constructor functions&quot;) and interfaces never have them. And only classes show up on the prototype chain (with exception for weirdness on the global scope).

Interfaces would only be used as a construct for described shared APIs and for when those shared interfaces are required in function arguments. I.e. interfaces would only be used for

X implements SomeInterface;

and

  void fooFunction(SomeInterface arg);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93361</commentid>
    <comment_count>13</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-09-13 16:53:28 +0000</bug_when>
    <thetext>From JSIDL, I think coercion rules are more useful than class to put into WebIDL.  I cannot really see a net improvement from class.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128990</commentid>
    <comment_count>14</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2017-12-06 10:30:33 +0000</bug_when>
    <thetext>Now that we have mixins the implements thing is no longer a concern, but also, let&apos;s track this in https://github.com/heycam/webidl/issues/485.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>