Pliant language

B

bearophileHUGS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,145
Latest member
web3PRAgeency
Top