about summary refs log tree commit diff stats
path: root/010vm.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2694Kartik K. Agaram2016-02-231-1/+1
|
* 2692 - all memory leaks fixedKartik K. Agaram2016-02-231-1/+3
| | | | | | | | | | To find this I spent some time trying to diagnose when it happened but there was no seeming pattern. I'd ended up with a small single-file .cc and single-file .mu that reproduced one memory leak. Eventually I tried deleting all type_tree and string_tree from it, and lo the leaks vanished. I retried on all of edit (just loading), and the leaks remained gone. At that point I switched tack and started looking at all the core methods of these classes.
* 2688Kartik K. Agaram2016-02-221-4/+0
|
* 2687Kartik K. Agaram2016-02-221-1/+1
|
* 2681 - drop reagent types from reagent propertiesKartik K. Agaram2016-02-211-43/+81
| | | | | | | | | | | | | | | | | 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.
* 2679Kartik K. Agaram2016-02-201-22/+0
|
* 2678Kartik K. Agaram2016-02-201-1/+2
| | | | | | | Start using type names from the type tree rather than the property tree in most places. Hopefully the only occurrences of 'properties.at(0).second' left are ones where we're managing it. Next we can stop writing to it.
* 2677Kartik K. Agaram2016-02-201-5/+7
| | | | Include type names in the type tree. Though we aren't using them yet.
* 2676 - start coalescing type and type-name treesKartik K. Agaram2016-02-201-4/+4
|
* 2675 - undo 2674Kartik K. Agaram2016-02-201-21/+19
|
* 2674 - tried to follow s-exps more closelyKartik K. Agaram2016-02-201-19/+21
| | | | | | | But I realize that this won't actually streamline replace_type_ingredients(), which needs that 'if (curr->left) curr = curr->left' dance for an unrelated reason. So there's no justification for entering into this big refactoring.
* 2673Kartik K. Agaram2016-02-191-1/+2
|
* 2672Kartik K. Agaram2016-02-191-4/+4
|
* 2671 - never use debug_string() in tracesKartik K. Agaram2016-02-191-2/+2
| | | | It's only for transient debugging.
* 2670 - better names for string conversionsKartik K. Agaram2016-02-191-9/+11
| | | | | | to_string(): relatively stable fields only; for trace() debug_string(): all fields; for debugging inspect(): for a form that can be parsed back later
* 2689 - consistently use s-exp syntax in tracesKartik K. Agaram2016-02-191-13/+15
|
* 2688Kartik K. Agaram2016-02-191-11/+11
|
* 2687Kartik K. Agaram2016-02-191-111/+116
| | | | | | Move code around to put all string-conversion functions in a single section with a reasonable order, from recipe to instruction to reagent to reagent members.
* 2686Kartik K. Agaram2016-02-191-2/+2
|
* 2685Kartik K. Agaram2016-02-191-24/+20
| | | | | | | | | | | | | | | | 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.
* 2667 - redo container data structureKartik K. Agaram2016-02-171-7/+3
| | | | I've been gradually Greenspunning reagents. Just go all the way.
* 2637 - save type names for container elementsKartik K. Agaram2016-02-071-1/+3
|
* 2635Kartik K. Agaram2016-02-061-0/+1
|
* 2617 - better error messagesKartik K. Agaram2016-01-301-1/+2
| | | | | | | | | | | | | | | | | | 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
* 2569Kartik K. Agaram2016-01-181-1/+1
|
* 2567Kartik K. Agaram2016-01-181-2/+7
|
* 2562Kartik K. Agaram2016-01-171-2/+2
| | | | | | | | | | | | 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.
* 2614 - still fixing bugs with missing '['Kartik K. Agaram2015-12-021-4/+11
| | | | | | When skipping past some text (usually whitespace, but also commas and comments) I need to always be aware of whether it's ok to switch to the next line or not.
* 2491Kartik K. Agaram2015-11-281-2/+12
|
* 2487Kartik K. Agaram2015-11-271-28/+0
| | | | | | | | | | | | | | | 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-2/+5
| | | | | 'append' also implicitly calls 'to-text' unless there's a better variant.
* 2454Kartik K. Agaram2015-11-171-3/+3
| | | | | | Another gotcha uncovered in the process of sorting out the previous commit: I keep using eof() but forgetting that there are two other states an istream can get into. Just never use eof().
* 2445 - dispatch between shape-shifting variantsKartik K. Agaram2015-11-151-2/+2
| | | | | Starting to leave debug prints around once again, just in case one of them is worth promoting to the trace..
* 2444Kartik K. Agaram2015-11-151-2/+9
| | | | Yet another bugfix as I trace through the last session with Caleb.
* 2441 - never miss any specializationsKartik K. Agaram2015-11-151-0/+10
| | | | | | | | | 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.
* 2413 - another backfilled test for 2391Kartik K. Agaram2015-11-091-0/+1
| | | | This time for the support for 'new' that was added in 2393.
* 2406Kartik K. Agaram2015-11-081-18/+7
| | | | | One new issue: the traces for all tests are perturbed by the .mu files we choose to load.
* 2405Kartik K. Agaram2015-11-081-0/+24
|
* 2399 - consistent debug_string vocabularyKartik K. Agaram2015-11-081-44/+47
|
* 2397Kartik K. Agaram2015-11-081-0/+17
| | | | | Fix that stray issue with a better phase ordering. Another thing I'm not testing.
* 2396 - edit working again!!Kartik K. Agaram2015-11-081-0/+8
| | | | | | | | | | | 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.
* 2394 - clean up outputKartik K. Agaram2015-11-071-3/+1
|
* 2393 - redo 2391Kartik K. Agaram2015-11-071-1/+3
| | | | | | | | | | | 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-3/+1
| | | | Yup, type ingredients were taking size 1 by default.
* 2391Kartik K. Agaram2015-11-071-1/+3
| | | | | | | | | | | | | 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.
* 2382Kartik K. Agaram2015-11-061-1/+4
| | | | Starting to leave commented out prints again out of desperation.
* 2381Kartik K. Agaram2015-11-061-0/+2
|
* 2380 - done loading mu codeKartik K. Agaram2015-11-061-8/+4
| | | | | | | | 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
* 2378Kartik K. Agaram2015-11-061-5/+5
| | | | | | 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.