Creating a package written in ATS

I created the following package for use by other projects:

Here is an example to show how CATS-parsemit can be used:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atscc2js

Basically, one needs to copy the SATS files provided by CATS-parsemit to a
local directory, say,
.CATS-parsemit. In addition, one needs to copy the CATS files generated
from the ATS source (of CATS-parsemit).
This can be done by issuing:

make pkgreloc

These CATS files replace the need for library binaries (in the form of .a
or .so files), thus greatly enhancing portability.

Now just do ‘make all’, and ‘atscc2js’ should be built properly.

From CATS-parsemit or from CATS-atscc2js? I don’t know the pkgreloc
target.

In CATS-atscc2jsOn Fri, May 22, 2015 at 12:41 PM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:

Le vendredi 22 mai 2015 18:18:35 UTC+2, gmhwxi a écrit :

[…] In addition, one needs to copy the CATS files generated from the ATS
source (of CATS-parsemit).
This can be done by issuing:

make pkgreloc

From CATS-parsemit or from CATS-atscc2js? I don’t know the pkgreloc
target.


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/b62fc6c3-1d12-4935-8b26-90959cd13969%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/b62fc6c3-1d12-4935-8b26-90959cd13969%40googlegroups.com?utm_medium=email&utm_source=footer
.

[…] In addition, one needs to copy the CATS files generated from the ATS
source (of CATS-parsemit).
This can be done by issuing:

make pkgreloc

From CATS-parsemit or from CATS-atscc2js? I don’t know the pkgreloc
target.

Your version of ATS2 is not newer enough :slight_smile:

I have 0.1.12 :frowning: Isn’t it the lastest?

I will try to install from GitHub (ATS, not just Contrib), but I feel to
remember ATS1 is required to build ATS2 from GitHub.

I see, it’s like encapsulation, but if whatever in a local section cannot
be used in another part, what’s the intended effect if not side effetcs? Or
is it about externs? But if so, then what about dynloads?Le jeudi 28 mai 2015 20:52:50 UTC+2, gmhwxi a écrit :

Well, the point is to make sure that whatever is included in the local
sections cannot
be used in other parts of the code. However, the compiler still gets to
compile the code
in local sections. This makes it straightforward to combine several files
of ATS code into
a single one.

[…] In addition, one needs to copy the CATS files generated from the ATS
source (of CATS-parsemit).
This can be done by issuing:

make pkgreloc

From CATS-parsemit or from CATS-atscc2js? I don’t know the pkgreloc
target.

From CATS-atscc2js seems to deal with the hidden directory
.CATS-parsemit , this do the same as copying manually and I still have
compilation errors:

./.CATS-parsemit/catsparse_include_all_dats.c:165072:22: error: ‘
CATSPARSE__filename_stdin’ undeclared (first use in this function)
and
./.CATS-parsemit/catsparse_include_all_dats.c:165125:22: error: ‘
CATSPARSE__location_dummy’ undeclared (first use in this function)

OK, I’ve seen there is a newer 0.1.13. Installing from the script I use
just fetched the previous one.Le vendredi 22 mai 2015 20:08:18 UTC+2, Yannick Duchêne a écrit :

Le vendredi 22 mai 2015 19:16:42 UTC+2, gmhwxi a écrit :

Your version of ATS2 is not newer enough :slight_smile:

I have 0.1.12 :frowning: Isn’t it the lastest?

I will try to install from GitHub (ATS, not just Contrib), but I feel to
remember ATS1 is required to build ATS2 from GitHub.

Just curious, in catsparse_include_all.dats
https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/MEDIUM/CATS-parsemit/catsparse_include_all.dats,
why do we need to put “#include xxx” in “local” structure?

Also the link
https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atscc2js
has been changed to
https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atsccomp/CATS-atscc2jsOn Friday, May 22, 2015 at 12:18:35 PM UTC-4, gmhwxi wrote:

I created the following package for use by other projects:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-parsemit

Here is an example to show how CATS-parsemit can be used:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atscc2js

Basically, one needs to copy the SATS files provided by CATS-parsemit to a
local directory, say,
.CATS-parsemit. In addition, one needs to copy the CATS files generated
from the ATS source (of CATS-parsemit).
This can be done by issuing:

make pkgreloc

These CATS files replace the need for library binaries (in the form of .a
or .so files), thus greatly enhancing portability.

Now just do ‘make all’, and ‘atscc2js’ should be built properly.

Just to have all the implements available to the compiler.
If a file is included, then the dynload for the file is not needed.
It is kind of being inlined.On Thursday, May 28, 2015 at 5:55:59 PM UTC-4, Yannick Duchêne wrote:

I see, it’s like encapsulation, but if whatever in a local section cannot
be used in another part, what’s the intended effect if not side effetcs? Or
is it about externs? But if so, then what about dynloads?

Le jeudi 28 mai 2015 20:52:50 UTC+2, gmhwxi a écrit :

Well, the point is to make sure that whatever is included in the local
sections cannot
be used in other parts of the code. However, the compiler still gets to
compile the code
in local sections. This makes it straightforward to combine several files
of ATS code into
a single one.

This is just to make sure that the contents in these files cannot interfere
with each other.

If you like, you could also do

val () = let #include “…” in () endOn Thursday, May 28, 2015 at 12:08:25 PM UTC-4, Zhiqiang Ren wrote:

Just curious, in catsparse_include_all.dats
https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/MEDIUM/CATS-parsemit/catsparse_include_all.dats,
why do we need to put “#include xxx” in “local” structure?

Also the link

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atscc2js
has been changed to

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atsccomp/CATS-atscc2js

On Friday, May 22, 2015 at 12:18:35 PM UTC-4, gmhwxi wrote:

I created the following package for use by other projects:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-parsemit

Here is an example to show how CATS-parsemit can be used:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atscc2js

Basically, one needs to copy the SATS files provided by CATS-parsemit to
a local directory, say,
.CATS-parsemit. In addition, one needs to copy the CATS files generated
from the ATS source (of CATS-parsemit).
This can be done by issuing:

make pkgreloc

These CATS files replace the need for library binaries (in the form of .a
or .so files), thus greatly enhancing portability.

Now just do ‘make all’, and ‘atscc2js’ should be built properly.

Just to have all the implements available to the compiler.

Okay, I see. So may be unless an application is so big it needs separate
units to be type-checked within a reasonable amount of time, this may be
more simple to always use includes in locals.

If a file is included, then the dynload for the file is not needed.
It is kind of being inlined.

Yes, that sounds obvious.

I have not yet looked at it, but I have a question too: how do one make use
of what’s included in the local sections, as this is not like a namespace?
Or is this only for side effects?Le jeudi 28 mai 2015 18:14:48 UTC+2, gmhwxi a écrit :

This is just to make sure that the contents in these files cannot
interfere with each other.

If you like, you could also do

val () = let #include “…” in () end

On Thursday, May 28, 2015 at 12:08:25 PM UTC-4, Zhiqiang Ren wrote:

Just curious, in catsparse_include_all.dats
https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/MEDIUM/CATS-parsemit/catsparse_include_all.dats,
why do we need to put “#include xxx” in “local” structure?

Well, the point is to make sure that whatever is included in the local
sections cannot
be used in other parts of the code. However, the compiler still gets to
compile the code
in local sections. This makes it straightforward to combine several files
of ATS code into
a single one.On Thursday, May 28, 2015 at 1:39:43 PM UTC-4, Yannick Duchêne wrote:

I have not yet looked at it, but I have a question too: how do one make
use of what’s included in the local sections, as this is not like a
namespace? Or is this only for side effects?

Le jeudi 28 mai 2015 18:14:48 UTC+2, gmhwxi a écrit :

This is just to make sure that the contents in these files cannot
interfere with each other.

If you like, you could also do

val () = let #include “…” in () end

On Thursday, May 28, 2015 at 12:08:25 PM UTC-4, Zhiqiang Ren wrote:

Just curious, in catsparse_include_all.dats
https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/MEDIUM/CATS-parsemit/catsparse_include_all.dats,
why do we need to put “#include xxx” in “local” structure?

Your version of ATS2 is not newer enough :)On Fri, May 22, 2015 at 1:12 PM, ‘Yannick Duchêne’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:

Le vendredi 22 mai 2015 18:41:51 UTC+2, Yannick Duchêne a écrit :

Le vendredi 22 mai 2015 18:18:35 UTC+2, gmhwxi a écrit :

[…] In addition, one needs to copy the CATS files generated from the ATS
source (of CATS-parsemit).
This can be done by issuing:

make pkgreloc

From CATS-parsemit or from CATS-atscc2js? I don’t know the pkgreloc
target.

From CATS-atscc2js seems to deal with the hidden directory
.CATS-parsemit , this do the same as copying manually and I still have
compilation errors:

./.CATS-parsemit/catsparse_include_all_dats.c:165072:22: error: ‘
CATSPARSE__filename_stdin’ undeclared (first use in this function)
and
./.CATS-parsemit/catsparse_include_all_dats.c:165125:22: error: ‘
CATSPARSE__location_dummy’ undeclared (first use in this function)


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/fe4ab684-0185-4342-9c77-0d18436a3239%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/fe4ab684-0185-4342-9c77-0d18436a3239%40googlegroups.com?utm_medium=email&utm_source=footer
.