Commit Graph

243 Commits

Author SHA1 Message Date
Kartik K. Agaram 687dd3f5da 2442
Fix the drawback in the previous commit: if an ingredient is just a
literal 0 we'll skip its type-checking and hope to map type ingredients
elsewhere.
2015-11-15 01:02:53 -08:00
Kartik K. Agaram ef96f57ce2 2441 - never miss any specializations
I was failing to specialize calls containing literals. And then I had to
deal with whether literals should map to numbers or characters. (Answer:
both.)

One of the issues that still remains: shape-shifting recipes can't be
called with literals for addresses, even if it's 0.
2015-11-15 00:37:29 -08:00
Kartik K. Agaram be422222cd 2428 - sandbox/ working again 2015-11-12 22:31:49 -08:00
Kartik K. Agaram 080e9cb73f 2422 - a bugfix from the last lesson
Thanks Caleb Couch. This one's been on my list for 2 weeks.
2015-11-10 20:47:09 -08:00
Kartik K. Agaram c1585c88fa 2417 - support mutable ingredients in headers
If a name repeats between ingredients, we raise an error.
If a name repeats across ingredients and products, every call should
share the same name across the corresponding ingredients and products.
2015-11-10 19:19:53 -08:00
Kartik K. Agaram b766f5f874 2404 - ah, finally a useful assertion
And it caught a bug: I mean to always update type names and types in
sync.

The last month or so I've been getting reluctantly but inexorably
converted to the need and value of a type system. First I thought I just
need a minimal but rigorous type system to avoid memory corruption and
security issues. Now I think I also want it to be expressive enough to
be able to express what data different phases in a compiler read and
write, and to be able to designate specific fields as 'fully computed'
so that we can statically check that phases wait until their data is
available.

The phase-ordering problem in a compiler is perhaps the canary in the
coal-mine for a more general problem: even small changes can
dramatically explode the state space if they violate assumptions
previously held about the domain. My understanding of when type pointers
are null and not null is immeasurably more nuanced today than it was a
week ago, but I didn't need the nuance until I introduced generic
functions. That initial draft of a hundred lines bumped me up to a much
larger state space. How to make it more obvious when something happens
that is akin to discovering a new continent, or finding oneself
teleported to Jupiter?

Assumptions can be implicit or explicit. Perhaps a delete of an
assertion should be estimated at 1000 LoC of complexity?
2015-11-08 21:29:56 -08:00
Kartik K. Agaram ebdf923d2d 2397
Fix that stray issue with a better phase ordering.
Another thing I'm not testing.
2015-11-08 14:04:46 -08:00
Kartik K. Agaram d71d3b4aaa 2388 - final layer of edit/ loaded successfully 2015-11-07 13:33:26 -08:00
Kartik K. Agaram 90e9eb3d4f 2376 2015-11-05 14:37:37 -08:00
Kartik K. Agaram 350ca0c64e 2375 - layer 9 done 2015-11-05 14:22:39 -08:00
Kartik K. Agaram b0403c1888 2374 - now edit works until layer 8 2015-11-05 14:17:31 -08:00
Kartik K. Agaram 3895c4e9fc 2371 - layer 5 of edit 2015-11-05 10:08:35 -08:00
Kartik K. Agaram f7e7582507 2370 - layers 1-4 of edit are back
One nice consequence of all my deduction of reply ingredients is that I
can insert the same fragment into recipes with different headers, and
everything works as long as reply instructions are implicitly deduced.

One thing I had to fix to make this work was to move reply-deduction out
of rewrite rules and turn it into a first-class transform, so that it
happens after tangling.

I'm glad to see the back of that hack inside <scroll-down>.
2015-11-05 09:18:09 -08:00
Kartik K. Agaram 805a476150 2369 - layer 1 of edit is back 2015-11-05 00:57:23 -08:00
Kartik K. Agaram e01277f73d 2368 - start getting edit working again
Still seeing repeated null refinements. Maybe my approach to fixing
those errors is fundamentally broken.
2015-11-05 00:36:02 -08:00
Kartik K. Agaram e330f85455 2309 2015-10-28 18:35:39 -07:00
Kartik K. Agaram 5f52da4aee 2267
Introducing a new 'newlayer' tag like 'todo', to record places where a
nascent new layer might be starting to bud off.
2015-10-09 16:49:09 -07:00
Kartik K. Agaram e00d485428 2260 - start tracing by depth rather than label
Now we can collect all traces, just modulating the depth.
2015-10-06 23:38:28 -07:00
Kartik K. Agaram d135851ef9 2247 - type-check products of non-primitive recipes
We still can't check ingredient types, and even this is still a run-time
check. We'll need to start tracking recipe signatures at some point.

I've had to introduce a hack called /skiptypecheck. Time to get generics
working.
2015-10-05 18:40:51 -07:00
Kartik K. Agaram af7a5722df 2234 - check type of get's product
Already I'm finding type errors in the programming environment.
2015-10-02 00:28:08 -07:00
Kartik K. Agaram 900e6a0efe 2227 - offset-checking for containers 2015-10-01 13:43:32 -07:00
Kartik K. Agaram 4814bf94e7 2226 - standardize warning format
Always show recipe name where error occurred. But don't show internal
'interactive' name for sandboxes, that's just confusing.

What started out as warnings are now ossifying into errors that halt all
execution. Is this how things went with C and Unix as well?
2015-10-01 13:13:10 -07:00
Kartik K. Agaram a0fc38c9e1 2218 - check types in instructions much earlier
Front-loads it a bit more than I'd like, but the payoff is that other
recipes will now be able to describe the type checks right next to their
operation.

I'm also introducing a new use of /raw with literals to indicate unsafe
typecasts.
2015-09-30 01:01:34 -07:00
Kartik K. Agaram 124dc19908 2216 2015-09-29 21:55:23 -07:00
Kartik K. Agaram de75312f69 2206 - fix missing ingredients
How the heck was this working until now?
There must be redundant moves. And was I clobbering test data?
2015-09-26 10:32:17 -07:00
Kartik K. Agaram fa94f4d923 2183 - environment + external editor using tmux
Thanks Jack and Caleb Couch for the idea.
2015-09-12 13:51:25 -07:00
Kartik K. Agaram 7169c63627 2182 2015-09-12 11:51:37 -07:00
Kartik K. Agaram 8beff53e5a 2180 - render the trace even if there's warnings 2015-09-10 19:22:27 -07:00
Kartik K. Agaram 42b3a2f820 2179 - undo bugfix 2015-09-10 13:25:48 -07:00
Kartik K. Agaram f5465e1220 2177 2015-09-07 10:37:27 -07:00
Kartik K. Agaram 5ccf2653fb 2176 2015-09-06 16:52:48 -07:00
Kartik K. Agaram b14ac6dc48 2173 - 'main' for 'mu edit' running layers 1 and 2
Layer 2 provides an almost fully functioning interactive editor:

  $ ./mu edit/00[12]* -- abcdef
2015-09-06 16:15:38 -07:00
Kartik K. Agaram e8b0d7ab56 2172 - 'main' for 'mu edit' running just layer 1
Takes the text to render inside the editor on the commandline:

  $ ./mu edit/001-editor.mu -- abcdef

Layer 1 has no interactivity. Just shows the text you pass in on the
commandline, wrapping as you would expect. Press any key to exit.
2015-09-06 12:31:56 -07:00
Kartik K. Agaram b4bccf49db 2167 2015-09-05 15:31:55 -07:00
Kartik K. Agaram 23ea84415c 2166 2015-09-05 15:24:11 -07:00
Kartik K. Agaram 2636b3633a 2164 2015-09-05 14:35:45 -07:00
Kartik K. Agaram bbc28b803c 2163
`render-string` (and `render-code-string`; ugh) should start a new line
after, not before, like everybody else.

I've been meaning to fix this for a long time, but now I have to, to
move the warnings fields out of early layers.
2015-09-05 14:13:28 -07:00
Kartik K. Agaram fd469c02dc 2162 2015-09-05 13:29:32 -07:00
Kartik K. Agaram bdcfcc2e8e 2161
Starting on making the basic programming environment oblivious to
warnings. That should come later.
2015-09-05 12:53:12 -07:00
Kartik K. Agaram 5f0da59d32 2160 2015-09-05 12:43:25 -07:00
Kartik K. Agaram 4a027415c2 2159 2015-09-05 12:40:38 -07:00
Kartik K. Agaram ae244ebddc 2157 - edit/ now contains real layers
To run just until say layer 6, say this:

  $ ./mu test edit/00[0-6]*

The layers are not perfect yet; there might be a few things (like the
warning fields) that need to move to a later layer.
2015-09-05 12:17:27 -07:00
Kartik K. Agaram a90faae990 2156 - split edit.mu into multiple files
Now you can bring up the programming environment by saying:

  $ mu edit

The files under edit aren't yet *layers*, though, they have a few
dependencies that we need to clean up.
2015-09-05 11:51:10 -07:00