about summary refs log tree commit diff stats
path: root/024jump.cc
Commit message (Collapse)AuthorAgeFilesLines
* 5001 - drop the :(scenario) DSLKartik Agaram2019-03-121-70/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 4987 - support `browse_trace` tool in SubXKartik Agaram2019-02-251-5/+5
| | | | | | | | | | | | | | | | | | I've extracted it into a separate binary, independent of my Mu prototype. I also cleaned up my tracing layer to be a little nicer. Major improvements: - Realized that incremental tracing really ought to be the default. And to minimize printing traces to screen. - Finally figured out how to combine layers and call stack frames in a single dimension of depth. The answer: optimize for the experience of `browse_trace`. Instructions occupy a range of depths based on their call stack frame, and minor details of an instruction lie one level deeper in each case. Other than that, I spent some time adjusting levels everywhere to make `browse_trace` useful.
* 4266 - space for alloc-id in heap allocationsKartik Agaram2018-06-241-5/+16
| | | | This has taken me almost 6 weeks :(
* 4264Kartik Agaram2018-06-171-0/+183
| | | | Undo the relayout of 4259.
* 4259Kartik Agaram2018-06-161-183/+0
|
* 4258 - undo 4257Kartik Agaram2018-06-151-16/+5
|
* 4257 - abortive attempt at safe fat pointersKartik Agaram2018-06-151-5/+16
| | | | | | | | | | | | | | | | I've been working on this slowly over several weeks, but it's too hard to support 0 as the null value for addresses. I constantly have to add exceptions for scalar value corresponding to an address type (now occupying 2 locations). The final straw is the test for 'reload': x:num <- reload text 'reload' returns an address. But there's no way to know that for arbitrary instructions. New plan: let's put this off for a bit and first create support for literals. Then use 'null' instead of '0' for addresses everywhere. Then it'll be easy to just change what 'null' means.
* 4247Kartik Agaram2018-05-251-0/+19
|
* 3887 - clean up early exits in interpreter loopKartik K. Agaram2017-05-281-3/+12
| | | | | | | | | | It's always confusing when `break` refers to a `switch` but `continue` refers to the loop around the `switch`. But we've done ugly things like this and `goto` for expedience. However, we're starting to run into cases where we now need to insert code at every `continue` or `continue`-mimicking `goto` inside the core interpreter loop. Better to make the loop single-entry-single-exit. Common things to run after every instruction will now happen inside the `finish_instruction` function rather than at the `finish_instruction` label.
* 3877Kartik K. Agaram2017-05-261-8/+8
|
* 3810Kartik K. Agaram2017-04-041-8/+8
| | | | | | | 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.
* 3380Kartik K. Agaram2016-09-171-5/+5
| | | | | One more place we were missing expanding type abbreviations: inside container definitions.
* 3120Kartik K. Agaram2016-07-211-3/+3
| | | | | | | | Always show instruction before any transforms in error messages. This is likely going to make some errors unclear because they *need* to show the original instruction. But if we don't have tests for those situations did they ever really work?
* 2990Kartik K. Agaram2016-05-201-8/+8
| | | | | | | | | | 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..
* 2881 - disallow recipe literals in conditional jumpsKartik K. Agaram2016-04-281-3/+5
| | | | | | | If you accidentally use a recipe name in an ingredient you usually get an error because types don't match. But jumps need to be flexible enough to support both addresses and booleans, so they were accepting recipe literals as well. Now a useful error results.
* 2803Kartik K. Agaram2016-03-211-16/+16
| | | | | Show more thorough information about instructions in the trace, but keep the original form in error messages.
* 2735 - define recipes using 'def'Kartik K. Agaram2016-03-081-6/+6
| | | | | | | | | | | | 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.
* 2712Kartik K. Agaram2016-02-261-8/+8
|
* 2685Kartik K. Agaram2016-02-191-3/+3
| | | | | | | | | | | | | | | | 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.
* 2377 - stop using operator[] in mapKartik K. Agaram2015-11-061-12/+12
| | | | | | | | | | | | | | | | 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.
* 2313Kartik K. Agaram2015-10-291-5/+5
|
* 2258 - separate warnings from errorsKartik K. Agaram2015-10-061-8/+8
| | | | | | | 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-8/+8
| | | | | | | | 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?
* 2223Kartik K. Agaram2015-09-301-19/+31
|
* 2214Kartik K. Agaram2015-09-281-0/+141
href='/akkartik/mu/commit/035lookup.cc?h=main&id=1fb0cf9ef9e616163039fd4df6584c6c2ba68d23'>1fb0cf9e ^
a97a00df ^
dc9afcbd ^








6c96a437 ^
dc9afcbd ^














ce9b2b05 ^


dc9afcbd ^
ce9b2b05 ^
dc9afcbd ^



ce9b2b05 ^



dc9afcbd ^
ce9b2b05 ^
dc9afcbd ^



ce9b2b05 ^


dc9afcbd ^
ce9b2b05 ^
dc9afcbd ^










ce9b2b05 ^

dc9afcbd ^

ce9b2b05 ^
dc9afcbd ^







fc19980d ^



acce384b ^

fc19980d ^













dc9afcbd ^


192d59d3 ^
dc9afcbd ^
192d59d3 ^
dc9afcbd ^





acce384b ^



ce9b2b05 ^
192d59d3 ^
dc9afcbd ^





b9a78a84 ^

192d59d3 ^

b9a78a84 ^
ce9b2b05 ^
b9a78a84 ^




dc9afcbd ^


acce384b ^



ce9b2b05 ^
192d59d3 ^
dc9afcbd ^
















acce384b ^



ce9b2b05 ^
192d59d3 ^
dc9afcbd ^
acce384b ^
dc9afcbd ^


192d59d3 ^



ce9b2b05 ^
acce384b ^
192d59d3 ^
dc9afcbd ^


fc19980d ^


acce384b ^



ce9b2b05 ^
192d59d3 ^
fc19980d ^
192d59d3 ^
fc19980d ^










88298924 ^


192d59d3 ^



88298924 ^
ce9b2b05 ^
88298924 ^

dc9afcbd ^













acce384b ^



ce9b2b05 ^
192d59d3 ^
dc9afcbd ^









ce9b2b05 ^

d52406cc ^
dc9afcbd ^
dc9afcbd ^
6e793202 ^
dc9afcbd ^


ce9b2b05 ^



dc9afcbd ^
ce9b2b05 ^

dc9afcbd ^


ce9b2b05 ^



dc9afcbd ^
ce9b2b05 ^

dc9afcbd ^



















ce9b2b05 ^

dc9afcbd ^








ce9b2b05 ^
dc9afcbd ^






555d95c1 ^
dc9afcbd ^



9dcbec39 ^
dc9afcbd ^









3473c63a ^
dc9afcbd ^



















3473c63a ^
dc9afcbd ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480