about summary refs log tree commit diff stats
path: root/apps/factorial.mu
Commit message (Collapse)AuthorAgeFilesLines
* 7842 - new directory organizationKartik K. Agaram2021-03-031-60/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Baremetal is now the default build target and therefore has its sources at the top-level. Baremetal programs build using the phase-2 Mu toolchain that requires a Linux kernel. This phase-2 codebase which used to be at the top-level is now under the linux/ directory. Finally, the phase-2 toolchain, while self-hosting, has a way to bootstrap from a C implementation, which is now stored in linux/bootstrap. The bootstrap C implementation uses some literate programming tools that are now in linux/bootstrap/tools. So the whole thing has gotten inverted. Each directory should build one artifact and include the main sources (along with standard library). Tools used for building it are relegated to sub-directories, even though those tools are often useful in their own right, and have had lots of interesting programs written using them. A couple of things have gotten dropped in this process: - I had old ways to run on just a Linux kernel, or with a Soso kernel. No more. - I had some old tooling for running a single test at the cursor. I haven't used that lately. Maybe I'll bring it back one day. The reorg isn't done yet. Still to do: - redo documentation everywhere. All the README files, all other markdown, particularly vocabulary.md. - clean up how-to-run comments at the start of programs everywhere - rethink what to do with the html/ directory. Do we even want to keep supporting it? In spite of these shortcomings, all the scripts at the top-level, linux/ and linux/bootstrap are working. The names of the scripts also feel reasonable. This is a good milestone to take stock at.
* 7176 - type checks for 'copy' instructionKartik Agaram2020-11-041-1/+1
|
* 7154Kartik Agaram2020-11-011-30/+26
|
* 7032Kartik Agaram2020-10-141-0/+5
|
* 7031Kartik Agaram2020-10-141-1/+1
|
* 7030Kartik Agaram2020-10-141-2/+2
|
* 7029Kartik Agaram2020-10-141-4/+7
|
* 6719 - error-checking for 'index' instructionsKartik Agaram2020-08-211-2/+2
| | | | | | | | 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.
* 6573Kartik Agaram2020-06-211-4/+4
|
* 6393 - start running .mu apps in CIKartik Agaram2020-05-241-3/+3
|
* 6392 - 'length' instruction done in all complexityKartik Agaram2020-05-241-2/+2
|
* 6153 - switch 'main' to use Mu stringsKartik Agaram2020-03-151-7/+7
| | | | | | | | | | | 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.
* 6144Kartik Agaram2020-03-141-4/+10
|
* 6143Kartik Agaram2020-03-141-0/+2
|
* 6130Kartik Agaram2020-03-111-4/+3
|
* 6076Kartik Agaram2020-03-021-20/+21
|
* 6041 - array indexing starting to workKartik Agaram2020-02-211-5/+9
| | | | | | | | | | | | | And we're using it now in factorial.mu! In the process I had to fix a couple of bugs in pointer dereferencing. There are still some limitations: a) Indexing by a literal doesn't work yet. b) Only arrays of ints supported so far. Looking ahead, I'm not sure how I can support indexing arrays by non-literals (variables in registers) unless the element size is a power of 2.
* 6026Kartik Agaram2020-02-181-7/+7
|
* 6024 - finally, commandline parsing in MuKartik Agaram2020-02-181-4/+22
|
* 6010 - starting to flesh out run-testsKartik Agaram2020-02-161-1/+1
|
* 6009 - significantly cleaner lexingKartik Agaram2020-02-161-3/+2
| | | | | | | | | This cleans up a bunch of little warts that had historically accumulated because of my bull-headedness in not designing a grammar up front. Let's see if the lack of a grammar comes up again. We now require that there be no space in variable declarations between the name and the colon separating it from its type.
* 6008Kartik Agaram2020-02-161-2/+3
| | | | | | | | Allow comments at the end of all kinds of statements. To do this I replaced all calls to next-word with next-mu-token.. except one. I'm not seeing any bugs yet, any places where comments break things. But this exception makes me nervous.
* 6006Kartik Agaram2020-02-141-2/+2
|
* 6005Kartik Agaram2020-02-141-0/+7
| | | | | | | | Support calling SubX code from Mu. I have _zero_ idea how to make this safe. Now we can start writing tests. We can't use commandline args yet. That requires support for kernel strings.
* 5954 - 'factorial' working!Kartik Agaram2020-01-291-0/+19