Pliant language

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sun Jan 8 10:19:55 EST 2006


This post is about a programming language that I've never used, called
Pliant. Sometimes knowing something about other languages can be useful
for our language, so I think this is not a fully off topic post. Time
ago I have found Python (that now I am using a lot) because I like to
explore less known languages.

It's a bit like a Lisp without most of its parenthesis:
http://en.wikipedia.org/wiki/Pliant
http://fullpliant.org/

An example of Pliant code:
http://fullpliant.org/pliant/util/encoding/zlib.pli


As bitwise operators Pliant uses the following ones instead of the
cryptic symbols (~ | & ^) used by C and Python:
.not. .or. .and. .xor.

For the same purpose maybe Python 3 can use:
NOT OR AND XOR
That are easy to remember.

Pliant uses indentations almost as Python, this is an example (I have
added the ! to keep the indentations):

! function factorial x -> f
!   arg Int x f
!   if x=0
!     f := 1
!   else
!     f := x * (factorial x-1)


But with a difference (this is from Pliant online documentation):

>Tabs are not allowed in the source code: you have to use spaces instead. The main reason for not allowing them is that not everybody agrees on the number of spaces each tab stands for, so when a program contains several modules provided by different people, the number could be different in various modules. Tabs could be allowed if the number of spaces they stood for were declared at the beginning of the module, but then the various editors would have to be aware of that ... so it is simpler to use only spaces. Furthermore, most editors provide a 'translate tabs to spaces' function.<

Bye,
bearophile




More information about the Python-list mailing list