I just found out about a functional programming language called Joy (see http://www.latrobe.edu.au/philosophy/phimvt/joy.html). Joy differs from Haskell in that it has no variables. Instead, all functions are postfix, taking a stack as their argument and returning a stack as a result. Joy advocates contend that the elimination of variables and environments improves on functional languages in much the same way the elimination of state improved on imperative languages. In particular, they claim the result is massively simplified semantics and implementation (all the tree-rewriting rules go away), faster development, easier optimization (search and replace lists of functions) and even simple meta-programming. Here is a quick example program to give a flavor for how it works. [1 2 3 4] [dup *] map == [1 2 3 4] [square] map is the same as Haskell's map (\x->x*x) [1,2,3,4] == map square [1,2,3,4] Recursion is handled via some built in combinator primitives. For example this is qsort: qsort == [small] [] [uncons [>] split] [[swap] dip cons concat] binrec (the explanation of how this works is at http://www.latrobe.edu.au/philosophy/phimvt/joy/j01tut.html) Currently Joy is a interpreted language without a compiler checked type-system, but there is some discussion about adding such a system. (It is also apparently non-lazy, but I'm not sure what that means in a world without variables). The system is very new and primitive, but looks promising. I am curious what the wiser and more experienced people on this list think of Joy's approach. -Alex- ___________________________________________________________________ S. Alexander Jacobson Shop.Com 1-646-638-2300 voice The Easiest Way To Shop (sm)
Hello S., Tuesday, September 25, 2001, 9:08:48 AM, you wrote: SAJ> I just found out about a functional programming language called Joy (see SAJ> http://www.latrobe.edu.au/philosophy/phimvt/joy.html). SAJ> Joy differs from Haskell in that it has no variables. Instead, all SAJ> functions are postfix, taking a stack as their argument and returning a SAJ> stack as a result. No, this is just a good old Forth programming language. It's a pity that author of Joy even didn't mentioned Forth in his writings... What differs from Forth is a presence of an attemt to describe language in a mathematically-strict manner, more smarter base primitives (syntax, scopes/hierarchies e.t.c.) and an attempt of so called "Total RPN" in forthish world. RPN - reverse polish notation. SAJ> The system is very new and primitive, but looks promising. Isn't new. Forth is 30-years old, unfortunately it didn't received much interests from huge companies such as Microsoft or Borland. -- Best regards, hw mailto:hw@ksue.kharkov.ukrtel.net
[...] SAJ> Joy differs from Haskell in that it has no variables. Instead, all SAJ> functions are postfix, taking a stack as their argument and returning SAJ> a stack as a result. No, this is just a good old Forth programming language. It's a pity that author of Joy even didn't mentioned Forth in his writings...
SAJ told that Joy is functional. If I unterstood him correctly, he said functional languages eliminated state and Joy IN ADDITION TO THIS eliminated variables and environments. So there must be a important difference to Forth because AFAIK Forth didn't eliminate state. Of course the particular idea of transforming stacks is not new.
[...]
Wolfgang
participants (3)
-
hw -
S. Alexander Jacobson -
Wolfgang Jeltsch