ATS as a C library.

67 views
Skip to first unread message

aditya siram

unread,
Jan 27, 2017, 4:12:54 PM1/27/17
to ats-lang-users
Hi,
I know that the ATS compiler can decompile sum/product types and functions to unmangled C struct/union/functions but I was wondering if it's possible to also produce a header file with the struct/union declarations and function signatures. I'd like to distribute C code decompiled from ATS as a library without the client having to know it was written in ATS. For that I need header files as well.
Thanks!
-deech

gmhwxi

unread,
Jan 27, 2017, 4:22:49 PM1/27/17
to ats-lang-users

It sounds like something pretty straightforward to do.

If you could provide a manually constructed sample, I would be happy to take a look.

gmhwxi

unread,
Jan 27, 2017, 10:13:02 PM1/27/17
to ats-lang-users
I take a guess. Maybe this is what you need:

https://www.npmjs.com/package/ats-postiats-include

For instance, the following package contains only C code
generated for ATS source:

https://www.npmjs.com/package/atsccomp-atscc2js

The C code can be readily compiled into an excutable (atscc2js) by a
standard C compiler such as gcc and clang after the ats-positiats-include
package is installed. There is no need to install ATS for doing the compilation.
Reply all
Reply to author
Forward
0 new messages