diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-17 22:28:38 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-17 22:33:28 -0700 |
commit | c026dba0067d2ce476d9777087f233dacf868f92 (patch) | |
tree | b51b178ad9fbee59da68c6e40012b53caa3782df /shell/evaluate.mu | |
parent | 60cab88acec8c655346e5e4396ebfcb3a03b5b23 (diff) | |
download | mu-c026dba0067d2ce476d9777087f233dacf868f92.tar.gz |
shell: reenable the trace
We now have a couple of protections: - if we get close to running out of space in the trace we drop in an error - if we run out of space in the trace we stop trying to append - if there are errors we cancel future evaluations This is already much nicer. You can't do much on the Mu computer, but at least it gracefully gives up and shows its limitations. On my computer the Mu shell tries to run computations for about 20s before giving up. That seems at the outer limit of what interactivity supports. If things take too long, test smaller chunks.
Diffstat (limited to 'shell/evaluate.mu')
-rw-r--r-- | shell/evaluate.mu | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/evaluate.mu b/shell/evaluate.mu index 170a1713..580a9ac3 100644 --- a/shell/evaluate.mu +++ b/shell/evaluate.mu @@ -2,6 +2,15 @@ # we never modify `in` or `env` # ignore 'screen-cell' on a first reading; it's a hack for sandboxes fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), screen-cell: (addr handle cell), keyboard-cell: (addr handle cell) { + # errors? skip + { + compare trace, 0 + break-if-= + var error?/eax: boolean <- has-errors? trace + compare error?, 0/false + break-if-= + return + } var in/esi: (addr handle cell) <- copy _in #? dump-cell in #? { |