FVM - ponyatov/orth GitHub Wiki
FVM must have few structures and some functions implements primitive operation (VM commands):
Other elements like:
- input/output (including source code loading),
- definitions search,
- interpreter and
- compiler
can be considered as part of FVM, but we'll describe them in separate sections.
There is no memory
Be noted: our VM model does not have any memory image as classical FORTH. As we targeted on object system implementation, we can avoid one of most annoying FORTH problem: writing on random addresses popped from the stack. Every time you make an error in classical FORTH and use a random address with words like !
or CMOVE
, your system crashes (in a best case) or invisible do some unpredictable things.
Dynamic memory manager does all dirty work for us including object creation and garbage collection (we'll pose on Python runtime for the first time). In result we have no legal interface to trash memory, but we must use special container objects to hold data.