about summary refs log tree commit diff stats
path: root/041jump_target.cc
Commit message (Collapse)AuthorAgeFilesLines
* 5001 - drop the :(scenario) DSLKartik Agaram2019-03-121-87/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've been saying for a while[1][2][3] that adding extra abstractions makes things harder for newcomers, and adding new notations doubly so. And then I notice this DSL in my own backyard. Makes me feel like a hypocrite. [1] https://news.ycombinator.com/item?id=13565743#13570092 [2] https://lobste.rs/s/to8wpr/configuration_files_are_canary_warning [3] https://lobste.rs/s/mdmcdi/little_languages_by_jon_bentley_1986#c_3miuf2 The implementation of the DSL was also highly hacky: a) It was happening in the tangle/ tool, but was utterly unrelated to tangling layers. b) There were several persnickety constraints on the different kinds of lines and the specific order they were expected in. I kept finding bugs where the translator would silently do the wrong thing. Or the error messages sucked, and readers may be stuck looking at the generated code to figure out what happened. Fixing error messages would require a lot more code, which is one of my arguments against DSLs in the first place: they may be easy to implement, but they're hard to design to go with the grain of the underlying platform. They require lots of iteration. Is that effort worth prioritizing in this project? On the other hand, the DSL did make at least some readers' life easier, the ones who weren't immediately put off by having to learn a strange syntax. There were fewer quotes to parse, fewer backslash escapes. Anyway, since there are also people who dislike having to put up with strange syntaxes, we'll call that consideration a wash and tear this DSL out. --- This commit was sheer drudgery. Hopefully it won't need to be redone with a new DSL because I grow sick of backslashes.
* 4261 - start using literals for 'true' and 'false'Kartik Agaram2018-06-171-2/+2
| | | | | | | | | They uncovered one bug: in edit/003-shortcuts.mu <scroll-down> was returning 0 for an address in one place where I thought it was returning 0 for a boolean. Now we've eliminated this bad interaction between tangling and punning literals.
* 3877Kartik K. Agaram2017-05-261-2/+2
|
* 3810Kartik K. Agaram2017-04-041-4/+4
| | | | | | | Stop naming 'jump' instructions in their errors since they're so often rewritten from 'break' or 'loop' instructions. Thanks Lakshman Swaminathan for running into this issue.
* 3549Kartik K. Agaram2016-10-221-13/+16
| | | | | | | | | | | | | | | | | | More consistent definitions for jump targets and waypoints. 1. A label is a word starting with something other than a letter or digit or '$'. 2. A waypoint is a label that starts with '<' and ends with '>'. It has no restrictions. A recipe can define any number of waypoints, and recipes can have duplicate waypoints. 3. The special labels '{' and '}' can also be duplicated any number of times in a recipe. The only constraint on them is that they have to balance in any recipe. Every '{' must be followed by a matching '}'. 4. All other labels are 'jump targets'. You can't have duplicate jump targets in a recipe; that would make jumps ambiguous.
* 3522Kartik K. Agaram2016-10-191-2/+2
|
* 3380Kartik K. Agaram2016-09-171-16/+16
| | | | | One more place we were missing expanding type abbreviations: inside container definitions.
* 3327Kartik K. Agaram2016-09-111-2/+2
|
* 2990Kartik K. Agaram2016-05-201-4/+4
| | | | | | | | | | Standardize quotes around reagents in error messages. I'm still sure there's issues. For example, the messages when type-checking 'copy'. I'm not putting quotes around them because in layer 60 I end up creating dilated reagents, and then it's a bit much to have quotes and (two kinds of) brackets. But I'm sure I'm doing that somewhere..
* 2773 - switch to 'int'Kartik K. Agaram2016-03-131-4/+4
| | | | This should eradicate the issue of 2771.
* 2735 - define recipes using 'def'Kartik K. Agaram2016-03-081-9/+9
| | | | | | | | | | | | I'm dropping all mention of 'recipe' terminology from the Readme. That way I hope to avoid further bike-shedding discussions while I very slowly decide on the right terminology with my students. I could be smarter in my error messages and use 'recipe' when code uses it and 'function' otherwise. But what about other words like ingredient? It would all add complexity that I'm not yet sure is worthwhile. But I do want separate experiences for veteran programmers reading about Mu on github and for people learning programming using Mu.
* 2722 - fix a crash; thanks Ella Couch!Kartik K. Agaram2016-02-281-2/+24
|
* 2712Kartik K. Agaram2016-02-261-4/+4
|
* 2680Kartik K. Agaram2016-02-201-3/+3
| | | | Delete all the [] that has crept in since 2377 in November.
* 2494Kartik K. Agaram2015-11-281-1/+1
| | | | | Some more structure to transforms, and flattening of dependencies between them.
* 2493 - eliminate a couple of dependenciesKartik K. Agaram2015-11-281-1/+1
| | | | | | | In general you only want to specify one transform in terms of (before/after) another if the other direction wouldn't work. Otherwise try to make it work by just pushing transforms at the start/end of the list.
* 2441 - never miss any specializationsKartik K. Agaram2015-11-151-1/+1
| | | | | | | | | 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.
* 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.
* 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
* 2377 - stop using operator[] in mapKartik K. Agaram2015-11-061-9/+9
| | | | | | | | | | | | | | | | 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.
* 2360Kartik K. Agaram2015-11-041-1/+1
| | | | | | | | | 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.
* 2358 - starting to tackle the phase ordering problemKartik K. Agaram2015-11-041-2/+2
| | | | | | | 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.
* 2321 - more preparations for static dispatchKartik K. Agaram2015-10-291-5/+5
| | | | | Deduce operation id from name during transform rather than load, so that earlier transforms have a chance to modify the name.
* 2258 - separate warnings from errorsKartik K. Agaram2015-10-061-9/+9
| | | | | | | At the lowest level I'm reluctantly starting to see the need for errors that stop the program in its tracks. Only way to avoid memory corruption and security issues. But beyond that core I still want to be as lenient as possible at higher levels of abstraction.
* 2226 - standardize warning formatKartik K. Agaram2015-10-011-4/+4
| | | | | | | | 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?
* 2138 - warn on jump to an ambiguous labelKartik K. Agaram2015-09-041-0/+158
This seemingly simple goal uncovered a little nest of bugs: it turns out I've been awash in ambiguous labels until now. My baseline recipes in edit.mu were clean, but they introduced duplicate <waypoints> -- and *those* waypoints contained +jump-targets. Result: duplicate jump targets, so that I wasn't jumping where I thought I was jumping. Somehow I happened to be picking one of the alternatives that magically kept these issues quiescent. My first plan to fix this was to mangle names of all labels inside before/after fragments, keep the jump targets private to their fragment. But the labels also include more waypoints! Mangle those, and I can't tangle to them anymore. Solution: harden the convention that jump targets begin with '+' and waypoints are surrounded by '<>'. Mangle jump targets occurring inside before/after fragments to keep them private to their lexical fragment, but *don't* mangle waypoints, which must remain globally accessible.