I do not have the software engineering chops to make this happen but I am just curious if in theory from Haxe to CC65 possible. CC65 lets you write code for retro platforms using C. It comes with sample codes that can be compiled to C64 and tested in VICE emulator
" cc65 is a complete cross development package for 65(C)02 systems, including a powerful macro assembler, a C compiler, linker, archiver and several other tools. cc65 has C and runtime library support for many of the old 6502 machines. For details look at the Website."