Fexl
{{Short description|Functional programming language}F149 (talk) 13:01, 19 June 2022 (UTC)}
Fexl [1] is a programming language based on the concept of functions, and is an extension of the notation known as the lambda calculus, devised by Alonzo Church in the 1930s. The name is an acronym for "Function EXpression Language," and is pronounced fex'-uhl, somewhat similar to "pixel."
It is designed to be a very thin layer on top of the C programming language.
Example
A Hello, World! example:
say "Hello, world!"A function to calculate the nth Fibonacci number starting at 1. This is the naive implementation which will be slow for large n.
# (fib n) returns the nth Fibonacci number starting at 1.
\fib=
(@\fib\n
\n=n
le n 1 1;
+ (fib (- n 1)) (fib (- n 2))
)This version uses memoization to make it faster:
# (fib n) returns the nth Fibonacci number starting at 1.
\fib=
(
\memo=cache
@\fib\n
\n=n
le n 1 1;
memo n;
+ (fib (- n 1)) (fib (- n 2))
)References
This article "Fexl" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Fexl. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
