| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
It's bad enough that metadata comments are restricted to integer literals;
let's at least make them work on _all_ integer literals.
|
|
|
|
| |
Convert comments about magic constants into metadata.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
A tiny modicum of reuse amidst all this copypasta: I'm able to reuse the
same function that renders lines without stacks in the sandbox.
|
|
|
|
|
| |
Still a bug in cursor positioning. It's always shown at the start of the
function body.
|
|
|
|
| |
Still can't edit functions, but we're getting there.
|
|
|
|
|
|
|
|
|
| |
In particular, I'm starting to have opinions about how to scalably position
the cursor at the end of each frame.
One advantage of text mode without a pointer device (mouse/trackpad): only
one cursor to track. UI can't be modified anywhere. That simplifies any
reactive UI framework.
|
|
|
|
| |
We can't yet edit the function once we jump to it.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Also square roots.
But there's a bug in rendering floats without precision.
|
| |
|
| |
|
|
|
|
|
|
|
| |
I've wrestled for a long time with how to support integer division with
its hard-coded registers. The answer's always been staring me in the face:
just turn it into a function! We already expect function outputs to go
to hard-coded registers.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Minor tweaks to get Mu shell running nicely on a Linux console atop Qemu.
We also need to switch a few 256-color codes to 8-color mode. I'm not
sure whether/how to patch the repo for those.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ok, I found a failing manual test for files as well.
Here are the two steelman tests, one for screens and one for files:
1.
5 5 fake-screen =s
s 1 down 1 right
ctrl-d foo
expand
final state:
s foo foo
s 1 down 1 right ⇗
┌─────┐ ┌─────┐
┌─────┐ 1 ┌─────┐ 1 ┌─────┐ │
┌─────┐ │ ┌─────┐ │ ─
│ │
│ │
─
└─────┘ └─────┘
└─────┘ └─────┘ └─────┘
└─────┘ └─────┘
2.
"x" open =f
f read f read
ctrl-d read2
expand
final state:
f read2 read2
f read f read ⇗
FILE ❝def❞
FILE ❝abc❞ FILE ❝❞
❝def❞ ❝ghi❞
In both cases there are 3 levels of issues:
- getting a single-line expression to work
- getting a single-line expression to work when operating on a binding
defined in a previous line
- getting an expanded function call to work
The third is where the rub is right now. And what both examples above share
is that the function performs 2 mutations to the screen/file.
So we need a deep copy after all. And it's not very clear how to copy a
file descriptor including the seek location. Linux's dup() syscall creates
an alias to the file descriptor. And opening /proc seems awfully Linux-specific:
https://stackoverflow.com/questions/54727231/duplicating-file-descriptor-and-seeking-through-both-of-them-independently/54727424#54727424
|
|
|
|
|
| |
I can't get file values to exhibit the same problem. Why are fake screens
special?
|
|
|
|
|
|
|
|
|
| |
Even this isn't enough. While shallow copies keep us from transferring
new bindings to callers, the screen object is still the same, so mutations
to bindings are contagious.
Basically I'm losing IQ points from programming in a language that encourages
mutation over copying.
|
|
|
|
| |
We're still busted, but on the right track.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug was incredibly painful to track down: the one-line fix is to replace
'line' with 'first-line' in the call to 'evaluate' in render-line before
recursing.
Things that made it challenging:
- A high degree of coiling with recursive calls and multiple places of
evaluation.
- An accidental aliasing in bindings (when rendering the main column in
render-line) that masked the underlying bug and made things seem to work
most of the time.
- Too many fucking arguments to render-line, a maze of twisty line objects
all alike.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Attempt #3: always create a copy of the bindings before each column/evaluate.
The details are fuzzy in my head, but it seemed worth trying. I figured
I'd either see the old duplication behavior or everything will work. Instead
I'm seeing new problems.
commit 7208:
5 5 fake-screen =s
s 1 down 1 right
expected:
|
-
observed:
|
|
-
commit 7210-7212:
5 5 fake-screen =s
s 1 down 1 right
[define foo]
s foo
[expand foo]
observed: no bindings available when rendering foo expanded
commit 7213:
5 5 fake-screen =s
s 1 down 1 right
[define foo]
s foo
[expand foo]
expected within foo:
|
-
observed within foo:
|
|
-
commit 7215:
5 5 fake-screen =s
s 1 down 1 right
[define foo]
s foo
[expand foo]
observed: no bindings available when rendering foo expanded
|
|
|
|
|
|
|
|
|
|
| |
Turns out even that doesn't work.
There are two distinct use cases here:
1. Keeping columns from infecting each other.
2. Expanding function calls.
Perhaps ping-ponging between them is a sign I need tests.
|
|
|
|
|
|
|
|
| |
It turns out deciding when to initialize the table of bindings is quite
a thorny problem in the presence of function calls (since they need their
args bound). In time I should probably support a linked list of tables.
For now I'll just continue to reuse tables, but perform lookups in reverse
order so that the correct binding is always returned.
|
| |
|