REFAL programming language

From Free net encyclopedia

(Redirected from REFAL)

REFAL (for REcursive Functions Algorithmic Language) is a functional programming language targeted at symbol manipulation: string processing, translation, artificial intelligence. Refal-5 is a dialect of Refal developed at the City College of New York and supported by Refal Systems Inc.

REFAL is one of the oldest members of the functional languages family; it was first implemented by Valentin Turchin in 1968 in Russia (where it is said to be still widely used). Refal combines mathematical simplicity with the practicality needed for writing large programs.

Unlike typical functional languages (such as Lisp) and like some symbolic computation languages (such as Mathematica), Refal is based on pattern-matched term-rewriting. Its designers claim that the typical Refal program is on the average two to three times shorter than the analogous program in Lisp and yet more readable. It is also claimed that Refal is conceptually simpler when compared to Prolog since its pattern matching/replacing works forwards (i.e., starting from the givens) instead of backwards (i.e., starting from the goal), as is the case in Prolog. Some claim that this is a more natural approach to writing algorithms and that it also makes them easier to test and debug.

Other design goals for Refal were: simplicity, high modularity, and an inherent support for structured programming (there is absolutely no support for GO TO-like structures in Refal). For a mathematically oriented person, Refal provides all the power of a practical programming language, yet eliminates the need to learn a lot of small details, for which many other programming languages are notorious. Refal supports partial evaluation of functions, and the programming system includes a powerful tracer-debugger which can catch the moment when the argument of the evaluated function matches any given pattern.

Because of its fundamental simplicity, Refal is offered as an effective choice for introducing students to functional programming languages. It has been taught at the City College of New York for several years with an overall positive response from students. Refal is also used as a language for research in the theory of programming languages and program transformation.

References

  • V. Turchin, The concept of a supercompiler, ACM Transactions on Programming Languages and Systems, vol. 8, pp. 292-325, 1986. (This paper includes a short definition of a simplified version of Refal)

External links

ru:РЕФАЛ