about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* 3193Kartik K. Agaram2016-08-161-1/+19
| | | | | | | | | | | Bugfix: 'restart' should never restart completed routines. They will often have nothing to run. I ran into this while considering whether 'read' on channels to return true on success or failure. Switching from 'fail?' to 'success?' crashed. But now that it's fixed I think I'll keep things the way they are. No reason to be consistent with 'next-ingredient' and have the status be true to signal success.
* 3192Kartik K. Agaram2016-08-162-28/+28
|
* 3191 - now builds on OpenBSDKartik K. Agaram2016-08-161-1/+1
| | | | | | Looks like the _XOPEN_SOURCE #define isn't needed in termbox anymore, at least after I removed some features from it that I don't need. All it was doing is hiding SIGWINCH and likely other names as well.
* 3190Kartik K. Agaram2016-08-161-2/+7
| | | | | | | | | | | | I'm seeing *extremely* rare crashes due to some problem with negative refcounts in the edit/ app. It's not using any concurrency at all, so that's not the issue. Setting a tripwire to try and catch it. I'm going to run: mu --trace edit ..all the time for a while. And periodically restart when the trace makes the program too sluggish to continue.
* 3189Kartik K. Agaram2016-08-141-2/+1
|
* 3188Kartik K. Agaram2016-08-141-2/+2
|
* 3187Kartik K. Agaram2016-08-141-0/+0
|
* 3186 - handle 'new-buffer' without ingredientsKartik K. Agaram2016-08-141-0/+14
|
* 3185Kartik K. Agaram2016-08-141-1/+1
|
* 3184Kartik K. Agaram2016-08-141-0/+2
| | | | Fix CI. How does it work on my Mac without explicitly including errno?
* 3183 - cleanupKartik K. Agaram2016-08-132-39/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | - New plan Primitives: $open-file-for-reading $open-file-for-writing $read-from-file $write-to-file $close-file The '$' prefix indicates that none of these are intended to be used directly since they rely on type-system-busting numbers. Also that they are just temporary hacks depending on primitives provided by the host system. A putative 'Mu machine' would have very different primitives. Testable interfaces: - start-reading: starts a routine to read from a file and returns the source where the contents will become available. - start-writing: starts a routine to write to a file and returns the sink where the contents can be provided. Both operate on the real file-system if the first 'filesystem' ingredient is 0. Once you start them up you can read/write/close the channel as usual.
* 3182 - primitives for manipulating the file systemKartik K. Agaram2016-08-132-9/+176
| | | | | | | | | | | | | | I don't know why this took so long to gel. I just needed to copy my approach to screen management: 1. primitives layer (C++): simple, non-testable, non-safe operations. 2. wrappers layer (Mu): wrap operations with dependency-injected versions that can take a fake file system. 3. scenario layer (C++): implement assume-filesystem that constructs a fake file system. 4. scenario test layer (Mu): test out assume-filesystem in a test. This commit implements step 1.
* 3181Kartik K. Agaram2016-08-132-32/+32
|
* 3180 - safer way to slurp() from fileKartik K. Agaram2016-08-131-9/+4
|
* 3179Kartik K. Agaram2016-08-131-2/+2
|
* 3178Kartik K. Agaram2016-08-133-3/+10
|
* 3177Kartik K. Agaram2016-08-132-2/+3
| | | | Systematize all the newlines while displaying test progress.