HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
nothings
stb
C2014–2026
nothings / stb

stb

stb single-file public domain libraries for C/C++

78Distinct people
111Mentions
0Explicit recommenders
35KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

stb single-file public domain libraries for C/C++

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year111 dated mentions

Observed mentions: 2014-09-21 13:39:14 UTC to 2026-08-10 10:10:33 UTC.

0510152014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 5 mentions; 2 submissions, 3 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 15 mentions; 3 submissions, 12 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 8 mentions; 4 submissions, 4 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 8 mentions; 3 submissions, 5 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 12 mentions; 2 submissions, 10 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 14 mentions; 2 submissions, 12 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 9 mentions; 1 submissions, 8 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 8 mentions; 3 submissions, 5 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC404
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC523
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC15312
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC844
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC835
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC12210
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC14212
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC918
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC918
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC707
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC835
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC716
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC505

What Hacker News says

111 sources
> Everything being static inline makes it hostile to these older systems which have limited RAM If you don't define `PICOPHYSICS_IMPLEMENTATION` then you just get prototypes and a few struct definitions. From what I could tell the static inline functions are just used as helpers by the non-static functions defined in the implementation TU. It's similar to the stb[1] implementation pattern. Also, inlining improves code size more often than you might think. There is a lot of ceremony in a function call, and the compiler has to make pessimistic assumptions about what is trashed by the call, causing unnecessary spills and fills. Things like the simple vec3 operations here should pretty much always be made available for inlining; whether the compiler actually decides to inline them is a different story. [1]: https://github.com/nothings/stb
In Picophysics: Single file physics for games on platforms like N64, PSX, DC
Author here. What a pleasant surprise to see this trending on the front page! (I did post a Show HN at the time of the original release, https://news.ycombinator.com/item?id=33148540, but it never gained traction.) Just to answer some comments that I see: 1. This was absolutely not vibecoded! I'd originally started with a different version control system and was still getting used to Git and GitHub at the time that I'd released this. (I was a latecomer to Git just because I hated the CLI so much.) It was easiest for me just to drop the whole thing as a snapshot in a single commit. But my private repo for it actually started in May 2017, and it had 320 commits leading up to its release, all human-written. For the v2.0 that I have in mind, I'm thinking of force-pushing to migrate the full development history to the public repo. And final
Read the rest
ly I'll add that I'm a graphics engineer by education and career. Where would the fun be in vibe-coding this? :-) Oh, and this compiles down to just ~36KiB of object code on x86-64 last I checked. Good luck vibe-coding that constraint. 2. Why a single header with `#define CANVAS_ITY_IMPLEMENTATION`? I was inspired by the STB header ibraries (https://github.com/nothings/stb) and by libraries inspired by those, all of which I've found very convenient. In particular, I like their convenience for small utilities written in a single .cpp file where I can just `g++ -O3 -o prog prog.cpp` or such to compile without even bothering with a makefile or CMake. Since the implementation here is all within a single #ifdef block, I had figured that anyone who truly preferred separate .cpp and .h files could easily split it themselves in just a few minutes. But anyway, I thought this would be a fun way of "giving back" to the STB header ecosystem and filling what looked to me like an obvious gap among the available header libraries. It started as something that I'd wished I'd had before, for doing some lightweight drawing on top of images, and it just kind of grew from there. (Yes, there was Skia and Cairo, but both seemed way heavier weight than they ought to be, and even just building Skia was an annoying chore.) ---- Since I mentioned a v2.0, I do have a roadmap in mind with a few things for it: beside the small upgrades mentioned in the GitHub issues to support parts of newer <canvas> API specs (alternate fill rules, conic gradients, elliptical arcs, round rectangles) and text kerning, I'm thinking about porting it to a newer C++ standard such as C++20 (I intentionally limited v1.0 to C++03 so that it could be used in as many places as possible), possibly including a small optional library on top of it to parse and rasterize a subset of SVG, and an optional Python binding.
In Canvas_ity: A tiny, single-header -like 2D rasterizer for C++
I don't know how well this makes you understand your dependencies. As for C/C++ a lot of people probably depend on stb single header files libraries. There's stb_truetype but it specifically mentions not to use it on any untrusted/outside .ttf files which I do like but you have to keep in mind to bake to bitmaps or only use your own .ttf provided files, thus I would put this dependency in another place like tooling. Is there a way to do this in other languages like JS and NPM? Maybe carefully choosing which dependencies you include is better? https://github.com/nothings/stb/blob/master/stb_truetype.h#L...
In Understand Your Dependencies
Decabytes·Nov 1, 2024Submission

Ask HN: Has Anyone Tried Single File Development with IDE Code Collapse?

I've been exploring a different approach to organizing my projects by keeping all the code in a single file and taking advantage of the code collapse feature available in most modern IDEs. I'm curious if anyone else has tried this and what their experiences have been. One of the primary benefits I've found is easier code portability. With all the code in a single file, you can simply drop the file into your project without worrying about dependencies or file organization. Refactoring also becomes more straightforward since you can see all the related code in one place, making it easier to update dependencies and related functions. Additionally, LLM assistants often perform better with code completion when all the code is in one file, as they can access the entire context more easily. I've noticed that other projects also take a single fil
Read the rest
e approach. For instance, SQLite concatenates all its C files when it's built, there are single file header projects like STB^1 that tout ease of use, and even the .NET garbage collector^2 is a single 56k file. So, this approach is not entirely unprecedented. With modern editing tools, this method seems more viable than ever before. What does everyone think? 1. https://github.com/nothings/stb 2. https://github.com/dotnet/runtime/blob/main/src/coreclr/gc/gc.cpp
3 points · Open discussion
That's what inevitably happens when you make transitive dependencies easy and you have a culture of "if there's a library for it you must use it!" C/C++ are the only widely used languages without a popular npm-style package manager, and as a result most libraries are self-contained or have minimal, and often optional dependencies. efsw [1] is a 7000 lines (wc -l on the src directory) C++ FS watcher without dependencies. The single-header libraries that are popular in the game programming space (stb_* [2], cgltf [3], etc) as well as of course Dear ImGui [4] have been some of the most pleasant ones I've ever worked with. At this point I'm convinced that new package managers forbidding transitive dependencies would be an overall net gain. The biggest issue are large libraries that other ones justifiably depend on - OpenSSL, zlib, HTTP server
Read the rest
s/clients, maybe even async runtimes. It's by no means an unsolvable problem, e.g. instead of having zlib as a transitive dependency, it could: 1. a library can still hard-depend on zlib, and just force the user to install it manually. 2. a library can provide generic compress/decompress callbacks, that the user can implement with whatever. 3. the compress/decompress functionality can be make standard [1] https://github.com/SpartanJ/efsw [2] https://github.com/nothings/stb [3] https://github.com/jkuhlmann/cgltf [4] https://github.com/ocornut/imgui
In Rewriting Rust

Showing the 15 most recent of 111 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.