| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trying to find examples where a layer includes complexity just so later
layers can hook into it. Resolve_stack is the one big one I've found
that isn't just a simple function-call indirection that may later get
more complex.
Conclusion of a conversation with Stephen Malina: Such examples should
make one very nervous, because this sort of creep is how we end up with
over-engineered abstractions (http://www.joelonsoftware.com/articles/fog0000000018.html).
We need to step very carefully anytime we make the outsider reader's
comprehension task harder..
|
| |
|
|
|
|
|
| |
Clean up the flow of "mu --trace" followed by "mu browse-trace
interactive".
|
|
|
|
| |
Couple of fixes to example programs.
|
|
|
|
|
| |
Was there some reason I used a subshell?
No reason recorded at bottom.
|
| |
|
|
|
|
| |
Thanks Jack Couch for running into this.
|
|
|
|
| |
Thanks Jack Couch for running into this.
|
|
|
|
| |
Thanks Jack Couch for running into this.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Thanks Ella Couch for contributing this function.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Useful for programming contests like https://halite.io
Doesn't suffer from C++'s usual buffered gotchas: it'll skip leading
whitespace. Slow, though. Can be speeded up, though.
- 20 minutes later
But what's the point? Typewriter mode is actually harder to test than
'raw' console mode. Writing Mu programs in typewriter mode is just going
to encourage us all to slack off on writing tests.
|
| |
|
|
|
|
| |
Fix a memory leak.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was a large commit, and most of it is a follow-up to commit 3309,
undoing what is probably the final ill-considered optimization I added
to s-expressions in Mu: I was always representing (a b c) as (a b . c),
etc. That is now gone.
Why did I need to take it out? The key problem was the error silently
ignored in layer 30. That was causing size_of("(type)") to silently
return garbage rather than loudly complain (assuming 'type' was a simple
type).
But to take it out I had to modify types_strictly_match (layer 21) to
actually strictly match and not just do a prefix match.
In the process of removing the prefix match, I had to make extracting
recipe types from recipe headers more robust. So far it only matched the
first element of each ingredient's type; these matched:
(recipe address:number -> address:number)
(recipe address -> address)
I didn't notice because the dotted notation optimization was actually
representing this as:
(recipe address:number -> address number)
---
One final little thing in this commit: I added an alias for 'assert'
called 'assert_for_now', to indicate that I'm not sure something's
really an invariant, that it might be triggered by (invalid) user
programs, and so require more thought on error handling down the road.
But this may well be an ill-posed distinction. It may be overwhelmingly
uneconomic to continually distinguish between model invariants and error
states for input. I'm starting to grow sympathetic to Google Analytics's
recent approach of just banning assertions altogether. We'll see..
|
| |
|
|
|
|
| |
Another place I missed in commit 3309.
|
|
|
|
|
| |
Fix a place I forgot to update in commit 3309, moving to the new
type_tree representation.
|
| |
|
| |
|
|
|
|
| |
Thanks Ella Couch for reporting this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Periodic cleanup to replace 'reply' with 'return' everywhere in the
repo.
I use 'reply' for students to help reinforce the metaphor of function
calls as being like messages through a pipe. But that causes 'reply' to
get into my muscle memory when writing Mu code for myself, and I worry
that that makes Mu seem unnecessarily alien to anybody reading on
Github.
Perhaps I should just give it up? I'll try using 'return' with my next
student.
|
| |
|
|
|
|
|
|
|
|
| |
Follow-up to commit 3321: move get_base_type() more thoroughly to layer
55. The notion of a base_type doesn't really make sense before we
introduce type ingredients and shape-shifting containers, and it
simplifies early layers a *lot* even including the cost of that *ugly*
preamble in layer 55 to retrofit all the places.
|
|
|
|
|
|
|
|
|
| |
Don't crash on bad types.
I need to be more careful in distinguishing between the two causes of
constraint violations: bad input and internal bugs. Maybe I should
create a second assert() to indicate "this shouldn't really be an
assert, but I'm too lazy to think about it right now."
|
|
|
|
|
| |
size_of(type_tree*) is a mess; clean it up with an eye to the final
tangled version.
|
|
|
|
|
|
| |
I was under the impression that I only needed static array lengths for
container members, but these are *payload* types for allocations. So we
need to compute the size of a dynamic array.
|
|
|
|
| |
We weren't checking within (static) array elements for addresses.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Extract a helper to compute the element type of an array. As a side
effect, the hack for disambiguating array:address:number and
array:number:3 is now in just one place.
|
|
|
|
| |
Eject some array-related code out of the container layer.
|
|
|
|
|
| |
Standardize on calling literate waypoints "Special-cases" rather than
"Cases". Invariably there's a default path already present.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Following commit 3637, rename another auxiliary variable with our new
convention.
|
|
|
|
| |
Reorder a couple of nonsensically-placed fragments.
|