Re: Float16Array

2015-07-30 Thread Alexander Jones
Everything you mentioned, apart from computational savings AFAIK.

(Half is used extensively in the visual effects industry.)

On Thursday, 30 July 2015, Sebastian Markbåge sebast...@calyptus.eu wrote:

 On Wed, Jul 29, 2015 at 4:05 PM, Alexander Jones a...@weej.com
 javascript:_e(%7B%7D,'cvml','a...@weej.com'); wrote:

 In case it's not obvious, faster DMA and larger buffer/texture capacity
 vs. float32. Many applications benefit hugely from having floating point
 data but certainly do not need float32's range and precision - for those,
 half/float16 is a great choice.


 It is not obvious exactly what part you're targeting. E.g. Is it texture
 transfer over the network that is the biggest saving? Is it
 transfer/conversion cost to GPU memory? Is it computational complexity in
 the shader? Is it the fact that you can fit more data into GPU memory, i.e.
 you run out of space later?

 Just because it is in the OpenGL spec doesn't mean that it is actually
 useful on modern hardware since implementations theoretically are free to
 expand it to full float. Maybe they don't, I don't know. That's my question.

 It also the open question, if this is used in practice? E.g. float64 for
 SIMD was deemed as not important.

 So, no, it is not obvious to some of us that are not continuously in this
 world, and my question hasn't been answered. I think it is plausible and I
 would like to help out, but we need to clarify exactly where this is a
 benefit and why that benefit isn't going away.




___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: String.prototype.trimRight/trimLeft

2015-07-30 Thread Behrang Saeedzadeh
I think poly-filling is only a good idea when the spec says a given type
should have a given function but one or more browsers haven't implemented
it yet.

Otherwise it will become like the era of overtly monkey patching everything
in Ruby that could end up with libraries clashing with each other and
leading to lots of headaches for developers.

Unless something similar to C#'s extension methods are added to EcmaScript:
https://msdn.microsoft.com/en-AU/library/bb383977.aspx that can turned on a
polyfill on a per scope basis.



On Thu, Jul 30, 2015 at 1:12 AM Michał Wadas michalwa...@gmail.com wrote:

 I can't remember last time when I would need `isNullOrEmpty` -
 Boolean('') and Boolean(null) evaluates to false. And `if (str)`
 handles any case with consistent types.

 String.isNullOrEmpty = (a)=(typeof a === 'string' || a === null)  !a;

 Anyway - native isNullOrWhiteSpace would be probably be useful only to
 reduce GC pressure, because it's easily polyfilled.

 String.isNullOrWhiteSpace = (a)=a === null ? true : typeof a ===
 'string'  !a.trim();


 2015-07-29 13:27 GMT+02:00 Behrang Saeedzadeh behran...@gmail.com:
  Another set of very handy functions that in Java are provided by
 libraries
  such as Guava or Apache Commons and in C# are built in, are
  `String.isNullOrEmpty(aStr)` and `String.IsNullOrWhiteSpace(aStr)`.
 
  Would be nice if they ES Strings had them too.
 
  On Tue, Jul 28, 2015 at 10:15 AM John-David Dalton
  john.david.dal...@gmail.com wrote:
 
  In the wild I've seen ltrim rtrim which are variations of trimLeft and
  trimRight and padLeft padRight or lpad, rpad for other forms. For
 stings I
  think of left and right as leading and trailing and think of start and
 end
  as more position indicators of like slice or a range.
 
 
  -JDD
 
  On Mon, Jul 27, 2015 at 4:55 PM, Dmitry Soshnikov
  dmitry.soshni...@gmail.com wrote:
 
  OK, it was added to the agenda for the next meeting (will be presented
 by
  Sebastian Markbage), so can be discussed in detail. I agree that
 start,
  and end are now probably better fit (because of i18n, and a strong
  correlation with startsWith and endsWith). We can probably ignore
 the
  de-facto shipped in browsers, they will just implement in addition
  `trimStart` and `trimEnd`, and eventually deprecate the right and
 left.
 
  Dmitry
 
  On Tue, Jul 21, 2015 at 12:02 AM, Claude Pache claude.pa...@gmail.com
 
  wrote:
 
 
   Le 21 juil. 2015 à 08:28, Jordan Harband ljh...@gmail.com a
 écrit :
  
   On the contrary -left always begins at index 0 - start is
   sometimes index 0, sometimes index (length - 1).
 
  Counter-example: ES6 methods `String#startsWith` and `String#endsWith`
  are named correctly.
 
   I think left and right are the right names; start and end
   would require unicode bidirectional stuff.
 
  No, because characters in Unicode strings are ordered logically, not
  visually.
 
  —Claude
 
  ___
  es-discuss mailing list
  es-discuss@mozilla.org
  https://mail.mozilla.org/listinfo/es-discuss
 
 
 
  ___
  es-discuss mailing list
  es-discuss@mozilla.org
  https://mail.mozilla.org/listinfo/es-discuss
 
 
  ___
  es-discuss mailing list
  es-discuss@mozilla.org
  https://mail.mozilla.org/listinfo/es-discuss
 
  --
  Best regards,
  Behrang Saeedzadeh
 
  ___
  es-discuss mailing list
  es-discuss@mozilla.org
  https://mail.mozilla.org/listinfo/es-discuss
 

-- 
Best regards,
Behrang Saeedzadeh
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Any opinions about adding a Ruby-like ||= operator to EcmaScript?

2015-07-30 Thread Behrang Saeedzadeh
I am not very fussed about the syntax as long as the facility is in the
language. Any chance this gets included in EcmaScript 2016?


On Wed, Jul 29, 2015 at 10:26 PM Claude Pache claude.pa...@gmail.com
wrote:



  Le 29 juil. 2015 à 13:23, Behrang Saeedzadeh behran...@gmail.com a
 écrit :
 
  For example:
 
  obj.property ||= value;
 
  This would only assign value to obj.property if property is undefined
 or null.

 For me, that syntax suggests strongly: Assign `value` to `obj.property`
 if  `obj.property` is falsy. I'd rather want to write:

 obj.property ??= value

 where `??` could also be used as binary operator with the semantics you've
 guessed.

 —Claude


  --
  Best regards,
  Behrang Saeedzadeh
  ___
  es-discuss mailing list
  es-discuss@mozilla.org
  https://mail.mozilla.org/listinfo/es-discuss

-- 
Best regards,
Behrang Saeedzadeh
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Named Paramters

2015-07-30 Thread Axel Rauschmayer
 On 12 Jul 2015, at 16:05, Luke Scott l...@webconnex.com wrote:
 
 Personally I'd rather be able to name parameters without creating an object.

The intermediate object seem like something that JavaScript engines could 
eliminate by statically analyzing the code. I’m wondering whether any engine is 
planning to do that.

-- 
Dr. Axel Rauschmayer
a...@rauschma.de
rauschma.de
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Float16Array

2015-07-30 Thread Florian Bösch
Float16 isn't a legacy format to Float32 much in the same way that
unsigned int16 isn't a legacy format to unsigned int32.

Float16 is a mandatorily supported format in OpenGL ES 3.0 textures and
vertex attributes.

If more precision than byte is required, but less than float32 precision is
acceptable, benefits include all of:

   - Using half as much network bandwidth
   - Using half as much RAM
   - Getting half as many GPU cache misses
   - Using half as much GPU upload bandwidth
   - Using half as much GPU download bandwidth
   - Using half as much VRAM
   - Using half as much GPU vertex streaming bandwidth
   - Using half as much texel lookup bandwidth
   - Using half as much fillrate
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Maven like dependency management for browsers

2015-07-30 Thread Behrang Saeedzadeh
Hi,

Has this been discussed before? In a nutshell this diagram illustrates the
idea:

http://i.imgur.com/X1n57iQ.png

   - Rather than referencing a url in script or style tags, we require
   the browser to load name-spaced, versioned libraries. For example:
   com.jquery:jquery:1.0.
   - This can either be done using the script/style tags similar to
   script module=com.jquery:jquery:1.0/ or style
   module=com.jquery:jquery:1.0 / or probably programmatically too: (in a
   JS file: require com.jquery:jquery:1.0)
   - There will be a central placed governed by W3C, for example, that can
   host libraries. Third-party repositories could also exist and be used
   (e.g. script module=com.jquery:jquery:1.0 repository=cdn.jquery.com
   /
   - One benefit of this is dependency management. If jquery, for example,
   depends on lodash, it also gets downloaded and loaded automatically.

This is just the core of the idea. Nothing new (already similar systems are
available for Java, Node, .NET, Ruby, etc.) but this will bring it to the
web.

What do you think?
-- 
Best regards,
Behrang Saeedzadeh
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Maven like dependency management for browsers

2015-07-30 Thread Sébastien Cevey
Hi Behrang,

Have you had a look at JSPM and SystemJS? They cover similar grounds in
userspace, with the intent for SystemJS to be the upcoming standard Module
Loader.

https://github.com/jspm/jspm-cli
https://github.com/systemjs/systemjs

On Thu, 30 Jul 2015 at 09:59 Behrang Saeedzadeh behran...@gmail.com wrote:

 Hi,

 Has this been discussed before? In a nutshell this diagram illustrates the
 idea:

 http://i.imgur.com/X1n57iQ.png

- Rather than referencing a url in script or style tags, we
require the browser to load name-spaced, versioned libraries. For example:
com.jquery:jquery:1.0.
- This can either be done using the script/style tags similar to
script module=com.jquery:jquery:1.0/ or style
module=com.jquery:jquery:1.0 / or probably programmatically too: (in a
JS file: require com.jquery:jquery:1.0)
- There will be a central placed governed by W3C, for example, that
can host libraries. Third-party repositories could also exist and be used
(e.g. script module=com.jquery:jquery:1.0 repository=cdn.jquery.com
/
- One benefit of this is dependency management. If jquery, for
example, depends on lodash, it also gets downloaded and loaded
automatically.

 This is just the core of the idea. Nothing new (already similar systems
 are available for Java, Node, .NET, Ruby, etc.) but this will bring it to
 the web.

 What do you think?
 --
 Best regards,
 Behrang Saeedzadeh
 ___
 es-discuss mailing list
 es-discuss@mozilla.org
 https://mail.mozilla.org/listinfo/es-discuss


-- 

--
Visit theguardian.com. On your mobile and tablet, download the Guardian 
iPhone and Android apps theguardian.com/guardianapp and our tablet editions 
theguardian.com/editions.  Save up to 57% by subscribing to the Guardian 
and Observer - choose the papers you want and get full digital access. 
 Visit subscribe.theguardian.com

This e-mail and all attachments are confidential and may also be 
privileged. If you are not the named recipient, please notify the sender 
and delete the e-mail and all attachments immediately. Do not disclose the 
contents to another person. You may not use the information for any 
purpose, or store, or copy, it in any way.  Guardian News  Media Limited 
is not liable for any computer viruses or other material transmitted with 
or as part of this e-mail. You should employ virus checking software.
 
Guardian News  Media Limited is a member of Guardian Media Group plc. 
Registered 
Office: PO Box 68164, Kings Place, 90 York Way, London, N1P 2AP.  Registered 
in England Number 908396


___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss