about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* 3243Kartik K. Agaram2016-08-221-2/+2
|
* 3242Kartik K. Agaram2016-08-221-8/+1
| | | | | | | Drop support for escape characters in dilated reagents. We haven't felt the need for it yet, we have no tests for it, and eventually when we do we want to treat escapes the way we treat them in the rest of the language. (commit 3233)
* 3241Kartik K. Agaram2016-08-211-29/+26
| | | | Use allocate() in 'assume-console'.
* 3240Kartik K. Agaram2016-08-211-8/+8
|
* 3239Kartik K. Agaram2016-08-216-12/+12
|
* 3238Kartik K. Agaram2016-08-213-7/+16
| | | | | | Clean up primitive for reading from file. Never return EOF character. Stop using null character to indicate EOF as well. Instead, always use a second product to indicate EOF, and require calls to use it.
* 3237Kartik K. Agaram2016-08-212-2/+38
| | | | | | | | More checks for unsafe filesystem primitives. Most important, make sure the product of any $close-file instruction is never ignored, and that it's the same variable as the ingredient. (No way to indicate that in Mu code yet, but then Mu code should always be safe and not require such checks.)
* 3236Kartik K. Agaram2016-08-211-5/+0
|
* 3235Kartik K. Agaram2016-08-2013-26/+427
|
* 3234Kartik K. Agaram2016-08-202-1/+6
| | | | Fix some breaking sandbox/ tests.
* 3233 - change how Mu escapes stringsKartik K. Agaram2016-08-204-18/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks Sam Putman for helping think through this idea. When you encounter a backslash, strip it out and pass through any following run of backslashes. If we 'escaped' a single following character like C, then the character '\' would be the same as: '\\' escaped once '\\\\' escaped twice '\\\\\\\\' escaped thrice (8 backslashes) ..and so on, the number of backslashes doubling each time. Instead, our approach is to make the character '\' the same as: '\\' escaped once '\\\' escaped twice '\\\\' escaped thrice ..and so on, the number of backslashes merely increasing by one each time. This approach only works as long as backslashes aren't also overloaded to create special characters. So Mu doesn't follow C's approach of overloading backslashes both to escape quote characters and also as a notation for unprintable characters like '\n'.
* 3232Kartik K. Agaram2016-08-201-1/+34
| | | | Support pipe characters in fake files. Still super ugly, though.
* 3231 - reading from fake files in scenariosKartik K. Agaram2016-08-203-4/+68
|
* 3230Kartik K. Agaram2016-08-203-0/+0
|
* 3229 - fake file systems using 'assume-filesystem'Kartik K. Agaram2016-08-204-7/+223
| | | | Built with Stephen Malina.
* 3228Kartik K. Agaram2016-08-191-1/+1
|
* 3227Kartik K. Agaram2016-08-189-32/+55
|
* 3226Kartik K. Agaram2016-08-181-3/+3
|
* 3225 - testable interface for writing filesKartik K. Agaram2016-08-184-15/+41
| | | | | | | | 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.
* 3224Kartik K. Agaram2016-08-182-8/+3
|
* 3223Kartik K. Agaram2016-08-182-5/+4
|
* 3222Kartik K. Agaram2016-08-181-0/+4
| | | | | | | | | | | | | Commit 3191 stopped defining _XOPEN_SOURCE when building termbox/ to get Mu to build on OpenBSD. However, that had the side effect of not declaring the prototype for wcwidth() on some versions of Linux. Ugh. Just hack around this morass. In general the direction we want to go in Mu is fewer feature #defines. At least explicit ones. Should be an internal detail of the underlying platform our code shouldn't have to worry about. If headers don't cooperate, just start explicitly declaring prototypes and damn the consequences.
* 3221Kartik K. Agaram2016-08-181-3/+3
|
* 3220 - delete gh-pages branchKartik K. Agaram2016-08-171-11/+0
|
* 3219Kartik K. Agaram2016-08-1732-217/+767
| | | | | | | | Trying keeping html in the master branch: https://github.com/blog/2228-simpler-github-pages-publishing Let's see if https://akkartik.github.io/mu updates after I push this commit to just the master branch.
* 3218Kartik K. Agaram2016-08-172-0/+14
| | | | | | Fix CI. Scenario size_of_shape_shifting_exclusive_container was triggering undefined behavior in tangle/ and causing things to break in some compilers but not others.
* 3217Kartik K. Agaram2016-08-172-4/+4
| | | | Fix a new warning from Perl.
* 3216Kartik K. Agaram2016-08-171-1/+31
| | | | | | | | | | | | | | | | | | | Another hole in refcount management, which I noticed while doing commit 3202, and thinking about which led to the insight of commit 3212. Now the summary of commit 3197 is modified to this: Update refcounts of products after every instruction, EXCEPT: a) when instruction is a non-primitive and the callee starts with 'local-scope' (because it's already not decremented in 'return') OR: b) when instruction is primitive 'next-ingredient' or 'next-ingredient-without-typechecking', and its result is saved to a variable in the default space (because it's already incremented at the time of the call)
* 3215Kartik K. Agaram2016-08-171-3/+3
|
* 3214Kartik K. Agaram2016-08-172-1/+4
|
* 3213Kartik K. Agaram2016-08-171-2/+1
|
* 3212 - bugfix in refcount managementKartik K. Agaram2016-08-175-68/+99
| | | | | | | | | | | When updating refcounts for a typed segment of memory being copied over with another, we were only ever using the new copy's data to determine any tags for exclusive containers. Looks like the right way to do refcounts is to increment and decrement separately. Hopefully this is a complete fix for the intermittent but non-deterministic errors we've been encountering while running the edit/ app.
* 3211Kartik K. Agaram2016-08-172-2/+2
|
* 3210 - new primitive: character-to-codeKartik K. Agaram2016-08-173-0/+44
| | | | Thanks Ella Couch; this was long overdue.
* 3209Kartik K. Agaram2016-08-175-9/+9
|
* 3208Kartik K. Agaram2016-08-161-28/+12
|
* 3207Kartik K. Agaram2016-08-161-0/+17
|
* 3206Kartik K. Agaram2016-08-161-1/+1
|
* 3205Kartik K. Agaram2016-08-161-13/+13
|
* 3204Kartik K. Agaram2016-08-161-1/+4
| | | | Fix CI.
* 3203 - testable interface for reading a fileKartik K. Agaram2016-08-162-0/+47
| | | | | This commit was written by Stephen Malina. Thanks also to Stephen for running into the bug of commit 3202.
* 3202 - bugfix: 'start-running' and refcountsKartik K. Agaram2016-08-165-7/+75
| | | | | | | | | | | | | | | | | | | | | | When you pass an ingredient to a recipe using 'start-running' it mostly behaves identically to performing a regular function call. However, if the calling function completed before the new routine had a chance to run, the ingredients passed in ran the risk of being reclaimed. In response, let's always increment refcounts at the time of a function call rather than when the ingredients are read inside the callee. Now the summary of commit 3197 is modified to this: Update refcounts of products after every instruction, EXCEPT: a) when instruction is a non-primitive and the callee starts with 'local-scope' (because it's already not decremented in 'return') OR: b) when instruction is primitive 'next-ingredient' or 'next-ingredient-without-typechecking'
* 3201Kartik K. Agaram2016-08-162-1/+2
|
* 3200Kartik K. Agaram2016-08-162-2/+2
|
* 3199Kartik K. Agaram2016-08-164-15/+17
| | | | | | | | | Never mind, just close your nose and replace that function parameter with a global variable. This may not always be the solution for the problem of layers being unable to add parameters and arguments, but here it works well and it's unclear what problems the global might cause.
* 3198Kartik K. Agaram2016-08-161-15/+16
|
* 3197Kartik K. Agaram2016-08-164-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace an integer with a boolean across two layers of function calls. It has long been one of the ugliest consequences of my approach with layers that functions might need to be introduced with unnecessary arguments simply because we have no clean way to add parameters to a function definition after the fact -- or to add the default argument corresponding to that parameter in calls. This problem is exacerbated by the redundant argument having to be passed in through multiple layers of functions. In this instance: In layer 20 we define write_memory with an argument called 'saving_instruction_products' which isn't used yet. In layer 36 we reveal that we use this argument in a call to should_update_refcounts_in_write_memory() -- where it is again not used yet. Layer 43 finally clarifies what we're shooting for: a) In general when we need to update some memory, we always want to update refcounts. b) The only exception is when we're reclaiming locals in a function that set up its stack frame using 'local-scope' (signalling that it wants immediate reclamation). At that point we avoid decrementing refcounts of 'escaping' addresses that are being returned, and we also avoid incrementing refcounts of products in the caller instruction. The latter case is basically why we need this boolean and its dance across 3 layers. In summary, write_memory() needs to update refcounts except if: we're writing products for an instruction, the instruction is not a primitive, and the (callee) recipe for the instruction starts with 'local-scope'.
* 3196Kartik K. Agaram2016-08-162-2/+2
|
* 3195Kartik K. Agaram2016-08-161-0/+3
|
* 3194Kartik K. Agaram2016-08-161-2/+2
|