This project is very much iOS specific. It's written in Objective-C and uses JavaScriptCore (Apple's JS engine). So porting this over to Android would be a lot of work.
JSC as used by an app store app does not use Nitro. As the post stated, JSC is a private framework and the only way to use it in an approved app is to import the source into your project and build a copy of JSC that is bundled with your app. Since the JSC that you use is contained within your executable, iOS doesn't allow the write and execute permissions in memory that would be necessary for JIT.
This guy is a hacker in the truest sense, I read a blog post over a year ago about him tinkering away on this. It didn't seem he'd take it this far. It's a great achievement and I'm glad he's been insightful enough to keep it free.
I used Impact two years ago on something and I was so impressed with the API simplicity and power (not to mention the fact that it ran very well). This guy does great work.
Dominic is amazing at what he does. ImpactJS is such a powerful but simple tool. I love that every release is NOT bloatware, but carefully thought out feature enhacements.
Any plans on making it usable without XCode? (or a Mac, for that matter.)
Since the users just write javascript code, as long as you give them a way to insert that code into an app, they wouldn't really need to use the XCode build system at all (I know, app store rules would need to be addressed...)
I purchased ImpactJS after picking the "Creating HTML5 Games" book about it. I was really surprised with the quality of the toolkit and how responsive the developer is. I think it was the best investment I made this year and I can't wait to release some games.
I'm very happy with impact. It's well designed and easy to extend. After quite a bit of exploring different frameworks and engines (including writing my own), I think impact is my long term game dev solution.
That the canvas API is implemented with OpenGL is very impressive. CocoonJS [1] (a similar project for Android, as noted in the comments below) seems to have taken the same approach.
On a completely tangential note, given that the main desktop browsers now sport hardware accelerated canvas implementations, is there a performance difference in 2D graphics rendered with canvas vs. WebGL?
Canvas is directly implemented in gl (or directx) in most browsers at this point. WebGL is still faster like the poster above says because you as the programmer an can make optimizations that are not possible with the canvas api like drawing many things with one call.
Really great work! One question belonging to this, do you know how to used 4x5 ColorTransform Matrices with JavaScript and WebGL/OpenGL? I can't find anything about this on the I-net.
Safari uses a JIT. Other browsers and UIWebView based applications are not allowed to access the JIT, apparently because it is a security risk. Even lua based apps are not allowed to run luajit because code generation on iOS isn't allowed within apps.
Yes. I wish we could use the JIT – it would make computational heavy stuff way faster. Most games however aren't performance bound by computation, but by drawing. Not having the JIT isn't as bad as it may seem.
46 comments
[ 3.5 ms ] story [ 115 ms ] threadWhat about the support for Android, any plans for that?
But have a look at CocoonJS; it's cross platform (but closed source): http://ludei.com/tech/cocoonjs
For iOS, an added benefit of is that JavascriptCore uses Nitro, unlike UIWebView.
Also try loading this in Mobile Safari and compare it to the video: http://www.phoboslab.org/crap/bezier/
If he could to get this to work as an Android project it could be used to build games for OUYA.
I also wrote about some implementation details of the Canvas API and the challenges with OpenGL in my blog:
http://www.phoboslab.org/log/2012/09/ejecta
Since the users just write javascript code, as long as you give them a way to insert that code into an app, they wouldn't really need to use the XCode build system at all (I know, app store rules would need to be addressed...)
http://documentup.com/arturadib/node-five
Glad to see someone had the same idea for iOS :)
On a completely tangential note, given that the main desktop browsers now sport hardware accelerated canvas implementations, is there a performance difference in 2D graphics rendered with canvas vs. WebGL?
[1] http://ludei.com/tech/cocoonjs
http://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.htm...
[1] https://github.com/erichocean/blossom
If only there were some popular write-once run-anywhere VM, we could pretty easily get away from this weird document-oriented web thing forever.
Also, JavaScriptCore recently features a new "low level interpreter" – still not as fast as the JIT, but way faster than it was a few month ago: http://wingolog.org/archives/2012/06/27/inside-javascriptcor...
https://vimeo.com/45506217
Neat in any case. Looks like a nice implementation.