After reading Structure and Interpretation of Computer Programs I decided to rethink the interpreter of Fype. Fype is a small scripting language invented and implemented (in C) by me. I decided to take the code-base of Fype and to rewrite the core of its interpreter-part in order to use a Scheme/Lisp-like syntax. which is much easier to parse. The syntax is simpler and much more powerful now. So far it is now possible to define functions and sub-functions and to display all involving frames. Here is an example:
(def (test)
(say "This is test")
(def (test2)
(say "I am in test2" "And test3 will be defined next!")
(def (test3)
(say "Displaying all frames now:")
(show-frames))
(test3))
(test2))
(test)
The invocation of the interpreter prints out the following result:
This is test
I am in test2
And test3 will be defined next!
Displaying all frames now:
FRAME(id=3) 0:
FRAME(id=2) 1:
+ST_LAMBDA(name=test3;args=)
( ( say Displaying all frames now: ) ( show-frames ) )
FRAME(id=1) 2:
+ST_LAMBDA(name=test2;args=)
( ( say I am in test2 And test3 will be defined next! ) ( def ( test3 ) ( say Displaying all frames now: ) ( show-frames ) ) ( test3 ) )
FRAME(id=0) 3:
+ST_LAMBDA(name=test;args=)
( ( say This is test ) ( def ( test2 ) ( say I am in test2 And test3 will be defined next! ) ( def ( test3 ) ( say Displaying all frames now: ) ( show-frames ) ) ( test3 ) ) ( test2 ) )
Now what's left to do: Implement a few more built in functions. And we have a new Scheme/Lisp-like language with a very very small footprint available :)
Btw.: This version of fype aims to be pure-functional and with lazy evaluation.


