Commit Graph

187 Commits

Author SHA1 Message Date
Kartik K. Agaram
2e818ac82f 338 - starting to work on string primitives 2014-11-26 22:30:32 -08:00
Kartik K. Agaram
88edf1ba2f 337 - rename 'continue' instructions to 'loop' 2014-11-26 22:09:23 -08:00
Kartik K. Agaram
f05a31fcdd 335 - tangle at labels scoped to functions 2014-11-26 21:36:24 -08:00
Kartik K. Agaram
f7bbc9b317 334 2014-11-26 19:51:29 -08:00
Kartik K. Agaram
34b6a2faff 333 2014-11-26 19:50:40 -08:00
Kartik K. Agaram
c1b2f17fcf 323 - function clauses
You can now call 'def' on a function name multiple times. Each time the
instructions you provide are *prepended* to any existing instructions.

One important use for this is when you define a new type and need to
support it in all your generic methods. Now you can keep all those
extensions in one place, near the definition of the type.

To redefine a function, use 'def!'.
2014-11-24 22:51:03 -08:00
Kartik K. Agaram
371925c3d5 322 2014-11-24 22:43:47 -08:00
Kartik K. Agaram
a37494eb58 321 - before/after can now come anywhere
This pollutes our traces with all 'system software'. Too much trouble to
keep it out; just lump it for now. Who knows, might even be useful. Most
of the time convert* labels are easy to grep out when debugging.
2014-11-24 22:37:35 -08:00
Kartik K. Agaram
4feb3daf81 319 - ack, forgot to handle blocks when tangling
Will the 'lightweight tools' really be all that useable if we encourage
people to layer them one atop another and track precisely what inputs
each can accept? Something to keep an eye on.

In the meanwhile, we have a new (but very unrealistic) example
demonstrating the tangling directives.

There's still a big constraint on ordering: before/after clauses have to
come before functions that need them.
2014-11-24 22:11:46 -08:00
Kartik K. Agaram
80a63c05e9 316 2014-11-24 21:46:21 -08:00
Kartik K. Agaram
55b99d0cb9 315 - handle before/after uniformly like def 2014-11-24 21:40:59 -08:00
Kartik K. Agaram
cb9e66d70b 314 - better syntax for functions 2014-11-24 21:12:23 -08:00
Kartik K. Agaram
638ff3b1b8 313 - tangling primitives 2014-11-24 20:09:17 -08:00
Kartik K. Agaram
89b17724fe 312 2014-11-24 18:56:15 -08:00
Kartik K. Agaram
d69fd246f2 311 2014-11-24 18:52:15 -08:00
Kartik K. Agaram
cffff885c8 310 2014-11-24 15:22:06 -08:00
Kartik K. Agaram
7bb51ea91e 306 - 'sleep' now watches for changes to a location
This simplifies things a lot and eliminates the race condition.

I think it's practical too, as long as you save a single location and
don't permit sleeping on compound structures. I'm resigned to needing a
lock in the native setting.

Should I be concerned that I fixed a failing test by getting rid of hit?

If I had alternatives, how would I save the old sleep implementation?
2014-11-23 08:49:34 -08:00
Kartik K. Agaram
b437f7aee1 304 - a unit test for a race condition
Still failing, but worth memorializing for posterity.

Race condition tests are still experimental, even more tied to a very
specific implementation. If I make changes to 'write' the very
'wipe-read' label will go away.

But then you just delete all tests relying on stale labels and try to
think up new race conditions.
2014-11-23 07:19:14 -08:00
Kartik K. Agaram
019444d597 300 - missed a spot
Also uncovered a bug in convert-braces, which helps see a simpler
close-offset. Instead of all that crap with first incrementing then
waiting for counter to return to 0, just wait for counter to go to -1.
2014-11-23 06:11:38 -08:00
Kartik K. Agaram
1ced22ded9 299 - labels inside functions 2014-11-22 22:26:11 -08:00
Kartik K. Agaram
69ed99172c 298 2014-11-22 21:15:38 -08:00
Kartik K. Agaram
d5bb1bfb19 296 - finally, shared a channel between routines
Was already working, test was just stale. Reassuring.
2014-11-22 00:58:45 -08:00
Kartik K. Agaram
5cd7cebefa 294 - read/write now pass channel by reference
But handoff test still failing.
2014-11-22 00:31:31 -08:00
Kartik K. Agaram
85974128f4 293 - unit test for misplaced deadlock 2014-11-22 00:22:22 -08:00
Kartik K. Agaram
bd73a6ffe2 292 - back to state of commit 276
What have we learned?

  a) You can't detect deadlock between running a thread and waking up
  sleeping threads -- you may miss threads that are about to become
  available.

  b) Most of the context-switching code in 'run' shouldn't assume
  routine* is correctly set. That's just for 'run-for-time-slice' and
  for checking on blocked threads. I was implicitly requiring it when I
  shouldn't, and not setting it when checking blocked threads.

Before I fix the next failing test I want to write unit tests for a)
above.
2014-11-22 00:12:44 -08:00
Kartik K. Agaram
51370addc9 291 - figured out the channel-handoff problem
'read' and 'write' pass in the channel by value, so they block on
different *local* variables.

Does this kill my plan to pervasively use call-by-value everywhere? No,
we might be able to salvage it if channels are the only shared pointers.
2014-11-21 23:45:18 -08:00
Kartik K. Agaram
527a0ebef8 290 - how was channel-write-block *ever* working?!
Oh right, because I wasn't using default-scope when checking to wake up.
2014-11-21 21:37:22 -08:00
Kartik K. Agaram
4a007fd922 289 - finally back to deadlock detection 2014-11-21 20:47:48 -08:00
Kartik K. Agaram
672cda7e1c 288 - support sleeping while watching a memory location 2014-11-21 20:37:32 -08:00
Kartik K. Agaram
4b1be76c4c 283 2014-11-21 19:29:37 -08:00
Kartik K. Agaram
58ad6023b5 282 - scheduler skips ahead when all routines are asleep 2014-11-21 18:45:46 -08:00
Kartik K. Agaram
95b57986d0 281 2014-11-21 18:21:15 -08:00
Kartik K. Agaram
913c4b5f15 280 - waking up sleeping routines
Tests still hanging at some point.
2014-11-21 15:07:33 -08:00
Kartik K. Agaram
e9e28f5c00 277 - back up, start refactoring the scheduler
In trying to share pipes between routines, I realized my scheduler was
actually quite brittle. Changing scheduling-interval* shouldn't be
required in most tests, and shouldn't change the outcome most of the
time.

Current state: all scheduler tests fail, but everything else passes.
2014-11-21 14:38:11 -08:00
Kartik K. Agaram
c2c0d3a1e8 276 - now fork can take any args
No oargs, though. Hopefully we don't need them. Use channels for
passing data back.

Drawback: channels must all be passed in by value, and their direction
isn't obvious. Hard to tell when multiple threads read/write the same
channel. Hopefully it's amenable to static analysis.
2014-11-19 00:32:49 -08:00
Kartik K. Agaram
e0bf118825 275 - pass args to fork
Only literals for starters.
2014-11-19 00:23:48 -08:00
Kartik K. Agaram
38e51bc617 274 - long overdue test for 'fork' 2014-11-19 00:11:05 -08:00
Kartik K. Agaram
ea36397b50 267 - more intuitive channel capacity 2014-11-15 14:58:58 -08:00
Kartik K. Agaram
44de0079e5 266 - update html 2014-11-09 18:23:05 -08:00
Kartik K. Agaram
cd9fd50952 260 2014-11-08 09:26:18 -08:00
Kartik K. Agaram
643f35e5c5 259 - finally channel read/write can cause routine to sleep 2014-11-07 21:39:00 -08:00
Kartik K. Agaram
66741bc8ef 258 - new channel helpers: empty? and full? 2014-11-07 14:09:59 -08:00
Kartik K. Agaram
0a52288c41 257 - cleanup the narrative in mu.arc.t 2014-11-07 13:02:27 -08:00
Kartik K. Agaram
c8965db98b 256 - channel pointers can now wrap 2014-11-07 12:33:12 -08:00
Kartik K. Agaram
dd2c774407 255
As per 248, ignoring output values can reduce some of the pressure of
dealing with raw locations.
2014-11-07 12:04:52 -08:00
Kartik K. Agaram
0ecba1bcb1 250 - experimental support for _ oarg
This radically overhauls our assumption that args must always be lists,
so we're probably missing things. Where we do, more tests are required.

Only important trace change: .traces/dummy-oarg
2014-11-07 11:50:41 -08:00
Kartik K. Agaram
d08f480fde 248
I've been using raw locations to make tests easy to read (test checks
the same locations that code modifies). But this means I have to manage
them myself, and I've been shoving variables into the storage for
compounds like tagged-value. Doesn't matter in this case since we don't
look at the contents of the tagged-value, but still unhygienic.

Maybe we need syntax for ignoring some output values?
2014-11-07 11:06:57 -08:00
Kartik K. Agaram
d430ce7c3d 247 2014-11-07 00:59:23 -08:00
Kartik K. Agaram
0c62881a6f 246 2014-11-07 00:56:42 -08:00
Kartik K. Agaram
e4821af3f8 245 - sanity check for type table 2014-11-06 21:45:07 -08:00