Vyacheslav Egorov (2013-10-30T17:47:56.000Z)
domenic at domenicdenicola.com (2013-11-03T22:21:25.259Z)
Some people find "global" state that this proposal introduces bad. I see two ways addressing this: - Returning `{lo, hi}` object. - Pros: no global state, in combination with destructuring allows to write concise code, overhead can still be optimized away. - Cons: performance of polyfill is abysmal on bad and moderately good VMs, requires allocation sinking pass to optimize away object allocation. - Make `H` property of the respective operation (e.g. u64mul updates its own property `H`) - Pros: easy to implement, good perf on bad VMs - Cons: still kinda global state - `Math.<s>64<op>` can become `Math.createOperator(<s>64, <op>)` that returns function with `H` property: ```js var add = Math.createOperator("u64", "add"); var dl = add(add(al, ah, bl, bh), add.H, cl, ch); var dh = add.H; ``` - Pros: no global state, relatively good performance on the non advanced VMs, can be actually extended(!) e.g. SIMD operations can be exposed as `Math.createOperator("simd128", "add")`