Merge pull request #8 from kdsch/nayuki
README.md: add fast fibonacci algorithm example
README.md: add fast fibonacci algorithm example
Merge pull request #7 from kdsch/6-move-benchmarks
move benchmarks into tests
testdata/test.kp: change benchmark case
move benchmarks into tests
sloc: use find -exec, not xargs
README.md: fix list formatting
remove unused file; rename a file
move all files up one directory
change import path, become a module
progress!
We're in the middle of some changes. Stay tuned.
improve performance
Linked lists as expressions seem to speed up the machine;
particularly, shifting to the next word is much faster than ropes.
Still unclear whether this is true for stacks; should investigate
more.
add variadic bindings
This allows a single bindv expression to bind multiple values
from the stack to a sequence of variables.
let there be lists
Any decent programming language has data structures. We had Expr
and Stack, but now both have been merged into Seq. This is all
for the better. It gives us much flexibility and power. Furthermore,
we've introduce [ ] syntax for lists, backed up by Seq.
We had to abandon the linked list that was the sole implementation
of Stack. It will be missed. But std.Rope is much more powerful;
it works quite well as either a stack or an expression. It's a good
Seq.
We've introduced new builtins for lists.
One wrinkle introduced: lists can contain arbitrary expressions,
which are reduced when the list is reduced. These feels somewhat
like calling a block; but instead of the block working with the
main stack, it works on a separate stack.
This means that the interpreter embraces a self-replicating machine
model, which is not physically realistic. I have not determined
whether I care about this. In the long term, we should maybe not do
this.