about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* 2407 - bugfix: parsing recipe headersKartik K. Agaram2015-11-092-3/+29
|
* 2406Kartik K. Agaram2015-11-088-80/+49
| | | | | One new issue: the traces for all tests are perturbed by the .mu files we choose to load.
* 2405Kartik K. Agaram2015-11-082-23/+25
|
* 2404 - ah, finally a useful assertionKartik K. Agaram2015-11-083-10/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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?
* 2403 - experiment: documenting non-assertionsKartik K. Agaram2015-11-082-2/+2
| | | | | | | Is that like a Maybe type in a type system? No it's more, it captures the wistful longing of several hours spent trying to make an assertion true. Not even by moving my phases relating to the types around could I make this assertion true.
* 2402Kartik K. Agaram2015-11-081-2/+2
|
* 2401Kartik K. Agaram2015-11-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I tried to not populate the type at an early stage, and to pull out the type computations for all reagents into a separate transform grouped with but before the other type deduction transforms. But it seemed less readable to not mention types at all in layer 10. So we'll stick with our current approach, but try to be disciplined about grouping all the type transforms together, so that we can reason about whether a pass belongs before or after type deduction. (Doesn't seem rigorous enough for the name 'type inference'.) In particular, static dispatch and specialization of generics (resolve_ambiguous_calls) needs to happen after all type inference has completed, so that the only missing types are the generic type ingredients. In general I've been living in constant fear of the phase-ordering problem. No matter how many tests I write, I can't be sure that there isn't some corner case where my phases will be proven to be in a sub-optimal ordering. When I build the mu compiler in mu I'll want to also use the ability to perform static analyses in mu programs using mu userland capabilities. That would allow me to be sure that no phase writes to some field of reagent after some other purely checking phase reads it. Then all you have to do is be disciplined about not doing checking in mutating phases (which we currently aren't; hello check_or_set_invalid_types). Hmm, but I think this line of thought gives me some confidence now that I'm ok so far. The only field of reagents being modified after parsing/initialization is the type. So all I care about is whether each transform happens before or after all types are available. If I later start writing other fields or properties then I'll need to perform similar analysis for them, and it might get complicated enough to need a state diagram where partially filled out properties inhabit separate states from completely inferred properties.
* 2400 - eliminate last few warningsKartik K. Agaram2015-11-084-14/+21
|
* 2399 - consistent debug_string vocabularyKartik K. Agaram2015-11-0810-87/+83
|
* 2398Kartik K. Agaram2015-11-081-2/+2
|
* 2397Kartik K. Agaram2015-11-085-3/+25
| | | | | Fix that stray issue with a better phase ordering. Another thing I'm not testing.
* 2396 - edit working again!!Kartik K. Agaram2015-11-084-27/+55
| | | | | | | | | | | Still some spurious warnings. This was an insane experience building out generics. Time to reflect. Where did I go wrong? How did I end up writing no tests? Let's take some time and go over the last 50 commits with a fine-tooth comb. Generics seems to be the feature that has moved mu from a VM project to a compiler project.
* 2395 - type ingredients can map to trees of typesKartik K. Agaram2015-11-071-1/+3
|
* 2394 - clean up outputKartik K. Agaram2015-11-074-22/+1
|
* 2393 - redo 2391Kartik K. Agaram2015-11-079-61/+166
| | | | | | | | | | | Got that idea to work with a special-case for 'new'. Requires parsing new's first ingredient, performing the replacement, and then turning it back into a string. I didn't want to replace NEW with ALLOCATE right here, because then it messes with my invariant that transform should never see a naked ALLOCATE. Layer 11 still not working, but everything else is. Let's clean up before we diagnose the new breakage.
* 2392 - undo 2391Kartik K. Agaram2015-11-079-133/+61
| | | | Yup, type ingredients were taking size 1 by default.
* 2391Kartik K. Agaram2015-11-079-59/+133
| | | | | | | | | | | | | No, my idea was abortive. My new plan was to run no transforms for generic recipes, and instead only run them on concrete specializations as they're created. The trouble with this approach is that new contains a type specification in its ingredient which apparently needed to be transformed into an allocate before specialization. But no, how was that working? How was new computing size based on type ingredients? It might have been wrong all along.
* 2390 - undo 2389Kartik K. Agaram2015-11-073-9/+3
| | | | Ooh, I think I see a solution.
* 2389Kartik K. Agaram2015-11-073-3/+9
| | | | | | | | Now we're back to trying to rerunning idempotent transforms on specialized recipes. Still doesn't work, but at least we don't see different results depending on whether the trace is enabled inside the test or right at the start. That got fixed by the more disciplined insertion into maps, looks like.
* 2388 - final layer of edit/ loaded successfullyKartik K. Agaram2015-11-074-41/+62
|
* 2387 - edit/ passing except that final undo layerKartik K. Agaram2015-11-071-0/+2
|
* 2386 - core tests passing againKartik K. Agaram2015-11-072-2/+3
| | | | Layer 1 of edit/ is introducing spurious types, though.
* 2385 - tests passing until layer 58Kartik K. Agaram2015-11-071-2/+7
|
* 2384 - tests pass until layer 54Kartik K. Agaram2015-11-072-1/+4
|
* 2383 - new concern: idempotence of transformsKartik K. Agaram2015-11-0612-14/+14
| | | | | I'd not paid any attention to it so far, but I need to do so from now on.
* 2382Kartik K. Agaram2015-11-0613-13/+68
| | | | Starting to leave commented out prints again out of desperation.
* 2381Kartik K. Agaram2015-11-062-4/+14
|
* 2380 - done loading mu codeKartik K. Agaram2015-11-066-23/+27
| | | | | | | | New assertions still failing during tests. This whole implementation of generic recipes is like an extended spike. I don't have nearly enough tests. Ideally I'd have confidence in generics once layer 59 passed its tests.
* 2379 - further improvements to map operationsKartik K. Agaram2015-11-0619-51/+56
| | | | | | | Commands run: $ sed -i 's/\([^. (]*\)\.find(\([^)]*\)) != [^.]*\.end()/contains_key(\1, \2)/g' 0[^0]*cc $ sed -i 's/\([^. (]*\)\.find(\([^)]*\)) == [^.]*\.end()/!contains_key(\1, \2)/g' 0[^0]*cc
* 2378Kartik K. Agaram2015-11-066-12/+12
| | | | | | Now we're starting to run up against the misbehavior introduced by generics: Type tries to insert rows for type ingredients. That is a no-no.
* 2377 - stop using operator[] in mapKartik K. Agaram2015-11-0645-575/+593
| | | | | | | | | | | | | | | | I'm still seeing all sorts of failures in turning on layer 11 of edit/, so I'm backing away and nailing down every culprit I run into. First up: stop accidentally inserting empty objects into maps during lookups. Commands run: $ sed -i 's/\(Recipe_ordinal\|Recipe\|Type_ordinal\|Type\|Memory\)\[\([^]]*\)\] = \(.*\);/put(\1, \2, \3);/' 0[1-9]* $ vi 075scenario_console.cc # manually fix up Memory[Memory[CONSOLE]] $ sed -i 's/\(Memory\)\[\([^]]*\)\]/get_or_insert(\1, \2)/' 0[1-9]* $ sed -i 's/\(Recipe_ordinal\|Type_ordinal\)\[\([^]]*\)\]/get(\1, \2)/' 0[1-9]* $ sed -i 's/\(Recipe\|Type\)\[\([^]]*\)\]/get(\1, \2)/' 0[1-9]* Now mu dies pretty quickly because of all the places I try to lookup a missing value.
* 2376Kartik K. Agaram2015-11-051-7/+7
|
* 2375 - layer 9 doneKartik K. Agaram2015-11-051-6/+5
|
* 2374 - now edit works until layer 8Kartik K. Agaram2015-11-055-83/+73
|
* 2373 - bad bug: instruction was losing /lookupKartik K. Agaram2015-11-053-2/+18
|
* 2372Kartik K. Agaram2015-11-051-0/+4
|
* 2371 - layer 5 of editKartik K. Agaram2015-11-054-68/+45
|
* 2370 - layers 1-4 of edit are backKartik K. Agaram2015-11-055-357/+325
| | | | | | | | | | | | 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>.
* 2369 - layer 1 of edit is backKartik K. Agaram2015-11-052-34/+18
|
* 2368 - start getting edit working againKartik K. Agaram2015-11-052-23/+31
| | | | | Still seeing repeated null refinements. Maybe my approach to fixing those errors is fundamentally broken.
* 2367Kartik K. Agaram2015-11-051-1/+1
|
* 2366 - disallow static dispatch inside header-less recipesKartik K. Agaram2015-11-051-0/+1
| | | | | Not only can such recipes not have variants, their bodies too will be oblivious to multiple variants or generics.
* 2365Kartik K. Agaram2015-11-051-10/+10
|
* 2364Kartik K. Agaram2015-11-051-0/+10
|
* 2363 - duplex-list is now generic.Kartik K. Agaram2015-11-052-252/+252
| | | | It wasn't a phase-ordering issue after all..
* 2362Kartik K. Agaram2015-11-042-1/+2
| | | | | | Now we try to be smarter about checking for presence in the Type array. Still can't get generic duplex-list to work.
* 2361Kartik K. Agaram2015-11-041-1/+2
|
* 2360Kartik K. Agaram2015-11-0411-15/+60
| | | | | | | | | More flailing around trying to come up with the right phase ordering. I've tried to narrow down each transform's constraints wrt transforms in previous layers. One issue that keeps biting me is the Type map containing empty records because of stray [] operations. That's gotta be important.
* 2359Kartik K. Agaram2015-11-041-1/+1
|
* 2358 - starting to tackle the phase ordering problemKartik K. Agaram2015-11-0413-30/+32
| | | | | | | A new externality is starting to make its presence felt. Until I sort this out it's going to be hard to finish making duplex-list generic.