Live data from Hacker News

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

github.com

11–20 of 26 posts

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

#12

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. alloca…

I guess you're mentioning Greenspun's 10th rule, https://en.m.wikipedia.org/wiki/Greenspun%27s_tenth_rule:

> 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

#14
post #3

And 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

#15

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.

All parts of libc are not created equal. Some bits have hard dependencies on OS functionality that would make it a no-go in embedded. Other pieces, like string functions, are 100% CPU with no syscalls -- no reason not to have a good, optimized memcpy on embedded.

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

#16
post #3

And 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-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=source

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

#17
post #14
post #3

And 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.

I wonder why detaching forks is so clumsy a process. Is it really storage space concerns, or is it something we don’t know about?

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

#18
post #5

> Keith Packard Now, that is a name. Can this library be used as a replacement for glibc ?

>> Keith Packard

> 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

#19
post #3

And 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…

s/picolisp/picolibc/
Post reply on HN