Is writing a cross platform library with Haxe good idea?

Hi all. I want to re-write my custom physics engine library. Haxe promises to transpile on many code(other languages) with a single code.

For example, would it be a bad idea to write my physics library in Haxe and transfer it to languages such as C#, C ++, JavaScript? It sounds like a very attractive idea, but I haven’t encountered such an example.

Are there any good sample libraries about it?

It would not be bad idea, but in general haxe code on specific platform has some overhead - for example there is a garbage collection “behind the scenes” added for cpp, etc. It`s totally ok for usual usage, but may hit hard with low level stuff like physics engine. it can be tuned though, so so you need to check for yourself.

Take a look at Daff which does exactly that: GitHub - paulfitz/daff: align and compare tables

@RoBBoR is planning to work on a GC-less C++ target [0] and something like this would be a great use case for it. They seem to have gotten a lot of the stuff required for making a target setup [1] and have a lot of progress in making a GDScript target [2]. Sadly it isn’t ready yet.

[0] GitHub - RobertBorghese/hxcpp-NoGC: A version of hxcpp.h that makes Haxe/C++ output inherently use no gc, only value types.
[1] GitHub - RobertBorghese/reflaxe: Haxe framework for creating compilation targets using macros
[2] GitHub - RobertBorghese/Haxe-to-GDScript: Compile Haxe to GDScript 2.0 as easily as you'd output to any other target

1 Like

Thank you all.