aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2022-09-02Fix bugs with recursive macros and empty template.Rose Hogenson2-38/+91
2022-09-02Undo the hacky list constant changes.Rose Hogenson2-41/+4
We will eventually implement list constants using some kind of rodata.
2022-09-01Fix some bugs in macros, and add list constants.Rose Hogenson2-94/+236
2022-08-27Use reg 255 for swapping.Rose Hogenson2-3/+3
I wanted to use the top reg, for some reason I thought at the time that 127 was the biggest 8-bit number. Obviously it's 255.
2022-08-27Fix more bytes vs words bugs.Rose Hogenson1-5/+5
2022-08-27Enable nil constants.Rose Hogenson1-2/+3
2022-08-27Fix a bug in how offsets are calculated.Rose Hogenson1-3/+4
2022-08-27Implement multiple return values.Rose Hogenson8-85/+153
2022-08-23Change argument passing to use lists.Rose Hogenson5-329/+87
Using vectors is just horribly complicated combined with builtins like apply, or procedures that take a rest parameter. Now we pass all arguments in a list. Hopefully optimization can undo this for known functions in the future.
2022-08-23Insert references, not values into the map.Rose Hogenson1-7/+4
This fixes a bug in compiler.csc.
2022-08-22Add a few primitive list operations.Rose Hogenson3-4/+56
2022-08-22Simplify the heap.Rose Hogenson2-67/+68
Garbage collection is no longer recursive, heap takes an offset explicitly, and we use the vector length to store the free pointer.
2022-08-22Allow 0-length allocs.Rose Hogenson1-3/+7
2022-08-12Fix bugs in the macro expander.Rose Hogenson2-84/+125
Now I'm following the rule that you should ignore marks that were added after the binding was defined. I also introduced a lexical environment to handle lambdas.
2022-08-10Subtract int-min instead of adding int-max + 1.Rose Hogenson1-11/+3
2022-08-09Fix a few small bugs.Rose Hogenson2-3/+3
N lines of code will have about 2N bugs.
2022-08-08Fix the bugs in the number library.Rose Hogenson1-170/+218
I did some extensive manual testing. Hopefully there are no bugs left :)
2022-08-08Unexport case-lambda.Rose Hogenson1-1/+2
case-lambda is actually defined in the (scheme case-lambda) library, but it's too convenient so I'm just going to define two copies.
2022-08-07Misc test fixup in the compiler.Rose Hogenson6-21/+33
2022-08-07Add a needed import to 10-define.csc.Rose Hogenson1-1/+2
2022-08-07Add include-library-declarations.Rose Hogenson1-13/+50
2022-08-07Fix hoist.Rose Hogenson1-2/+4
Hoist needs to hoist the function bodies as well.
2022-08-07Fix an infinite loop in the garbage collector.Rose Hogenson1-15/+13
2022-08-07Add int<? and eq?.Rose Hogenson3-2/+37
2022-08-07Fix a bug in expand-body for an empty body.Rose Hogenson1-1/+2
2022-08-07Define last-index.Rose Hogenson2-0/+26
2022-08-07Fix a typo in codegen.Rose Hogenson1-3/+1
2022-08-07Activate the new libraries.Rose Hogenson1-1/+3
2022-08-07Add numbers.Rose Hogenson1-0/+821
2022-08-07Add vectors.Rose Hogenson1-0/+156
2022-08-07Add map and for-each.Rose Hogenson1-1/+35
2022-08-07Fix a bug in the records library.Rose Hogenson1-1/+2
We have to check if it's a pointer before dereferencing.
2022-08-07Add booleans.Rose Hogenson1-2/+25
2022-08-05Check that records are the correct type.Rose Hogenson1-9/+15
To avoid selecting the wrong field, or reading out of bounds, we should ensure that a record is the correct type before reading a field.
2022-08-05Add more of the standard library.Rose Hogenson10-386/+774
2022-08-05Add call-with-values.Rose Hogenson2-1/+21
2022-08-05Add call-with-current-continuation.Rose Hogenson2-0/+15
2022-08-04Add if, and, or, when and friends.Rose Hogenson3-2/+90
2022-08-04Add begin.Rose Hogenson1-1/+12
2022-08-04Add if and set!.Rose Hogenson3-5/+67
2022-08-03Start the scheme base library.Rose Hogenson3-0/+94
2022-08-01Remove mutable globals.Rose Hogenson3-9/+14
Per a closer reading of R7RS, it's an error to mutate an imported binding with set!. My apologies to Guile when I said they had a bug.
2022-08-01Modify the project structure.Rose Hogenson46-7/+13
Now the lib directory contains what will eventually end up on the user's /usr/lib/csc. When I write make install, it will copy all of the .csc files from lib into the destination lib directory. This means I can start working on the standard library in lib/scheme.
2022-08-01Rename the compiler in bytecode.rs.Rose Hogenson1-2/+2
2022-08-01Rename the compiler.Rose Hogenson2-9/+19
I'm starting the process of updating the whole project to use the new name Chromatopelma.
2022-07-30Add typeof to encoding.rs.Rose Hogenson1-0/+9
2022-07-30Add call-builtin syntax.Rose Hogenson4-2/+36
This syntax allows calling opcodes directly from scheme code. Very powerful technique.
2022-07-30Add the typeof opcode.Rose Hogenson3-0/+95
2022-07-30Fix a bug in the linker label calculation.Rose Hogenson2-5/+5
2022-07-30Move Cargo.nix to default.nix.Rose Hogenson1-0/+0