While ATS1 has direct support for C-unions, it is very difficult to use.
In ATS2, direct support for C-union types is no longer available. However,
it is quite straightforward to support C-unions in ATS2 externally.
Please see a running example by following the link below:
There is a lot of boilerplate code in this example. In the future, some
meta-programming
support may be added to automatically generate such code from a template
provided by
the user.