Extending ATS2 language

81 views
Skip to first unread message

Artyom Shalkhakov

unread,
Dec 3, 2014, 10:45:09 PM12/3/14
to ats-lan...@googlegroups.com
Hi all,

What are the options to extending ATS2 in a disciplined way?

I have two extensions in mind:

1. support for relational algebra operations
2. support for Smalltalk-style OOP (as was done in ATS/Proto)

For (2), I plan to follow the approach of Objective-C (Objective-ATS, if you prefer). A new type is introduced for objects, id, and for message selectors, SEL. Message selectors are formed at run-time, and a built-in "dispatch" function takes an object reference, a message selector, and some unspecified arguments and does the message send (the idea is to use the Objective-C runtime for this).

For (1), I don't really know, but since relation headers are essentially finite mappings from field labels to types, then it makes stuff quite complicated for type-checking. For (1), the idea is to basically re-implement Dataphor (dataphor.org) in ATS2 (we only need a new type for forming relation types, and then some built-in operations for dealing with terms of relation types, e.g. join, restrict, etc.).

What are the options to implement the two proposed extensions? I think that in contrast to ATS-parse-emit, here the source language needs to be extended (to be fair, target output may have to be tweaked a bit as well).

(As you can see, I have an abundance of ideas and no time to finish any of them, sigh.)

gmhwxi

unread,
Dec 5, 2014, 10:49:36 PM12/5/14
to ats-lan...@googlegroups.com
For (1), my suggestion would be that you first pick an interesting problem
involving relational algebra and then write some pseudo code to implement
a solution to this problem. It is essential to get a clear idea about what you
really want to implement before attempting any actual implementation.

For (2), I would say it makes a great sense to first do some serious co-programming with
ATS and Objective-C. Here is such an example:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/SMALL/GameOf24/OBJC

I feel it is essential for you to work out some examples before your attempting any implementation.

Please feel free to post to this forum your questions, comments, learning experience, etc.

Raoul Duke

unread,
Dec 6, 2014, 8:24:08 PM12/6/14
to ats-lang-users
for (1) if it is going to be something "relational" then pretty please
do something actually *relational* and *algebraic* rather than
something that is about hellacious sql. :-)
http://lambda-the-ultimate.org/node/5089

Artyom Shalkhakov

unread,
Dec 7, 2014, 3:23:30 AM12/7/14
to ats-lan...@googlegroups.com
On Saturday, December 6, 2014 9:49:36 AM UTC+6, gmhwxi wrote:
For (1), my suggestion would be that you first pick an interesting problem
involving relational algebra and then write some pseudo code to implement
a solution to this problem. It is essential to get a clear idea about what you
really want to implement before attempting any actual implementation.


Thanks for the advice.

I have a working application (implemented in D4, a Tutorial D dialect) that I want to re-write in ATS (in the future).
 
For (2), I would say it makes a great sense to first do some serious co-programming with
ATS and Objective-C. Here is such an example:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/SMALL/GameOf24/OBJC

I feel it is essential for you to work out some examples before your attempting any implementation.

Please feel free to post to this forum your questions, comments, learning experience, etc.


I've been doing some work towards this. Currently, I'm busy packaging GNUstep (an Objective-C environment for NixOS), a Linux distribution that simplifies the management of separate software environments (and I'll make a similar environment for ATS2 as well, so that new language users can quickly get started). After that is done, I'll try to come up with a motivating example.
 

Artyom Shalkhakov

unread,
Dec 7, 2014, 3:25:50 AM12/7/14
to ats-lan...@googlegroups.com

Yes, I meant relational and algebraic. Thanks for the link.

Brandon Barker

unread,
Dec 7, 2014, 8:28:35 AM12/7/14
to ats-lang-users
On Sun, Dec 7, 2014 at 3:23 AM, Artyom Shalkhakov <artyom.s...@gmail.com> wrote:
On Saturday, December 6, 2014 9:49:36 AM UTC+6, gmhwxi wrote:
For (1), my suggestion would be that you first pick an interesting problem
involving relational algebra and then write some pseudo code to implement
a solution to this problem. It is essential to get a clear idea about what you
really want to implement before attempting any actual implementation.


Thanks for the advice.

I have a working application (implemented in D4, a Tutorial D dialect) that I want to re-write in ATS (in the future).
 
For (2), I would say it makes a great sense to first do some serious co-programming with
ATS and Objective-C. Here is such an example:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/SMALL/GameOf24/OBJC

I feel it is essential for you to work out some examples before your attempting any implementation.

Please feel free to post to this forum your questions, comments, learning experience, etc.


I've been doing some work towards this. Currently, I'm busy packaging GNUstep (an Objective-C environment for NixOS), a Linux distribution that simplifies the management of separate software environments (and I'll make a similar environment for ATS2 as well, so that new language users can quickly get started). After that is done, I'll try to come up with a motivating example.
 
Just an aside, I now know of at least 4 people in the ATS community using or working on NixOS. That seems like a strong endorsement.
 
On Wednesday, December 3, 2014 10:45:09 PM UTC-5, Artyom Shalkhakov wrote:
Hi all,

What are the options to extending ATS2 in a disciplined way?

I have two extensions in mind:

1. support for relational algebra operations
2. support for Smalltalk-style OOP (as was done in ATS/Proto)

For (2), I plan to follow the approach of Objective-C (Objective-ATS, if you prefer). A new type is introduced for objects, id, and for message selectors, SEL. Message selectors are formed at run-time, and a built-in "dispatch" function takes an object reference, a message selector, and some unspecified arguments and does the message send (the idea is to use the Objective-C runtime for this).

For (1), I don't really know, but since relation headers are essentially finite mappings from field labels to types, then it makes stuff quite complicated for type-checking. For (1), the idea is to basically re-implement Dataphor (dataphor.org) in ATS2 (we only need a new type for forming relation types, and then some built-in operations for dealing with terms of relation types, e.g. join, restrict, etc.).

What are the options to implement the two proposed extensions? I think that in contrast to ATS-parse-emit, here the source language needs to be extended (to be fair, target output may have to be tweaked a bit as well).

(As you can see, I have an abundance of ideas and no time to finish any of them, sigh.)

--
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/a2d5a3ad-5281-4eed-8c7b-d043c11b8474%40googlegroups.com.



--
Brandon Barker
brandon...@gmail.com

Raoul Duke

unread,
Dec 8, 2014, 12:19:45 PM12/8/14
to ats-lang-users
> Just an aside, I now know of at least 4 people in the ATS community using or
> working on NixOS. That seems like a strong endorsement.


which way? :-)

Brandon Barker

unread,
Dec 8, 2014, 12:33:35 PM12/8/14
to ats-lang-users
Probably both ways ;) 

Lots of promise, but not necessarily the easiest to use. Actually, it is not too bad, but takes some getting used to, sort of like gentoo but slightly more so.

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

Shea Levy

unread,
Dec 8, 2014, 4:03:54 PM12/8/14
to ats-lan...@googlegroups.com
Oh hey, I didn’t know there were more of us :) I actually started using ATS in order to replace a key component of nix.

Brandon Barker

unread,
Dec 8, 2014, 4:15:56 PM12/8/14
to ats-lang-users
I'm a highly recent user. Aside from downloading the VM image a few months ago, I've only been using it for a few days. I think Chris Double also uses it.

Brandon Barker

unread,
Dec 12, 2014, 12:01:38 PM12/12/14
to ats-lang-users
What part of nix would that be out of curiosity, and how is it going?

On Mon, Dec 8, 2014 at 4:03 PM, Shea Levy <sh...@shealevy.com> wrote:


--
Brandon Barker
brandon...@gmail.com

Shea Levy

unread,
Dec 12, 2014, 1:12:31 PM12/12/14
to ats-lan...@googlegroups.com
Essentially it will replace libnixstore: The “lower-level” half of nix that handles the store invariants, coordinates builds and substitutions, etc. Currently it has a lot of deficiencies, including being single-threaded, loading huge paths entirely into memory, being written in C++, etc. (See https://github.com/zalora/defnix/issues/16 for a grab bag of improvements I’d like to make). Currently it’s still in the “when will I find some time to really start the damn thing” stage, unfortunately :D

Brandon Barker

unread,
Dec 12, 2014, 1:19:48 PM12/12/14
to ats-lang-users
I have noticed that doing a nix rebuild (forget the command exactly), takes quite some memory. It does sound like a big project.

Reply all
Reply to author
Forward
0 new messages