about summary refs log tree commit diff stats
path: root/chessboard.mu
Commit message (Collapse)AuthorAgeFilesLines
* 2880Kartik K. Agaram2016-04-271-4/+7
| | | | | | | | | | | Turns out we don't need a primitive to return an empty value of arbitrary type. Just create it on the heap using 'new'. But this uncovered *yet* another bug, sigh. When I specialize generic functions I was running all transforms on the generated functions after specialization completed. But there's one transform that includes code from elsewhere. If such code included type-ingredients -- kaboom. Now fixed and there's a test, so I've got that going for me which is nice.
* 2878Kartik K. Agaram2016-04-271-6/+1
|
* 2873 - fix a bug in converting conditional returnsKartik K. Agaram2016-04-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was an interaction between two transforms. The first turned: return-if ... into: jump-unless ..., 1:offset # skip next instruction return ... The second added an unconditional return at the end of the recipe if it didn't already exist (so that functions always end with a return). However, it was getting confused by the return instructions generated above, which look unconditional but sometimes get skipped. To fix this, conditional returns are now transformed into this: { break-unless ... return ... } Since the final instruction is now no longer a reply (but rather the '}' label), the second transform triggers and adds the unconditional return after it. This commit removes the final place marked 'BUG:' in the codebase yesterday (see commit 2870).
* 2870 - fix the final long-standing failing testKartik K. Agaram2016-04-271-2/+4
| | | | | | | | | | | | | | | | | The solution for avoiding deadlock is for routines to close channels before they exit. So that's good. Once I implemented 'close', I also found and fixed 2 unrelated bugs in chessboard.mu: a) one long-missed and long-masked case of forgetting to store character literals in character variables b) one typo in translating get-address to put So that's good. What's not so good: in the process of fixing this I've found three unrelated bugs (marked 'BUG:' in the changes). All three have workarounds, so existing tests pass for now. But they are my top priority next.
* 2864 - replace all address:shared with just addressKartik K. Agaram2016-04-241-51/+51
| | | | | | | Now that we no longer have non-shared addresses, we can just always track refcounts for all addresses. Phew!
* 2860 - rename 'index-address' to 'put-index'Kartik K. Agaram2016-04-231-10/+9
|
* 2845Kartik K. Agaram2016-04-161-17/+8
|
* 2798 - experiment: split channels into two endsKartik K. Agaram2016-03-191-93/+93
| | | | | | | | | | This way when you pass one end to a function or routine, you can implicitly give it the right to either read or write the channel, but not both. The cost: code gets more convoluted, names get more convoluted. You can see this in particular in the test for buffer-lines. Let's see how it goes..
* 2784 - make channels genericKartik K. Agaram2016-03-141-28/+28
| | | | | | I've ignored Mu's concurrency primitives for a while, but they're starting to return to front-and-center as I work on the file system interfaces.
* 2782 - directly use string literals everywhereKartik K. Agaram2016-03-141-31/+16
|
* 2749Kartik K. Agaram2016-03-091-12/+12
|
* 2748Kartik K. Agaram2016-03-091-10/+10
|
* 2746Kartik K. Agaram2016-03-091-3/+2
|
* 2735 - define recipes using 'def'Kartik K. Agaram2016-03-081-35/+35
| | | | | | | | | | | | I'm dropping all mention of 'recipe' terminology from the Readme. That way I hope to avoid further bike-shedding discussions while I very slowly decide on the right terminology with my students. I could be smarter in my error messages and use 'recipe' when code uses it and 'function' otherwise. But what about other words like ingredient? It would all add complexity that I'm not yet sure is worthwhile. But I do want separate experiences for veteran programmers reading about Mu on github and for people learning programming using Mu.
* 2576 - distinguish allocated addresses from othersKartik K. Agaram2016-01-191-59/+60
| | | | | | | | | | | | | | | | This is the one major refinement on the C programming model I'm planning to introduce in mu. Instead of Rust's menagerie of pointer types and static checking, I want to introduce just one new type, and use it to perform ref-counting at runtime. So far all we're doing is updating new's interface. The actual ref-counting implementation is next. One implication: I might sometimes need duplicate implementations for a recipe with allocated vs vanilla addresses of the same type. So far it seems I can get away with just always passing in allocated addresses; the situations when you want to pass an unallocated address to a recipe should be few and far between.
* 2573 - check product type of 'new'Kartik K. Agaram2016-01-191-1/+1
| | | | | | | | | | | I realize that my current doesn't allow nesting a:b:c linear type syntax inside a dilated property. So you can't currently say: (recipe address:number) Need to fix that at some point. Non-trivial since linear syntax is oblivious to dilated syntax. I should probably make the dilated syntax more fundamental and introduce it at an earlier layer.
* 2562Kartik K. Agaram2016-01-171-7/+7
| | | | | | | | | | | | We want to use the type 'recipe' for recipe *variables*, because it seems nicer to say `recipe number -> number` rather than recipe-ordinal, etc. To support this we'll allow recipe names to be mentioned without any type. This might make a couple of places in this commit more brittle. I'm dropping error messages, causing them to not happen in some situations. Maybe I should just bite the bullet and require an explicit :recipe-literal. We'll see.
* 2548 - teach 'print' to print integersKartik K. Agaram2015-12-281-1/+2
| | | | | | | | | | Still can't print non-integer numbers, so this is a bit hacky. The big consequence is that you can't print literal characters anymore because of our rules about how we pick which variant to statically dispatch to. You have to save to a character variable first. Maybe I can add an annotation to literals..
* chessboard.mu now workingKartik K. Agaram2015-12-151-3/+3
|
* 2468 - overload print-character as just 'print'Kartik K. Agaram2015-11-211-7/+7
|
* 2467 - rename 'string' to 'text' everywhereKartik K. Agaram2015-11-211-14/+14
| | | | | | | | Not entirely happy with this. Maybe we'll find a better name. But at least it's an improvement. One part I *am* happy with is renaming string-replace to replace, string-append to append, etc. Overdue, now that we have static dispatch.
* 2460 - headers for remaining recipesKartik K. Agaram2015-11-181-46/+28
|
* 2299 - check types of ingredients in callsKartik K. Agaram2015-10-281-18/+18
| | | | | | | | | | Still very incomplete: a) we perform the check at runtime b) tests for edit and sandbox apps no longer work; we can't fix them until we get type parameters in both containers and recipes (because list and list operations need to become generic).
* 2260 - start tracing by depth rather than labelKartik K. Agaram2015-10-061-1/+1
| | | | Now we can collect all traces, just modulating the depth.
* 2244Kartik K. Agaram2015-10-051-3/+3
|
* 2095Kartik K. Agaram2015-08-281-8/+0
| | | | | | | | | | | | Finally terminate the experiment of keeping debug prints around. I'm also going to give up on maintaining counts. What we really need is two kinds of tracing: a) For tests, just the domain-specific facts, organized by labels. b) For debugging, just transient dumps to stdout. b) only works if stdout is clean by default. Hmm, I think this means 'stash' should be the transient kind of trace.
* 2051Kartik K. Agaram2015-08-211-12/+12
| | | | | Forgot to fix chessboard tests during commit 2022: running sandboxes in separate routines.
* 1884Kartik K. Agaram2015-07-291-27/+0
|
* 1880 - switch .mu files to new type-deducing idiomKartik K. Agaram2015-07-291-156/+156
|
* 1869 - rename the /deref property to /lookupKartik K. Agaram2015-07-281-34/+34
| | | | Should be a little bit more mnemonic.
* 1868 - start using naked literals everywhereKartik K. Agaram2015-07-281-133/+133
| | | | First step to reducing typing burden. Next step: inferring types.
* 1808 - helper to print newlines during debuggingKartik K. Agaram2015-07-171-62/+20
| | | | | | | The recent session makes me weary of deleting comment counts from inside strings, and the newlines everywhere take up vertical space. Considered println like pascal/ruby, but I'd like something I can add/remove at the end of existing prints. So this hack for $print.
* 1780 - now we always reclaim local scopesKartik K. Agaram2015-07-131-10/+10
| | | | | | But still no difference in either memory footprint or in running time. This will teach me -- for the umpteenth time -- to optimize before measuring.
* 1773 - update all mu recipes to new-default-spaceKartik K. Agaram2015-07-131-10/+10
| | | | | Turns out to not affect memory utilization or run-time. At all. But still looks nicer and requires less fudging on our part.
* 1620Kartik K. Agaram2015-06-221-5/+18
| | | | | | | | chessboard finally passing all its tests. What made this hard was that for some reason one of the background routines in the main chessboard test wasn't terminating like it used to. And so it was polluting *later* tests. Just clean up that source of contamination for now. Later we'll think about routine termination.
* 1618Kartik K. Agaram2015-06-211-5/+5
|
* 1599Kartik K. Agaram2015-06-191-12/+12
|
* 1482Kartik K. Agaram2015-05-261-3/+2
|
* 1480Kartik K. Agaram2015-05-261-1/+1
|
* 1431Kartik K. Agaram2015-05-231-3/+3
|
* 1418 - starting trace-browser implementation in C++Kartik K. Agaram2015-05-221-1/+3
| | | | | | | | | I still have no idea how it will hook up to the rest. Parsing traces will be slow. I can't test it like this. Writing the large trace data structure to mu memory will be slow. But let's at least see the new algorithm in action. (Not in this commit; so far we just render the first n lines from the chessboard trace, and wait for a 'q' or 'Q' to quit.)
* 1408Kartik K. Agaram2015-05-191-4/+4
|
* 1401 - shave 80% off chessboard test timeKartik K. Agaram2015-05-181-0/+1
| | | | It was all going to laboriously writing out 300+ MB to disk.
* 1397 - support unicode in screen checksKartik K. Agaram2015-05-181-2/+3
|
* 1375 - cleanupKartik K. Agaram2015-05-141-4/+3
|
* 1374 - chessboard end-to-end test passes!Kartik K. Agaram2015-05-141-16/+37
| | | | | | | | | | After like 40 seconds (because of the 120-column screen), but whatever. The final bug was that clear-screen wasn't actually working right for fake screens. (The trace is too large for github, so I'm going to leave it out for now.)
* 1372 - new chessboard test no longer hangingKartik K. Agaram2015-05-141-16/+23
| | | | Still failing, though.
* 1371Kartik K. Agaram2015-05-141-16/+0
|
* 1369Kartik K. Agaram2015-05-141-17/+17
| | | | | Delete comment-out marker from inside mu strings. Have to do this manually for now.
* 1368 - alias carriage-return and newlineKartik K. Agaram2015-05-141-5/+62
| | | | | | | CRLF still shows as two newlines, though. Cross that bridge when we get to it. The new chessboard test is still hanging, though.