"A single-file C allocator with explicit heaps and tuning knobs" on the frontpage of HN https://news.ycombinator.com/item?id=47520807

Oh sounds nice and lightweight, good to have more allocator options

Oh wait this is 10k lines long and one commit and this person's first project

Oh look so many parentheses it makes me, a lisper, feel overwhelmed https://github.com/xtellect/spaces/blob/master/spaces.c#L4713

So tired of bumping into slop everywhere

A single-file C allocator with explicit heaps and tuning knobs | Hacker News

@cwebber tangent, isn’t LISP specifically hard to generate for LLMs because of the parenthesis situation
@thomasfuchs apparently they've gotten a lot better at paren balencing
@thomasfuchs @cwebber lol - have the vibecoders still not figured out semantic code tree generation? it seems so oldskl... lispers would have thought of it!?

@cwebber there is absolutely no way that code was not generated by an LLM.

no human would write C that way.

@ariadne @cwebber

A common tell for me these days is mixed camel and snake case, especially mixed camel and snake case in the same variable name this_is_soFuckingStupid().

spaces/spaces.c at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub
@puppygirlhornypost2 @cwebber bro its the meme. its the fuckin meme
@puppygirlhornypost2 @cwebber he's really doing his integer type due diligence here
spaces/Makefile at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub
@puppygirlhornypost2 @cwebber dawg what the fuck
@puppygirlhornypost2 @cwebber actually i've changed my mind. i'm all for it. let the Ouroboros eat its own fucking tail
@xan @puppygirlhornypost2 @cwebber i've seen first-semester students do better. such a disgrace. i hope the hype blows over.
spaces/bench.sh at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub
@puppygirlhornypost2 @xan Yeah @vv was looking at it, and pointed out that it downloaded an external benchmark program that wasn't even capable of running against another arbitrary allocator. So basically it isn't doing anything
@cwebber @puppygirlhornypost2 @vv After seeing the copyright dates of 2021-2026, I'm not sure if this is vibe coded or just natural born terrible code

@xan @vv @cwebber can you name a single person who would unironically type the following line:

page->hdr.fs.free = ((char *) ((FSBlock *) (((char *) ((Block *) ((char *) (page) + (((PageSize) ((PageSize) ((PageSize) (sizeof(Page) + (0)) + (PageSize) ((sizeof(double)) - 1u)) & ((PageSize) (~((PageSize) ((sizeof(double)) - 1u)))))))))) - 0))); page->hdr.fs.end = page->hdr.fs.free + (((char *) page + size - page->hdr.fs.free) / (((index) << 3) + ((PageSize) ((PageSize) ((PageSize) (0) + (PageSize) ((sizeof(double)) - 1u)) & ((PageSize) (~((PageSize) ((sizeof(double)) - 1u)))))))) * (((index) << 3) + ((PageSize) ((PageSize) ((PageSize) (0) + (PageSize) ((sizeof(double)) - 1u)) & ((PageSize) (~((PageSize) ((sizeof(double)) - 1u)))))));

@xan @vv @cwebber These are all casts.
@puppygirlhornypost2 @xan @vv Oops all casts!
@puppygirlhornypost2 @xan @vv I thought you were a puppygirl not a castgirl
@cwebber @xan @vv (Puppygirl)((Castgirl) amber + (Castgirl)((Puppygirl) 0))

@puppygirlhornypost2 @xan @vv Somehow I think I need @dragon's opinions on this

is this how we should write C what do you think

@cwebber @puppygirlhornypost2 @xan @vv GOOD LORD WHAT IS HAPPENING IN THERE

Why are we casting so much? Why are we using so many parens???

@xan @puppygirlhornypost2 @cwebber ​​ i'm not that familiar with c code styles but what what the hecc is this code style. this is so hard to look at

@puniko @xan @puppygirlhornypost2 @cwebber

This is the Anthropic coding style /s

@puniko @xan @cwebber at the very basic what it's doing is arithmetic with different types.

I could see why one would throw a couple C casts in here (iirc C does have some implicit casting, but these are more complex types). The problem is you can literally see things like (char*) [value] which is then casted into another type
(shitass)((char*) [value]) and then cast back to char*. this makes no sense to me with the level of nesting done here.
@puppygirlhornypost2 @xan @cwebber ​​ it certainly is "creative" (for a lack of a better word)
spaces/spaces.c at 422dbba85b5a7e9a209aaab2e9ac19c892528d39 · xtellect/spaces

A high-performance C allocator with explicit heap regions, fragmentation control, and runtime tuning. - xtellect/spaces

GitHub

@puniko @xan @puppygirlhornypost2 @cwebber

{ };
load bearing empty code block?

@Johann150 @xan @puppygirlhornypost2 @cwebber this code certainly does some very bold creative choices ​

@puppygirlhornypost2 @puniko @xan @cwebber eh, i think i've seen that one several times before. i guess because if you're counting characters, this is marginally shorter, albeit less clear

while (true) for (;;)

@Johann150 @puniko @puppygirlhornypost2 @cwebber @xan I'm not sure anyone is counting characters at this point. Or at least trying to keep the count low.
@puppygirlhornypost2 @Johann150 @xan @cwebber to be fair, this is a valid way in C to write a while true loop afaik
@Johann150 @xan @puppygirlhornypost2 @cwebber i think its sometimes written that way to prevent some compilers to yield a warning about the condition being always true or something
@puppygirlhornypost2 @xan @vv @cwebber Someone in the HN comment mentioned it might be C preprocessor macro expansion
@puppygirlhornypost2 @vv @xan @cwebber i could fully see this being a GNU project snippet
@puppygirlhornypost2 I’m not a principal or a director, but I would definitely call a team meeting to discuss this one
@xan @puppygirlhornypost2 @vv It's absolutely vibe coded. The author's blog and other HN comments also talk excitedly about AI and LLM stuff and the blog is equally incoherent "wall of technobabble" stuff
@cwebber @xan @puppygirlhornypost2 it's not technobabble 😤 it definitely makes sense to apply statistical mathematics to the location of bugs in a binary file... https://www.densebit.com/posts/19.html
Two Bugs

@vv @xan @puppygirlhornypost2 The further away you are in memory from the bugs, the less bugs there are QED

@puppygirlhornypost2 @cwebber gosh, if only there was a way to cite a file from make! Oh well, play golf.

#wtf #fuckai #fuckgolfcourses #too

@cwebber It’s tiring and it leads to an erosion of trust whose consequences are hard to anticipate.
@cwebber Are you sure, there isn't any cast to PageSize missing?
<g,d&r>
@cwebber With extra assembly and magic hex int32 for fun?
@cwebber And not even a single comment within the 10k C source. It seems not even an AI output, more a transpilation to C from another higher-level language, honestly.