Jesse D. McDonald
4ab23f6877
Thread context register (%ctx) through %apply and %call/cc forms.
...
Also remove top-level forms without side-effects during CPS transformation.
2012-07-14 13:44:46 -05:00
Jesse D. McDonald
35059dfebf
Implement register allocation.
...
All that remains is to convert the result to bytecode & format as rosella source code.
2012-07-14 13:44:43 -05:00
Jesse D. McDonald
c3e46525db
Implement conversion of shared variables to boxes.
...
Also, narrow bindings to their minimal necessary scope. This reduces
the number of variables which must be considered 'shared'.
2012-07-14 13:44:39 -05:00
Jesse D. McDonald
b899f0c3b0
Implement support for (call/cc), and shorthand form (let/cc).
...
Adds support for non-local returns, among other control-flow structures.
2012-07-14 13:44:35 -05:00
Jesse D. McDonald
14b2a1570a
Add support for (quote) literal forms in compiler.ss.
2012-07-14 13:44:33 -05:00
Jesse D. McDonald
0b0b352dd6
Clean up handling of (let) and (%bind), plus misc. cleanup.
...
With this change, any (%bind) returned from (simplify-let) or (simplify-form)
can be assumed to be flat, with unique bound symbols. Before, this was only
true of (%lambda) forms and the output of (compile).
2012-07-14 13:44:30 -05:00
Jesse D. McDonald
6b51229c48
Raise an error if (set! ...) is applied to a form without a value.
...
Exception is (%tail-call ...) form, which is permitted simply because
(%tail-call ...) transfers control unidirectionally; the enclosing
(%set! ...) form wouldn't be run anyway.
2012-07-14 13:44:17 -05:00
Jesse D. McDonald
8e147f7989
Don't create extra lambdas when both results of (if ...) are trivial.
...
Also map () directly to %nil, and allow (%if ...) to provide a value to a set! form.
2012-07-14 13:44:05 -05:00
Jesse D. McDonald
46b18c07d6
Implement conversion to tail-call form (CPS).
...
Also add some basic optimizations concerning binding and setting
variables which will never be used.
2012-07-14 13:43:58 -05:00
Jesse D. McDonald
988d4264b2
Improve representation of tail-calls, and normalize primitive operations.
2012-07-14 13:43:45 -05:00