3 ms·
This presentation seems to be missing the point. It's about "web apps" so presumably JS apps running in the browser, however as far as I know you cannot access
by laurent123456 13y ago
This presentation seems to be missing the point. It's about "web apps" so presumably JS apps running in the browser, however as far as I know you cannot access the DOM from ASM.js code, so creating a JS app is not going to be easy.
Then there's the "small problem" of having to develop this in C++, which means you don't have access to all the nice new frameworks that are being developed - AngularJS, emberJS, etc. and have to deal with the joy of dangling pointers, memory leaks, slow compilation time, etc. (even though you might not even need the speed benefit of C/ASM.js). That makes development time a lot longer for no obvious benefits. And of course, there's also the nightmare of debugging cryptic ASM.js code in the browser if something doesn't work.
I can see the point of ASM.js for games or apps where very high performance is required but for web apps I'd rather stick to regular JS.
- chii 13y agoif you are writing yet another TODO/agile trello/twitter clone, the hard parts isn't in the programming, and ASM.js (and compiling in general) doesnt concern you at all. The beauty of this form of programming is in being able to port large, existing code bases to new platforms with "relative" ease. This doesn't only apply to games (which in large part is the main reason for such things), but to things like a torrent implementation in the browser for example. Or, peer to peer chat ala skype in the browser, all without having to use a centralized server. Applications such as those is difficult write from scratch, but if a porting mechanism exists, it could be a boon to the amount of things you can do online now.
- laurent123456 13y agoI agree with that, but the presentation makes it look like C++ + EMScripten is almost a drop-in replacement for writing large web applications. Even for very large web applications front-ends like Gmail, AMS.js is probably still not a good solution. It's for very specific use cases, where high performance is needed, and not as simple as "Big web app? Compile it".
- neilxdsouza 13y agoIt might be on a case to case basis, but for me C++ and Emscripten was an almost drop in replacement. My survey compiler uses ncurses, wxWidget/gtk and web toolkit for native screen display. I read the emscripten documentation that you could call pure javascript and pass data back from javascript too. I wondered if you could use Dojo as a widget library replacement for native toolkits like wxWidgets etc. I tried it out and was able to get things working in 2-3 days. And I'm not good at Javascript and have not really tried Dojo before either. I was able to get Sencha to work, but not Sencha Touch. Dojo mobile is working fine as well (but I have to tweak it). The novelty is not asm.js but using the browser as a Windowing System and a JavaScript library as your UI library. The survey compiler is open source and if you are interested in getting started I and point you to the relevant sources. What Emscripten enables me is open up the tablet space for surveys with hardly any effort using toolkits like Phonegap.
- azakai 13y agoOf course, yes, I didn't mean that compiling C++ is good for web apps in general. Just for a small subset like certain games and so forth. Btw, you can access the DOM from compiled C++ (and asm.js), for example http://kripken.github.io/mloc_emscripten_talk/qcon.html#/33 http://kripken.github.io/mloc_emscripten_talk/qcon.html#/33 but again, I would not recommend that for general apps. It's useful when you do need to quickly do something in the DOM though, and you are actually writing something that benefits from compiling C++.