In the case of Haxe as target language, using a subtarget allows you to instruct Haxe to convert it to the specified language.
JTransc is split into several modules:
Here is where most of the jtransc code is found. It is written in Kotlin. And this project contains the AST, graph analyzing and transformation stuff. This part doesn’t know anything about target languages. Just handles JVM Bytecode and transforms it into an easy-to-handle AST. It is possible that this part alone would evolve into an standalone piece. Something like: AstVM that defines the AST. And then utilities that can serialize/unserialize and transform java bytecode into that AST. So anyone can consume or generate that AST code. Just as happens on WebAssembly but for higher level languages.
This project is a dependency of several JTransc modules. And it contains utility classes.
This module handles the Haxe generation. It knows about the haxe tooling (haxe and haxelib commands) and haxe specific annotations. And knows how to transform JTransc AST into Haxe sourcecode. But doesn’t know anything about JVM bytecode.
Contains generic code to handle several debug protocols, sourcemaps and provides a common interface for consume any of the supported debug protocols easily.
A plugin for intelliJ that can compile code using JTransc and implements the intelliJ debugging API using the
jtransc-main contains a command line interface for using JTransc without maven, and allows to build a fatjar with all the dependencies included.
jtransc-main-run provides a terminal command
jtransc using maven fast and easily.
This is the maven plugin. The one that handles compiling stuff with maven which is the recommended way for using JTransc.
This contains a custom RT compatible with the Java Runtime. This will eventually reference OpenJDK overriding just a small amount of specific classes.
This module is very important for JTransc and has its own section. This module can be referenced in any project even in those that are not using JTransc directly. It provides a set of annotations that JTransc can understand: some generic and some other target-specific. Also provides some classes that works out of the box with the JVM, but that provides an optimized implementation for some targets.