On 20/11/2015 19:51, Till Schneidereit wrote: > On Fri, Nov 20, 2015 at 12:23 PM, David Rajchenbach-Teller < > dtel...@mozilla.com> wrote: > >> It could be improved a bit, but the real issue is that JavaScript is a >> high-level, garbage-collected, dynamic programming language, while C is >> a low-level, memory-unsafe, type-unsafe, statically compiled programming >> language. >> >> I have heard a few ideas floating around on how this could be improved, >> by using a radical redesign of js-ctypes based on asm.js/WebAsm, but at >> the moment, I don't think that anybody is working on it. >> > > Reimplementing js-ctypes on top of TypedObjects would also work. But those > still aren't anywhere near being standardized, so it'll be a while until > that's a possibility.
A quick bit of googling brings up the Lua C API which is based on the concept of a virtual stack. [quote] A major component in the communication between Lua and C is an omnipresent virtual stack. Almost all API calls operate on values on this stack. All data exchange from Lua to C and from C to Lua occurs through this stack. Moreover, you can use the stack to keep intermediate results too. The stack helps to solve two impedance mismatches between Lua and C: The first is caused by Lua being garbage collected, whereas C requires explicit deallocation; the second results from the shock between dynamic typing in Lua versus the static typing of C. [/quote] Phil -- Philip Chee <phi...@aleytys.pc.my>, <philip.c...@gmail.com> http://flashblock.mozdev.org/ http://xsidebar.mozdev.org Guard us from the she-wolf and the wolf, and guard us from the thief, oh Night, and so be good for us to pass. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform