I’ve been reading and watching videos on Heaps and something I wish was documented better is how Heaps gets onto target platforms.
Here is my understanding so far:
-
Somewhere in Nicholas’s video on Heaps he mentioned that most of Heaps is written in Haxe. Since Haxe is designed to be compiled to any platform, this code is not a problem. What is a problem is the 20% or whatever that is NOT in Haxe (I think he said it was the renderer?)
-
With heaps you have various Target Platforms, currently listed as Flash, HashLink and HTML.
Now presumably if you want to target Desktop or Mobile you would use HashLink then, since the same page says By targeting HashLink you are also able to generate Native C code for your project (On another video Nicholas says you can just use Flash and Adobe Air to get onto mobile, but then elsewhere I’ve read him say that the performance for this isn’t great).
So for most common situations you would have Heaps Code (-> compiles down to) HashLink (-> which then can run on) Target Platform.
A few questions:
- In the docs it says HashLink is a virtual machine. Does this use bytecode? So when you create a
game.hl
file - is this bytecode? - If this is bytecode, then are we not just running byte-code on the target platform? This doesn’t then seem like “able to generate Native C code for your project”… What am I missing?
- If it is bytecode, do you then wrap your
game.hl
and assets with the platform version of the HashLink VM?
Maybe all of this stuff is obvious but I’ve somehow missed it from my investigations…