<?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>16604</bug_id>
          
          <creation_ts>2012-04-02 21:46:20 +0000</creation_ts>
          <short_desc>RFE: add unsigned byte as synonym for octet</short_desc>
          <delta_ts>2013-06-17 01:14:08 +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>Windows 3.1</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kenneth Russell">kbr</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>therandshow</cc>
    
    <cc>w3c</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66339</commentid>
    <comment_count>0</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-04-02 21:46:20 +0000</bug_when>
    <thetext>Would it be possible to add the type &apos;unsigned byte&apos; as a synonym for &apos;octet&apos;? Doing so would improve symmetry with the other signed and unsigned types in the spec (short/unsigned short, etc.).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66352</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-04-03 07:30:52 +0000</bug_when>
    <thetext>Why do we have both byte and octet to begin with? This is confusing with many specifications that use byte as terminology and treat e.g. 0xFF as byte. I&apos;d prefer renaming octet to byte and dropping the current byte.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66385</commentid>
    <comment_count>2</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-04-03 19:21:10 +0000</bug_when>
    <thetext>From the standpoint of the typed array and WebGL specs it&apos;s essential to have both signed and unsigned byte concepts, so dropping support for signed bytes doesn&apos;t work for us.

Since the other integer types in Web IDL are signed, and use the &quot;unsigned&quot; modifier for the unsigned variants, it seems most symmetric to do the same for byte.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66396</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-04-03 21:58:20 +0000</bug_when>
    <thetext>&quot;byte&quot; should (and indeed does, in almost all contexts) mean 0..255, IMHO.

I recommend &quot;short int&quot; and &quot;unsigned short int&quot; if you need symmetric names, with &quot;byte&quot; as a synonym for &quot;unsigned short int&quot;. Or alternatively, &quot;tinyint&quot; and &quot;unsigned tinyint&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66397</commentid>
    <comment_count>4</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2012-04-03 22:11:41 +0000</bug_when>
    <thetext>short and unsigned short already exist in Web IDL and map to C&apos;s int16 / uint16. Those typedefs are also needed for the typed array spec and likely elsewhere.

&quot;tiny&quot; / &quot;tiny int&quot; and unsigned variants could work. Not sure about the potential for namespace collisions with existing code.

Changing byte to be an unsigned type has downsides. It requires updating all existing HTML5 specs which refer to that type, and would imply introducing a &quot;signed byte&quot; type which is again asymmetric with how the other integer types in Web IDL behave.

I would still prefer &quot;byte&quot; and &quot;unsigned byte&quot;, but would also prefer the pair of types &quot;signed byte&quot; and &quot;byte&quot; over introducing a new &quot;tiny&quot; concept.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66406</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-04-04 07:34:33 +0000</bug_when>
    <thetext>How many specifications are we talking about here? I cannot find usage of this within HTML itself for instance. We could also name the type &quot;short short&quot;, just like we have &quot;long long&quot; for longer than long, &quot;short short&quot; could be shorter than short.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66425</commentid>
    <comment_count>6</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2012-04-04 19:20:48 +0000</bug_when>
    <thetext>I still think if we go down this route we should just be allowed to define custom ranges (e.g., percent [0-100], angle [0-360], richter[0-10.0], etc.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66426</commentid>
    <comment_count>7</comment_count>
    <who name="John Thomas">therandshow</who>
    <bug_when>2012-04-05 00:02:03 +0000</bug_when>
    <thetext>Nice context for byte vs octet - http://www.tcpipguide.com/free/t_BinaryInformationandRepresentationBitsBytesNibbles-3.htm

Careful with &quot;short int&quot; and &quot;unsigned short int&quot; as octet I believe generally (though w/ basic data type lengths you can never be sure) maps to C/C++ signed/unsigned char != signed/unsigned int

http://www.cplusplus.com/doc/tutorial/variables/

Ultimately, even though you might confuse byte with short with octet, you will rarely confuse octet with something that is not 8-bits long.

Also, with octet - it&apos;s not about range, it&apos;s about storage size, although if an octet&apos;s unsigned (which I think it has to be), it should go from 0-255</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66463</commentid>
    <comment_count>8</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-04-06 01:47:18 +0000</bug_when>
    <thetext>Bits, bytes, words and longs, how many were going to St Ives?

octet came from OMG IDL, where it already meant an unsigned 8 bit integer type.  When we needed to introduce a signed type, because OMG IDL didn&apos;t have one, I used byte because Java&apos;s byte type is signed, rather than introduce &quot;signed octet&quot;.

I agree the current names are a bit sucky, though.  But I&apos;m not really in favour of introducing synonyms.  Seeing different names for the same concept in different specs, depending on the style preferences of the author, will be confusing.

I think there are sufficiently few specs using byte that updating them if we decide to change the names will be easy enough.  (It might even just be WebGL and the Typed Arrays spec.)


If people think the status quo is unacceptable, then I think my next preference would be to have &quot;byte&quot; and &quot;signed byte&quot;, or &quot;octet&quot; and &quot;signed octet&quot;.  The former looks and sounds nicer, but the latter more strongly feels like something unsigned to me.  (And true enough maybe technically a byte doesn&apos;t imply 8 bits necessarily, but I don&apos;t think it&apos;s a real enough concern.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66466</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-04-06 06:40:38 +0000</bug_when>
    <thetext>byte and signed byte works. E.g. http://dvcs.w3.org/hg/encoding/raw-file/tip/Overview.html and HTML and many other specifications always talk about bytes in the unsigned sense. I think it would make sense if we did that consistently throughout the platform standards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89373</commentid>
    <comment_count>10</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-06-17 01:14:08 +0000</bug_when>
    <thetext>I don&apos;t think it&apos;s worth changing at this point.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>