Picolibc – Libc for Embedded Systems - https://news.ycombinator.com/item?id=21150678 - Oct 2019 (41 comments)
Picolibc: C library designed for embedded 32- and 64- bit systems
11–20 of 26 posts
Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#12Libc 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. alloca…
> Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.
Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#13Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#14And because it's a fork of 'mirror/newlib-cygwin', searching for "picolibc" on GitHub does not find it, even though this project has 678 stars and the original newlib-cygwin has only 144 stars. Why is GitHub search so broken?
Seriously though: Making your fork "unhooked" from its parent is not very difficult, it only takes one support request and they usually get back to you within the week.
Independently of that, yes, search should find forks too.
Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#15Libc 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.
Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#16And because it's a fork of 'mirror/newlib-cygwin', searching for "picolibc" on GitHub does not find it, even though this project has 678 stars and the original newlib-cygwin has only 144 stars. Why is GitHub search so broken?
For me it was discoverable via the fourth and tenth results.
picolibc
1. 005 https://github.com/mtottenh/picolibc
2. 005 https://github.com/litex-hub/pythondata-software-picolibc
3. 005 https://github.com/AshlingMicrosystems/picolibc
4. 005 https://github.com/ft/zephyr-picolibc
5. 005 https://github.com/keith-packard/picolibc-ci
6. 005 https://github.com/modm-ext/picolibc-partial
7. 005 https://github.com/philpem/picolibc-docker-arm
8. 005 https://github.com/antmicro/pythondata-software-picolibc
9. 005 https://github.com/likewise/riscv-picolibc-docker
10. 005 https://github.com/picolibc/pico-hello
11. 005 https://github.com/libhal/gcc-arm-none-eabi-picolibc
12. 005 https://github.com/keith-packard/simple-mps
13. 005 https://github.com/picolibc/simple-mps
14. 005 https://github.com/swiftgeek/stm32f103-demo
I search Github from the command line, with no Javascript or cookies. To understand relationships between projects that are returned as results, I always go up a level to the user pages from the project pages, e.g., I looked at https://github.com/ft?tab=repositories&type=source and https://github.com/picolisp?tab=repositories&type=sourceRe: Picolibc: C library designed for embedded 32- and 64- bit systems
#17And because it's a fork of 'mirror/newlib-cygwin', searching for "picolibc" on GitHub does not find it, even though this project has 678 stars and the original newlib-cygwin has only 144 stars. Why is GitHub search so broken?
Not bought by Musk yet :) Seriously though: Making your fork "unhooked" from its parent is not very difficult, it only takes one support request and they usually get back to you within the week. Independently of that, yes, search should find forks too.
Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#18> Keith Packard Now, that is a name. Can this library be used as a replacement for glibc ?
> Now, that is a name.
A name and a whole lot of history
> Can this library be used as a replacement for glibc ?
glibc doesn't generally do well on "smaller embedded systems with limited ROM and RAM", but ymmv, depends on what "small" means for you
Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#19And because it's a fork of 'mirror/newlib-cygwin', searching for "picolibc" on GitHub does not find it, even though this project has 678 stars and the original newlib-cygwin has only 144 stars. Why is GitHub search so broken?
https://github.com/search?q=picolibc&p=1 For me it was discoverable via the fourth and tenth results. picolibc 1. 005 https://github.com/mtottenh/picolibc 2. 005 https://github.com/litex-hub/pythondata-software-picolibc 3. 005 https://github.com/AshlingMicrosystems/picolibc 4. 005 https://github.com/ft/zephyr-picolibc 5. 005 https://github.com/keith-packard/picolibc-ci 6. 005 https://github.com/modm-ext/picolibc-part…
Re: Picolibc: C library designed for embedded 32- and 64- bit systems
#20> Keith Packard Now, that is a name. Can this library be used as a replacement for glibc ?
No. This is designed to run on bare-metal. It's rather a replacement for newlib.