# Publishing libraries in target languages

**URL:** <https://community.haxe.org/t/publishing-libraries-in-target-languages/2490>\
**Category:** Haxe\
**Created:** [May 31, 2020, 4:44am UTC](https://community.haxe.org/t/publishing-libraries-in-target-languages/2490 "2020-05-31T04:44:00Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![jedwards1211](https://community.haxe.org/user_avatar/community.haxe.org/jedwards1211/32/1240_2.png) [@jedwards1211](https://community.haxe.org/u/jedwards1211)\
**Post date:** [June 26, 2020, 9:01pm UTC](https://community.haxe.org/t/publishing-libraries-in-target-languages/2490/8 "2020-06-26T21:01:19Z")

</div>

After looking into this more, my friend and I decided to look into writing our libraries in C++ and using SWIG and Emscripten to connect them to other languages. Definitely not the best, as it would be nice to avoid compiling C++ for each platform we need to support when using the library in a VM language like Java or Python. But it seems like an easier option for now.

The primary reason we decided against using Haxe was that the output C++ code isn’t very idiomatic, as described in [this comment](https://community.haxe.org/t/hxcpp-option-to-not-append-obj-to-class-names/2506/2). Especially regarding arrays and the use of garbage collection instead of shared pointers.

Im tempted to start writing tools to transpile a carefully limited subset of either Java or TypeScript to source code for other common languages. I think it would be the cleanest approach in the long run, but it would take a lot of work.

As far as Haxe, I like a lot of things about it, but I get the impression it would require major surgery to make it convenient for publishing target language libraries.

---

_[View the full topic](https://community.haxe.org/t/publishing-libraries-in-target-languages/2490)._
