bit sets and their uses
Jose E. Marchesi
jemarch@gnu.org
Tue Feb 3 22:43:04 GMT 2026
Hello Chris.
> Hi everyone,
>
> van Vliet defines a mode CharBag in his transput routines as:
>
> mode {ℵ₀} CharBag =
> PSEUDO56 { Some mode which allows efficient retrieval of
> information as to the presence or absence of a given character in a
> given set (for example, a bit string). };
>
> He goes on to use CharBag to define sets of characters that are interesting
> for formatting purposes as well as supporting terminator characters.
>
> This probably seemed pretty simple to implement at the time where "all char
> values fit in 8 bits". But with Unicode...
>
> So I did some looking around and came upon this:
>
> https://roaringbitmap.org
>
> which seems quite interesting, at least from the perspective of handling
> bit sets efficiently.
>
> I'm wondering if anyone else has looked at this problem and found a
> preferred solution?
If it was me I would just use a string for CharBag at this point (making
STRINGTOBAG pretty trivial) then worry about performance later..
Unicode has _a lot_ of codepoints, so a sophisticated implementation of
sets like the one you mention is probably what we need.
More information about the Algol68
mailing list