Commit Graph

1359 Commits

Author SHA1 Message Date
Kartik Agaram ee3ddc3961 7302 - tile: at long last, division
Also square roots.

But there's a bug in rendering floats without precision.
2020-11-29 12:51:57 -08:00
Kartik Agaram 614b132b2e 7301 - tile: float computations now working 2020-11-29 12:45:23 -08:00
Kartik Agaram 61cfedceef 7300 - bugfix in type-checking float returns 2020-11-29 12:42:34 -08:00
Kartik Agaram 33a85545e1 7299 - bug in code-generating float returns 2020-11-29 12:20:08 -08:00
Kartik Agaram 6b1cde4761 7297 - tile: use floats everywhere 2020-11-29 12:17:23 -08:00
Kartik Agaram a518d84bf4 7295 2020-11-29 03:40:12 -08:00
Kartik Agaram 8766aa12cd 7294 2020-11-28 08:31:55 -08:00
Kartik Agaram bbcf033aff 7292 - mu.subx: loosen copy-byte checks a bit
Without this there's no way to convert an int to a byte. And that feels
too restrictive, and gives up a lot of safe things one might want to do
with bytes. (Such as divide a number by 10 and emit the remainder as a
byte.)
2020-11-27 22:44:23 -08:00
Kartik Agaram bcd2adfbf3 7291 2020-11-27 22:27:34 -08:00
Kartik Agaram 6f65b65f7d 7290
I've wrestled for a long time with how to support integer division with
its hard-coded registers. The answer's always been staring me in the face:
just turn it into a function! We already expect function outputs to go
to hard-coded registers.
2020-11-27 21:37:20 -08:00
Kartik Agaram 3341af3d92 7288 2020-11-27 00:26:27 -08:00
Kartik Agaram 530af63477 7287
Regression: I'd broken compare on bytes. Apparently I took away support
for bytes from numberlike-output even though I didn't need to by the end.
2020-11-27 00:17:51 -08:00
Kartik Agaram 125bfde435 7286 - mu.subx: isolate bytes from previous values 2020-11-27 00:04:54 -08:00
Kartik Agaram c165b0be5a 7285 2020-11-26 23:20:15 -08:00
Kartik Agaram 736bfe9547 7284 2020-11-26 22:34:32 -08:00
Kartik Agaram b0dfe182ff 7283 2020-11-26 21:59:28 -08:00
Kartik Agaram 7f40e8a3f6 7282 2020-11-26 21:46:46 -08:00
Kartik Agaram 896a353a7d 7281 2020-11-26 21:37:09 -08:00
Kartik Agaram 066014d4b4 7280 2020-11-26 21:23:15 -08:00
Kartik Agaram 5ce7c8dcff 7279 2020-11-26 20:10:46 -08:00
Kartik Agaram e9f411d5c5 7278 - typo in mu.subx 2020-11-26 12:58:02 -08:00
Kartik Agaram 32505d159e 7269 2020-11-21 21:40:23 -08:00
Kartik Agaram fd4d7b38da 7267 - mu.subx: type-check 'convert' statements 2020-11-20 00:20:58 -08:00
Kartik Agaram 1696ed831a 7261 - mu.subx: array bounds-checking done 2020-11-17 18:16:26 -08:00
Kartik Agaram 83221b4e21 7260
This seems to preserve the intent of commit 6555.
2020-11-17 16:32:38 -08:00
Kartik Agaram 98399a621f 7258 2020-11-17 10:04:53 -08:00
Kartik Agaram 18944f44e6 7257 - partially undo commit 7253
I don't need to pass the function pointer quite so low. I think..
2020-11-17 10:04:49 -08:00
Kartik Agaram 789c0ac05a 7256 2020-11-17 09:25:17 -08:00
Kartik Agaram 18579f77c6 7253 - mu.subx: starting to bounds-check 'index'
First step: start passing the function name into code-generation functions.
We're going to need it for the error message.
2020-11-16 22:32:25 -08:00
Kartik Agaram 3d31467c0d 7251 2020-11-16 00:37:37 -08:00
Kartik Agaram 8d2dece291 7250 2020-11-16 00:00:32 -08:00
Kartik Agaram 002f2609e9 7248 - mu.subx: new primitive 'clear-object' 2020-11-15 23:13:23 -08:00
Kartik Agaram b6b94712a1 7246 - tile: segment each function's area 2020-11-15 22:05:33 -08:00
Kartik Agaram bdbf2093ea 7245 - tile: right-align functions 2020-11-15 21:45:20 -08:00
Kartik Agaram 7ca4b6a2f7 7244 - tile: new layout for primitives 2020-11-15 21:01:17 -08:00
Kartik Agaram 56ed1a1073 7243 - tile: starting to make functions editable 2020-11-15 20:30:01 -08:00
Kartik Agaram a8dfb603fd 7242 2020-11-15 20:24:41 -08:00
Kartik Agaram 0879555213 7241 - mu.subx: check float registers 2020-11-15 17:24:38 -08:00
Kartik Agaram dcf004d51e 7240 2020-11-15 17:14:07 -08:00
Kartik Agaram 91dc5814df 7239 2020-11-15 16:06:00 -08:00
Kartik Agaram 0e0a60013d 7238 - mu.subx: final restrictions on 'addr'
I had to tweak one app that wasn't following the rules.
2020-11-15 13:18:38 -08:00
Kartik Agaram e996502f01 7237
Minor tweaks to get Mu shell running nicely on a Linux console atop Qemu.

We also need to switch a few 256-color codes to 8-color mode. I'm not
sure whether/how to patch the repo for those.
2020-11-14 20:27:43 -08:00
Kartik Agaram ea8a64cfb0 7232 - mu.subx: more checks for byte types 2020-11-12 23:56:41 -08:00
Kartik Agaram f3d33ac462 7231 2020-11-12 23:25:45 -08:00
Kartik Agaram 165ed256a3 7230 - mu.subx: some more checks for stmt outputs 2020-11-12 23:13:48 -08:00
Kartik Agaram 37ebd39253 7229 - tile: fix ctrl-e 2020-11-12 20:37:42 -08:00
Kartik Agaram 2ee741b0d3 7228 2020-11-12 20:33:37 -08:00
Kartik Agaram d715599246 7226 2020-11-11 23:30:56 -08:00
Kartik Agaram 307745bcc2 7225
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.
2020-11-11 23:25:55 -08:00
Kartik Agaram 3ae62cfd79 7222
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
2020-11-10 19:32:54 -08:00
Kartik Agaram 021c2975aa 7221
I can't get file values to exhibit the same problem. Why are fake screens
special?
2020-11-09 21:56:21 -08:00
Kartik Agaram f20984f44a 7220
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.
2020-11-09 21:44:38 -08:00
Kartik Agaram 7e4f8983f8 7219
We're still busted, but on the right track.
2020-11-09 21:25:56 -08:00
Kartik Agaram c01289ddde 7218
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.
2020-11-09 21:16:09 -08:00
Kartik Agaram 148f2c9b65 7217 2020-11-08 11:31:54 -08:00
Kartik Agaram 2be7af86db 7216
In addition to fixing a segfault, the realization here is that we don't
always have a type name. Error messages need to take that into account.
2020-11-08 09:43:35 -08:00
Kartik Agaram 4cf8be04e9 7215
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
2020-11-07 21:13:10 -08:00
Kartik Agaram 8fdf344ea9 7214 - undo 7213
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.
2020-11-07 20:22:19 -08:00
Kartik Agaram 97b665c9b4 7213 - redo the bugfix of 7210
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.
2020-11-07 20:12:21 -08:00
Kartik Agaram 9185512dba 7212 2020-11-07 19:51:31 -08:00
Kartik Agaram 4f86220a6c 7211 2020-11-07 19:49:11 -08:00
Kartik Agaram f2a3c381a7 7210
Bug fixed; I had to reinitialize the table of bindings.
Interesting debugging experience.
2020-11-07 19:45:58 -08:00
Kartik Agaram 412304cf45 7209 2020-11-07 18:26:08 -08:00
Kartik Agaram 776f1eee0b 7208 - tile: start new line
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.
2020-11-07 18:23:05 -08:00
Kartik Agaram d7ad7f9753 7207 - tile: bugfix 2020-11-07 18:02:03 -08:00
Kartik Agaram 5e3927f7e1 7206 - tile: up/down/left/right now print lines 2020-11-07 16:36:47 -08:00
Kartik Agaram 8338c38698 7205 - tile: magnitudes for up/down/left/right 2020-11-07 15:26:04 -08:00
Kartik Agaram 88e53f5628 7202 - rendering screens above other values 2020-11-06 18:26:25 -08:00
Kartik Agaram 1f77feff37 7201 2020-11-06 18:25:52 -08:00
Kartik Agaram cea9b05bb6 7200 - tile: cursor movement helpers 2020-11-06 18:18:42 -08:00
Kartik Agaram 7ee2129ef4 7199 - tile: primitive 'move' 2020-11-06 17:46:42 -08:00
Kartik Agaram aa96c23f0c 7198 - tile: primitive 'print' 2020-11-06 17:46:27 -08:00
Kartik Agaram abba997d1b 7197 - tile: render screen contents and cursor 2020-11-06 16:05:33 -08:00
Kartik Agaram 2855bc69bd 7196 - tile: render empty screen 2020-11-06 14:26:42 -08:00
Kartik Agaram 443140ae3e 7195 - tile: create 'screen' objects 2020-11-06 13:39:46 -08:00
Kartik Agaram 9a0412b858 7194 2020-11-06 13:39:46 -08:00
Kartik Agaram 0181e9eeb6 7193 - tile: extract taxonomy of values into a separate file 2020-11-06 13:39:46 -08:00
Kartik Agaram 494eb64aaf 7192 - more checks around literals
We can copy non-zero literals only to non-addr non-offset scalars.

This change is surprisingly short for the magnitude of the limb I felt
myself going out on for it. Surprising that there were no unpleasant discoveries.
2020-11-05 23:50:12 -08:00
Kartik Agaram bdb48b5211 7191 2020-11-05 21:03:57 -08:00
Kartik Agaram ed146be6bc 7190
Training sights now on some gaps with offset types.
2020-11-05 20:49:00 -08:00
Kartik Agaram 4b41663394 7189 - some validations on function name
Mu has no overloading or static dispatch for now.
2020-11-05 20:10:46 -08:00
Kartik Agaram 7a25625c43 7188 - raise error on deref of var on stack 2020-11-05 19:08:44 -08:00
Kartik Agaram c31d1d3a3d 7185 - type checks for 'populate-stream'
Lots of copy-pasta.
2020-11-05 16:35:47 -08:00
Kartik Agaram 2ea3107c21 7184 - type checks for 'populate' 2020-11-05 16:27:46 -08:00
Kartik Agaram 6017f1e240 7183 - type checks for 'allocate' 2020-11-05 15:06:25 -08:00
Kartik Agaram 9b91efeadd 7182 - type checks for 'copy-object' 2020-11-05 01:20:23 -08:00
Kartik Agaram 686b87cc06 7181 - type checks for 'address' instruction 2020-11-05 00:51:15 -08:00
Kartik Agaram cc356b35bf 7180
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.
2020-11-04 22:58:13 -08:00
Kartik Agaram 8767e709c5 7179
After this bugfix, apps/tile/ is now working.

apps/browse/ is still failing.
2020-11-04 22:38:39 -08:00
Kartik Agaram 940dad03c2 7178 - type checks for 'compare' instruction 2020-11-04 20:34:43 -08:00
Kartik Agaram 179d26ae8e 7177 - type checks for 'copy-to' instruction 2020-11-04 19:04:43 -08:00
Kartik Agaram 0102aa377a 7176 - type checks for 'copy' instruction 2020-11-04 19:04:15 -08:00
Kartik Agaram 768aeffbbe 7174 - function returns should now be safe 2020-11-03 22:32:50 -08:00
Kartik Agaram bd57b37fc5 7173
All tests passing again.
2020-11-03 21:31:48 -08:00
Kartik Agaram da2dc3ee9d 7172 2020-11-03 20:37:26 -08:00
Kartik Agaram c623ff2975 7171 2020-11-03 20:23:39 -08:00
Kartik Agaram 71d21ae662 7170
One more test.
2020-11-03 20:13:41 -08:00
Kartik Agaram aa36ee1cdf 7169
Now test-return-unavailable-value is passing,
but test-convert-return-with-duplicate-values is failing.

Time to think.
2020-11-03 20:13:02 -08:00
Kartik Agaram ec638f029d 7168 - snapshot
2 new tests:
  test-return-unavailable-value - currently failing
  test-convert-return-with-duplicate-values - currently passing

I don't yet know how to make both pass.
2020-11-03 19:15:32 -08:00
Kartik Agaram f7cd97c197 7167 2020-11-03 18:10:32 -08:00
Kartik Agaram f21c96203e 7166 2020-11-03 15:42:58 -08:00
Kartik Agaram da791479a0 7165
All tasks of https://github.com/akkartik/mu/issues/45#issuecomment-719990879
should now be complete.
2020-11-03 14:04:35 -08:00
Kartik Agaram 85a29a4e4e 7164 2020-11-03 13:37:32 -08:00
Kartik Agaram 65dcc74693 7163 - first type checks for 'return' statements 2020-11-03 13:29:09 -08:00
Kartik Agaram 571ad49190 7161 - stop processing function outputs
Assignments to them will no longer work, and they can never be live variables.

https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 3.
2020-11-02 21:03:03 -08:00
Kartik Agaram 95d89d1cc0 7160 2020-11-02 20:36:42 -08:00
Kartik Agaram a3f7791586 7159 - explicitly use 'return' everywhere
https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 2.
2020-11-02 19:50:52 -08:00
Kartik Agaram c8e41a470f 7157 2020-11-01 22:17:40 -08:00
Kartik Agaram 34063288c9 7156 2020-11-01 22:07:40 -08:00
Kartik Agaram 10adec2f21 7155
apps/arith.mu compiling again.
2020-11-01 22:04:35 -08:00
Kartik Agaram 17623a628a 7154 2020-11-01 22:02:13 -08:00
Kartik Agaram cc7dcdc3b8 7153
Bugfix in computing the label a return should jump to.
2020-11-01 20:37:56 -08:00
Kartik Agaram ccadc6e604 7152 - 'return' instruction
https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 1.

We don't have checking for it yet. Soon.
2020-11-01 18:02:02 -08:00
Kartik Agaram c694b8e2cb 7151
Drop pending tests for the old plan of liveness analysis.
2020-11-01 11:19:03 -08:00
Kartik Agaram 77687ba944 7148 2020-10-31 20:29:09 -07:00
Kartik Agaram 8c44afcccc 7145 - roll back to 7143 2020-10-30 20:23:56 -07:00
Kartik Agaram 264acd9ec9 7144 - tmp: redo checks for function outputs
This isn't done, but an intermediate snapshot seems worth capturing.

Back in March (commit 6082), I made a plan to check writes to function
outputs using liveness analysis. I've been shying away from actually acting
on this plan ever since. In recent weeks I've had this gap bite me three
times.

Returning to the problem now, I think I don't actually need to compute
variable liveness. The compiler can, I think, do the same thing for output
registers whether their variables are alive or dead. The new rule is this:

Once a register gets a function output written to it, no local is popped
into it. Instead of popping outer locals to the register, we simply increment
the stack and keep going.

Since the function output will continue to live on the vars stack past
this point (see clean-up-block), any attempts to read shadowed variables
will throw an error as usual.

This rule is also now easy to explain to people, I think. "You wrote the
function output. Now the register can't be used for anything else."

It's really cool that this works (if it does). Another fruit from "Mu's
lovely property."
2020-10-30 06:05:52 -07:00
Kartik Agaram 8fe51755bf 7143
Am I starting to have too much code duplication?
2020-10-29 22:06:50 -07:00
Kartik Agaram 2486881de0 7142 2020-10-29 21:36:33 -07:00
Kartik Agaram 0a5d247ba7 7141 2020-10-29 21:15:15 -07:00
Kartik Agaram bc67d01879 7140 2020-10-29 13:19:53 -07:00
Kartik Agaram 7521fcdc1e 7139 - type-check compute-offset 2020-10-29 00:34:00 -07:00
Kartik Agaram 4cbe0ba1ac 7138 - type-check array 'length' instruction 2020-10-29 00:03:19 -07:00
Kartik Agaram d3657eec0d 7137 2020-10-28 23:25:40 -07:00
Kartik Agaram 216af9cc1c 7136 2020-10-28 23:25:05 -07:00
Kartik Agaram 33b1e9a894 7135 - type-check write-to-stream
Lots of copy-pasta.
2020-10-28 22:39:14 -07:00
Kartik Agaram d648812c51 7134 - type-check read-from-stream 2020-10-28 22:35:35 -07:00
Kartik Agaram 6b218b8d62 7130 - back to the Mu compiler for a spell
Hacking on apps has created some urgency now for several additional safety
checks.
2020-10-27 21:22:18 -07:00
Kartik Agaram c5e1cbc4ce 7129 - tile: allow bindings anywhere
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.
2020-10-27 20:51:28 -07:00
Kartik Agaram 603b4c47dd 7128
More consistent spacing in sandbox render.
2020-10-27 10:31:21 -07:00
Kartik Agaram 5df70f4dff 7127 2020-10-27 00:49:02 -07:00
Kartik Agaram f926aaedfc 7126 2020-10-27 00:44:36 -07:00
Kartik Agaram 61dca1cec4 7125 - tile: fade out values on the stack 2020-10-27 00:43:50 -07:00
Kartik Agaram 332998546d 7124 - tiles: better 'lines' primitive 2020-10-27 00:43:14 -07:00
Kartik Agaram 307a75530f 7123 - tile: truncate string if necessary 2020-10-26 23:57:39 -07:00
Kartik Agaram c15b6e3fc6 7122 - tile: styling for strings 2020-10-26 23:45:40 -07:00
Kartik Agaram 22ade886d5 7121
Starting to polish 'line-count' demo:

  filename line-count
    = filename open lines len
2020-10-26 23:45:40 -07:00
Kartik Agaram 0f9a65dc0d 7120 - tile: array of lines from file
Requires a quick hacky change to Mu compiler.
2020-10-26 23:45:40 -07:00
Kartik Agaram f3d1929033 7119 - tile: new primitive to slurp file contents
Stack display is messed up when file contents contain newlines. Ignoring
that for now.
2020-10-26 21:56:47 -07:00
Kartik Agaram 2ddfdf191c 7118 2020-10-26 21:54:31 -07:00
Kartik Agaram 8bbd494aaa 7117 2020-10-26 21:53:02 -07:00
Kartik Agaram d5ac55d3ca 7116 - tile: regression in typing in strings
We really need to clean up the Mu compiler's logic around function outputs.
2020-10-26 21:50:37 -07:00
Kartik Agaram 71418907f6 7115 2020-10-26 21:24:43 -07:00
Kartik Agaram c5b1b560e2 7113 2020-10-26 21:06:26 -07:00
Kartik Agaram 14a41f4a27 7112 - tile: arrays of non-integers 2020-10-26 21:01:42 -07:00
Kartik Agaram 16a31669e3 7111 2020-10-26 17:06:00 -07:00
Kartik Agaram 7c9b650d27 7110
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.
2020-10-26 09:27:32 -07:00
Kartik Agaram 475da72c61 7109
Turns out I've been including some unnecessary files when building apps/mu!

Treeshaken stats before:
  LoC 26258 => 9717
  LoC including common libraries: 29736 => 12719
  binary size: 406K  => 79K

After:
  LoC 26258 => 9717
  LoC including common libraries: 28322 => 12370
  binary size: 406K  => 77K

So our treeshaking isn't perfect. No surprise there..

The treeshaken build also starts to fail without the one-liner change to
mu.subx, which looks like a bug in the treeshaker.
2020-10-25 22:32:56 -07:00
Kartik Agaram 10d5b13af8 7108 - tile: read from file handle 2020-10-25 21:43:18 -07:00
Kartik Agaram 5f5579e168 7107 - tile: file handles 2020-10-25 21:35:24 -07:00
Kartik Agaram 2d7960d493 7106 - tile: arrays of ints 2020-10-25 21:15:43 -07:00
Kartik Agaram 1787560a6d 7105 - tile: define-function works with strings 2020-10-25 20:33:40 -07:00
Kartik Agaram fa4cc8c871 7104 - tile: word-rename works with strings 2020-10-25 20:12:32 -07:00
Kartik Agaram bdf1bf7777 7103 - tile: first primitive for strings 2020-10-25 20:00:36 -07:00
Kartik Agaram ad54c69667 7102 2020-10-25 19:41:07 -07:00
Kartik Agaram a148b23a22 7101 - tile: remove quotes when evaluating strings
This found several bugs due to me not checking for null strings.
2020-10-25 18:45:11 -07:00
Kartik Agaram 8a6ad45d8d 7100 - tile: render string literals 2020-10-25 18:14:12 -07:00
Kartik Agaram 517ef9f64f 7099 2020-10-25 15:23:49 -07:00
Kartik Agaram f37e7f33e8 7098 - tile: string values
Strings can contain spaces.
2020-10-25 14:34:40 -07:00
Kartik Agaram a87bc353f5 . 2020-10-24 19:33:41 -07:00
Kartik Agaram e648bc9c88 tile: process space in middle of word 2020-10-24 18:26:19 -07:00
Kartik Agaram 1137dd2a99 tile: process space at start of word
This was very difficult to debug.

We still need to process space in the middle of a word.
2020-10-24 16:52:33 -07:00
Kartik Agaram 03012c91c2 tile: adjust spacing between commandline and stack 2020-10-23 00:09:24 -07:00
Kartik Agaram 4568607634 7087 - defining functions now seems to be working 2020-10-20 22:15:32 -07:00
Kartik Agaram 6b973819d0 7086
Expanding words now seems to be working. I was forgetting to update 'prev'
pointers in a few places.
2020-10-20 21:48:53 -07:00
Kartik Agaram 9ac5159486 7085 2020-10-20 21:18:38 -07:00
Kartik Agaram cbe90c6a2b 7084
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!)
2020-10-20 13:39:31 -07:00
Kartik Agaram 38ff550455 7083
Defining functions mostly working. But we still need to fix the cursor
afterwards.
2020-10-20 10:02:31 -07:00
Kartik Agaram ce94374bd1 7082 2020-10-20 09:39:12 -07:00
Kartik Agaram 5bdcb85f67 7081
Defining new functions seems to be working. _However_, we aren't yet detecting
duplicates. `x x *` leads to a declaration of `x x f`.
2020-10-20 09:33:13 -07:00
Kartik Agaram c2d537c46b 7080
Constructing new functions with ctrl-d is now working right. But the call
seems exactly flipped.
2020-10-20 01:07:21 -07:00
Kartik Agaram 0cdbfff256 7079 2020-10-19 23:53:45 -07:00
Kartik Agaram e28b949f18 7078 2020-10-19 23:20:33 -07:00
Kartik Agaram 5e9a482193 7077 - tile: render function list 2020-10-19 23:13:28 -07:00
Kartik Agaram 5532ea013b 7066 - tile: some more primitives for testing
Lesson learned: functions store args in _reverse_ order. Since evaluation
is very frequent, it's worth optimizing for it.
2020-10-19 22:41:46 -07:00
Kartik Agaram 3ff287f410 7065 2020-10-19 22:29:08 -07:00
Kartik Agaram 7144ae7638 7064 2020-10-19 22:27:52 -07:00
Kartik Agaram 1158758f20 7063 - tile: scaffolding for defining functions 2020-10-18 23:41:57 -07:00
Kartik Agaram f1a3f88e95 7062 2020-10-18 23:23:36 -07:00
Kartik Agaram 266ac87340 7061 2020-10-18 23:22:06 -07:00
Kartik Agaram 19fd3c9ca4 7060 - tile: renaming variables now works 2020-10-18 23:07:23 -07:00
Kartik Agaram 956394017e 7059
Cursor now in the right place after rename. But stack still doesn't show
the value of a name.
2020-10-18 22:48:11 -07:00
Kartik Agaram a3ddc1bdb3 7058
Snapshot; things seem to be working besides ctrl-r, but we aren't yet rendering
only the final line.
2020-10-18 21:57:09 -07:00
Kartik Agaram 47497ea552 7057 - tile: back to names
We can now create new bindings for names while evaluating lines.
2020-10-18 20:51:47 -07:00
Kartik Agaram 82d1fe7c9c 7056 - orange-pink 2020-10-18 20:18:51 -07:00
Kartik Agaram d7d384a72b 7055 2020-10-18 15:49:20 -07:00
Kartik Agaram e170b35d8b 7054 2020-10-18 15:39:34 -07:00
Kartik Agaram dc0e03e4a5 7053
Rename seems to now be working. State still isn't rendered right, so we
can't be sure.
2020-10-17 23:29:02 -07:00
Kartik Agaram 1fc218bf9d 7052 2020-10-17 23:10:00 -07:00
Kartik Agaram 26bfae3d5e 7051 2020-10-17 13:54:33 -07:00
Kartik Agaram d29dcd1263 7050 2020-10-17 12:32:44 -07:00
Kartik Agaram ab697ede40 7049 2020-10-17 11:50:43 -07:00
Kartik Agaram e3d6e067c6 7048 2020-10-17 11:48:13 -07:00
Kartik Agaram 302082ab70 7047 2020-10-17 11:45:37 -07:00
Kartik Agaram 5f8c473c55 7046 - start of flow for naming words
Names don't stick yet, but we have a scaffolding for printing a dialog
and accepting input.
2020-10-17 11:40:29 -07:00
Kartik Agaram 2dd300eb20 7045 2020-10-16 22:46:39 -07:00
Kartik Agaram b72c5a60ff 7044 2020-10-16 22:40:40 -07:00
Kartik Agaram 7244bf99dd 7043 - the REPL is dead; long live the IVL 2020-10-16 22:29:23 -07:00
Kartik Agaram 16212c63cb 7042 2020-10-15 22:37:21 -07:00
Kartik Agaram fc1d71dd09 7039
Ok, I think we may finally be done crushing all the pesky bugs.

And now we can insert and delete words in the middle of a line, and have
expanded calls stay stable!
2020-10-15 21:22:51 -07:00