C++ to Haxe Compiler

450 views
Skip to first unread message

Ashiq A.

unread,
Jul 10, 2015, 5:16:17 AM7/10/15
to haxe...@googlegroups.com
Hi,

Has anyone entertained the thought of writing a C++-to-Haxe compiler?

Take a look at Emscripten. It's a C++ to JS compiler, so you get things like SQLite running in-browser (which is pretty awesome).

I imagine if a C++-to-Haxe compiler existed, it could be sold as "well convert your code to Haxe and immediately you can run it in-browser (Flash), on mobile (Android via Lime), etc." which seems like a pretty big thing.

--Ashiq

Juraj Kirchheim

unread,
Jul 10, 2015, 6:40:59 AM7/10/15
to haxe...@googlegroups.com
Given that C++ already has an LLVM frontend, I'm not sure how this level of indirection helps. You can run C++ on Flash with Alchemy, in the browser with Emscripten and on mobile (with native code) as well.

A decent C++ to Haxe converter would be interesting, but I think in general C++ code cannot really be translated to readable Haxe code ;)

Best,
Juraj

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Hugh

unread,
Jul 13, 2015, 12:31:52 AM7/13/15
to haxe...@googlegroups.com
You could probably write a parser for the emscripten output reasonably easily - but as Juraj says, it's not going to look great - a bunch of functions that act on a global byte-array.  Still, might be interesting.

Ashiq A.

unread,
Jul 13, 2015, 5:11:32 AM7/13/15
to haxe...@googlegroups.com
Like other Haxe code, I don't expect the generated code to be useful. I expect the end-result to be useful (eg. SQLite in Flash).

Maybe it's a good academic/weekend exercise for someone to try if they're interested.

Cristian Baluta

unread,
Jul 13, 2015, 6:56:26 AM7/13/15
to haxe...@googlegroups.com
Seems you're the only one interested

Andy Green

unread,
Aug 29, 2016, 6:38:49 PM8/29/16
to Haxe
I have already written universal-transpiler, which compiles a small subset of C++ into Haxe and several other languages.
Reply all
Reply to author
Forward
0 new messages