Sats Cats Dats Hats

Hi ATS users!

I’m curious about the naming convention of ATS source files, and I haven’t
been able to find a completely clear answer (although this page
https://github.com/githwxi/ATS-Postiats/wiki/C-interface was very
helpful).

As far as I can tell, there are four different extensions and they are used
thusly:

  • Sats – S for source?
    • The primary functional interfaces in ATS are defined in [lib].sats
      in the SATS directory, where [lib] is our library of interest. The
      [lib].sats file will reference a .cats file in the CATS directory,
      which is essentially a C wrapper for the C library functions.
  • Cats – C for the C language?
    • The [lib].cats file accomplishes two things: it annotates existing
      functions and definitions in the C library that are intended to be included
      in the ATS interface, and more importantly, it often defines C wrappers
      that more directly reflect the function signature in ATS. The
      [lib].cats file is a C file, and should include the relevant C
      library wrappers. Often this is just one C include file:
  • Dats – D for dynamic or definition?
  • The [lib].dats file in the DATS directory, if it exists, should
    implement functions that are implemented in ATS but not in the C library
    (or functions that are implemented in ATS and are preferred over the
    implementation in C, or dynamic wrappers around the C library functions).
  • Hats – H for header files?
    • There can also be a HATS directory containing various .hats files,
      which is similar to DATS but does not have the one-to-one
      correspondence that a .dats file would have with a .sats file; this
      is used for alternative implementations of functions, or in the case of C
      libraries, possibly alternative implementations of a similar C library (and
      in this case, each .hats file would likely depend on a particular
      .cats file as well).

What is the purpose of separating all of these intentions into separate
files, and what is the real meaning of the [SCDH] letters?

CATS could be .js if you do ATS+JS co-programming.

HATS is very different. It is much more general than .h in C.

ATS has a powerful template system that allows you to reassemble code.
In many cases, HATS is just DATS with certain parts missing; the missing
parts are supposed to be found in the surrounding context.

Okay, I don’t want to cause too much confusion for the moment.
The ATS story is a very interesting one. It should be most interesting if
you
get to know more about ATS :)On Tuesday, May 5, 2015 at 2:52:23 PM UTC-4, Chad Zawistowski wrote:

SATS and DATS are recognized by patscc/patsopt, but CATS and HATS are not.

In that case, all .cats files might as well be .c, and all .hats files
might as well be .h. Is that correct? It seems odd to use a different
extension.

A good use of HATS can be found in Chapter 12 (currently) of the following
book:

http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/book1.htmlOn Tuesday, May 5, 2015 at 3:10:38 PM UTC-4, gmhwxi wrote:

CATS could be .js if you do ATS+JS co-programming.

HATS is very different. It is much more general than .h in C.

ATS has a powerful template system that allows you to reassemble code.
In many cases, HATS is just DATS with certain parts missing; the missing
parts are supposed to be found in the surrounding context.

Okay, I don’t want to cause too much confusion for the moment.
The ATS story is a very interesting one. It should be most interesting if
you
get to know more about ATS :slight_smile:

On Tuesday, May 5, 2015 at 2:52:23 PM UTC-4, Chad Zawistowski wrote:

SATS and DATS are recognized by patscc/patsopt, but CATS and HATS are not.

In that case, all .cats files might as well be .c, and all .hats files
might as well be .h. Is that correct? It seems odd to use a different
extension.

Hi Chad,

S is for statics. These files are staloaded, and contain type definitions and function declarations, but not implementations.

D is for dynamics. These files are dynloaded, and additionally can be staloaded if they contain declarations that don’t exist in a separate statics file. They can contain anything in the sats files, and also implementations.

C is for the c programming language, as you described.

H is for header. These files are #included, and contain code or macro definitions that should be literally copied into other files, like C headers.> On May 4, 2015, at 16:44, Chad Zawistowski chad...@gmail.com wrote:

Hi ATS users!

I’m curious about the naming convention of ATS source files, and I haven’t been able to find a completely clear answer (although this page was very helpful).

As far as I can tell, there are four different extensions and they are used thusly:
Sats – S for source?
The primary functional interfaces in ATS are defined in [lib].sats in the SATS directory, where [lib] is our library of interest. The [lib].sats file will reference a .cats file in the CATS directory, which is essentially a C wrapper for the C library functions.
Cats – C for the C language?
The [lib].cats file accomplishes two things: it annotates existing functions and definitions in the C library that are intended to be included in the ATS interface, and more importantly, it often defines C wrappers that more directly reflect the function signature in ATS. The [lib].cats file is a C file, and should include the relevant C library wrappers. Often this is just one C include file:
Dats – D for dynamic or definition?
The [lib].dats file in the DATS directory, if it exists, should implement functions that are implemented in ATS but not in the C library (or functions that are implemented in ATS and are preferred over the implementation in C, or dynamic wrappers around the C library functions).
Hats – H for header files?
There can also be a HATS directory containing various .hats files, which is similar to DATS but does not have the one-to-one correspondence that a .dats file would have with a .sats file; this is used for alternative implementations of functions, or in the case of C libraries, possibly alternative implementations of a similar C library (and in this case, each .hats file would likely depend on a particular .cats file as well).
What is the purpose of separating all of these intentions into separate files, and what is the real meaning of the [SCDH] letters?

You received this message because you are subscribed to the Google Groups “ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/65418da4-47d5-4ce1-a883-06b018723f27%40googlegroups.com.

A few more points:

SATS files are just special DATS files. Basically, in DATS, if you declare
a function/value,
you need to use ‘extern’; you don’t in SATS. One does not really need SATS
files at all when
programming in ATS.

SATS and DATS are recognized by patscc/patsopt, but CATS and HATS are not.On Mon, May 4, 2015 at 5:07 PM, Shea Levy sh...@shealevy.com wrote:

Hi Chad,

S is for statics. These files are staloaded, and contain type definitions
and function declarations, but not implementations.

D is for dynamics. These files are dynloaded, and additionally can be
staloaded if they contain declarations that don’t exist in a separate
statics file. They can contain anything in the sats files, and also
implementations.

C is for the c programming language, as you described.

H is for header. These files are #included, and contain code or macro
definitions that should be literally copied into other files, like C
headers.

On May 4, 2015, at 16:44, Chad Zawistowski chad...@gmail.com wrote:

Hi ATS users!

I’m curious about the naming convention of ATS source files, and I haven’t
been able to find a completely clear answer (although this page
https://github.com/githwxi/ATS-Postiats/wiki/C-interface was very
helpful).

As far as I can tell, there are four different extensions and they are
used thusly:

  • Sats – S for source?
    • The primary functional interfaces in ATS are defined in [lib].sats
      in the SATS directory, where [lib] is our library of interest. The
      [lib].sats file will reference a .cats file in the CATS directory,
      which is essentially a C wrapper for the C library functions.
  • Cats – C for the C language?
    • The [lib].cats file accomplishes two things: it annotates
      existing functions and definitions in the C library that are intended to be
      included in the ATS interface, and more importantly, it often defines C
      wrappers that more directly reflect the function signature in ATS. The
      [lib].cats file is a C file, and should include the relevant C
      library wrappers. Often this is just one C include file:
  • Dats – D for dynamic or definition?
  • The [lib].dats file in the DATS directory, if it exists, should
    implement functions that are implemented in ATS but not in the C library
    (or functions that are implemented in ATS and are preferred over the
    implementation in C, or dynamic wrappers around the C library functions).
  • Hats – H for header files?
    • There can also be a HATS directory containing various .hats
      files, which is similar to DATS but does not have the one-to-one
      correspondence that a .dats file would have with a .sats file; this
      is used for alternative implementations of functions, or in the case of C
      libraries, possibly alternative implementations of a similar C library (and
      in this case, each .hats file would likely depend on a particular
      .cats file as well).

What is the purpose of separating all of these intentions into separate
files, and what is the real meaning of the [SCDH] letters?


You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/65418da4-47d5-4ce1-a883-06b018723f27%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/65418da4-47d5-4ce1-a883-06b018723f27%40googlegroups.com?utm_medium=email&utm_source=footer
.


You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/56156B21-C609-4749-8A8E-40D836759018%40shealevy.com
https://groups.google.com/d/msgid/ats-lang-users/56156B21-C609-4749-8A8E-40D836759018%40shealevy.com?utm_medium=email&utm_source=footer
.

Thanks, Shea!

SATS and DATS are recognized by patscc/patsopt, but CATS and HATS are not.

In that case, all .cats files might as well be .c, and all .hats files
might as well be .h. Is that correct? It seems odd to use a different
extension.