What use of the C preprocessor are you seeing? Is it the #include? That does work like C’s #include but there are more module like things. See staload. These respect namespacing and local definitions so you can do things like:
local
staload FOO = "somefile.sats"
in
$FOO.dosomething()
end
#include in ATS code is textual substitution in ATS code and the code processed by the ATS compiler. Anything in C code blocks is directly inserted into the generated C code (ATS compiles to C which is then compiled by a C compiler) so is handled by the C compiler. ATS doesn’t parse that code. So there are two languages at play there, both using #include for similar functionality.
The fact that ATS makes heavy use of the C preprocessor bothers me. Does it have a true module system? Is there a particular reason it doesn’t?
What use of the C preprocessor are you seeing? Is it the
#include
? That does work like C’s#include
but there are more module like things. See staload. These respect namespacing and local definitions so you can do things like:Yes, the include specifically made me think so. Is that actually the CPP? Anyways, reassuring to see there’s other functionality.
No, the
#include
isn’t handled by the CPP. The C preprocessor is only used if you use #include/#define inside embedded C code blocks:Interesting! Seeing as the
#include
syntax is reused, is it textual substitution or something more complex?#include
in ATS code is textual substitution in ATS code and the code processed by the ATS compiler. Anything in C code blocks is directly inserted into the generated C code (ATS compiles to C which is then compiled by a C compiler) so is handled by the C compiler. ATS doesn’t parse that code. So there are two languages at play there, both using#include
for similar functionality.Great to see folks using this language- I’ve had my eyes on it for some time, but haven’t tried it out yet.
Is the book available in text or Epub format?
Not yet as far as I can tell. The other ATS documents are available in PDF and epub.