4 ms·
Picolibc: C library designed for embedded 32- and 64- bit systems
- NelsonMinar 4y agoMore on Keith Packard's website: https://keithp.com/picolibc/ https://keithp.com/picolibc/
- bxparks 4y agoAnd 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?
- otikik 4y agoNot 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.
- simpleintheory 4y agoI wonder why detaching forks is so clumsy a process. Is it really storage space concerns, or is it something we don’t know about?
- 1vuio0pswjnm7 4y agohttps://github.com/search?q=picolibc&p=1 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 https://github.com/ft?tab=repositories&type=source and https://github.com/picolisp?tab=repositories&type=source https://github.com/picolisp?tab=repositories&type=source
- 1vuio0pswjnm7 4y agos/picolisp/picolibc/
- nerpderp82 4y agoLibc 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.
- kevin_thibedeau 4y agoIt's easy to avoid the functions with global state and Newlib can be built to minimize or eliminate their RAM consumption.
- smat 4y agoIs there a list of functions for newlib?
- AlotOfReading 4y agoGreenspun'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.
- makapuf 4y agoI guess you're mentioning Greenspun's 10th rule, https://en.m.wikipedia.org/wiki/Greenspun%27s_tenth_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.
- asveikau 4y agoAll 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.
- hulitu 4y ago> Keith Packard Now, that is a name. Can this library be used as a replacement for glibc ?
- biorach 4y ago>> 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
- stuarch 4y ago> 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.
- ixtenu 4y agoWhat'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.
- TD-Linux 4y agoThe 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.
- suprjami 4y agoiirc Keith talked about other library comparisons in his LCA talk about picolibc: https://youtu.be/SC6aBezNFFQ https://youtu.be/SC6aBezNFFQ
- projektfu 4y agoIt's for baremetal, and works on much smaller microcontrollers. It also seems to carry its own processor init code which other libc doesn't carry.
- dang 4y agoRelated: Picolibc – Libc for Embedded Systems - https://news.ycombinator.com/item?id=21150678 https://news.ycombinator.com/item?id=21150678 - Oct 2019 (41 comments)
- JohnKuzyarko 4y agoI've used this to successfully port some code to run on bare metal on the GBA!
- chinabot 4y agoEmbedded 64-Bit.. Wow, What case scenario would use this over an OS ?
- projektfu 4y agoYour guess is as good as mine. I assume it makes sense for running the test suite quickly before running it slowly, and for use with 64-bit baremetal raspberry pi, Atom, and their ilk.
- pabs3 4y agoSome of the author's blog posts may answer that: https://keithp.com/blogs/embedded-arm-libc/ https://keithp.com/blogs/embedded-arm-libc/ https://keithp.com/blogs/picolibc/ https://keithp.com/blogs/picolibc/ https://keithp.com/blogs/tags/picolibc/ https://keithp.com/blogs/tags/picolibc/ IIRC they do a lot of stuff with amateur rocketry, so it might related to that.
- argulane 4y agoOnly in a very special cases. I'm writing embedded bare-metal 64-bit arm code at work right now. That is because the product needs less than 300ms boot times from power on and needs to be fast enough to do image compression (AVIF) in a reasonable time. Just using Linux and suspend would eat too much battery from the power budget. It has to have 1 year of battery life like previous generation of that same product. i.MX RT1170 with its 1Ghz 32Bit Cortex-M7 core was not fast enough so we had to jump up to much faster 64bit Cortex-A53 core.