2

We have a html5 game with some performance issues in older phones, so I would like to know if there is any tool even in alpha that address this problem.

I am not talking about bundling the app with PhoneGap or similar, also I'm not looking something like impactjs but a tool that takes a generic html5 app and compile it somehow to native.

Any help would be greatly appreciated.

Edit: Making the question more broad, and since apparently there is not such tool at the moment, does anyone have some idea on where to look more info on how to create a tool like this?.

The target platforms must include: iOS, Android, Windows phone and Bada. All others would be nice to have :p.

I think that the performance penalty comes from the freedom that html5 provides, what about taking a browser and chopping out all the functionality that is not needed for this particular html5 app, and then embed everything together. Would this be simpler ? would be possible to create an automatic tool to do this with any app?

Agustin Cautin
  • 411
  • 5
  • 23
  • 1
    What actions in the HTML5 are "slow"? Why do you think "compiling" would help those slow actions? In any case, you seem to be asking for a language translator; when you say to "native", what target langauges/frameworks do you want. In general, full translators are pretty hard to build; see http://stackoverflow.com/questions/3455456/how-to-translate-between-programming-languages/3460977#3460977 I haven't look much at HTML5; is there a reason to believe this is an easy translator? – Ira Baxter May 11 '12 at 17:18
  • The game is in general slow, every time a player do some action there is a noticeable delay from the game to respond. – Agustin Cautin May 11 '12 at 18:10
  • So you don't have a specific understanding of what's slow? How do you know the slowness isn't just an artifact of "older phones"? You don't want build a compiler test it, and discover it was a waste of effort. – Ira Baxter May 11 '12 at 19:20
  • ... just noted your edit: "anyone have some idea ... how to create a tool like this?" Funny you should ask :-} My link above tells that my company does do things like this, and we have strong translator foundations on which to build such translators, as well as output modules specifically targeted to support ObjectiveC, Java, and C#. – Ira Baxter May 11 '12 at 19:22
  • Well the native iOS is not slow at all, having the same assets functionality and animations. (I would even say that code wise is a lot less efficient, since has never been an issue, it is not optimized at all). I looked at your link, but I don't want to build a translator (Maybe this is the only option and hence not doable). But since browsers are already interpreting the code (Please forgive my ignorance) wouldn't be possible to "extract" this output somehow? – Agustin Cautin May 11 '12 at 20:23
  • This is kind like observing that since Python interprets its source text, you should be able to extract a C program from its actions. This would only work if Python's interpreter manufactured C code, compiled and ran it. The analog is the HTML5 interpreter produces "native code" for you to grab. I don't know how it actually works, but my guess is the HTML5 interpreter figures out what do, and then makes machine-code binary calls on the actions; it never produces "compilable" source. – Ira Baxter May 11 '12 at 20:54
  • ... Most people (rightly) don't want to build a translator. Its expensive, hard, and risky. Some do; might not be you, granted. But the way you posed the question "...compile to..." is inherently a translation question. The way you hoped to solve it was by taking advantage of somebody else's translator, which is fine if it exists. Translators are rarer than unicorns, though. – Ira Baxter May 11 '12 at 20:55
  • Maybe you misunderstand me, I don't want the "compilable" source. I want the compiled binary. Do this makes any difference or is also impossible ? – Agustin Cautin May 11 '12 at 20:56
  • I understand you want to *ship* the compiled binary. Mostly you get binaries by compiling source code of some kind; where did that source code come from? Given the targets run Java/C#/... you've got to translate the HTML5 to one of those languages, and compile that to get your binary. Or else I've completely misunderstood what is going on. – Ira Baxter May 11 '12 at 20:59
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/11170/discussion-between-agustin-cautin-and-ira-baxter) – Agustin Cautin May 11 '12 at 21:00
  • No. I've been burned by chat room rules "your remark is too long" and then it throws it away. I don't get burned in comments, whether SO approves of this or not. – Ira Baxter May 11 '12 at 21:01
  • "The HTML5 interpreter figures out what do, and then makes machine-code binary calls on the actions", This is the binary I want. Somehow "pre-rendering" the app. – Agustin Cautin May 11 '12 at 21:06
  • Sure, that binary is some of what you want. To get it, you have to pry the binary code for the HTML5 interpreter apart and watch what it is doing as your program runs. Most of us don't know how to do that. Even if you did, the set of binary calls isn't exactly what you need, because it represents a *specific execution* of your program. You want to translate the control structure, etc. of your program, so it will exhibit all possible expected behaviors, as opposed to the results of one specific execution. Back to translation again. – Ira Baxter May 11 '12 at 21:08
  • True, thank you very much for your patience. Probably the best way will be to manually port to native, and maybe next year try again when html5 is more mature and performance is not an issue anymore. – Agustin Cautin May 11 '12 at 21:13
  • What you're asking for can only exist in the context of what you are trying to convert. There is no generic converter that convert from a to b. If you don't know your incoming data you cannot make anything out of it. That said email me at specifically describe exactly what your source is – jacobsgriffith May 12 '12 at 03:39

1 Answers1

1

Take a look at appcelerator http://www.appcelerator.com/platform

James Cross
  • 7,799
  • 8
  • 24
  • 30
  • 1
    I might be misunderstanding, but it looks like from JS you can *target* HTML5 (and iOS and Android), not take an HTML5 game and turn it into a native app. Do you have a link to docs that discuss taking existing HTML5 game and turning it in to a native app using this SDK? – Dave Newton May 10 '12 at 11:57
  • This is the same as impactjs, I have to program in this sdk to be able to target iOS and Android. I want something more general than this. – Agustin Cautin May 10 '12 at 12:09