Introduction
Genesis
YANI is an interpreter I wrote on my free time as an application to the language & compiler theories I studied during my BSc. Finally I didn’t work for nothing as I completed it and presented it as my final year project of my DUETI.
The language itself is based on the examples I studied in lectures, and thus isn’t meant to be useful in any ways, just simple!
The interpreter itself is written in portable ANSI C. It is in fact a combonation of a compiler and a virtual machine, reunified to avoid useless intermediary files.
Source Example
To get an idea of what the language is capable, here is a recursive implementation of the Fibonacci function in YANI:
function fib(n)=
if n<=2 then
1
else
fib(n-1)+fib(n-2)
;
fib(10).
The first lines define a function called fib with a single argument n. It’s composed of a statement embed between = and ;. The fib function makes use of YANI mathematical expressions support as well as conditional statements and logic operators. Finally at the end of the source file stands the “entry-point” of the program, which call our defined Fibonacci for 10.
Here is the program output when executed by YANI:
C:\Program Files\YANI>YANI fib.yani
Result : 55
In the same section
Stay tuned!
What others think
«Anyway, thank you for the wonderful plug-in. It's greatly appreciated.»
Andrew T.