ATS3-alpha.0.1 to be released

355 views
Skip to first unread message

Hongwei Xi

unread,
Apr 24, 2025, 2:52:10 PMApr 24
to ats-lan...@googlegroups.com
Hi, there,

I will be releasing the first version of ATS3 shortly.
More will be said in a followup email.

For those who are familiar with ATS2, I would like to emphasize
that ATS3 is very different from ATS2 at this point. Many advanced
features of ATS2 have yet to be incorporated into ATS3.

As you can see, there are two words in 'program verification'.
Verification needs to be built on top of a productive approach
to program construction.

While ATS2 focuses on program verification, ATS3 has shifted the
focus on program construction. The first priority of ATS3 is to provide
a means for programmers to construct programs in a higher productive
manner. The feature of templates in ATS3 is my attempt at it, and it is
likely my last attempt at it as well. One could only experiment for so much
and so long in one's own limited capacity.

Cheers!

Hongwei Xi
Principal Designer and Implementer of ATS PL System



Patrick M. Nielsen

unread,
Apr 24, 2025, 2:55:15 PMApr 24
to ats-lan...@googlegroups.com

Great news! Very excited to try :)



-------- Original Message --------
--
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 visit https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLovH3CX1CYDFR5mn_xkdzfWZO56r%3DwiMAT2w%2BESN0MG_Q%40mail.gmail.com.

Darcy Harding

unread,
Apr 24, 2025, 9:37:34 PMApr 24
to ats-lang-users

Awesome! I'm really keen to get into it!

Martin DeMello

unread,
Apr 24, 2025, 10:07:10 PMApr 24
to ats-lan...@googlegroups.com
Awesome!!

martin

toastal

unread,
Apr 24, 2025, 11:53:59 PMApr 24
to ats-lan...@googlegroups.com
> More will be said in a followup email.

Can’t wait to hear more.

> ATS3 has shifted the focus on program construction

Great goal.

Jasen Qin

unread,
Apr 25, 2025, 12:10:05 AMApr 25
to ats-lan...@googlegroups.com
sounds amazing, hope to see it

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

gmhwxi

unread,
Apr 25, 2025, 10:20:37 AMApr 25
to ats-lang-users
Thanks for your enthusiasm!

ATS3: For constructing quality code productively
1. Correctness through advanced types
2. Productivity through code sharing and meta-programming

Right now, there is not yet a compiler from ATS3 to C.
I am still in the process of designing an intermediate
language for compiling to C/C++.

We can compile ATS3 to JavaScript and also to Python3.
For this release, I will just push out  a compiler from ATS3
to JS (ATS3-to-JS-in-ATS3). This compiler has been successfully
bootstrapped in the sense that it can compile its own source, which
for now consists of about 160K lines written in ATS3.

By the way, the first compiler for ATS3 is ATS3-to-JS-in-ATS2, which
consists of about 120K lines written in ATS2 (ATS-Postiats).

What I will push out is a big file of JS code that you can use node
(or nodejs) to run to compile ATS3 programs. Yes, you can use 'bun'
to run it, too. For now, we will focus on using 'node'. In the future, we
may even use Quick JS (QJS) by Fabrice Bellard to run the file.

Programming in ATS3 as of now is likely a very different programming
experience. Please be patient. In a nutshell,  an ATS3 program can contain
many templates; the compiler fetches the code for these templates; in the
fetched code, there can be further templates, and the compiler does template
resolution recursively. And the programmer writes code to affect the outcome
of template resolution. If you have experience with C++ templates; it helps. If
you are familiar with type classes in Haskell, it helps, too.

If one programmer implements some templates and another puts them on
the search path of the compiler, then code sharing happens. Templates are
different from library functions in one big sense: the user of a template can
write code to modify the template from the outside.

There will be many many more new concepts on the way. Hopefully, learning
ATS3 can become an enlightening journey for you. If you would like to help
enlighten others by posting something here or elsewhere, please be my guest. 

Cheers!

Hongwei Xi

toastal

unread,
Apr 25, 2025, 11:20:23 AMApr 25
to gmhwxi, ats-lang-users
Will there be a new book or addendum to existing books?

gmhwxi

unread,
Apr 25, 2025, 12:29:54 PMApr 25
to ats-lang-users
Certainly. Have been contemplating about it. Will be a new book if it happens.

It will take a long time for ATS2 to be fully incorporated into ATS3. Right now,
ATS3 is all about template-based programming. We need programs before verification.
Putting verification ahead of program construction is like putting a cart in front of a horse.
However, the very irony here is that I would probably not have done ATS2-kind of work if I
had come up with ATS3-kind of design in the first place :)

Cheers!

--Hongwei

gmhwxi

unread,
Apr 25, 2025, 12:44:38 PMApr 25
to ats-lang-users
It is released.

The ATS3-to-JS-in-ATS3 compiler released
was generated this morning. It is still warm :)
Yes, you need to have access to 'node' or 'nodejs'
(probably a fairly recent version) in order to run the
compiler and the JS code generated by the compiler.

I created a repository for those interested in trying ATS3:

https://github.com/githwxi/XATSHOME


Will gradually write more and more documentation. It is an on-going process that has no ending in sight.

Cheers!

--Hongwei

PS: Just checked my notes to learned that developing ATS3-to-JS-in-ATS3 has taken about 3 years so far. The whole ATS-Xanadu
project started in April, 2018, since when 7 years has passed.
On Thursday, April 24, 2025 at 2:52:10 PM UTC-4 gmhwxi wrote:

gmhwxi

unread,
Apr 27, 2025, 8:52:30 PMApr 27
to ats-lang-users

I have just added a compiler from ATS3 to python3 (ATS3-to-PY-in-ATS3).

Here is an example of using this compiler (which needs to be run using Node or Bun):


NodeJS is async, and it is not a good fit for developing compilers. I should have probably employed Python3
(instead of JS) in the first place as the target language for bootstrapping ATS3. I guess one big reason for this
is that I had been burnt badly long ago by Python2's non-standard way of handling variable bindings. Awful!
Anyway, given what we have, the good news is that it should be fairly straightforward now to get a compiler for
ATS3 that can be run inside a browser.

What we have now is ATS3-to-PY-in-ATS3.js. I hope we will soon have ATS3-to-PY-inATS3.py. Then we don't need
Node for compiling ATS3 programs; we can use Python3 in place of Node.

Cheers!

--Hongwei

gmhwxi

unread,
May 4, 2025, 9:26:07 PMMay 4
to ats-lang-users
Hi,

I have finally managed to produce ATS3-to-PY-in-ATS3.py. However, this compiler is not yet able to bootstrap itself.

One major issue with this compiler is that its compilation speed is very very slow when compared to its counterpart
in JS. It seems to be *10* times slower (or more). Still, it can be useful if you are interested in write scripts in ATS3, which
I think I will do a great deal of in the near future.

Cheers!

--Hongwei

gmhwxi

unread,
May 6, 2025, 2:43:47 PMMay 6
to ats-lang-users

Now ATS3-to-PY-in-ATS3.py can compile itself. In my first trial, it took about 9 hours for it to
finish compiling itself. This means that ATS3-to-PY-in-ATS3.py is close to being *20* times
slower when compared to ATS3-to-PY-in-ATS3.js.  Therefore, one should always use the latter
to generate Python3 code from ATS3 as long as one can run 'node'. We should expect compilers
for ATS3 in the near future that can compile much faster than ATS3-to-PY-in-ATS3.js does.

Cheers!

gmhwxi

unread,
May 6, 2025, 2:45:49 PMMay 6
to ats-lang-users
Forgot to mention a little description on the ATS3 compilers we have so far:


Cheers!

--Hongwei
Reply all
Reply to author
Forward
0 new messages