Re: 2.0.3

3 views
Skip to first unread message

Nick Black

unread,
Nov 7, 2020, 1:35:30 PM11/7/20
to José Luis Cruz, team notcurses
José Luis Cruz left as an exercise for the reader:
> You can see I've created type aliases for the C structs following the
> Rust idiomatic naming guidelines, while trying not to diverge from
> your naming conventions.

aye it seems good stuff.

> I also noticed some inconsistencies like using ncmselector_item
> instead of ncmultiselector_item (dunno if that's on purpose though)

likely accidents. one dude found two whole functions missing
from ncselector.

> And I also have some questions like:
> what's an nctablet?

https://nick-black.com/dankwiki/index.php?title=Outcurses#Panelreels
https://github.com/dankamongmen/notcurses/blob/master/USAGE.md#reels

a reel is a wheel. tablet are printed on the outside of this
wheel. projected onto the 2d rendering area, we see some portion
of the reel, and zero or more tablets.

in growlight, each adapter (think PCIe card) is a tablet.
in omphalos, each NIC is a tablet.

probably easiest to see from one of them.

> And regarding the grapheme clusters.. I'm still not sure if an EGC is
> the same as a gcluster, since the documentation seems to use one or
> the other interchangeably... and I'd like to clear up that issue once
> and for all in types.rs...

a gcluster is not a type as far as i'm aware. there is a field
"gcluster" in the cell type. the gcluster field uniquely identifies
an EGC in one of two ways:

1) an EGC of four UTF8 bytes or fewer (including all
single-Unicode EGCs) is directly written into gcluster.
it can be treated as a C string because the fifth byte of
"cell"s is guaranteed to be 0, ala a NUL terminator.

2) an EGC of more than four UTF8 bytes is indicated by its
first byte being 0x01. we do not allow non-printing
characters to be loaded into cells (i.e. attempting to load
"\x01" directly into a cell will be rejected), so this is a
valid sentinel. in this case, the remaining 24 bits index
into an egcpool; they point at a NUL-terminated EGC of
dynamic length.

a gcluster is not a type, or if you wanna get all Haskell on me
i suppose it's a folded coproduct, a precise bit of nomenclature
of use to no one save the world's five dozen Haskell coders and
unhappy graduate students looking very grim as they diagram
sentences from Pierce or, in a few unfortunate circumstances,
Barendregt.

> Finally an egcpool is meant to be fully private, right? No need to
> expose it I guess

Pool's Closed. https://knowyourmeme.com/memes/pools-closed

--
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.
signature.asc
Reply all
Reply to author
Forward
0 new messages