Commit Graph

3 Commits

Author SHA1 Message Date
Kartik Agaram 5462619d96 6742 - support for formatting in fake screens
We still need a few primitives, but we can implement these as needed. I'm
ready to call the fake screen done.
2020-09-07 14:18:48 -07:00
Kartik Agaram 3001235028 6687 - stream-empty? and stream-full? 2020-07-30 19:34:29 -07:00
Kartik Agaram bae22d720f 6684 - experimental primitives for streams
This is a hacky special case. The alternative would be more general support
for generics.

One observation: we might be able to type-check some primitives using `sig`s.
Only if they don't return anything, since primitives usually need to support
arbitrary registers. I'm not doing that yet, though. It eliminates the
possibility of writing tests for them in mu.subx, which can't see 400.mu.
But it's an alternative:

  sig allocate out: (addr handle _)
  sig populate out: (addr handle array _), n: int
  sig populate-stream out: (addr handle stream _), n: int
  sig read-from-stream s: (addr stream _T), out: (addr _T)
  sig write-to-stream s: (addr stream _T), in: (addr _T)

We could write the tests in Mu. But then we're testing behavior rather
than the code generated. There are trade-offs. By performing type-checking
in mu.subx I retain the option to write both kinds of tests.
2020-07-29 21:41:29 -07:00