| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'default-scope' is now 'default-space'
'closure-generator' is now 'next-space-generator'
The connection to high-level syntax for closures is now tenuous, so
we'll call the 'outer scope' the 'next space'.
So, let's try to create a few sentences with all these related ideas:
Names map to addresses offset from a default-space when it's provided.
Spaces can be strung together. The zeroth variable points to the next
space, the one that is accessed when a variable has /space:1.
To map a name to an address in the next space, you need to know what
function generated that space. A corollary is that the space passed in
to a function should always be generated by a single function.
Spaces can be used to construct lexical scopes and objects.
|
| |
|
|
|
|
|
| |
We achieve this by separating out the freezing of system software, which
we needed to do anyway to address the duplication in 'init-fn'.
|
|
|
|
|
|
|
|
|
| |
To inform it about space metadata you have to tag environments with the
function that generated them. Every function can only ever be called
with environments generated by a single function. As an assembly-like
language, mu requires closures to be called with an explicit
environment, but it warns when the environment might not be what the
function expects.
|
|
|
|
|
|
|
|
|
|
| |
How did this work until now? The reply was being treated as a label, and
if 'write' returned nothing it would still work fine because the output
is already present, and a missing 'reply' leaves oargs as-is.
Should we do something to catch this? Perhaps we should track args
modified and check that there are oargs for them. But that seems quite
heavyweight.. Maybe we should clear oargs when missing a 'reply'?
|
| |
|
|
|
|
| |
This wasn't working until I fixed 459.
|
|
|
|
|
| |
No need for a separate channels array; just pass channels in globals.
The global space is a superset of unix's fd array.
|
|
|
|
| |
But we don't do nonsense like copy all state from the parent routine.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This is the first step to creating closures. That requires specifying
the lexical scope 'frame' to read a variable from.
|
|
|
|
|
|
|
|
| |
Clear up that ancient todo.
We don't particularly care about what abstraction we write tests at, as
long as we do so at *some* layer and document the intent. That lets us
move tests up or down in the future when we know more/have better taste.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Was dropped in commit 149. But we need it for more convenient
overloading, especially now that the right way to build tagged-values is
unclear.
The original concern was that type/otype would make code harder to
'assemble' down to native. But we should be able to insert CALL
instructions to the right clause inside a function's code. So keep it
around in the toolbox.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Biggest change was to the interface to the 'sizeof' helper. Where it
used to accept either a type symbol or a cons operand, it now always
accepts an operand, though the value of the operand can be _. In the
process the implementation is radically simpler.
Also reorg'd unit tests a little, putting those for 'deref' before
'sizeof'.
Finally, I'm giving in and enabling the printing of test names as
they're run. We still need this all the time in our surgery.
|
| |
|
| |
|
| |
|
|
|
|
| |
Now we can call unions 'or-record'.
|
|
|
|
| |
Tests now take 21s instead of 76s, reclaiming recent losses and more.
|
| |
|
|
|
|
| |
Seemingly large diff but most changes are peephole.
|
|
|
|
| |
Further cleanup of convert-names tests.
|
| |
|
|
|
|
| |
It makes them harder to appreciate.
|
| |
|
|
|
|
|
|
|
|
|
| |
With the notion of layers we add the constraint of only being able to
formulate loop tests without 'run' -- otherwise they'd have to leave
layer 11 because they have so many more dependencies.
Might bring back the run-based tests afresh later. Especially since
loop-fail test is now totally gone.
|
| |
|
|
|
|
| |
$ arc load.arc 10 mu.arc.t
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Tests only passing at level 9:
$ arc load.arc 9 mu.arc.t
|
|
|
|
| |
Within a level we can now just rely on simple ordering.
|
|
|
|
| |
We're now going to start doing surgery on low-level helpers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When I'm doing extensive surgery to the internals I want to avoid
loading higher levels; they aren't expected to work. But I don't want to
keep different levels in separate files just for that. And I definitely
don't want to put low-level stuff first. Now I can influence loading in
a cross-cutting manner by creating sections with numbers:
(section 100
...code...)
And disabling them by running:
$ ./anarki/arc 99 mu.arc.t
Currently we load all mu 'system software' in level 100, so running at
level 99 sidesteps them. Lower levels coming soon.
But most of the time we don't need to worry about levels, and the 'mu'
script lets us forget about them. Just run .mu files with:
$ ./mu factorial.mu
To run tests:
$ ./mu test mu.arc.t
|
| |
|
|
|
|
|
| |
We expect users to come across mu from arbitrary bits of code, so try to
make each line as self-contained as possible.
|
|
|
|
|
| |
Hack: currently restricted to 1000 locations per routine, no way to grow past that.
That suffices to pass our failing test.
|
|
|
|
| |
Still incomplete; one test temporarily disabled.
|
| |
|