about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* 349 - jump to labelKartik K. Agaram2014-11-272-3/+49
|
* 348Kartik K. Agaram2014-11-272-7/+7
|
* 347 - allow 'arg' channel to be rewoundKartik K. Agaram2014-11-272-9/+26
|
* 346Kartik K. Agaram2014-11-271-7/+7
|
* 345Kartik K. Agaram2014-11-272-59/+2
|
* 344 - about to give up on rewrite rulesKartik K. Agaram2014-11-273-8/+30
| | | | | | | | | | | | | | | | | I wanted to come up with some way to rewrite 'def-clause foo' to 'after foo/more-clauses', something like: rewrite def-clause [ (fn-name string-address) <- arg (label-name string-address) <- strcat (fn-name string-address deref) ("/more-clauses" literal) (body expr) <- arg reply `(after ,label-name ,body) ] But the quasiquote is still a nested expression that doesn't fit our model well. Still an open question how to do template interpolation in mu.
pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# write-int: add (the binary representation of) a single int to a stream

== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

write-int:  # out: (addr stream byte), n: int
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # . save registers
    50/push-eax
    51/push-ecx
    57/push-edi
    # edi = out
    8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           7/r32/edi   8/disp8         .                 # copy *(ebp+8) to edi
    # ecx = out->write
    8b/copy                         0/mod/indirect  7/rm32/edi    .           .             .           1/r32/ecx   .               .                 # copy *edi to ecx
    # if (out->write >= out->size) abort
    3b/compare                      1/mod/*+disp8   7/rm32/edi    .           .             .           1/r32/ecx   8/disp8         .                 # compare ecx with *(edi+8)
    7d/jump-if->=  $write-int:abort/disp8
$write-int:to-stream:
    # out->data[out->write] = n
    8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
    89/copy                         1/mod/*+disp8   4/rm32/sib    7/base/edi  1/index/ecx   .           0/r32/eax   0xc/disp8       .                 # copy eax to *(edi+ecx+12)
    # out->write += 4
    81          0/subop/add         0/mod/indirect  7/rm32/edi    .           .             .           .           .               4/imm32           # add to *edi
$write-int:end:
    # . restore registers
    5f/pop-to-edi
    59/pop-to-ecx
    58/pop-to-eax
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

$write-int:abort:
    # . _write(2/stderr, error)
    # . . push args
    68/push  "write-int: out of space\n"/imm32
    68/push  2/imm32/stderr
    # . . call
    e8/call  _write/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # . syscall(exit, 1)
    bb/copy-to-ebx  1/imm32
    e8/call  syscall_exit/disp32
    # never gets here

test-write-int-single:
    # - check that write-int writes to first int of 'stream'
    # setup
    # . clear-stream(_test-stream)
    # . . push args
    68/push  _test-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # write-int(_test-stream, "abcd")
    # . . push args
    68/push  0x64636261/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  write-int/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # check-stream-equal(_test-stream, "abcd", msg)
    # . . push args
    68/push  "F - test-write-int-single"/imm32
    68/push  "abcd"/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . end
    c3/return

test-write-byte-buffered-multiple:
    # - check that write-int correctly appends multiple writes
    # setup
    # . clear-stream(_test-stream)
    # . . push args
    68/push  _test-stream/imm32
    # . . call
    e8/call  clear-stream/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
    # write-int(_test-stream, "abcd")
    # . . push args
    68/push  0x64636261/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  write-int/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # write-int(_test-stream, "efgh")
    # . . push args
    68/push  0x68676665/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  write-int/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # check-stream-equal(_test-stream, "abcdefgh", msg)
    # . . push args
    68/push  "F - test-write-byte-buffered-multiple"/imm32
    68/push  "abcdefgh"/imm32
    68/push  _test-stream/imm32
    # . . call
    e8/call  check-stream-equal/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
    # . end
    c3/return

# . . vim:nowrap:textwidth=0
'column3'>| * 324 - more elaboration in ReadmeKartik K. Agaram2014-11-251-22/+143 | | | | | I have different prose in Readme and at the top of the tests. Let's see how hard they are to manage over time. * 323 - function clausesKartik K. Agaram2014-11-242-2/+33 | | | | | | | | | | | 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!'. * 322Kartik K. Agaram2014-11-241-12/+12 | * 321 - before/after can now come anywhereKartik K. Agaram2014-11-243-31/+35 | | | | | | 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. * 320Kartik K. Agaram2014-11-241-1/+1 | * 319 - ack, forgot to handle blocks when tanglingKartik K. Agaram2014-11-243-13/+87 | | | | | | | | | | | | 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. * 318Kartik K. Agaram2014-11-241-0/+7 | * 317Kartik K. Agaram2014-11-241-79/+83 | * 316Kartik K. Agaram2014-11-241-7/+7 | * 315 - handle before/after uniformly like defKartik K. Agaram2014-11-242-63/+89 | * 314 - better syntax for functionsKartik K. Agaram2014-11-247-412/+550 | * 313 - tangling primitivesKartik K. Agaram2014-11-242-2/+218 | * 312Kartik K. Agaram2014-11-242-7/+20 | * 311Kartik K. Agaram2014-11-242-6/+6 | * 310Kartik K. Agaram2014-11-242-10/+10 | * 309 - publish to githubKartik K. Agaram2014-11-232-120/+419 | | | | Also mirror mu.arc.t.html to the gh-pages branch. * 308 - temporarily inline charterm dependencyKartik K. Agaram2014-11-2311-0/+4154 | * 307Kartik K. Agaram2014-11-231-1/+4 | * 306 - 'sleep' now watches for changes to a locationKartik K. Agaram2014-11-232-97/+22 | | | | | | | | | | | | 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? * 305 - simplify wakeup to not require routine*Kartik K. Agaram2014-11-231-7/+2 | * 304 - a unit test for a race conditionKartik K. Agaram2014-11-232-0/+32 | | | | | | | | | | | 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. * 303Kartik K. Agaram2014-11-231-2/+2 | * 302 - now we can add some labels to 'write'Kartik K. Agaram2014-11-231-0/+2 | | | | | | | | The hope is that those labels will help us test the race condition by hooking into the scheduler. Hooking into the scheduler will complicate the task of dropping racket and running tests natively. But we'll worry about that later. * 301 - yes, close-offset simplifies nicelyKartik K. Agaram2014-11-231-18/+14 |