Live data from Hacker News

Picolibc: C library designed for embedded 32- and 64- bit systems

github.com

1–10 of 26 posts

Re: Picolibc: C library designed for embedded 32- and 64- bit systems

#7

Libc is an antipattern (me saying it makes it so, like a best practice) that has its own state, it should largely be avoided for everything, but most of all embedded applications.

It's easy to avoid the functions with global state and Newlib can be built to minimize or eliminate their RAM consumption.

Re: Picolibc: C library designed for embedded 32- and 64- bit systems

#8
post #6

What's the rationale for this project? In other words, what makes it different than other embedded libc projects like Newlib or uClibc-ng or musl? Not seeing any documentation which answers this question.

The biggest thing for me is the meson build system. newlib uses autoconf-generated files checked into the build tree, with several different versions of autoconf used depending on directory. So you have to keep several versions of autoconf around if you want to add e.g. another source file without churning the generated files.

Re: Picolibc: C library designed for embedded 32- and 64- bit systems

#9

Libc is an antipattern (me saying it makes it so, like a best practice) that has its own state, it should largely be avoided for everything, but most of all embedded applications.

Greenspun's rule also applies to libc's. I've seen far more bugs introduced by bad "bare metal" libc reimplementations than I've seen difficulties introduced by just using using a real libc.

I'm not sure what your alternative is to stateful runtimes and I'm very curious what such a thing would look like beyond the reentrant APIs already in most libcs. Even Go and Haskell use stateful runtimes above the OS e.g. allocators/GC.

Re: Picolibc: C library designed for embedded 32- and 64- bit systems

#10
post #6

What's the rationale for this project? In other words, what makes it different than other embedded libc projects like Newlib or uClibc-ng or musl? Not seeing any documentation which answers this question.

iirc Keith talked about other library comparisons in his LCA talk about picolibc: https://youtu.be/SC6aBezNFFQ
Post reply on HN