Imperative vs. functional vs. linear functional

I wrote a small article in the Effective-ATS series where
3 styles of programming are compared:

http://ats-lang.sourceforge.net/EXAMPLE/EFFECTIVATS/HanoiTowers/index.html

Imperative: difficult to reasonable
Functional: facilitating reasoning but is wasteful in terms of memory usage
Linear functional: Functional + efficient memory usage

Cheers!

–Hongwei

Website down.
Cannot say I have much love for sourceforge these days.

Can you point to examples of how support for overloading is better than
ML’s?

My understanding is that there is very little support for overloading in ML.

For instance, ‘xs - i’ means removing the element ‘i’ from the list ‘xs’ in
the
code I showed. That is, ‘-’ is given the following type in this case:

(list0(a), a) → list0(a)

This is not possible in ML as ‘-’ is given the type 'a * 'a → 'a during
type inference.

Also, dot-symbol overloading in ATS is not ML-like:

http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c260.html

Overloading in ATS is completely ad-hoc. Basically, anything goes as long
as the compiler
can figure out what is being overloaded based on the arity and type
information.On Wednesday, February 10, 2016 at 7:36:08 PM UTC-5, aditya siram wrote:

Hi,
I really like what ATS can do but a lot of the examples, including the one
you link to, don’t seem to show off it’s overloading capabilities. I’m a
noob so I maybe misunderstanding the code but it seems to make calls to a
lot of type specific functions and datatypes like list0_tabulate and
nil0.

I have seen some of the overloading peek through in your template function
examples that use fwork but not much beyond.

Can you point to examples of how support for overloading is better than
ML’s?

Thanks!
-deech

On Wednesday, February 10, 2016 at 1:52:00 PM UTC-6, gmhwxi wrote:

Thanks :slight_smile:

One can certainly write ATS code that looks elegant. For instance:

Redirecting to Google Groups

It takes time to write elegant code, though. People complaining about the
syntax of ATS are often not knowing much about
ATS. There are certainly amny Haskellers who think that anything
non-Haskell is ugly.

On Wednesday, February 10, 2016 at 5:45:46 AM UTC-5, anonymous anomymous wrote:

I always thought of functional programming somewhat wasteful (for reason
mentioned) but superior to other programming styles. Linear functional ATS
is really impressive. What am I saying? ATS on the whole is impressive!
Thanks, Professor, for the article. I hope, in time, the language gets the
popularity it deserves. I mean, it’s sad that such a good language is a bit
lacking in terms of attention. I often hear complaints about the syntax…
Programmers nowadays are really spoiled by Ruby and Python.

Best regards,
anonymous

There is a backup link at github:

http://ats-lang.github.io/EXAMPLE/EFFECTIVATS/On Friday, February 5, 2016 at 12:44:16 PM UTC-5, Raoul Duke wrote:

Website down.
Cannot say I have much love for sourceforge these days.

For me, the main advantage of Python etc. is ease of installation. :slight_smile: (Not
a super big fan of then as actual languages per se.)

Also, I added a poorman’s demo for Hanoi Towers:

http://ats-lang.sourceforge.net/EXAMPLE/EFFECTIVATS/HanoiTowers/HanoiTowers_txt.htmlOn Friday, February 5, 2016 at 1:22:36 PM UTC-5, gmhwxi wrote:

There is a backup link at github:

http://ats-lang.github.io/EXAMPLE/EFFECTIVATS/

On Friday, February 5, 2016 at 12:44:16 PM UTC-5, Raoul Duke wrote:

Website down.
Cannot say I have much love for sourceforge these days.

Thanks :slight_smile:

One can certainly write ATS code that looks elegant. For instance:

https://groups.google.com/forum/#!searchin/ats-lang-users/permute/ats-lang-users/LYHMWUMalIM/g4WCoANCEQAJ

It takes time to write elegant code, though. People complaining about the
syntax of ATS are often not knowing much about
ATS. There are certainly amny Haskellers who think that anything
non-Haskell is ugly.On Wednesday, February 10, 2016 at 5:45:46 AM UTC-5, anonymous anomymous wrote:

I always thought of functional programming somewhat wasteful (for reason
mentioned) but superior to other programming styles. Linear functional ATS
is really impressive. What am I saying? ATS on the whole is impressive!
Thanks, Professor, for the article. I hope, in time, the language gets the
popularity it deserves. I mean, it’s sad that such a good language is a bit
lacking in terms of attention. I often hear complaints about the syntax…
Programmers nowadays are really spoiled by Ruby and Python.

Best regards,
anonymous

Hi,
I really like what ATS can do but a lot of the examples, including the one
you link to, don’t seem to show off it’s overloading capabilities. I’m a
noob so I maybe misunderstanding the code but it seems to make calls to a
lot of type specific functions and datatypes like list0_tabulate and
nil0.

I have seen some of the overloading peek through in your template function
examples that use fwork but not much beyond.

Can you point to examples of how support for overloading is better than
ML’s?

Thanks!
-deechOn Wednesday, February 10, 2016 at 1:52:00 PM UTC-6, gmhwxi wrote:

Thanks :slight_smile:

One can certainly write ATS code that looks elegant. For instance:

Redirecting to Google Groups

It takes time to write elegant code, though. People complaining about the
syntax of ATS are often not knowing much about
ATS. There are certainly amny Haskellers who think that anything
non-Haskell is ugly.

On Wednesday, February 10, 2016 at 5:45:46 AM UTC-5, anonymous anomymous wrote:

I always thought of functional programming somewhat wasteful (for reason
mentioned) but superior to other programming styles. Linear functional ATS
is really impressive. What am I saying? ATS on the whole is impressive!
Thanks, Professor, for the article. I hope, in time, the language gets the
popularity it deserves. I mean, it’s sad that such a good language is a bit
lacking in terms of attention. I often hear complaints about the syntax…
Programmers nowadays are really spoiled by Ruby and Python.

Best regards,
anonymous