Swift target support


I think it would be great if the Haxe compiler can emit Swift target code. I’m curious if anyone else has the same request.

I’m working as iOS eng at Slack. Slack is using Haxe language to write a common text format parser for various server and client platforms. It is really useful to run consistent codes efficiently across many platforms. Currently our iOS app is using generated JavaScript code for text format parser. But we have performance problems with running JavaScript on iOS devices. We tried generated C++ code previously, but it also had some performance problem with complicated regexps. That’s why we ended up using JavaScript code now.

If the Haxe compiler had Swift target support, it would save many Slack iOS users and my life!



long story short, there have been attempts to add swift/objc to haxe in past but non of them really was done.
https://github.com/ralcr there was most know try to add it but I think nothing have been done since last years.
But maybe there are some other hidden works on it :slight_smile: but I would like to have it as well.

Rom Thompson had a start at one. I’m not sure how complete it is.

It’s not swift, but if apple hasn’t removed objc yet hxcpp can output it.

haxe -main Main -cpp out/ -D objc -D file_extension=mm

Hugh talked about it at the last summit, Haxe Summit 2017 Day 2 - Writing hxcpp externs - Hugh Sanderson - YouTube

1 Like

Maybe a bit far fetched, but you could try the LUA VM - interop would be lightweight, and regexes should be fast.

Here is an attempt of ios native development with haxe(hxcpp)

Can you post problematic code examples in haxe c++ maybe community can help get them working?