[Toybox] Lots of libc's.

David Seikel onefang_toybox at dave.isageek.net
Wed Aug 31 21:19:08 PDT 2022


I guess the real question I want an answer to is which is the best libc?

Rob obviously has his opinions, and I'd like to hear them.  No doubt
others on this list have their useful opinions to.

For my purposes small, fast, high quality, pick three.  Working across
multiple operating systems would be great, but happy to reduce that to
Android, Linux, Windows, maybe Mac and iOS as well.  POSIXish FTW.

Assembler usually gets my nod for small and fast, anything I ever wrote
in what ever assembler was needed for a given project was always smaller
and faster.  But yeah, that means writing assembler for a bunch of CPUs. 
On the other hand, most seem to be switching to 64 bit only, so I could
cut that list down to x86_64 and ARM 64 bit.  RISC-V has my attention,
but it's not ready yet for me to poke at it.


For bonus points, a good collection of the usual algorithmic stuff. 
Currently using qlibc https://github.com/wolkykim/qlibc but open to
changing.

My big personal project is rewriting OpenSim, a 3D virtual world server,
in other words most of what this new "metaverse" thing claims is coming
in the future, but has been around for over a decade.  Rewriting it in C,
assembler, and Lua.  The problem is it's huge, and simulating worlds
involves lots of tiny details.  My proposed solution is to not write
everything, but tack on other peoples libraries.  The problem there is
that I add a dozen libraries, I get a dozen implementations of basic
things like linked lists and dictionaries.  Lua for example has it's
tables, which are a dictionary plus extendable array.  But the only way
they publish to use that in C is via their horrid stack based thingy. 
That's a pain to use from C, you have to make a function call to pass
each parameter, a function call to do the thing, then another function
call to get the results.  With potentially more function calls to get
through the C <-> Lua data conversions.  Not good for "I just want to
use a dictionary from C".

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.


More information about the Toybox mailing list