The current status of ATS3

211 views
Skip to first unread message

gmhwxi

unread,
Jun 29, 2020, 2:40:33 PM6/29/20
to ats-lang-users

For those interested in ATS3.

Before I take a break, I would like to give you an update on the
implementation of ATS3.

To put things into some sort of perspective, let me first say a few
words on the motivation behind ATS3.

Advised by Prof. Frank Pfenning, I did my PhD thesis on PROGRAM
VERIFICATION during my years at CMU, designing and implementing DML
(Dependently Typed ML), a programming language that extends ML with a
restricted form of dependent types. Note that DML is the predecessor of ATS.
These days, the dependent types in DML are often referred to as DML-style
dependent types in the literature (in contrast to Martin-Lof's dependent types
that were originally invented for creating a type-theoretic foundation for Mathematics).

As you can see, there are two words in PROGRAM VERIFICATION. One must
talk about program construction when talking about program
verification. Originally, the kind of programs I intended to verify
were supposedly written in an ML-like language. But it soon (even
before 2008) became very clear to me that such a language badly lacks
meta-programming support. And I immediately started to improvise. I
first added some support for templates into ATS1 and then strengthened
it in ATS2.  Unfortunately, the kind of support for templates in ATS2
was in direct conflict with the support for dependent types. The
original primary motivation for ATS3 was to eliminate this (crippling)
conflict.

Up to ATS2, I mostly did language implementation for the purpose of
experimenting with a variety of programming features. At this point, I
no longer feel that I have time and/or energy to continue
experimenting. Compared to ATS2, I re-designed the implementation of
ATS3 to make it much more modular so as to better support future
changes and additions. I intend for ATS3 to eventually become a language
of production quality.

ATS3 is implemented in ATS2. There are three big components planned
for ATS3: program construction (Part I), program compilation (Part 2),
and program verification (Part 3).

######

Part 1:

At this moment, I have nearly finished Part I.

This part covers type inference (involving only ML-style algebraic
types) and template resolution (this is, replacing template instances
with proper template-free code).  There is currently a rudimentary
interpreter available for interpreting programs constructed in ATS3. I
have also being implementing a template-based prelude library for
ATS3.

Part 2:

I will soon be starting to work on Part 2 after taking a break, hoping
to finish something that can be tested at the end of the Summer.

Part 3:

This part essentially does type-checking involving linear types and
dependent types. Hopefully, I will be able to get a running implementation
by the Spring next year.

######

Based on what I have experimented so far, I find the current support
for templates in ATS3 to be a game-changing programming feature that
can greatly increase one's programming productivity. I am a bit amazed
by it :) If you think that the templates in C++ are powerful, then you
will find that the templates in ATS3 are even more powerful in many
aspects. Actually, not only just more powerful but also a great deal
safer. Keep tuned.

Cheers!

--Hongwei


Brandon Barker

unread,
Jun 29, 2020, 6:36:26 PM6/29/20
to ats-lang-users
Hi Hongwei,

I hope you can enjoy a much deserved break. 

One question, regarding Part 3 - it sounds like you removed dependent types, but plan to add them back in, in some novel fashion? Or did I misunderstand?

Hongwei Xi

unread,
Jun 29, 2020, 9:44:13 PM6/29/20
to ats-lan...@googlegroups.com
Hi Brandon,

Thanks!

Let me clarify.

The syntax for ATS3 is very similar to that of ATS2. ATS3 supports programming
with dependent types in essentially the same way as ATS2. In addition, ATS3 supports
Hindley-style (not Hindley-Milner-style) type inference on algebraic types (that is, types
involving no explicit quantifiers).

In Part 1, dependent types are turned into algebraic types (by an operation that erases
explicit quantifiers as well as type indices). For example, the list length function can be
given the following dependently typed interface:

fun<a:type>
list_length(xs: list(a, n)): int(n)

After type-erasure is performed, the above interface is turned onto the following one:

fun<a:type> list_length(xs: list(a)): int

In Part 3, which is yet to be implemented, dependent type-checking as in ATS2 is to be
performed on the code produced at the end of Part 1. Note that the code produced at the end
of Part 1 has already gone through template resolution, that is, the template instances have been
replaced with code making no use of templates. This is fundamentally different from ATS2, which
does template resolution *after* dependent type-checking.

As template resolution in ATS3 only involves algebraic types (that are non-dependent), it can be
implemented in a simple and robust manner. In contract, template resolution in ATS2 may involve
dependent types, and its current implementation is plagued with bugs and/or incomplete specifications.

When programming in ATS3, one can quickly lose track of code generation due to deeply embedded
template resolution. Anyway, I have stopped trying to figure out why my code works. As long as it works.
It is a bit like magic :)

Cheers,

--Hongwei








--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/6b594d79-3ebb-41a7-83b3-72490726b4e5o%40googlegroups.com.

Artyom Shalkhakov

unread,
Jun 30, 2020, 2:53:56 PM6/30/20
to ats-lang-users
Hi Hongwei,

Thank you very much for this work!
I'm wondering how are ATS3 templates different from ATS2 templates?


Part 2:

I will soon be starting to work on Part 2 after taking a break, hoping
to finish something that can be tested at the end of the Summer.

Part 3:

This part essentially does type-checking involving linear types and
dependent types. Hopefully, I will be able to get a running implementation
by the Spring next year.

######

Based on what I have experimented so far, I find the current support
for templates in ATS3 to be a game-changing programming feature that
can greatly increase one's programming productivity. I am a bit amazed
by it :) If you think that the templates in C++ are powerful, then you
will find that the templates in ATS3 are even more powerful in many
aspects. Actually, not only just more powerful but also a great deal
safer. Keep tuned.


Why are ATS3 templates more powerful than C++ templates? Could you contrast the two in some way?
 
Cheers!

--Hongwei


Hongwei Xi

unread,
Jun 30, 2020, 4:04:29 PM6/30/20
to ats-lan...@googlegroups.com
Hi Artyom,

I will try to answer other questions later.

>>Why are ATS3 templates more powerful than C++ templates? Could you contrast the two in some way?

I have to say that I do not use C++ on a regular basis.
C++ used to be C + classes + templates. By the way, I often jokingly tell others this is what the two plusses in
C++ stand for :)

C does not support inner functions. C++ used to support no inner functions. Now C++ support 'lambdas', with
which you can implement inner functions. But can you implement inner templates in C++?

ATS supports embedded templates (that is, inner templates). I don't know whether C++ supports inner templates.
If it doesn't. then ATS is more powerful in this regard. This is a big deal because inner templates are used ubiquitously
in ATS library code.

Also, with dependent types and linear types, you can do a great deal more of static checking on templates,
flushing out potential bugs. The introduction of features like concepts in C++ tells me that template-related
bugs can be quite nasty, cutting big into the benefits from using templates.

Maybe "powerful" is not the right word. There is raw power and there is controlled power. Kind of like nuclear
bombs versus nuclear power plants. I was mostly talking about the latter.









--
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.

Hongwei Xi

unread,
Jul 1, 2020, 2:16:09 AM7/1/20
to ats-lan...@googlegroups.com
>>I'm wondering how are ATS3 templates different from ATS2 templates?

Here is a simple but very telling example:

fun
<a:type><n:int>
array_length(A0: array(a, n)): int(n)

The type array(T, N) is for a C-array of size N for storing values of type T.
Given that the size information of a C-array is not attached to the array, the function
array_length can only be implemented in a context where the size information can be
obtained in some manner.

In ATS3 (but not in ATS2), we can implement a template of the following interface:

fun
<a:type>
foo{n:int}(A0: array(a, n)): void

In ATS2, we have to change the interface to

fun
<a:type>
foo{n:int](A0: array(a, n), size: int(n)): void

In other words, in ATS3, the size of a C-array does not have to be passed together with
the C-array; it can be "gleaned" from the context instead.

By the way, I remember you once asked a question on the tabulate function template. In
ATS3, it can finally be properly done:

fun
<a:type><n:int>
tabulate(): list(a, n)

fun
<a:type><n:int>
tabulate$for{i:nat | i < n}(int(i)): a

Here is some running code that could clarify further:


Cheers!





gmhwxi

unread,
Jul 3, 2020, 2:46:28 AM7/3/20
to ats-lang-users

I had originally assumed that the following style of ATS template implementation
could also be done in C++. But I realized that this is not the case after studying
C++ templates tonight.

fun
<a:type>
g_print(x: a): void

impltmp
{a:type}
g_print<list(a)>(xs) = ...

Did I miss something about C++ templates? It seems that the template parameters
of a template implementation in C++ must be variables.

--Hongwei
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@googlegroups.com.

Chris Double

unread,
Jul 3, 2020, 7:55:47 AM7/3/20
to ats-lan...@googlegroups.com
On Fri, Jul 3, 2020 at 6:46 PM gmhwxi <gmh...@gmail.com> wrote:
>
> Did I miss something about C++ templates? It seems that the template parameters
> of a template implementation in C++ must be variables.

I think this C++ example does what you are trying, unless I'm
misunderstanding the ATS code:

--------------------------8<----------------------
#include <iostream>
#include <list>

template <class T> void g_print(T const& x) {
std::cout << "case 1" << std::endl;
}

template <> void g_print(int const& x) {
std::cout << "case 2" << std::endl;
}

template <class T> void g_print(std::list<T> const& x) {
std:: cout << "case 3" << std::endl;
}

int main() {
g_print("hello");
g_print(5);
std::list<int> l;
g_print(l);
return 0;
}
--------------------------8<----------------------

It prints out:

case 1
case 2
case 3

Chris.
--
https://bluishcoder.co.nz

Matthias Wolff

unread,
Jul 3, 2020, 9:03:08 AM7/3/20
to ats-lan...@googlegroups.com

C++ templates restricted to functions show only one half oft the truth.

template<typename T>
struct function;

struct XXX;

template<>
struct function<XXX> {

    template<typename... A>
    void operator()(std::ostream& s, const A&... a) {
       (s << ... << a);
    }
};

struct YYY;

template<>
struct function<YYY> {

    template<typename... A>
    void operator()(const A&... a) {
       (std::cout << ... << a);
    }
};

int main()
{

    //using function object - additional constructor parenthesis
    function<XXX>()(std::cout,"a",1);

    function<YYY>()(1,"a");

    return 0;

}

Template power in c++ starts with structs or classes and templated normal functions
are often used to redirect the call to templated structs and their specializations. Where
structs/classes may have many also templated methods and many inner classes and
yes a function - I think - can have inner structs:

void my_function()
{
    struct abc { void print() { std::cout << "ok" << std::endl; } };

    abc().print();
}

Variadic templates are really powerful "template<typename... T> struct mystruct" and next
template type deduction.

Template are not a weak point in C++. But if you look in direction of category theory, one can
very quickly recognize, that this topic is a black hole. C++ has no mathematical inspiration and
the same is most the time true for the programmers.

Perhaps I could transport a little bit more on c++ template feelings.


Am 03.07.20 um 08:46 schrieb gmhwxi:
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/503d7a16-7ae4-4a6d-94ad-9ef51fd35a22o%40googlegroups.com.

Matthias Wolff

unread,
Jul 3, 2020, 9:54:02 AM7/3/20
to ats-lan...@googlegroups.com

A lambda is a shortcut for a function object with exactly on parenthesis operator implemented

struct function
{
    function(int k) : j(k) {}

    void operator(auto i) { cout << i << "/" << k << endl; }

    int j;

};

application: function(1)(2) or in two steps auto f = function(1); f(2)

lambda:

auto j = 1

auto f = [j](int i) { cout << i << "/" << j << endl; };

The capture copy j is like the member j of struct function.

application: f(2)

Therefore it's clear if I can use a lambda within a normal c-function it must be possible
to declare a class/struct within a function - if there is some logic behind.

So now I'm complete. 



Am 03.07.20 um 15:03 schrieb Matthias Wolff:

Hongwei Xi

unread,
Jul 3, 2020, 10:27:33 AM7/3/20
to ats-lan...@googlegroups.com
Thanks for clarifying.

In your example, there are three templates named g_print.
In particular, the types/interfaces of these three templates do
not have to be the instantiation of one general type/interface.

In ATS, we have one g_print:

fun<a:type> g_print(x: a): void

And then three implementations:

impltmp g_print<int> = ...
impltmp g_print<string> = ...
impltmp{a:type} g_print<list(a)> = ...

This subtle difference affects how type-checking is performed.

In C++, template instantiation/resolution is done first and then type-checking is performed on the result
of instantiation/resolution.

In ATS, ML-like algebraic type-checking is done before template resolution. And linear and dependent
type-checking on the result of template resolution is planned to be done after.


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CALn1vHEpfccad3EydBsRjLsoxWo%3DgBgUGQVfD-naT9BYqTeqOQ%40mail.gmail.com.

Hongwei Xi

unread,
Jul 3, 2020, 11:36:28 AM7/3/20
to ats-lan...@googlegroups.com
Thanks for your explanation.

I will start another thread to talk about variadic stuff.

To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/8fb6bfae-872a-416a-8ad2-4e1281161ebfo%40googlegroups.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/503d7a16-7ae4-4a6d-94ad-9ef51fd35a22o%40googlegroups.com.

--
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.

Hongwei Xi

unread,
Jul 3, 2020, 12:50:44 PM7/3/20
to ats-lan...@googlegroups.com
Thanks for these clarifying examples.

Now I think my guess is correct that C++ does not support embedded template
implementations. Let me introduce an example to make my point.

Say we want pairs in our code. Traditionally, we declare a class(or struct) in C++.
Then there will be a constructor for creating pairs:

class pair { .... }

With the support for embeddable templates in ATS, there is another way. We don't have
to have a constructor for pairs; we can just implement member functions for pairs based
on some contextual data:

extern
fun<a:type,b:type> pair_fst(): a
extern
fun<a:type,b:type> pair_snd(): b

fun
<a:type
,b:type>
pair_swap(): (b, a) = (pair_snd(), pair_fst())

fun
foo(x: int) =
let
  fun bar(y: int) =  let
    impltmp pair_fst<>() = x
    impltmp pair_snd<>() = y in pair_swap()
  end
in
  ...
end

In the above example, x and y are treated as the first and second components
of a pair. In particular, there is no pair construction here. Why is this a very useful feature?
Well, let's think about plain C-arrays (with no attached size information). But without size
information, a C-array cannot be used safely. In ATS, the size of a C-array can be "gleaned"
from a context where the C-array is used. Specifically, the programmer can implement something
like the following code to tell the compiler how to find the size information:

impltmp
<a:type><n:int>
array_length(A) = <some integer expression> (of the type int(n))

######

Can this style of programming be done in C++?

Essentially, this means that one needs to introduce pair_fst and pair_snd
in an embedded manner as is illustrated below. My guess is that C++ does
not support this style of programming:

fun
<a:type
,b:type>
pair_swap(): (b, a) = (pair_snd(), pair_fst())

fun
foo(x: int) =
let
  fun bar(y: int) =
  let
    fun pair_fst<>() = x // [pair_fst] is embedded here
    fun pair_snd<>() = y // [pair_snd] is embedded here
  in
     pair_swap()
  end
in
  ...
end








To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/8fb6bfae-872a-416a-8ad2-4e1281161ebfo%40googlegroups.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/503d7a16-7ae4-4a6d-94ad-9ef51fd35a22o%40googlegroups.com.
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/69d08849-2a62-52fb-6d42-b9d8d1d4a954%40bejocama.de.

--
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.

Artyom Shalkhakov

unread,
Jul 4, 2020, 5:36:09 AM7/4/20
to ats-lang-users
On Wednesday, July 1, 2020 at 9:16:09 AM UTC+3, gmhwxi wrote:
>>I'm wondering how are ATS3 templates different from ATS2 templates?

Here is a simple but very telling example:

fun
<a:type><n:int>
array_length(A0: array(a, n)): int(n)

The type array(T, N) is for a C-array of size N for storing values of type T.
Given that the size information of a C-array is not attached to the array, the function
array_length can only be implemented in a context where the size information can be
obtained in some manner.

In ATS3 (but not in ATS2), we can implement a template of the following interface:

fun
<a:type>
foo{n:int}(A0: array(a, n)): void

In ATS2, we have to change the interface to

fun
<a:type>
foo{n:int](A0: array(a, n), size: int(n)): void

In other words, in ATS3, the size of a C-array does not have to be passed together with
the C-array; it can be "gleaned" from the context instead.


This is awesome. I'm glad you found a solution to make it work.
 
By the way, I remember you once asked a question on the tabulate function template. In
ATS3, it can finally be properly done:

fun
<a:type><n:int>
tabulate(): list(a, n)

fun
<a:type><n:int>
tabulate$for{i:nat | i < n}(int(i)): a

Here is some running code that could clarify further:



Yes, I remember that question. :) It's great that we can finally make the code modular and safe at the same time!
 
Cheers!






To unsubscribe from this group and stop receiving emails from it, send an email to ats-lan...@googlegroups.com.

Matthias Wolff

unread,
Jul 4, 2020, 9:19:16 AM7/4/20
to ats-lan...@googlegroups.com

Yes correct.

In c++ declaration and implementation must  be in the same namespace and
templates in blockscope are in general not allowed.

Yes I know the late binding section of the ats documentation. ATS developpers
should be happy to have it. Functional constructions are more lightweight than
c++ object oriented ones.

Looking on this example I think c programmers could like it more then c++
programmers.

regards, matthias


Am 03.07.20 um 18:50 schrieb Hongwei Xi:

Andreas ZUERCHER

unread,
Jul 9, 2020, 12:41:23 PM7/9/20
to ats-lang-users
Prior to Stroustrup's work on concept maps in concepts, C++ templates' inspiration was almost entirely a proper subset of Ada generics (but without Ada's option of shared implementation of machine code among all expansions/type-instantiations).  C++ concepts without concept-maps has no feature of which I am aware that Ada generics have not already had for since either 1983 or 1995 editions of the Ada language.  The history of C++ prior to C++11 is almost entirely a multidecade critique of Ada:  C++ as Ada done right was the mantra (which might be factually correct if restricting* Ada to only Ada83 which was rather half-baked, because Ada95, Ada2005, and especially Ada2012 are better examples of the Ada school of thought done right—and they differ quite substantially in their definition of “Ada done right” that C++'s definition of “Ada done right”).

* The vast majority of DoD & aerospace usage of Ada in 2020 (i.e., what remains extant in production, not transliterated into either Java or C++ with the historic Ada implementation abandoned) is strictly limited to Ada83, prohibiting all later features, which is why AdaCore and other Ada compiler vendors charge a premium for maintaining Ada83 but allow cheaper or free access to later editions of the language and which is why no Ada compiler vendor other than AdaCore maintains a Ada2012-or-later edition of the language and only one other Ada compiler vendor of which I know ever implemented any editions of the Ada language other than Ada83 and Ada95.  A common perception/reputation (without well-substantiated statistics either way) is that the vast vast vast majority of lines of Ada source code are Ada83 at Boeing civilian aerospace, at DoD contractors, and at NATO contractors.  So limiting Ada to elide all of its later incarnations post-Ada83 is not entirely unreasonable under certain pragmatic lines of thought to which the C++ standardization-leadership subscribes.

So adding historical color to Matthias's point, the only theoretic mathematical influence (however spartan) over C++'s templates-as-a-mimicking-derivative-work would have come from Jean Ichbiah's work on LIS (Language d'Implementation de Systèmes), HOLWG's Green, Ada-0, Ada80, and Ada83, if any such theoretic influence can be found in Ichbiah's historical work.  Figuring that it took C++ around 20+ years to officially introduce concepts without concept-maps into the C++ community's language-design conversation (for C++ to overtly state Ada's type-satisfaction restrictions on template parameters), Ada's generics have been on discernibly stronger conceptual footing, if not mathematical-theoretical, footing for decades and even stronger nowadays with Ada2012's expanded expressivity of where clauses.

But agreeing wholeheartedly with Matthias's point, Ada's typing/subtyping-as-destinct-from-subclasses and generic type-satisfaction restrictions have been vastly more expressive than almost any other mainstream/ISO-standardized programming language, but it does not overtly evoke much theoretic type theory in its standardization, description, implementation, or defense—instead relying on ad hoc software-engineering-based lines of thought and whatever bleed-over software engineering world might borrow from mathematical type theory, however spartan.  And there does not exist to my knowledge any Ada-generic-based way of accomplishing Hongwei's goals that differ much from the C++-template-based analysis in this thread & related threads here.  C++'s Standard Template Library was a early-1990s re-write/transliteration of a prior directly-analogous Alex-Stapanov library for Ada generics.  Ada world introduced type-traits to generic libraries in mimicking reaction to Andrei Alexandrescu's work on the C++ Loki library's use of traits just as C++ Boost libraries did as derivative-work mimicking as well.  (Alexandrescu is the primary voice for considering System F in C++ world, as a theoretical-mathematical inspiration/guidance, but only opportunistically it seems.)  AFAIK, Ada community/standardization has not pushed Ada beyond Alexandrescu-esque type-traits.

Btw, as opposed to greater fidelity to mathematical type theory, Ada202X's focus for a big ‘breakthrough’ new rethink era has been instead focused on Rust's borrow checker; neither SPARK nor Ada appears to be directly mimicking ATS's dependent-type-based school of thought, although SPARK community likes to think that they are plodding along toward proof-oriented programming but through apparently less-sophisticated mechanisms than ATS is.
 
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lan...@googlegroups.com.
--
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-lan...@googlegroups.com.

Timmy Jose

unread,
Aug 5, 2020, 9:56:33 AM8/5/20
to ats-lang-users
Hello all,

I am learning the ATS language right now, and have a couple of questions:

  1. Will ATS3 syntax and semantics diverge significantly from ATS2? (It looks like it's mostly going to be similar, but please correct me if I'm wrong), and
  2. Will there be an added focus on making ATS a production-capable language with ATS3? (Again, looks to be the case from what I could figure out, but please correct me again!)

I have a vested interest in asking these questions - as you yourselves acknowledge, the learning curve is not very smooth, but I'm enjoying it so far, and have hopes of using it as a production language in the near future, or at least for some serious projects. I just want to make sure than my learnings from
ATS2 will carry forward as much as possible! :-)

Best Regards,

Timmy

Hongwei Xi

unread,
Aug 5, 2020, 12:21:04 PM8/5/20
to ats-lan...@googlegroups.com
  >>1. Will ATS3 syntax and semantics diverge significantly from ATS2? (It looks like it's mostly going to be similar, but please correct me if I'm wrong), and

The syntax of ATS3 is very similar to that of ATS2.

Here is some code in ATS3:


I would say that ATS2 and ATS3 share 95% of the syntax or more.

  2. Will there be an added focus on making ATS a production-capable language with ATS3? (Again, looks to be the case from what I could figure out, but please correct me again!)

Certainly. To program is to program productively. If we just talk about using ATS with emacs (or other editors) to produce C (or JS) code of quality, it won't take too
long. If we talk about an IDE of some sort, I don't feel I have the energy and/or the expertise. But hopefully others may.

When compared to C, ATS2 and ATS3 use the same data representation (for values of datatypes). As a consequence, the C code generated by ATS2 is compatible with the C code generated by ATS3. Not only your learnings but also your code can be carried forward :)

Cheers!

--Hongwei


To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/f8215610-16ee-4dec-bb75-082b8bc666c1n%40googlegroups.com.

Timmy Jose

unread,
Aug 5, 2020, 12:35:08 PM8/5/20
to ats-lang-users
Hi Hongwei,

Thank you! :-)  .... all the little lingering doubts in my mind have been cleared up now, and I'm quite excited to wrap up learning the fundamentals of the language, and get going with some projects.

The IDE part is indeed quite interesting. I feel that making an IDE (along with or in lieu of purely a plugin) may be rather easily done on the IntelliJ platform (like Raku have done already). In fact that might be an interesting project once I get comfortable with ATS, but others are always welcome to lead the charge!

Best,

Timmy
Reply all
Reply to author
Forward
0 new messages