News for hackers. Stuff that matters.
Re:Running Lua in a browser via Emscripten by azakai on Thursday May 30, 2013 @09:24PM (#5796330)
WeakMaps don't quite give you everything that weak references do in other languages. Sometimes weak refs can be used to check if the object referred to has gone away (the weak ref becomes null in that case), that is not possible with WeakMaps. You also cannot create a list of weak references and iterate over them with a WeakMap.

There has been some discussion about adding more powerful weak refs to JavaScript, but I'm not sure where that discussion stands.

Re:Running Lua in a browser via Emscripten by gsnedders on Thursday May 30, 2013 @10:00PM (#5796442)
I wrote a parenthetical about weak references. I wonder why I deleted it. In short: weakrefs are unlikely to appear any time soon in ES, as they open up all kinds of fun around cross-origin objects (being able to detect their approximate life-time, and that's a fairly major side-channel attack) in some lovely edge-cases.
Re:Running Lua in a browser via Emscripten by samth on Friday May 31, 2013 @08:28AM (#5798151)
If you have any more details about this, or even if you don't, please post to es-discuss about it. Currently there is broad consensus on TC39 to add weak references in JS in the future.
Re:Running Lua in a browser via Emscripten by mwcampbell on Thursday May 30, 2013 @09:46PM (#5796406)
I was imprecise; Lua has weak tables, not general weak references. So I'd be happy with weak maps in JS.