Folding


In the history of computer languages , Pliant is the first attempt to connect branches C and LISP . The programming language Pliant was initiated in 1984 by Hubert Tonneau , and published for the first time in 1999 . It is distributed under the GNU GPL v2 license .

Objective and Philosophy

Pliant’s objective is to reconcile performance efficiency with expressiveness.

Positioning of Pliant in programming languages

Pliant is a superset of C: any program written in C can be translated line to line by Folding, although the syntax is different. On the other hand, Pliant is not a superset of C ++, because its object model is different, based on instances and not on classes. Pliant presents the raw efficiency of the C, but allows a much better expressiveness and flexibility thanks to three of its key characteristics:

  • the metaprogramming
  • the reflexivity
  • the dynamic compilation

The syntax

Unlike many programming languages, Pliant’s default syntax does not follow the model of C: it would have been chosen the simplest and least “loaded” possible to make programs easier to read and facilitate small extensions to Applications. It uses indentation and removes most parentheses, brackets, and other braces. As an example, here is the comparison of the factorial function in C, Pliant, and Python (example of another language that adopted a different syntax from C):

C factorial function Fold factorial function Python factorial function
 / * Factor function in C * /
 Int factorial (int x) {
 If (x <2) {
 Return 1;
 } Else {
 Return x * factorial (x-1);
 }
 }
# Folding factorial function
Factor function x -> y
 Arg Int xy
 If x <2
 Y: = 1
 Else
 Y: = x * (factorial x-1)
 # Python factorial function
 Factorial def (x):
 If x <2:
 Return 1
 Else:
 Return x * factorial (x-1)

NB: braces could be removed from the C version, but errors can easily be committed in case of nesting several blocks, this would not correspond to the coding standards usually recommended.

It should be noted that Pliant allows in particular to change its own syntax.

Pliant’s contribution to metaprogramming

A computer language defines the tools that the human, in this case the programmer, will have to specify to the machine what to do. There are many computer languages. Of each new language, one tends to argue that it is better than another, because it has some more practical functionality, that is to say, a certain means of expression provided to the programmer. In fact, discussions about computer languages ​​often have a strong ideological connotation.

In this logic, the language designer and the programmer are not on an equal footing. The designer sets the rules, the programmer must apply them. If the fixed rules are not adapted to the situation, that is to say to the program to write, the programmer has no real room for maneuver, other than to change the language, which amounts to moving the problem Rather than solving it. Indeed, complex applications need to face a whole series of difficulties, which would require simultaneously implementing a whole series of languages ​​in order to benefit from all the optimal functionalities, but poses an insurmountable problem which is the interface between These different languages ​​that never goes without saying.

There are two exceptions to the rule of rigid language where the designer sets the rules once and for all:

  • LISP, established in 1959.
  • Folding, created in 1999.

With these two languages, when you want to have a new functionality, you can add it to the language rather than having to change the language. There are, however, two fundamental differences between LISP and Pliant.

First of all, in LISP, there is no safeguard against this freedom. Now, as at the social level, what guarantees maximum effective freedom is not anarchy, that is, the total absence of rules, but a few very general rules that facilitate the coexistence of different activities .

Secondly, the designers of LISP were not so much concerned with the problem of efficiency, because at the time it was thought that the exponential increase in the power of the machines would quickly render it irrelevant, which did not happen.

A programming language is the interface between the human language, represented in the form of a graph, and the machine language which is a list of instructions. Apart from the fact that it does not have a procedural mode of execution, Lisp differs from other languages ​​in its ability to rewrite (metaprogramming); In fact, Lisp’s ability to rewrite is turing-equivalent on the tree part (human language), which is not the case with any other language (except Pliant). In Lisp the power of expression is maximum, but the execution is frozen, left to the compiler.

The Pliant rewrite capacity is also turing-equivalent on the instructions part, which makes Pliant the only language to link the two representations 1 . At each node of the tree is attached a list of elementary instructions and the result argument.

Appendices

External links

  • ( In ) http://zhar.net/projects/pliant/whatispliant/  [ archive ]
  • ( In ) https://www.sourceware.org/ml/guile/1999-03/msg00309.html  [ archive ] First published in 1999
  • ( In ) http://www.fullpliant.org/  [ archive ] Official website
  • ( In ) http://beta.slashdot.org/story/15613  [ archive ] Discussion on slashdot when the first release
  • ( In ) http://www.webopedia.com/TERM/P/Pliant.html  [ archive ]
  • ( In ) http://cams.ehess.fr/pom/langen/soft.html#pliant  [ archive ]
  • ( In ) https://sites.google.com/site/pliantcookbook/home  [ archive ]
  • ( In ) https://just10.com  [ archive ] scheduled commercial product with folding

Bibliography

  • ( In ) Marcus V. dos Santos Woungang Isaac, Moses Nyongwa. Folding: A Software Framework for Web-Based Courseware Development . Handbook of E-Learning Methods for Language Acquisition, Rita de Cassia Veiga Marriott & Patricia Lupion Torres (Eds.), Idea Group Publishing. Chapter 11, pages 165-184, 2008.
  • ( In ) Marcus V. dos Santos Woungang Isaac, and Moses Nyongwa. Academia: a simple Web-based courseware tool fully implemented in Folding . World Conference on Educational Multimedia, Hypermedia and Telecomunications (EDMEDIA’05), Montreal, Canada, June 27-July 02, 2005.
  • ( In ) Marcus V. dos Santos, Isaac Woungang, and Patrice O. Mendez. Folding: Flexible E-learning Tool . World Conference on Educational Multimedia, Hypermedia and Telecomunications (EDMEDIA’04), Lugano, Switzerland, June 21-26, 2004.