about summary refs log tree commit diff stats
path: root/apps/tile/environment.mu
Commit message (Collapse)AuthorAgeFilesLines
* 7229 - tile: fix ctrl-eKartik Agaram2020-11-121-7/+7
|
* 7228Kartik Agaram2020-11-121-3/+7
|
* 7225Kartik Agaram2020-11-111-42/+15
| | | | | | | 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-25/+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
* 7220Kartik Agaram2020-11-091-5/+12
| | | | | | | | | Even this isn't enough. While shallow copies keep us from transferring new bindings to callers, the screen object is still the same, so mutations to bindings are contagious. Basically I'm losing IQ points from programming in a language that encourages mutation over copying.
* 7219Kartik Agaram2020-11-091-30/+30
| | | | We're still busted, but on the right track.
* 7218Kartik Agaram2020-11-091-4/+31
| | | | | | | | | | | | | | | 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.
* 7215Kartik Agaram2020-11-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attempt #3: always create a copy of the bindings before each column/evaluate. The details are fuzzy in my head, but it seemed worth trying. I figured I'd either see the old duplication behavior or everything will work. Instead I'm seeing new problems. commit 7208: 5 5 fake-screen =s s 1 down 1 right expected: | - observed: | | - commit 7210-7212: 5 5 fake-screen =s s 1 down 1 right [define foo] s foo [expand foo] observed: no bindings available when rendering foo expanded commit 7213: 5 5 fake-screen =s s 1 down 1 right [define foo] s foo [expand foo] expected within foo: | - observed within foo: | | - commit 7215: 5 5 fake-screen =s s 1 down 1 right [define foo] s foo [expand foo] observed: no bindings available when rendering foo expanded
* 7214 - undo 7213Kartik Agaram2020-11-071-0/+1
| | | | | | | | | | Turns out even that doesn't work. There are two distinct use cases here: 1. Keeping columns from infecting each other. 2. Expanding function calls. Perhaps ping-ponging between them is a sign I need tests.
* 7213 - redo the bugfix of 7210Kartik Agaram2020-11-071-1/+0
| | | | | | | | It turns out deciding when to initialize the table of bindings is quite a thorny problem in the presence of function calls (since they need their args bound). In time I should probably support a linked list of tables. For now I'll just continue to reuse tables, but perform lookups in reverse order so that the correct binding is always returned.
* 7212Kartik Agaram2020-11-071-1/+1
|
* 7211Kartik Agaram2020-11-071-0/+24
|
* 7210Kartik Agaram2020-11-071-0/+2
| | | | | Bug fixed; I had to reinitialize the table of bindings. Interesting debugging experience.
* 7208 - tile: start new lineKartik Agaram2020-11-071-0/+35
| | | | | | | | Only the final line shows the stack for now. No way to move cursor back up. One bug I'm noticing: creating a screen on one line and then reusing it in a second causes operations to be performed multiple times.
* 7202 - rendering screens above other valuesKartik Agaram2020-11-061-1/+2
|
* 7201Kartik Agaram2020-11-061-8/+6
|
* 7200 - tile: cursor movement helpersKartik Agaram2020-11-061-3/+5
|
* 7198 - tile: primitive 'print'Kartik Agaram2020-11-061-1/+1
|
* 7196 - tile: render empty screenKartik Agaram2020-11-061-4/+3
|
* 7195 - tile: create 'screen' objectsKartik Agaram2020-11-061-0/+7
|
* 7194Kartik Agaram2020-11-061-0/+4
|
* 7193 - tile: extract taxonomy of values into a separate fileKartik Agaram2020-11-061-122/+0
|
* 7180Kartik Agaram2020-11-041-1/+1
| | | | | | | More bugfixes, now all apps are working. In the process of fixing the bugs in translating apps/browse, I found a typo in apps/tile that just happened to accidentally be compiling fine.
* 7159 - explicitly use 'return' everywhereKartik Agaram2020-11-021-79/+79
| | | | https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 2.
* 7125 - tile: fade out values on the stackKartik Agaram2020-10-271-4/+1
|
* 7123 - tile: truncate string if necessaryKartik Agaram2020-10-261-3/+21
|
* 7122 - tile: styling for stringsKartik Agaram2020-10-261-1/+6
|
* 7121Kartik Agaram2020-10-261-5/+11
| | | | | | | Starting to polish 'line-count' demo: filename line-count = filename open lines len
* 7120 - tile: array of lines from fileKartik Agaram2020-10-261-1/+5
| | | | Requires a quick hacky change to Mu compiler.
* 7119 - tile: new primitive to slurp file contentsKartik Agaram2020-10-261-1/+5
| | | | | Stack display is messed up when file contents contain newlines. Ignoring that for now.
* 7118Kartik Agaram2020-10-261-3/+5
|
* 7117Kartik Agaram2020-10-261-2/+4
|
* 7113Kartik Agaram2020-10-261-2/+12
|
* 7112 - tile: arrays of non-integersKartik Agaram2020-10-261-4/+29
|
* 7111Kartik Agaram2020-10-261-36/+41
|
* 7107 - tile: file handlesKartik Agaram2020-10-251-1/+19
|
* 7106 - tile: arrays of intsKartik Agaram2020-10-251-0/+28
|
* 7105 - tile: define-function works with stringsKartik Agaram2020-10-251-0/+4
|
* 7103 - tile: first primitive for stringsKartik Agaram2020-10-251-1/+1
|
* 7102Kartik Agaram2020-10-251-3/+13
|
* 7100 - tile: render string literalsKartik Agaram2020-10-251-7/+25
|
* 7098 - tile: string valuesKartik Agaram2020-10-251-0/+10
| | | | Strings can contain spaces.
* .Kartik Agaram2020-10-241-11/+8
|
* tile: process space in middle of wordKartik Agaram2020-10-241-1/+15
|
* tile: process space at start of wordKartik Agaram2020-10-241-5/+48
| | | | | | This was very difficult to debug. We still need to process space in the middle of a word.
* tile: adjust spacing between commandline and stackKartik Agaram2020-10-231-1/+1
|
* 7087 - defining functions now seems to be workingKartik Agaram2020-10-201-7/+7
|
* 7086Kartik Agaram2020-10-201-11/+2
| | | | | Expanding words now seems to be working. I was forgetting to update 'prev' pointers in a few places.
* 7084Kartik Agaram2020-10-201-2/+7
| | | | | | | | | Cursor now updating right. Still a couple of bugs: ctrl-e doesn't know about multiple lines function calls don't expand right in multi-line sandboxes (but at least I'm now getting to see them in action!)
* 7083Kartik Agaram2020-10-201-2/+15
| | | | | Defining functions mostly working. But we still need to fix the cursor afterwards.