top | item 4570382

Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas Implementation for iOS

190 points| phoboslab | 13 years ago |impactjs.com | reply

45 comments

order
[+] phoboslab|13 years ago|reply
Thanks for the great response so far!

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

[+] mrspeaker|13 years ago|reply
Thanks very much for open sourcing this. Keep up the good work - everything you post is great... great information, and great code. Thanks again!
[+] evmar|13 years ago|reply
Have you seen Plask? (http://www.plask.org/) What are your thoughts on it? I guess it doesn't target OpenGL, but I imagine it's pretty fast already...
[+] soapdog|13 years ago|reply
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.
[+] city41|13 years ago|reply
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.
[+] programminggeek|13 years ago|reply
ImpactJS is a fantastic tool and Ejecta solves a real problem in a smart way. Phobos Lab does awesome work.
[+] firlefans|13 years ago|reply
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.
[+] drcode|13 years ago|reply
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...)

[+] dj2stein9|13 years ago|reply
This looks like a great way to build iOS games in HTML5.

If he could to get this to work as an Android project it could be used to build games for OUYA.

[+] TazeTSchnitzel|13 years ago|reply
I want this in the browser. Throw away the DOM, and let's just have canvas and JS. Skip loading any HTML or CSS. It would be great.
[+] wwweston|13 years ago|reply
In fact -- why do we even have browsers?

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.

[+] jaipilot747|13 years ago|reply
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?

[1] http://ludei.com/tech/cocoonjs

[+] spot|13 years ago|reply
webgl can be much faster because you can draw many primitives with one call. there's a lot of overhead from js down to gl.
[+] kevingadd|13 years ago|reply
Isn't JS performance going to suffer if it's using a custom build of JSC that can't JIT?
[+] phoboslab|13 years ago|reply
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.

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...

[+] killahpriest|13 years ago|reply
Native iOS doesn't have JIT
[+] dsirijus|13 years ago|reply
Pretty cool.

What about the support for Android, any plans for that?

[+] phoboslab|13 years ago|reply
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.

But have a look at CocoonJS; it's cross platform (but closed source): http://ludei.com/tech/cocoonjs

[+] kylebrown|13 years ago|reply
I was curious about that too. With android support, it would be a good alternative to Corona (use js instead of Lua).

For iOS, an added benefit of is that JavascriptCore uses Nitro, unlike UIWebView.

[+] wklauss|13 years ago|reply
Reminds me of CocoonJS (basically the same idea, also support for Android but closed source).

https://vimeo.com/45506217

Neat in any case. Looks like a nice implementation.

[+] SunboX|13 years ago|reply
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.
[+] matthuggins|13 years ago|reply
As far as I am aware, ImpactJS is unfortunately only for tile-based game development on canvas. Has this influenced/limited Ejecta in any way?
[+] icemelt8|13 years ago|reply
The quicker you guys realize it the better, Flash is the better choice.
[+] vicapow|13 years ago|reply
Apple needs to just buy you out right and include this in safari.
[+] wsc981|13 years ago|reply
Just wanted to tell this is some really cool work you've done.
[+] acron0|13 years ago|reply
Bugger. There goes my pet project. Nice one phoboslab!
[+] rabidsnail|13 years ago|reply
The word "Ejecta" sounds dirty. I feel weird just typing it.
[+] antidaily|13 years ago|reply
You're probably not old enough to have had a walkman?