about summary refs log tree commit diff stats
path: root/baremetal/109stream-equal.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-01-15 21:11:43 -0800
committerKartik Agaram <vc@akkartik.com>2021-01-15 21:22:33 -0800
commit49424b1933051b6cf1ce3371ada9cd7fa2d31df0 (patch)
tree3a30ae973fca31024aec4a48a29b75d5f66400fa /baremetal/109stream-equal.subx
parent8ed27ce4319eb843ee021ca0b1cb46d275c2f89d (diff)
downloadmu-49424b1933051b6cf1ce3371ada9cd7fa2d31df0.tar.gz
7523
There's a dependency cycle here:

- draw-grapheme (Mu) uses read-grapheme (Mu) to be unicode-aware.
- read-grapheme uses read-byte (SubX). Streams are a fundamental data
  structure in Mu. For the Mu compiler to be able to reason about the
  safety of stream operations, they need to be an opaque type. All
  stream primitives are written in SubX. To manipulate a stream's
  internals we force people to reach for SubX. That way if there's no
  SubX code there's confidence that things are safe.
- read-byte and other stream operations have unit tests, like they
  should. The unit tests need to print data to screen when say a test
  fails. To do this they use various check- functions (SubX) that take a
  string argument.
- Printing a string to screen uses draw-grapheme (Mu).

Perhaps I should maintain variants of drawing primitives that operate
only on ASCII.
Diffstat (limited to 'baremetal/109stream-equal.subx')
-rw-r--r--baremetal/109stream-equal.subx3
1 files changed, 3 insertions, 0 deletions
diff --git a/baremetal/109stream-equal.subx b/baremetal/109stream-equal.subx
index 8f6cf1bf..ad0dcb7c 100644
--- a/baremetal/109stream-equal.subx
+++ b/baremetal/109stream-equal.subx
@@ -1,4 +1,7 @@
 # some primitives for checking stream contents
+#
+# We need to do this in machine code because streams need to be opaque types,
+# and we don't yet support opaque types in Mu.
 
 == code
 #   instruction                     effective address                                                   register    displacement    immediate