Also fixed a minor bug with printing, and removed the ability to
configure the parser.
Added and updated QUICKSTART.md as a quick way to get people started.
There's some broken scripts under 'scripts/' that require functions to
work properly.
I've ripped out the deep copying, and flattened the bucket usage, but
this results in no memory being freed or reused for the lifetime of the
program.
This is shown most clearly with this script:
```toy
fn makeCounter() {
var counter: int = 0;
fn increment() {
return ++counter;
}
return increment;
}
var tally = makeCounter();
while (true) {
var result = tally();
if (result >= 10_000_000) {
break;
}
}
```
The number of calls vs amount of memory consumed is:
```
function calls -> memory used in megabytes
1_000 -> 0.138128
10_000 -> 2.235536
100_000 -> 21.7021
1_000_000 -> 216.1712
10_000_000 -> 1520.823
```
Obviously this needs to be fixed, as ballooning to gigabytes of memory
in only a moment isn't practical. That will be the next task - to find
some way to free memory that isn't needed anymore.
See #163, #160
I build a self-referential system, then tried to copy only parts. I need
to step back and adjust my approach.
'Toy_private_deepCopyValue' and 'Toy_private_deepCopyScope' need to be
ripped out, and I need to simply accept there will be only one instance
of 'Toy_Bucket' that isn't freed until the top-level VM is.
I need an hour's break before I'll tackle this again.
See #163
Functions are having issues with being copied around, especially
between buckets, leading to the scopes getting looped. The program gets
stuck in 'incrementRefCount()'.
It's past my time limit, so I'll keep working on it tomorrow with a
fresh mind.
All function stuff is still untested.
See #163
If a string exists in the data, instead of being written, the function
'emitCStringToData()' will instead return the address of the match
within the data section.
Then, I can search the jump table for that address, and use the existing
jump entry or append a new one.
Fixes#168
Parameter lists are read manually, rather than delegating to
parsePrecedence, because that was causing issues.
function bodies are read as block-level statements, just like the entire
files.
They're no-ops in compilation for now, and param types aren't parsed.
'return' keyword needs to be implemented.
Was distracted by bugfixes in v2 and v2-docs.