REFAL programming language

From Wikipedia, the free encyclopedia

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. 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. It is related also to the Markov algorithm approach of algorithm concept. 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). 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.

It has been taught at the City College of New York for several years. REFAL is also used as a language for research in the theory of programming languages and program transformation.

[edit] 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)

[edit] External links

In other languages