Commit Graph

25 Commits

Author SHA1 Message Date
Kartik Agaram
dd66068298 4261 - start using literals for 'true' and 'false'
They uncovered one bug: in edit/003-shortcuts.mu
  <scroll-down> was returning 0 for an address in one place where I
  thought it was returning 0 for a boolean.

Now we've eliminated this bad interaction between tangling and punning
literals.
2018-06-17 00:29:22 -07:00
Kartik Agaram
cdf2822743 4242 - get rid of refcounts entirely
We're going to lean back into the experiment of commit 4179 back in Jan.
If we delete memory it's up to us to ensure no pointers into it survive.

Since deep-copy depends on our refcounting infrastructure, it's gone as
well. So we're going to have to start watching out for pointers shared
over channels.
2018-05-12 10:22:26 -07:00
Kartik K. Agaram
4a48bedcd1 4134 - 'input' = 'ingredient' 2017-12-03 23:25:40 -08:00
Kartik K. Agaram
130596f0e0 3933 2017-06-20 10:18:03 -07:00
Kartik K. Agaram
359586f0ee 3932
Some corrections and one bugfix to channels after reviewing their
implementation with Caleb Couch.
2017-06-20 10:17:09 -07:00
Kartik K. Agaram
d6ae00788a 3828 - make buffers shape-shifting (generic) 2017-04-18 10:47:35 -07:00
Kartik K. Agaram
8bd3f99fc3 3688
Move my todos over the past couple of years into the codebase now that
it might be going dormant.

Surprising how few todos left undone!
2016-11-25 11:33:13 -08:00
Kartik K. Agaram
ef69c56c82 3608 - concurrent writes to fake file system 2016-10-29 17:06:48 -07:00
Kartik K. Agaram
ada5eb55cb 3552
Stop requiring jump instructions to explicitly provide a ':label' type
for jump targets.

This has been a source of repeated confusion for my students:
  a) They'd add the ':label' to the label definition rather than the
  jump target (label use)
  b) They'd spend time thinking about whether the initial '+' prefix was
  part of the label name.

In the process I cleaned up a couple of things:

  - the space of names is more cleanly partitioned into labels and
    non-labels (clarifying that '_' and '-' are non-label prefixes)
  - you can't use label names as regular variables anymore
  - you can infer the type of a label just from its name
2016-10-22 12:08:10 -07:00
Kartik K. Agaram
433a7c7b49 3527 2016-10-20 17:14:37 -07:00
Kartik K. Agaram
6f65d5918f 3429 - standardize Mu scenarios
A long-standing problem has been that I couldn't spread code across
'run' blocks because they were separate scopes, so I've ended up making
them effectively comments. Running code inside a 'run' block is
identical in every way to simply running the code directly. The 'run'
block is merely a visual aid to separate setup from the component under
test.

In the process I've also standardized all Mu scenarios to always run in
a local scope, and only use (raw) numeric addresses for values they want
to check later.
2016-09-28 19:48:56 -07:00
Kartik K. Agaram
59085fca60 3392
Bugfix for the "remaining bug" mentioned in commit 3391.
2016-09-17 14:15:39 -07:00
Kartik K. Agaram
a0331a9b0e 3390 2016-09-17 13:00:39 -07:00
Kartik K. Agaram
760f683f27 3389 2016-09-17 12:55:10 -07:00
Kartik K. Agaram
17622b5a39 3387 2016-09-17 10:32:16 -07:00
Kartik K. Agaram
7a84094adb 3385 2016-09-17 10:28:25 -07:00
Kartik K. Agaram
08f4628e8b 3379
Can't use type abbreviations inside 'memory-should-contain'.
2016-09-17 00:31:55 -07:00
Kartik K. Agaram
05fe4be58a 3353
Fix failing scenarios in channel layer. We do so by introducing a kludgy
new instruction to explicitly signal when a routine is stuck ('blocked')
and waiting on another.

All this locking and blocking may well be a crap design. We'll see if we
find ourselves using these primitives again. Ideally we don't need them
for anything else now that we're done building channels.

Still some failing scenarios left in chessboard.mu. Let's see how that
goes.
2016-09-15 00:48:55 -07:00
Kartik K. Agaram
f8e6e864d8 3351 - new but incomplete synchronization setup
Previously our channels were based on an unconventional
`wait-for-location` primitive that waits for a specific address to
change its contents. This only works as long as a channel has a single
reader and a single writer routine. To support multiple readers and
writers we switch to a more conventional compare-and-set primitive.

There's still a couple of failing scenarios, though -- the ones using
`wait-for-routine-to-block`, because the new approach never blocks on an
empty or full channel, just yields CPU for a time before polling. Hmm,
how to fix this?
2016-09-14 19:25:55 -07:00
Kartik K. Agaram
ea19d0dc2c 3337 - first use of type abbreviations: text
In the process I've uncover a couple of situations we don't support type
abbreviations yet. They're next.
2016-09-12 00:38:36 -07:00
Kartik K. Agaram
029a3bdf53 3258
In the process of debugging the last couple of commits (though I no
longer remember exactly how) I noticed that 'wait-for-routine' only
waits until the target routine stops running for any reason, including
when it blocks on something. That's not the synchronization primitive we
want in production code, even if it's necessary for some scenarios like
'buffer-lines-blocks-until-newline'. So we rename the old 'wait-for-routine'
primitive to 'wait-for-routine-to-block', and create a new version of
'wait-for-routine' that say callers of 'start-writing' can safely use,
because it waits until a target routine actually completes (either
successfully or not).
2016-08-26 13:27:57 -07:00
Kartik K. Agaram
ebea4c3f4a 3231 - reading from fake files in scenarios 2016-08-20 18:29:09 -07:00
Kartik K. Agaram
a621ef95f4 3225 - testable interface for writing files
For example usage of file operations, see filesystem.mu.

Is it ugly that we don't actually write to disk unless we wait for the
writing routine to exit? Maybe there's a nice way to wrap it. At any
rate, all buffering is explicit, which seems a win compared to *nix.
2016-08-18 21:09:27 -07:00
Kartik K. Agaram
3d748ce13e 3194 2016-08-16 11:37:06 -07:00
Kartik K. Agaram
b462361dbe 3154 - reorg before making 'random' more testable 2016-07-27 21:58:47 -07:00