Functional Programming in Joy #1
Just because something is obscure does not make it unworthy of study.
What is Joy?
Joy is a pure, concatenative, functional, scalar programming language.
Joy is pure because it does not contain assignment.
Joy is functional because computation consists of the evaluation of expressions.
Joy is concatenative (and not applicative) because
- The elementary well-formed expressions of Joy are monadic functions of a nameless data stack.
- If X and Y are well-formed expressions, then the concatenation of X and Y is well-formed.
- If Z is the concatenation of X and Y, then the value of Z is the composition of the values of X and Y.
Sadly, the official website is no longer hosted by La Trobe University however there is a reasonably complete mirror hosted by Kevin Albrecht and the Wikipedia page is helpful.
Hello World in Joy?
"Hello, world!\n" putchars .
Quicksort in Joy?
DEFINE qsort == [small] # termination condition: 0 or 1 element [] # do nothing [uncons [>] split] # pivot and two lists [enconcat] # insert the pivot after the recursion binrec. # recursion on the two lists (full-stop ends the define)
Who invented Joy?
Manfred von Thun was the inventor of the Joy programming language.According to the LaTrobe University Alumni news:
"Alumni and staff will be saddened to hear of the death of Manfred von Thun on 23 October after a long illness. Manfred was a member of the philosophy department from early 1972 until his retirement in 2003, but remained an honorary associate until 2009. Manfred specialized in logic, philosophy of science, philosophy of mind, computer programming and cybernetics. He was also renowned for developing the computer programming language, Joy. He will be sadly missed."
Joy’s inventor, Manfred von Thun
No comments:
Post a Comment