aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2022-03-03Write the compiler frontend.Rose Hogenson4-54/+186
2022-03-03Start the garbage collector.Rose Hogenson7-77/+561
I don't think we finished it, but I wrote this code a while ago and I'm just trying to get it committed.
2022-01-25Nitpick on loop style.Rose Hogenson1-3/+4
2022-01-25Use an exception for loop return.Rose Hogenson1-18/+12
This makes everything a lot easier, as it handles nested loops automatically. My brain wave was storing the returned values in a thunk.
2022-01-25Fix the bugs in loop.Rose Hogenson2-44/+230
It works! Sometimes it emits nested loops!
2022-01-24Implement lambda?Rose Hogenson2-12/+209
2022-01-24Finish the loop macro.Rose Hogenson3-164/+362
I also cleaned everything up a lot. Maybe there are still bugs because the test coverage is awful, but for now I'm happy to be done.
2022-01-22Store the list length in sort.Rose Hogenson1-8/+12
Computing length each time is very unnecessary.
2022-01-22Add a loop macro.Rose Hogenson3-12/+313
2022-01-15Finish the macro expander.Rose Hogenson6-105/+501
It works!! At least it passes all the test cases. Next I will: 1. finish the builtins, 2. add a conversion to IR2 in continuation passing style, 3. add a compiler from IR2 to bytecode, 4. and add an option to the frontend compiler to generate a standalone executable.
2022-01-14Write a first draft macro expander.Rose Hogenson6-161/+414
Committing it because it compiles. I have to write tests and debug it still.
2022-01-13Rewrite match to use exceptions.Rose Hogenson1-17/+43
This makes the control flow more clear, and eliminates the need to scan the pattern twice. It also makes it easier to add new forms by consolidating the pattern logic in one procedure.
2022-01-13Use := instead of = for variable assignment.Rose Hogenson1-1/+1
I was reading about the difference, and := does what you want more often than not.
2022-01-13Generalize the hash map.Rose Hogenson3-35/+48
Before we were assuming keys could be compared with eqv?. But it seems like that assumption isn't true when we want to hold identifiers in the hash map.
2022-01-11Add a README.Rose Hogenson1-0/+5
2022-01-11Move scheme compiler into a separate directory.Rose Hogenson27-0/+0
2022-01-11Add a first implementation of a macro expander.Rose Hogenson3-0/+422
This half-finished macro expander is the most satisfying piece of code I have ever written.
2022-01-11Make bindings visible while a guard is evaluated.Rose Hogenson2-5/+15
The current implementation repeats the bindings twice, but I guess it's fine. It seems to work.
2022-01-11Add guards to the match syntax.Rose Hogenson2-1/+20
I'm not sure the syntax is great, but it's very helpful to have.
2022-01-09Write the linker.Rose Hogenson13-102/+450
2022-01-09Remove str- prefixes from the strings library.Rose Hogenson3-47/+45
Not very scheme.
2022-01-09Redo the testing framework.Rose Hogenson9-637/+310
We can lean more on the power of scheme to make the testing framework a little less verbose.
2022-01-09Add some magic to detect symbols.Rose Hogenson2-26/+41
I still don't understand this snippet.
2022-01-09Define helper intercalate.Rose Hogenson2-2/+44
2022-01-09Improve match syntax.Rose Hogenson2-29/+44
Now ! is required to match against a constant, and by default a name is bound.
2022-01-09Simplify macro definitions in match.Rose Hogenson1-31/+9
2022-01-09Add wildcard to pattern syntax.Rose Hogenson2-7/+25
2022-01-09Add a library for pattern matching.Rose Hogenson2-0/+102
2022-01-09Use load to evaluate each library's tests.Rose Hogenson2-1/+2
2022-01-09Initial commit.Rose Hogenson25-0/+1987
Not sure if everything here will be needed eventually, but we have a working bytecode interpreter. Next I will write the linker, then the core compiler, and finish with the macro expander.