| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Draft 5.
|
|
|
|
|
| |
Now parse-type passes, but some outer test is failing. The result is not
being consumed right by `type-equal?`.
|
|
|
|
|
|
| |
Draft 3.
Getting close. Now the tree structure seems right.
|
|
|
|
| |
Draft 2.
|
|
|
|
|
|
|
| |
Draft of my first, incorrect attempt at parsing s-expressions.
No matter how many times I've done this, I never get it right the first
time.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Anytime we create a slice, the first check tends to be whether it's empty.
If we handle ill-formed slices here where start > end, that provides a
measure of safety.
In the Mu translator (mu.subx) we often check for a trailing ':' or ','
and decrement slice->end to ignore it. But that could conceivably yield
ill-formed slices if the slice started out empty. Now we make sure we never
operate on such ill-formed slices.
|
|
|
|
|
|
|
| |
Signed and unsigned don't quite capture the essence of what the different
combinations of x86 flags are doing for SubX. The crucial distinction is
that one set of comparison operators is for integers and the second is
for addresses.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Layers 0-89 are used in self-hosting SubX.
Layers 90-99 are not needed for self-hosting SubX, and therefore could
use transitional levels of syntax sugar.
Layers 100 and up use all SubX syntax sugar.
|
|
|
|
| |
Finalize design for type trees.
|
|
|
|
|
|
|
|
|
|
| |
When I created it I was conflating two things:
a) needing to refer to just the start, rather than the whole, and
b) counting indirections.
Both are kinda ill-posed. Now Mu will have just `addr` and `handle` types.
Normal types will translate implicitly to `addr` types, while `handle`
will always require explicit handling.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Follow stupid GNU convention, because why not:
https://www.gnu.org/prep/standards/html_node/Releases.html
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I can now run this program:
fn main -> result/ebx: int {
result <- do-add 3 4
}
fn do-add a: int, b: int -> result/ebx: int {
result <- copy a
result <- add b
}
We still can't define local variables, but can write any programs involving
ints by passing in enough arguments for temporaries.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Let's start putting r32 first in compare instructions that need it. Ordering
there is quite subtle and of great import.
|
|
|
|
| |
Bugfix.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We haven't implemented it yet, but there's now a design for how we check
whether a function has written its output correctly. Functions must write
to each output at the top level at least once, and never overwrite an output
register in the top-level once it's been defined.
This is conservative (it can be perfectly reasonable for functions to write
the output, reuse the register for a temporary, and then write the output
again) but easy to check.
|
| |
|
|
|
|
|
| |
Bugfix: statements defining a new register variable require an initializer
instruction.
|
| |
|
|
|
|
|
| |
Copy (mov) instructions are unlike instructions we've encoded so far, in
that their destination is not read.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
See test-convert-function-with-arg-and-body.
|
|
|
|
|
|
|
|
|
|
|
| |
One test failing. It took enough debugging just to get to the expected
failure that it seems worth saving this snapshot.
Saw some signs that I have to remember to zero-out allocated memory. We
need a scalable solution for this.
I think parse-var-with-type needs to be rewritten. Just added a test and
a hacky fix for now.
|