News for hackers. Stuff that matters.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by phoboslab on Tuesday September 25, 2012 @10:24AM (#4570469)
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

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by mrspeaker on Tuesday September 25, 2012 @11:50AM (#4570981)
Thanks very much for open sourcing this. Keep up the good work - everything you post is great... great information, and great code. Thanks again!
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by evmar on Tuesday September 25, 2012 @05:56PM (#4572900)
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...
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by soapdog on Tuesday September 25, 2012 @11:11AM (#4570748)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by city41 on Tuesday September 25, 2012 @01:08PM (#4571416)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by programminggeek on Tuesday September 25, 2012 @10:38AM (#4570547)
ImpactJS is a fantastic tool and Ejecta solves a real problem in a smart way. Phobos Lab does awesome work.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by firlefans on Tuesday September 25, 2012 @10:48AM (#4570612)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by yesimahuman on Tuesday September 25, 2012 @11:06AM (#4570717)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by imaffett on Tuesday September 25, 2012 @12:36PM (#4571247)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by drcode on Tuesday September 25, 2012 @10:48AM (#4570610)
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...)

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by imaffett on Tuesday September 25, 2012 @12:36PM (#4571239)
DirectCanvas from appMobi (I work there) is based on iOS impact (and enhanced) - http://www.appmobi.com . No need for a Mac or XCode.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by dj2stein9 on Tuesday September 25, 2012 @10:19AM (#4570435)
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.

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by TazeTSchnitzel on Tuesday September 25, 2012 @04:50PM (#4572591)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by wwweston on Tuesday September 25, 2012 @06:53PM (#4573153)
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.

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by TazeTSchnitzel on Wednesday September 26, 2012 @02:27PM (#4577177)
Yeah, like Java. :P
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by erichocean on Tuesday September 25, 2012 @05:37PM (#4572816)
That's pretty much exactly what Blossom[1] is; there's no need to write HTML or CSS.

[1] https://github.com/erichocean/blossom

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by TazeTSchnitzel on Tuesday September 25, 2012 @05:41PM (#4572834)
Yeah, but I'm thinking having the current W3C APIs.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by jaipilot747 on Tuesday September 25, 2012 @11:24AM (#4570815)
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

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by spot on Tuesday September 25, 2012 @11:42AM (#4570934)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by jaipilot747 on Tuesday September 25, 2012 @12:13PM (#4571124)
Then what is stopping browser vendors from implementing canvas directly in gl directly, making canvas more or less a wrapper?
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by greggman on Tuesday September 25, 2012 @02:59PM (#4572037)
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.

http://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.htm...

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by kevingadd on Tuesday September 25, 2012 @07:02PM (#4573205)
Isn't JS performance going to suffer if it's using a custom build of JSC that can't JIT?
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by phoboslab on Wednesday September 26, 2012 @08:24AM (#4575206)
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...

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by killahpriest on Tuesday September 25, 2012 @08:42PM (#4573613)
Native iOS doesn't have JIT
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by kevingadd on Tuesday September 25, 2012 @08:53PM (#4573648)
The browser certainly does. Or is this only an alternative to a WebView in an app store app?
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by vicapow on Tuesday September 25, 2012 @11:32PM (#4574045)
even google wasn't able to include a JIT in Chrome for iOS
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by mamp on Wednesday September 26, 2012 @12:47AM (#4574199)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by dutchbrit on Wednesday September 26, 2012 @03:46AM (#4574607)
There's even a massive JIT vulnerability in webkit on iOS at the moment.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by arturadib on Tuesday September 25, 2012 @11:10AM (#4570740)
Interesting! I created Node-Five with a similar goal in mind (low-level graphics and audio from the HTML5 spec):

http://documentup.com/arturadib/node-five

Glad to see someone had the same idea for iOS :)

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by dsirijus on Tuesday September 25, 2012 @10:11AM (#4570397)
Pretty cool.

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

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by phoboslab on Tuesday September 25, 2012 @10:21AM (#4570448)
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

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by kylebrown on Tuesday September 25, 2012 @01:30PM (#4571541)
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.

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by jevinskie on Tuesday September 25, 2012 @09:08PM (#4573696)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by wklauss on Tuesday September 25, 2012 @09:01PM (#4573676)
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.

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by SunboX on Tuesday September 25, 2012 @01:47PM (#4571629)
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.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by matthuggins on Tuesday September 25, 2012 @04:32PM (#4572509)
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?
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by tlrobinson on Tuesday September 25, 2012 @10:30PM (#4573927)
Cool. This sounds a bit like Game Closure (http://gameclosure.com/)
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by icemelt8 on Wednesday September 26, 2012 @06:10AM (#4574906)
The quicker you guys realize it the better, Flash is the better choice.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by vicapow on Tuesday September 25, 2012 @11:32PM (#4574048)
Apple needs to just buy you out right and include this in safari.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by wsc981 on Tuesday September 25, 2012 @11:21AM (#4570796)
Just wanted to tell this is some really cool work you've done.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by grimboy on Tuesday September 25, 2012 @10:15AM (#4570413)
Any actual benchmarks?
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by phoboslab on Tuesday September 25, 2012 @10:19AM (#4570437)
I haven't done any formal benchmarks. A quick test with 1000 sprites runs with 60fps on the iPhone4s.

Also try loading this in Mobile Safari and compare it to the video: http://www.phoboslab.org/crap/bezier/

Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by acron0 on Tuesday September 25, 2012 @10:27AM (#4570484)
Bugger. There goes my pet project. Nice one phoboslab!
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by rabidsnail on Tuesday September 25, 2012 @10:18AM (#4570428)
The word "Ejecta" sounds dirty. I feel weird just typing it.
Re:Show HN: Ejecta, A Fast, Open Source JavaScript, Canvas I... by antidaily on Tuesday September 25, 2012 @10:38AM (#4570546)
You're probably not old enough to have had a walkman?