HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
gregoryc
standardlib
C2023–2023
gregoryc / standardlib

standardlib

A complete standardlib for c for once

2Distinct people
2Mentions
0Explicit recommenders
117GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A complete standardlib for c for once

GitHub

Where it is used

No documented product use has been verified yet.

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

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 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 hour2 dated mentions

Observed mentions: 2023-12-04 21:47:40 UTC to 2023-12-05 10:12:53 UTC.

012023-12-04 21:00:00 UTC to 2023-12-04 22:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsDec 4, 21:002023-12-04 22:00:00 UTC to 2023-12-04 23:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-04 23:00:00 UTC to 2023-12-05 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 00:00:00 UTC to 2023-12-05 01:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 01:00:00 UTC to 2023-12-05 02:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 02:00:00 UTC to 2023-12-05 03:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 03:00:00 UTC to 2023-12-05 04:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsDec 5, 03:002023-12-05 04:00:00 UTC to 2023-12-05 05:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 05:00:00 UTC to 2023-12-05 06:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 06:00:00 UTC to 2023-12-05 07:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 07:00:00 UTC to 2023-12-05 08:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 08:00:00 UTC to 2023-12-05 09:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 09:00:00 UTC to 2023-12-05 10:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-12-05 10:00:00 UTC to 2023-12-05 11:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsDec 5, 10:00

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
Dec 4, 21:002023-12-04 21:00:00 UTC2023-12-04 22:00:00 UTC110
Dec 4, 22:002023-12-04 22:00:00 UTC2023-12-04 23:00:00 UTC000
Dec 4, 23:002023-12-04 23:00:00 UTC2023-12-05 00:00:00 UTC000
Dec 5, 00:002023-12-05 00:00:00 UTC2023-12-05 01:00:00 UTC000
Dec 5, 01:002023-12-05 01:00:00 UTC2023-12-05 02:00:00 UTC000
Dec 5, 02:002023-12-05 02:00:00 UTC2023-12-05 03:00:00 UTC000
Dec 5, 03:002023-12-05 03:00:00 UTC2023-12-05 04:00:00 UTC000
Dec 5, 04:002023-12-05 04:00:00 UTC2023-12-05 05:00:00 UTC000
Dec 5, 05:002023-12-05 05:00:00 UTC2023-12-05 06:00:00 UTC000
Dec 5, 06:002023-12-05 06:00:00 UTC2023-12-05 07:00:00 UTC000
Dec 5, 07:002023-12-05 07:00:00 UTC2023-12-05 08:00:00 UTC000
Dec 5, 08:002023-12-05 08:00:00 UTC2023-12-05 09:00:00 UTC000
Dec 5, 09:002023-12-05 09:00:00 UTC2023-12-05 10:00:00 UTC000
Dec 5, 10:002023-12-05 10:00:00 UTC2023-12-05 11:00:00 UTC101

What Hacker News says

2 sources
> how is memory management done? It always uses malloc/free with no way to specify your own allocator, it nearly always assumes malloc succeeds, and when it does check it thinks malloc(0) returning NULL is an error, it prefers to malloc the maximal possible size then realloc smaller, and it does not document the API's memory ownership policy. (For example, you have to read the code to learn that sorted_strings returns a sorted copy of the input strings, rather than the sorted string array in-place.) A function like longest_common_prefix always mallocs space, when I would think just knowing the prefix size is more useful in an embedded program. > Either way, seems like a fantastic toolkit for working in C! Do take care as it appears to have a lot of small issues. Take https://github.com/gregoryc/standardlib/blob/4fb308a5716927e... for exam
Read the rest
ple. It processes each regular file in a directory and saves the result to the file: char *file_data; char *new_str = map_function(file_data = read_file(entry->d_name)); free(file_data); write_file(entry->d_name, file_data); free(new_str); This should write new_str to the file, not file_data, which has already been freed. Going back to memory ownership, you can also see there is no documentation that map_function must return memory that will be freed by the caller. Digging deeper, "read_file" uses fopen(filename, "r") to open a file, then a SEEK_END/ftell() to get the size. There is a minor issue that ftell() may report -1 (on my machine it returns -1 for a fifo), causing a malloc(0) which is checked against NULL, and may falsely report a malloc failure rather than being an issue with how it tried to predict the size instead of using dynamic growth. (The places which use read_file first checks it's a real file, but the file can be changed between the check and its use.) I also think there's an issue with shellescape as it does not quote backslashes. I think the version in Python's shlex.quote() is more robust. Then there's the lack of documentation, like, do you expect startswith() and endswith() to be case-insensitive? I don't. Why would you use str_to_double() instead of atof(), and why is there no locale-independent variant? Quite a few of these seem like they should never be used, like "count_vowels()", which returns 0 for "sky" and 1 for "Brontë". And what is the difference between "is_string_alphanumeric" and "is_alphanumeric"? Quite a few of these functions might better be written using C11's _Generic (https://stackoverflow.com/questions/479207/how-to-achieve-fu... .
In An usable and maximally efficient C standard library

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.