The Lua VM, on the Web
daurnimator.github.io
daurnimator.github.io
I guess what I don't understand is how the higher-level bindings work. Something like the neo-geo emulators running in asm.js can read controllers and output graphics. How much custom code is required going from system C to browser JS. Is it closer to a 'gimme' if it targets GL and can just use WebGL? Is there something like sdl.js? And if it has those external library dependencies, does the whole dependency tree have to be compiled to asm.js?
More specifically, if the lua VM can be put into the browser, and interpret lua code, then how much custom code would it take to make Love2D work?
Edit: Just re-reading this question I realized it'd most likely be like a static build, so it would pull in the dependency source, and then most likely something that would use the io/display stuff API, but with a browser back-end. I've dug around a couple times trying to find a basic overview of that, but to not much avail. I'd love any references though.
[1] http://kripken.github.io/emscripten-site/
[2] https://github.com/kripken/emscripten/blob/master/tests/hell...
SDL2 cross-compiles to JavaScript properly and should be used by most things now.
I feel like I'm just asking dumb toolchain questions because I'm missing something fundamental about targeting an executable build to the browser.
https://kripken.github.io/emscripten-site/docs/porting/conne...
taking this port of GNUnet[1] to Javascript through emscripten, where does the GNUnet code ends and where does JS starts? What functions are exported by the GNUnet code? In this case, Clojurescript is used, but I suppose I could reuse the "ported C" part and write my own pure-Javascript app on top of it, right? How difficult is that?
Someone is working on it:
1) wrappers for popular native APIs and frameworks to simplify porting existing code: apart from the 'expected' C and C++ runtime wrappers, emscripten also offers wrappers for GL, GLES 1..3, EGL, GLFW, GLU, GLUT, GLEW, SDL and OpenAL, these generally translate (and sometimes emulate) the behaviour of the native APIs to the underlying HTML5 APIs (e.g. GL to WebGL, SDL Audio and OpenAL to WebAudio, etc...)
2) there are also smaller emscripten-specific APIs that are essentially minimal shims around HTML5 APIs, for instance to initialize a WebGL context, one could either use the EGL or SDL wrappers which add some code bloat and don't directly map to WebGL initialization attributes, or one can use the emscripten_webgl_*() functions which map directly to the WebGL context initialization process, there are also similar small shims for input, XMLHttpRequest, WebWorkers and others, the advantage of these direct HTML5 shims is that they introduce less code bloat, but they don't exist anywhere outside the emscripten platform
3) emscripten also provides a number of different ways to easily write your own shims to call from C/C++ into JS, and the other way around, even with marshalling complex C++ data types (see: https://kripken.github.io/emscripten-site/docs/porting/conne...)
I really like that emscripten is much more than just a compiler toolchain with C/C++ runtime, there has been a tremendous amount of work to make it as simple as possible to port existing code over without or just minimal changes!
Similarly, emscripten provides a standard C OpenGL API, but it actually translates those calls to WebGL Javascript calls.
It is a really well designed engine. And it's community has a lot of talented people.
I'm deeply saddened that it appears to be dying. And that I don't have more time to work with it and contribute to it.
The emscripten port of Love.js: https://github.com/TannerRogalsky/love.js
You can implement anything from component based design, traditional inheritance and other paradigms with just those 3 components.
* nginx modules (proxying rules)
* Redis modules (special triggers)
* Machine learning with Torch
* Embedded systems (ESP8266)
https://www.destroyallsoftware.com/talks/the-birth-and-death...
Where can I read more about this kernel-level sandboxing that's discussed towards the end?
Additionally: as I understand things, the methodology behind asm.js could (in principle) be applied to any JIT-ed language. Is the choice of doing this in JS only because JS is the language of browsers (i.e.: kernel-level sandboxing can easily use existing browser sandboxing code) or are there other technical considerations behind this decision?
https://www.destroyallsoftware.com/screencasts
It's a bit pricey at $29 dollars a month but if all of the content is as interesting, entertaining and thought provoking as this talk I could see it being worth the price. I would be curious to hear anyone's feedback.
I also wrote a blog post with a comparison of different frameworks: http://lua.space/webdev/the-best-lua-web-frameworks
I have been slowly working towards a full express clone, but don't have a compelling reason to complete it.
EDIT: though now that I look at it, it's already possible:
The big thing lua.vm.js needs is weakrefs https://github.com/tc39/proposal-weakrefs
I use both of them with Sailor, but I tend to prefer starlight recently