about summary refs log tree commit diff stats
path: root/057static_dispatch.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2703Kartik K. Agaram2016-02-251-1/+1
|
* 2702Kartik K. Agaram2016-02-251-5/+4
|
* 2681 - drop reagent types from reagent propertiesKartik K. Agaram2016-02-211-22/+17
| | | | | | | | | | | | | | | | | All my attempts at staging this change failed with this humongous commit that took all day and involved debugging three monstrous bugs. Two of the bugs had to do with forgetting to check the type name in the implementation of shape-shifting recipes. Bug #2 in particular would cause core tests in layer 59 to fail -- only when I loaded up edit/! It got me to just hack directly on mu.cc until I figured out the cause (snapshot saved in mu.cc.modified). The problem turned out to be that I accidentally saved a type ingredient in the Type table during specialization. Now I know that that can be very bad. I've checked the traces for any stray type numbers (rather than names). I also found what might be a bug from last November (labeled TODO), but we'll verify after this commit.
* 2685Kartik K. Agaram2016-02-191-5/+5
| | | | | | | | | | | | | | | | Stack of plans for cleaning up replace_type_ingredients() and a couple of other things, from main problem to subproblems: include type names in the type_tree rather than in the separate properties vector make type_tree and string_tree real cons cells, with separate leaf nodes redo the vocabulary for dumping various objects: do we really need to_string and debug_string? can we have a version with *all* information? can we have to_string not call debug_string? This commit nibbles at the edges of the final task, switching from member method syntax to global function like almost everything else. I'm mostly using methods just for STL in this project.
* 2646 - redo static dispatch algorithmKartik K. Agaram2016-02-111-79/+145
| | | | | | | | The old approach of ad hoc boosts and penalties based on various features was repeatedly running into exceptions and bugs. New organization: multiple tiered scores interleaved with tie-breaks. The moment one tier yields one or more candidates, we stop scanning further tiers. Just break ties and return.
* 2644Kartik K. Agaram2016-02-101-3/+6
| | | | More tweaking of traces as I debug recipe specialization.
* 2642Kartik K. Agaram2016-02-091-1/+1
|
* 2641Kartik K. Agaram2016-02-081-1/+1
| | | | | Turns out we don't need to threshold non-shape-shifting and shape-shifting variants at different levels to keep all tests passing.
* 2636Kartik K. Agaram2016-02-061-4/+5
|
* 2617 - better error messagesKartik K. Agaram2016-01-301-0/+45
| | | | | | | | | | | | | | | | | | When we stash a value, mu does several levels of work for us: a) First it inserts instructions above the stash to convert the value to text using to-text-line. b) to-text-line calls to-text. Both are shape-shifting, so multiple levels of specialization happen. To give a good error message, we track the 'stack' of current specializations at the time of the error, and also check if the offending instruction at the top-most level looks like it was inserted while rewriting stash instructions. Manual example (since booleans can't be stashed at the moment): x:boolean <- copy 1/true stash x
* 2616Kartik K. Agaram2016-01-301-0/+1
| | | | Drop yet another source of perturbance in traces.
* 2603 - bugfix: defining main with commandline argsKartik K. Agaram2016-01-251-1/+1
| | | | Pretty hacky fix: we simply suppress static dispatch for main.
* 2576 - distinguish allocated addresses from othersKartik K. Agaram2016-01-191-4/+4
| | | | | | | | | | | | | | | | 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.
* 2564Kartik K. Agaram2016-01-181-2/+0
|
* 2561Kartik K. Agaram2016-01-171-0/+5
| | | | | Reorganize layers in preparation for a better, more type-safe implementation of first-class and higher-order recipes.
* 2559 - stop using 'next-ingredient' explicitlyKartik K. Agaram2016-01-121-14/+4
| | | | | I still need it in some situations because I have no way to set a non-zero default for an optional ingredient. Open question..
* 2557 - type-check most ingredients ahead of timeKartik K. Agaram2016-01-121-38/+1
|
* 2553 - keep failed specializations from generating spurious errorsKartik K. Agaram2015-12-281-6/+0
| | | | Thanks Caleb Couch.
* 2546 - another phase-ordering constraintKartik K. Agaram2015-12-191-1/+19
| | | | Thanks Caleb Couch.
* three bugs fixedKartik K. Agaram2015-12-151-13/+48
| | | | | | | | | | | | | | | | | - notes bug in edit/ triggers in immutable but not master branch bug triggered by changes to layer 059: we're finding an unspecialized call to 'length' in 'append_6' hard to debug because trace isn't complete just bring out the big hammer: use a new log file length_2 from recipes.mu is not being deleted (bug #1) so reload doesn't switch length to length_2 when variant_already_exists (bug #2) so we end up saving in Recipe for a primitive ordinal so no valid specialization is found for 'length' (bug #3) why doesn't it trigger in a non-interactive scenario? argh, wasn't checking for an empty line at end. ok, confidence restored.
* bugfix: phase orderingKartik K. Agaram2015-12-151-0/+43
|
* layer 3 of edit/ now workingKartik K. Agaram2015-12-151-0/+21
| | | | | Now I complain before running if a call somewhere doesn't line up with its ingredients, or if no specialization can be made to match it.
* 2610Kartik K. Agaram2015-11-291-5/+5
|
* 2608 - improve errors when static dispatch failsKartik K. Agaram2015-11-291-0/+50
|
* 2607 - resolve some edge cases in static dispatchKartik K. Agaram2015-11-291-6/+70
|
* 2499 - done reorganizing transformsKartik K. Agaram2015-11-281-2/+1
|
* 2487Kartik K. Agaram2015-11-271-4/+17
| | | | | | | | | | | | | | | Ok, now I'm a little happier about our type checking. Type checking lies in three layers: layer 21: checking types, usually at run-time in the VM or just before layer 57: checking type names layer 59: checking type names It's taken me the process of writing this commit to convince myself that all three layers check mappings for literal values in a consistent manner. Layer 21 uses sizes, and layers 57/59 have whitelists, but either way the goal is that number != character != boolean unless mediated through a literal.
* 2483 - to-text can now handle listsKartik K. Agaram2015-11-271-5/+31
| | | | | 'append' also implicitly calls 'to-text' unless there's a better variant.
* 2482 - better choice between valid variantsKartik K. Agaram2015-11-271-2/+31
| | | | Literal '0' ingredients should map to numbers before addresses.
* 2481Kartik K. Agaram2015-11-271-2/+1
|
* 2472Kartik K. Agaram2015-11-221-2/+0
|
* 2470 - allow overloading primitive operationsKartik K. Agaram2015-11-221-3/+28
| | | | | | | | | This turned out to be surprisingly easy: rather than try to specify the types expected by each operation, just have primitive instructions go through any other variants and only remain unnamed if no variants pass. All I had to do was stop using contains_key() anywhere on Recipe_variants, so that I could use get_or_insert() rather than get().
* 2445 - dispatch between shape-shifting variantsKartik K. Agaram2015-11-151-2/+8
| | | | | Starting to leave debug prints around once again, just in case one of them is worth promoting to the trace..
* 2438 - specialize inside header-less recipesKartik K. Agaram2015-11-141-1/+0
| | | | | | | What was I thinking with 2366? Thanks Caleb Couch. It turned out we couldn't call shape-shifting recipes inside the edit/ or sandbox/ apps.
* 2436Kartik K. Agaram2015-11-141-2/+2
|
* 2435Kartik K. Agaram2015-11-131-2/+2
|
* 2421 - 'generic' => 'shape-shifting'Kartik K. Agaram2015-11-101-1/+1
| | | | More evocative, less jargony.
* 2418 - start raising errors on generic callsKartik K. Agaram2015-11-101-6/+7
|
* 2406Kartik K. Agaram2015-11-081-4/+2
| | | | | One new issue: the traces for all tests are perturbed by the .mu files we choose to load.
* 2397Kartik K. Agaram2015-11-081-1/+3
| | | | | Fix that stray issue with a better phase ordering. Another thing I'm not testing.
* 2394 - clean up outputKartik K. Agaram2015-11-071-1/+0
|
* 2393 - redo 2391Kartik K. Agaram2015-11-071-1/+1
| | | | | | | | | | | 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-071-1/+1
| | | | Yup, type ingredients were taking size 1 by default.
* 2391Kartik K. Agaram2015-11-071-1/+1
| | | | | | | | | | | | | 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.
* 2387 - edit/ passing except that final undo layerKartik K. Agaram2015-11-071-0/+2
|
* 2386 - core tests passing againKartik K. Agaram2015-11-071-2/+2
| | | | Layer 1 of edit/ is introducing spurious types, though.
* 2383 - new concern: idempotence of transformsKartik K. Agaram2015-11-061-1/+1
| | | | | I'd not paid any attention to it so far, but I need to do so from now on.
* 2382Kartik K. Agaram2015-11-061-0/+1
| | | | Starting to leave commented out prints again out of desperation.
* 2380 - done loading mu codeKartik K. Agaram2015-11-061-7/+7
| | | | | | | | 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-061-2/+2
| | | | | | | 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