└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Native-friendly API for Haxe targets 2 | 3 | Write code in Haxe, distribute in native-friendly form. 4 | 5 | ## Initiative 6 | 7 | Haxe is great, one can write once and run the code in many targets. 8 | But it isn't very great as it is almost all-or-nothing. 9 | One either write the whole solution in Haxe or not use Haxe at all. 10 | Because it isn't really easy (but definitely not impossible) to mix 11 | Haxe with the native language in the same project. 12 | 13 | There are a few reasons for that. One of the major reasons is that 14 | in order to standardize across targets, Haxe has created it own set of 15 | data types, some of which has quite different interfaces than the 16 | equivalent types on the native side. And this make it not so easy to 17 | communicate between Haxe and the native targets. 18 | 19 | Also, Haxe is a garbage-collected language, which is another major obstacle 20 | for smoothly integrate Haxe into non-GCed targets like c++. Extra care 21 | is required in passing data across the bridge. 22 | 23 | This project serves as an intiative trying to close the gap between 24 | Haxe and its native targets. 25 | 26 | ## Goals 27 | 28 | #### Data Type 29 | 30 | The primary goal of this initiative is to provide common data types that 31 | are useful to both Haxe and Native developers. 32 | 33 | For example, in Haxe/JS a Map is implemented as an object with a `h` key holding 34 | the key/value pairs, while on Haxe/Java & Haxe/C# it is a double array. Both of them 35 | are not very useful to a native developer. 36 | 37 | For this particular problem, one of the possible solution is to use `Proxy` in 38 | JS to forward field access into the underlying `h` object. Or implement a wrapper 39 | over the Map (Java), IDictionary(C#) interfaces. 40 | 41 | Function type and Enum are some another topics we defintely want to discuss. 42 | 43 | #### Others 44 | 45 | Here lists some of the extended goals that may worth discussion: 46 | 47 | - Making private functions private 48 | - Genenate native-friendly class from an ordinary Haxe class 49 | - Macro that generates the required header/wrapper/whatnot for c++ 50 | - Documentations, tutorials, starter kits, etc 51 | - Toolkit for building, testing, packing binaries, submiting to central repositories, etc 52 | 53 | ## Collaborations Welcome 54 | 55 | This initiative requires experitize from each targets and couldn't possibly be done 56 | by a single person. So, any kind of collaborations will be more than welcomed, may it 57 | be a comment, idea, discussion, code example, test case, reference. Anything. 58 | 59 | ## Experimental 60 | 61 | For now, all codes inside this repo (if there are any) are deemed as experimental. 62 | Use at your own risk. 63 | --------------------------------------------------------------------------------