about summary refs log tree commit diff stats
path: root/apps/calls
Commit message (Collapse)AuthorAgeFilesLines
* 7329 - snapshot: advent day 4 part 2Kartik Agaram2020-12-041-0/+0
| | | | | | | | | | | | I've found two bugs in SubX libraries: 1. next-word had an out-of-bounds read 2. next-word was skipping comments, because that's what I need during bootstrapping. I've created a new variant called next-raw-word that doesn't skip comments. These really need better names. We're now at the point where 4b.mu has the right structure and returns identical result to 4a.mu.
* 7238 - mu.subx: final restrictions on 'addr'Kartik Agaram2020-11-151-0/+0
| | | | I had to tweak one app that wasn't following the rules.
* 7231Kartik Agaram2020-11-121-0/+0
|
* 7225Kartik Agaram2020-11-111-0/+0
| | | | | | | Both manual tests described in commit 7222 now work. To make them work I had to figure out how to copy a file. It requires a dependency on a new syscall: lseek.
* 7173Kartik Agaram2020-11-031-0/+0
| | | | All tests passing again.
* 7138 - type-check array 'length' instructionKartik Agaram2020-10-291-0/+0
|
* 7101 - tile: remove quotes when evaluating stringsKartik Agaram2020-10-251-0/+0
| | | | This found several bugs due to me not checking for null strings.
* 6946 - print floats somewhat intuitively in hexKartik Agaram2020-10-041-0/+0
|
* 6943Kartik Agaram2020-10-041-0/+0
| | | | | | | | Move some implementation around for floating-point. I originally thought I wouldn't bother supporting sigils like %xmm0. But it turns out I need them to pass floats into SubX function calls. And it turns out the sigils work fine for free.
* 6908 - compiling all floating-point operationsKartik Agaram2020-09-301-0/+0
| | | | | We don't yet support emulating these instructions in `bootstrap`. But generated binaries containing them run natively just fine.
* 6902Kartik Agaram2020-09-291-0/+0
|
* 6898 - names for floating-point xmm* registersKartik Agaram2020-09-291-0/+0
|
* 6783Kartik Agaram2020-09-161-0/+0
| | | | An extra test that should have been in commit 6781.
* 6781 - new app: RPN (postfix) calculatorKartik Agaram2020-09-151-0/+0
| | | | This was surprisingly hard; bugs discovered all over the place.
* 6733 - read utf-8 'grapheme' from byte streamKartik Agaram2020-08-281-0/+0
| | | | | | No support for combining characters. Graphemes are currently just utf-8 encodings of a single Unicode code-point. No support for code-points that require more than 32 bits in utf-8.
* 6719 - error-checking for 'index' instructionsKartik Agaram2020-08-211-0/+0
| | | | | | | | 1000+ LoC spent; just 300+ excluding tests. Still one known gap; we don't check the entirety of an array's element type if it's a compound. So far we just check if say both sides start with 'addr'. Obviously that's not good enough.
* 6622 - new syscalls: time and ntimeKartik Agaram2020-07-081-0/+0
| | | | | As a side-effect I find that my Linode can print ~100k chars/s. At 50 rows and 200 columns per screen, it's 10 frames/s.
* 6604 - new appKartik Agaram2020-07-011-0/+0
| | | | | | https://archive.org/details/akkartik-2min-2020-07-01 In the process I found a bug, added a new syscall, and 'emulated' it.
* 6597Kartik Agaram2020-06-291-0/+0
|
* 6596Kartik Agaram2020-06-291-0/+0
|
* 6595Kartik Agaram2020-06-291-0/+0
|
* 6594 - start standardizing the meaning of 'print'Kartik Agaram2020-06-291-0/+0
|
* 6528Kartik Agaram2020-06-151-0/+0
|
* 6520 - new app: parse-intKartik Agaram2020-06-141-0/+0
| | | | | | Several bugs fixed in the process, and expectation of further bugs is growing. I'd somehow started assuming I don't need to have separate cases for rm32 as a register vs mem. That's not right. We might need more reg-reg Primitives.
* 6508 - support null exit-descriptorKartik Agaram2020-06-101-0/+0
|
* 6507 - use syscall names everywhereKartik Agaram2020-06-101-0/+0
|
* 6409 - primitives for text-mode UIsKartik Agaram2020-05-271-0/+0
|
* 6406 - primitive 'copy-handle'Kartik Agaram2020-05-251-0/+0
|
* 6382 - re-enable mu.subx in CIKartik Agaram2020-05-221-0/+0
| | | | | | | | | | | I thought I'd done this in the previous commit, but I hadn't. And, what's more, there was a bug that seemed pretty tough for a time. Turns out my self-hosted translator doesn't support '.' comment tokens in data segments. Hopefully I'm past the valley of the shadow of death now. "I HAVE NO TOOLS BECAUSE I’VE DESTROYED MY TOOLS WITH MY TOOLS." -- James Mickens (https://www.usenix.org/system/files/1311_05-08_mickens.pdf)
* update binariesKartik Agaram2020-05-221-0/+0
| | | | CI should start passing again now.
* handle nulls in lookupKartik Agaram2020-05-181-0/+0
| | | | | | | | | Cleaner abstraction, but adds 3 instructions to our overhead for handles, including one potentially-hard-to-predict jump :/ I wish I could have put the alloc id in eax for the comparison as well, to save a few bytes of instruction space. But that messes up the non-null case.
* all syntax sugar now workingKartik Agaram2020-05-181-0/+0
| | | | | | | | I just needed to adjust row-sizes when accessing the Registers table. This commit dedicated to a fun hour on https://hn.town.siempre.io. Thanks Cyrus! (via https://news.ycombinator.com/item?id=22818300)
* 6208Kartik Agaram2020-04-221-0/+0
|
* 6182 - start of support for safe handlesKartik Agaram2020-04-031-0/+0
| | | | | | | | | | | | | | So far it's unclear how to do this in a series of small commits. Still nibbling around the edges. In this commit we standardize some terminology: The length of an array or stream is denominated in the high-level elements. The _size_ is denominated in bytes. The thing we encode into the type is always the size, not the length. There's still an open question of what to do about the Mu `length` operator. I'd like to modify it to provide the length. Currently it provides the size. If I can't fix that I'll rename it.
* 6181Kartik Agaram2020-04-031-0/+0
|
* 6153 - switch 'main' to use Mu stringsKartik Agaram2020-03-151-0/+0
| | | | | | | | | | | At the SubX level we have to put up with null-terminated kernel strings for commandline args. But so far we haven't done much with them. Rather than try to support them we'll just convert them transparently to standard length-prefixed strings. In the process I realized that it's not quite right to treat the combination of argc and argv as an array of kernel strings. Argc counts the number of elements, whereas the length of an array is usually denominated in bytes.
* 6126 - support 8-byte register namesKartik Agaram2020-03-111-0/+0
| | | | Using these is quite unsafe. But what isn't, here?
* 6094 - new 'compute-offset' instructionKartik Agaram2020-03-071-0/+0
| | | | | | | | | | | | | | | | | | | | | | | If indexing into a type with power-of-2-sized elements we can access them in one instruction: x/reg1: (addr int) <- index A/reg2: (addr array int), idx/reg3: int This translates to a single instruction because x86 instructions support an addressing mode with left-shifts. For non-powers-of-2, however, we need a multiply. To keep things type-safe, it is performed like this: x/reg1: (offset T) <- compute-offset A: (addr array T), idx: int y/reg2: (addr T) <- index A, x An offset is just an int that is guaranteed to be a multiple of size-of(T). Offsets can only be used in index instructions, and the types will eventually be required to line up. In the process, I have to expand Input-size because mu.subx is growing big.
* 6085Kartik Agaram2020-03-061-0/+0
| | | | Support parsing ints from strings rather than slices.
* 6083Kartik Agaram2020-03-061-0/+0
|
* 6070Kartik Agaram2020-02-291-0/+0
|
* 6064Kartik Agaram2020-02-271-0/+0
| | | | Fix CI.
* 6046Kartik Agaram2020-02-211-0/+0
| | | | One more error condition when desugaring function calls in SubX.
* 6000 - clean up after no-local branchesKartik Agaram2020-02-091-0/+0
|
* 5999Kartik Agaram2020-02-091-0/+0
| | | | | Fix CI. apps/survey was running out of space in the trace segment when translating apps/mu.subx
* 5948 - branching to named blocksKartik Agaram2020-01-291-0/+0
|
* 5933Kartik Agaram2020-01-271-0/+0
| | | | Expand some buffer sizes to continue building mu.subx natively.
* 5903Kartik Agaram2020-01-191-0/+0
|
* 5898 - strengthen slice-empty? checkKartik Agaram2020-01-191-0/+0
| | | | | | | | | | | Anytime we create a slice, the first check tends to be whether it's empty. If we handle ill-formed slices here where start > end, that provides a measure of safety. In the Mu translator (mu.subx) we often check for a trailing ':' or ',' and decrement slice->end to ignore it. But that could conceivably yield ill-formed slices if the slice started out empty. Now we make sure we never operate on such ill-formed slices.
* 5887 - reorganize libraryKartik Agaram2020-01-141-0/+0
| | | | | | | Layers 0-89 are used in self-hosting SubX. Layers 90-99 are not needed for self-hosting SubX, and therefore could use transitional levels of syntax sugar. Layers 100 and up use all SubX syntax sugar.