about summary refs log tree commit diff stats
path: root/apps/tile/rpn.mu
Commit message (Collapse)AuthorAgeFilesLines
* 7690Kartik Agaram2021-02-071-26/+26
| | | | Convert comments about magic constants into metadata.
* 7302 - tile: at long last, divisionKartik Agaram2020-11-291-0/+20
| | | | | | Also square roots. But there's a bug in rendering floats without precision.
* 7297 - tile: use floats everywhereKartik Agaram2020-11-291-36/+41
|
* 7248 - mu.subx: new primitive 'clear-object'Kartik Agaram2020-11-151-10/+5
|
* 7226Kartik Agaram2020-11-111-12/+0
|
* 7225Kartik Agaram2020-11-111-0/+14
| | | | | | | Both manual tests described in commit 7222 now work. To make them work I had to figure out how to copy a file. It requires a dependency on a new syscall: lseek.
* 7222Kartik Agaram2020-11-101-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ok, I found a failing manual test for files as well. Here are the two steelman tests, one for screens and one for files: 1. 5 5 fake-screen =s s 1 down 1 right ctrl-d foo expand final state: s foo foo s 1 down 1 right ⇗ ┌─────┐ ┌─────┐ ┌─────┐ 1 ┌─────┐ 1 ┌─────┐ │ ┌─────┐ │ ┌─────┐ │ ─ │ │ │ │ ─ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ └─────┘ 2. "x" open =f f read f read ctrl-d read2 expand final state: f read2 read2 f read f read ⇗ FILE ❝def❞ FILE ❝abc❞ FILE ❝❞ ❝def❞ ❝ghi❞ In both cases there are 3 levels of issues: - getting a single-line expression to work - getting a single-line expression to work when operating on a binding defined in a previous line - getting an expanded function call to work The third is where the rub is right now. And what both examples above share is that the function performs 2 mutations to the screen/file. So we need a deep copy after all. And it's not very clear how to copy a file descriptor including the seek location. Linux's dup() syscall creates an alias to the file descriptor. And opening /proc seems awfully Linux-specific: https://stackoverflow.com/questions/54727231/duplicating-file-descriptor-and-seeking-through-both-of-them-independently/54727424#54727424
* 7219Kartik Agaram2020-11-091-3/+3
| | | | We're still busted, but on the right track.
* 7218Kartik Agaram2020-11-091-2/+4
| | | | | | | | | | | | | | | This bug was incredibly painful to track down: the one-line fix is to replace 'line' with 'first-line' in the call to 'evaluate' in render-line before recursing. Things that made it challenging: - A high degree of coiling with recursive calls and multiple places of evaluation. - An accidental aliasing in bindings (when rendering the main column in render-line) that masked the underlying bug and made things seem to work most of the time. - Too many fucking arguments to render-line, a maze of twisty line objects all alike.
* 7210Kartik Agaram2020-11-071-0/+12
| | | | | Bug fixed; I had to reinitialize the table of bindings. Interesting debugging experience.
* 7209Kartik Agaram2020-11-071-1/+1
|
* 7206 - tile: up/down/left/right now print linesKartik Agaram2020-11-071-20/+57
|
* 7205 - tile: magnitudes for up/down/left/rightKartik Agaram2020-11-071-17/+41
|
* 7200 - tile: cursor movement helpersKartik Agaram2020-11-061-0/+116
|
* 7199 - tile: primitive 'move'Kartik Agaram2020-11-061-1/+30
|
* 7198 - tile: primitive 'print'Kartik Agaram2020-11-061-0/+37
|
* 7195 - tile: create 'screen' objectsKartik Agaram2020-11-061-0/+33
|
* 7194Kartik Agaram2020-11-061-45/+47
|
* 7159 - explicitly use 'return' everywhereKartik Agaram2020-11-021-2/+3
| | | | https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 2.
* 7129 - tile: allow bindings anywhereKartik Agaram2020-10-271-7/+7
| | | | | | | | | | Amazing how easy this was. And it does feel more intuitive. If I decide at some point that I want to bind something to a name I don't usually want to lose the entire line after that point. It also sidesteps for now the thorny question of whether to permit organically switching to a new line (rather than using the 'name value' hotkey), and how that should work.
* 7127Kartik Agaram2020-10-271-1/+1
|
* 7124 - tiles: better 'lines' primitiveKartik Agaram2020-10-271-14/+17
|
* 7120 - tile: array of lines from fileKartik Agaram2020-10-261-0/+46
| | | | Requires a quick hacky change to Mu compiler.
* 7119 - tile: new primitive to slurp file contentsKartik Agaram2020-10-261-0/+36
| | | | | Stack display is messed up when file contents contain newlines. Ignoring that for now.
* 7115Kartik Agaram2020-10-261-5/+5
|
* 7112 - tile: arrays of non-integersKartik Agaram2020-10-261-12/+37
|
* 7110Kartik Agaram2020-10-261-0/+54
| | | | | | | | | | Some more helpers that I want to avoid using, but they help me gain confidence in the current implementation of file handles. Manual test: "x" open dup read swap read Assumes there's a file called `x` in the current directory that contains at least two (short!) lines.
* 7108 - tile: read from file handleKartik Agaram2020-10-251-0/+36
|
* 7107 - tile: file handlesKartik Agaram2020-10-251-0/+32
|
* 7106 - tile: arrays of intsKartik Agaram2020-10-251-23/+54
|
* 7105 - tile: define-function works with stringsKartik Agaram2020-10-251-12/+33
|
* 7104 - tile: word-rename works with stringsKartik Agaram2020-10-251-3/+11
|
* 7103 - tile: first primitive for stringsKartik Agaram2020-10-251-0/+38
|
* 7101 - tile: remove quotes when evaluating stringsKartik Agaram2020-10-251-1/+1
| | | | This found several bugs due to me not checking for null strings.
* 7100 - tile: render string literalsKartik Agaram2020-10-251-0/+14
|
* 7066 - tile: some more primitives for testingKartik Agaram2020-10-191-0/+2
| | | | | Lesson learned: functions store args in _reverse_ order. Since evaluation is very frequent, it's worth optimizing for it.
* 7058Kartik Agaram2020-10-181-0/+3
| | | | | Snapshot; things seem to be working besides ctrl-r, but we aren't yet rendering only the final line.
* 7057 - tile: back to namesKartik Agaram2020-10-181-5/+44
| | | | We can now create new bindings for names while evaluating lines.
* 6965Kartik Agaram2020-10-051-5/+5
|
* 6879Kartik Agaram2020-09-261-14/+18
| | | | Extract a new function.
* 6876Kartik Agaram2020-09-261-21/+8
| | | | Back to commit 6872.
* 6873Kartik Agaram2020-09-261-8/+21
| | | | Now saving the subsidiary stack.
* 6871Kartik Agaram2020-09-261-2/+2
| | | | Segfault now fixed. Everything seems to be working again.
* 6870Kartik Agaram2020-09-261-29/+29
| | | | | | Emit a stack of not ints but more complex objects containing the int payload. Function calls again segfaulting.
* 6868Kartik Agaram2020-09-261-14/+42
| | | | First function call working in apps/tile!
* 6867Kartik Agaram2020-09-261-2/+5
| | | | Segfault fixed. This shouldn't have been so hard.
* 6860Kartik Agaram2020-09-261-2/+71
| | | | | Snapshot: tile currently segfaulting. I need to back up and make it easier to debug.
* 6853 - tile: initialize a test function definitionKartik Agaram2020-09-241-0/+3
|
* 6852 - tile: placeholder for lexical scopesKartik Agaram2020-09-241-1/+1
|
* 6844 - tile: initial data modelKartik Agaram2020-09-231-23/+4
| | | | I actually deleted a test here! Hard-core prototype mode.
evision' href='/akkartik/mu/blame/html/040brace.cc.html?h=hlt&id=63b94083336684c011e2fcdd23226043d0cf6bb7'>^
672e3e50 ^
90560d71 ^
672e3e50 ^
9542bb11 ^

672e3e50 ^


90560d71 ^
672e3e50 ^














d5d908dd ^





672e3e50 ^


9570363a ^

672e3e50 ^
9570363a ^
672e3e50 ^










9570363a ^
672e3e50 ^









9570363a ^
672e3e50 ^











90560d71 ^
672e3e50 ^
9570363a ^

672e3e50 ^

9570363a ^
672e3e50 ^













9570363a ^

672e3e50 ^
90560d71 ^
9570363a ^
672e3e50 ^













9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^

9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^





9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^


9570363a ^
672e3e50 ^



90560d71 ^
672e3e50 ^
9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^







65361948 ^
672e3e50 ^
9570363a ^
672e3e50 ^







9570363a ^

672e3e50 ^
65361948 ^
9570363a ^
672e3e50 ^









9570363a ^

672e3e50 ^
65361948 ^
9570363a ^
672e3e50 ^









9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^
90560d71 ^
9570363a ^
672e3e50 ^






9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^








9570363a ^

672e3e50 ^
9570363a ^
90560d71 ^
65361948 ^

9570363a ^
672e3e50 ^

65361948 ^
672e3e50 ^

d5d908dd ^





9542bb11 ^
0e4a335e ^








672e3e50 ^



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