ammer

Implementing new platforms

About type representation

Instances of TypeMarshal (obtained from a Marshal instance) define how any given type is to be passed between Haxe and C. This marshalling is performed in up to three steps in C code (depending on the concrete platform and type), named L1 (closest to Haxe and the concrete Haxe target), L2, and L3 (unified C representation).

Implementing the platform file

To create a new Platform, it is best to follow examples of existing platforms, whose implementations are in the ammer.core.plat package. There is also a None platform which performs no-ops or raises exceptions for all of its operations; it can also serve as a good template file for new platform implementations.

Types such as ammer.core.Platform and ammer.core.PlatformId should also be adapted to make ammer-core aware of the new platform.

When developing the actual implementation, a rough guideline is as follow:

« Previous: Interface