Last friday I wrote that I wanted to write code. And that's what I did. During the last few days, I created a small interpreter for my very own functional programming language. It doesn't yet have any official name, but since it has a scheme-like syntax, I gave it the working title "scheme0". But I think this will change. A name I already thought about was "NFL", for "naive functional language". The interpreter is naive, because I'm naive. I never did any course on writing compilers or interpreters, and so I simply did it the way I thought it would work. Anyway, for anybody interested in actual code, you can download a preview version
here.
To give an example on how source code of my language looks like, here you can see an implementation a well-known algorithms to compute a number's factorial (i.e. n! := n*(n-1)!, 1! := 1, recursively solved):
(defun (fact 'x) (if (eq 'x 1) 1 (mul 'x (fact (minus 'x 1) ) ) ) )
For more (simple) examples have a look into the preview .tar.gz. Please play with it, and implement other algorithms, to test whether the interpreter works correctly. So, feedback is welcome (as usual).