about summary refs log tree commit diff stats
path: root/072channel.mu
Commit message (Collapse)AuthorAgeFilesLines
* 2880Kartik K. Agaram2016-04-271-14/+20
| | | | | | | | | | | 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.
* 2879 - allow extending shape-shifting containersKartik K. Agaram2016-04-271-2/+1
|
* 2873 - fix a bug in converting conditional returnsKartik K. Agaram2016-04-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* 2872 - tangle directive spurious errors fixedKartik K. Agaram2016-04-271-19/+9
|
* 2871 - downgrade one bug and explain anotherKartik K. Agaram2016-04-271-2/+5
|
* 2870 - fix the final long-standing failing testKartik K. Agaram2016-04-271-0/+54
| | | | | | | | | | | | | | | | | 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.
* 2869Kartik K. Agaram2016-04-261-39/+39
|
* 2864 - replace all address:shared with just addressKartik K. Agaram2016-04-241-81/+81
| | | | | | | 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-2/+1
|
* 2859 - rename 'get-address' to 'get-location'Kartik K. Agaram2016-04-231-2/+2
| | | | | | This reinfoces that it's only really intended to be used by 'wait-for-location'. To reinforce that we also move it to the same layer as 'wait-for-location'.
* 2840Kartik K. Agaram2016-04-161-3/+3
|
* 2835 - continue replacing 'get-address' with 'put'Kartik K. Agaram2016-04-151-14/+21
| | | | | | | | | | I have a tack now for issue 2 of 2829 (dealing with wait-for-location): have get-address and index-address return a type that can't be looked up. That way the worst that can happen with an address pointing to a freed location is a routine that randomly hangs and starts working again. And even that won't happen if you disallow transferring the new type across routines in ingredients or channels, just like I plan to do with 'address:shared'.
* 2834 - make 'wait-for-location' more intuitiveKartik K. Agaram2016-04-151-2/+2
| | | | | | | Previously to watch an address we had to perform a lookup of it, which the instruction then proceeded to undo. This way wait-for-instruction no longer supports literal ingredients, but the real-world usage becomes cleaner.
* 2829 - issues while switching to 'put'Kartik K. Agaram2016-04-101-13/+6
| | | | | | | | | | | | | | | | 1. It turns out we couldn't overload 'get' and 'get-address' until now, because transform_names looks for those names, and the resolve_ambiguous_calls transform happens before transform_names. Why does resolve_ambiguous_calls happen before transform_names? Because if my students made mistakes in the ingredients to an instruction they got overzealous errors from resolve_ambiguous_calls. Now this impacts 'put' as well, which is already overloaded for tables. Not sure what to do about this; I'm going to go back to the overzealous errors, and just teach students to visually scan past them for now. 2. I need addresses in a third place besides storing to containers and arrays, and managing the heap -- to synchronize routines. wait-for-location requires an address. Not sure what to do about this..
* 2798 - experiment: split channels into two endsKartik K. Agaram2016-03-191-94/+123
| | | | | | | | | | 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..
* 2794Kartik K. Agaram2016-03-191-40/+40
| | | | Arrange for tests to run multiple variants of channel functions.
* 2793 - more fixes to make channels genericKartik K. Agaram2016-03-191-8/+8
| | | | Finally..
* 2788Kartik K. Agaram2016-03-171-5/+5
|
* 2787Kartik K. Agaram2016-03-171-2/+2
| | | | | | *Really* make channels generic. I'd fixed all the call sites in 2785, but forgotten to actually switch the declaration. It works though; generics working smoothly.
* 2784 - make channels genericKartik K. Agaram2016-03-141-60/+60
| | | | | | 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.
* 2778 - fix all layersKartik K. Agaram2016-03-141-0/+357