| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
One more place we were missing expanding type abbreviations: inside
container definitions.
|
|
|
|
| |
Can't use type abbreviations inside 'memory-should-contain'.
|
|
|
|
|
| |
This commit completes the final step: fixing the final failing tests (in
chessboard.mu) by teaching `restart` about the block signal.
|
|
|
|
| |
Process type abbreviations in *shape-shifting* function headers.
|
|
|
|
|
| |
In the process I've uncover a couple of situations we don't support type
abbreviations yet. They're next.
|
|
|
|
| |
Fix CI.
|
|
|
|
|
|
|
|
| |
Extremely ugly change.
Also ended up fixing some places where I was mixing up sources and
sinks. But I'm not going to bother updating edit/ and sandbox/ apps.
Just too many scenarios to clean up.
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out we don't need a primitive to return an empty value of
arbitrary type. Just create it on the heap using 'new'.
But this uncovered *yet* another bug, sigh. When I specialize generic
functions I was running all transforms on the generated functions after
specialization completed. But there's one transform that includes code
from elsewhere. If such code included type-ingredients -- kaboom. Now
fixed and there's a test, so I've got that going for me which is nice.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was an interaction between two transforms. The first turned:
return-if ...
into:
jump-unless ..., 1:offset # skip next instruction
return ...
The second added an unconditional return at the end of the recipe if it
didn't already exist (so that functions always end with a return).
However, it was getting confused by the return instructions generated
above, which look unconditional but sometimes get skipped.
To fix this, conditional returns are now transformed into this:
{
break-unless ...
return ...
}
Since the final instruction is now no longer a reply (but rather the '}'
label), the second transform triggers and adds the unconditional return
after it.
This commit removes the final place marked 'BUG:' in the codebase
yesterday (see commit 2870).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The solution for avoiding deadlock is for routines to close channels
before they exit. So that's good.
Once I implemented 'close', I also found and fixed 2 unrelated bugs in
chessboard.mu:
a) one long-missed and long-masked case of forgetting to store
character literals in character variables
b) one typo in translating get-address to put
So that's good.
What's not so good: in the process of fixing this I've found three
unrelated bugs (marked 'BUG:' in the changes). All three have
workarounds, so existing tests pass for now. But they are my top
priority next.
|
|
|
|
|
|
|
| |
Now that we no longer have non-shared addresses, we can just always
track refcounts for all addresses.
Phew!
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This way when you pass one end to a function or routine, you can
implicitly give it the right to either read or write the channel, but
not both.
The cost: code gets more convoluted, names get more convoluted. You can
see this in particular in the test for buffer-lines. Let's see how it
goes..
|
|
|
|
|
|
| |
I've ignored Mu's concurrency primitives for a while, but they're
starting to return to front-and-center as I work on the file system
interfaces.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
I'm dropping all mention of 'recipe' terminology from the Readme. That
way I hope to avoid further bike-shedding discussions while I very
slowly decide on the right terminology with my students.
I could be smarter in my error messages and use 'recipe' when code uses
it and 'function' otherwise. But what about other words like ingredient?
It would all add complexity that I'm not yet sure is worthwhile. But I
do want separate experiences for veteran programmers reading about Mu on
github and for people learning programming using Mu.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the one major refinement on the C programming model I'm planning
to introduce in mu. Instead of Rust's menagerie of pointer types and
static checking, I want to introduce just one new type, and use it to
perform ref-counting at runtime.
So far all we're doing is updating new's interface. The actual
ref-counting implementation is next.
One implication: I might sometimes need duplicate implementations for a
recipe with allocated vs vanilla addresses of the same type. So far it
seems I can get away with just always passing in allocated addresses;
the situations when you want to pass an unallocated address to a recipe
should be few and far between.
|
|
|
|
|
|
|
|
|
|
|
| |
I realize that my current doesn't allow nesting a:b:c linear type syntax
inside a dilated property. So you can't currently say:
(recipe address:number)
Need to fix that at some point. Non-trivial since linear syntax is
oblivious to dilated syntax. I should probably make the dilated syntax
more fundamental and introduce it at an earlier layer.
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to use the type 'recipe' for recipe *variables*, because it
seems nicer to say `recipe number -> number` rather than recipe-ordinal,
etc. To support this we'll allow recipe names to be mentioned without
any type.
This might make a couple of places in this commit more brittle. I'm
dropping error messages, causing them to not happen in some situations.
Maybe I should just bite the bullet and require an explicit
:recipe-literal. We'll see.
|
|
|
|
|
|
|
|
|
|
| |
Still can't print non-integer numbers, so this is a bit hacky.
The big consequence is that you can't print literal characters anymore
because of our rules about how we pick which variant to statically
dispatch to. You have to save to a character variable first.
Maybe I can add an annotation to literals..
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Not entirely happy with this. Maybe we'll find a better name. But at
least it's an improvement.
One part I *am* happy with is renaming string-replace to replace,
string-append to append, etc. Overdue, now that we have static dispatch.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Still very incomplete:
a) we perform the check at runtime
b) tests for edit and sandbox apps no longer work; we can't fix them
until we get type parameters in both containers and recipes (because
list and list operations need to become generic).
|
|
|
|
| |
Now we can collect all traces, just modulating the depth.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Finally terminate the experiment of keeping debug prints around. I'm
also going to give up on maintaining counts.
What we really need is two kinds of tracing:
a) For tests, just the domain-specific facts, organized by labels.
b) For debugging, just transient dumps to stdout.
b) only works if stdout is clean by default.
Hmm, I think this means 'stash' should be the transient kind of trace.
|
|
|
|
|
| |
Forgot to fix chessboard tests during commit 2022: running sandboxes in
separate routines.
|
| |
|
| |
|
|
|
|
| |
Should be a little bit more mnemonic.
|
|
|
|
| |
First step to reducing typing burden. Next step: inferring types.
|
|
|
|
|
|
|
| |
The recent session makes me weary of deleting comment counts from inside
strings, and the newlines everywhere take up vertical space. Considered
println like pascal/ruby, but I'd like something I can add/remove at the
end of existing prints. So this hack for $print.
|
|
|
|
|
|
| |
But still no difference in either memory footprint or in running time.
This will teach me -- for the umpteenth time -- to optimize before
measuring.
|
|
|
|
|
| |
Turns out to not affect memory utilization or run-time. At all.
But still looks nicer and requires less fudging on our part.
|
|
|
|
|
|
|
|
| |
chessboard finally passing all its tests. What made this hard was that
for some reason one of the background routines in the main chessboard
test wasn't terminating like it used to. And so it was polluting *later*
tests. Just clean up that source of contamination for now. Later we'll
think about routine termination.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
I still have no idea how it will hook up to the rest. Parsing traces
will be slow. I can't test it like this. Writing the large trace data
structure to mu memory will be slow. But let's at least see the new
algorithm in action. (Not in this commit; so far we just render the
first n lines from the chessboard trace, and wait for a 'q' or 'Q' to
quit.)
|