The Virtual Machine in Falk is a Threaded Interpreter. This is probably the fastest Virtual Machine interpreter. The only downside I can think of is that is't harder to implement, compared to other solutions like Decode and Dispatch.
Target syntax style is aimed to be like C. Falk is going to be a dynamically typed language. When defining a variable, type is not required.
Example:
# define function
test = func(from, to) {
if (from > to) {
return;
}
count = from;
while (count < to) {
print(count);
count += 1;
}
}
# call function
test(4, 18);
Falk is compiled in C99 and should compile on most platforms.
If you want to do something, nothing should stop you from doing so. My goal is to make it possible to compile a library and then, link it to the Falk interpreter.
- VM √
- Variables (modify, create)
- Strings, numbers (
double
) - C function calls
- Deserializer (execute a compiled file)
- Push, pop, goto, jump and if instructions
- Assignment & Comparison operators
- Simple optimizations (lookup variable and store pointer instead of key)
- Lexer √
- Keywords
- Identifiers
- Numbers
- Operators (length of 1 (+, -, /))
- Simple block mismatch check
- Line counter
- Parser x
- Infix to postfix √
- Grammar checking (syntax validation) √
- AST x
- AST -> byte code x