Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
Alright, here's an update over me getting owned by SICP for a month now.

I might write this every month, it's good fun.

Pages read 53 (1-53)

Exercises that gave me AIDS so far: 1.7, 1.10, 1.11, 1.12, 1.13


My Approach to One Of The Densest Technical Books I've Had To Read

The first weeks of me reading the book were basically me trying to set a sustainable approach to my readthroughs of the book. Having already skimmed it previously, I knew I was in for the lengthiest ego squeeze of my life.

To sum up my approach, I treat the book like I did with college lectures: pen, paper, and re-interpreting what I'm reading into my own words. The reason I do so is for one simple reason: to understand something, you must be able to explain it clearly and concisely, and be able to re-frame and illustrate it, which is what I then do by re-writing my handwritten notes, and conceptually mapping them out in a personal Obsidian archive of mine, which will then act as my own personal encyclopedia. I write my notes into the archive every time I hit a new cluster of exercises as a way to ready myself up for what's coming next.

While it's a very mentally taxing process that has you progress at a glacial pace (especially when you're tackling brand-new concepts, just look at the numbers of pages I've read in a month lmao), it's also foolproof: progressing means active reading and thinking on my end. You may ask yourself why I wouldn't find faster methods to learn?

First, because it's a proven strategy for me, and second, I deem learning an exercise in understanding, not a competition in speed. This race to "optimize" time out of learning to prioritize profit is the very reason why junior devs increasingly become worse out of learning centers: school replaced calm learning and reasoning for information retention with no framing instead. I thankfully have time by my side; I don't have to burn myself out rushing everything and skipping key concepts like I have previously.

Rhythm-wise, I give myself an hour and a half up to three hours every day between the morning and noon studying the book and solving exercises, with the week-end being dedicated to writing more personal observations on my journey and chilling.
All around, I've made the process pretty fun, which I would've never suspected for such a dense book. I find myself craving reading sessions more than gaming sessions and exercise. I think a part of me misses the grind I had back in college, but still, no regrets there.


How I Learned Not To Give a Shit And Like Scheme Lisp

Last time I posted in this thread, it was to post a visceral reaction to the parenthesis poisoning Lisp had, and it's esolang-esque structure. Two weeks in, and the structure started making more sense (along with the messages detailing me how I'm a fag for not having the vision). It's still giving me trouble when parentheses start to exponentially stack across procedures, but I'm getiing used to it.

I'm starting to understand the hype behind the language, and I'm still running purely mathematical procedures. It's really well-illustrated and explained.


I'm Bad At Mathematical Thinking, And I'm Mad At Myself

What struck me once I got over the hurdle of not being able to read Lisp code was how undertrained and out of shape my math skills were after high-school. While I'm slowly improving on this regard through the exercises, it's still very obvious I still have lots of work to do on this aspect, and it's kind of become a fixation of mine since I hit recursion exercises.

For instance, Exercise 10 of chapter 1 has you play around with the Ackermann function. I spent more time trying to understand the function instead of tinkering with the procedure and the examples the book provides you with. This ended up with me trying to model homebrew tests through the raw formula itself rather than solve the exercise by just trying to produce a substitution model of the examples I already had. It took me two days before I realized I could've done that after pulling up the answers to the exercise.

Speaking of recursion, is it weird that I understand how all types of recursion conceptually work, and how it all clicks in exercises and examples instinctively, but I can't for the life of me write them properly? I end up failing those exercises because I end up trying to re-frame how it all works, only to realize my first interpretations of recursivity were correct, and still fuck up anyways. Has my brain invented recursive mindfuckery initiated by doubt?

To sum it up, I kinda feel like a dunce reading the laws of the universe. It is great fun though, and I definitely am improving. It's all I could ask for: an entire year in a dev mill couldn't do that.

EDIT: typos n shit
 
Last edited:
Moderately off topic, but what’s the deal with microservices? I’ve heard people justify them by comparing them to the Unix shell and its utilities. However, when you use the shell to build a script, mostly you’re using utilities that you didn’t have to write, but in every project I’ve seen that uses microservices, they end up writing their own for each of the services. That’s kinda like writing your own shell just to write a single script.
Maybe they’re useful if you’re trying to build highly distributed services or something, but apart from that I don’t really get it.
It's my understanding that the primary users of microservices are other startups being funded by the same VC firm, that such use is mandated as a condition of funding, and that the purpose of the whole exercise is to create the appearance of demand for a microservice startup's product in order to increase its perceived value prior to the IPO where Andreesen-Horowitz or Y Combinator cashes out and hands the worthless company off to the bagholders.
Didn't someone already do this with JVM bytecode? I feel like if India is Mars, that's the moonbase staging ground.
India is sort of like Mars in the sense that it's a fundamentally uninhabitable wasteland populated by deranged freaks who don't really know what they're doing and mindlessly perform rituals to appease the machine spirits. The two main differences are that Mechanicus techpriests are way cooler than jeets and that in the grim, dark present of Saarhsmmer 40,000 the Omnissiah has more arms than a cockroach.
 
If anyone has strong opinions on C project utilities, I could use some recommendations for:
- Unit Testing
- Linting
- Internal Dependency Tracking
- Dead Code Elimination Helpers

I've taken a brief gander at stuff CUnit, clang-tidy, even doxygen, but I'm a bit unsure of what would work best.
My codebase has passed 5kloc, and my ability to just do this kind of shit manually is starting to wane
There are no wrong answers, but if possible I'd like to know the pros and cons of a given recommendation

Thanks in advance
 
I don't think I've messed with clang-tidy, at least not directly. I do have clang-format, and clangd set up as my lsp which has clang-tidy integration. It's the best choice I've found for a c lsp. I had seen ccls recommended, but it didn't really seem to work as well as clangd, at least it didn't give me all the things I get with clangd. I'm sure other people probably have more comprehensive setups.

It at least does the work of throwing me warnings when there is something obviously wrong before I try building, formating my file for me, completions that have bits of documentation in the popups, and auto-inserting includes if I don't have them already. What might be even more important are the functions you get with an lsp like clangd. like lsp rename. It renames a variable in every place it occurs. Which is such a nice timesaver (and it's smarter than doing it with :%s/varname/newvar, since that will rename any occurance of a string that matches [I'm a neovim user if others aren't it's basically like a sed search and replace command you can do in vim]), or being able to jump around in files by reference to functions.

The other stuff I don't think I can be much help on.
 
Last edited:
i have mixed feelings about clang-tidy
>PLEASE ADD [[NODISCARD]] TO EVERY SINGLE FUNCTION THAT RETURNS ANYTHING BUT VOID
i know they have good intentions but fuck does this shit get annoying
nodiscard is really nice in moderation, but making it mandatory is lmfao
 
The GitHub issue behind this one is funny but also reminds me we need to kill every single programmer who treats computers as some form of magic and refuses to understand how they work even after basing their whole career around these things.

https://github.com/microsoft/terminal/issues/10362
Are these guys supposed to be developers? They talk like tech support guys condescending to somebody’s grandmother. Text rendering sucks, but holy shit, 7200 rendering calls? For what? Pretty colors? In text????
 
WG21 should remove [[nodiscard]] and instead make all functions [[nodiscard]] by default and add a [[yesdiscard]] attribute
 
Haven't C compilers produced warnings about unassigned return values and unused locals since forever? What's the point of nodiscard then?
 

Watched this video recently, very cool. The storage of textures as edit actions and layers similar to photo editing applications and his own QuakeC-like language for a virtual machine are my favorite bits. No procedural generation was used, as opposed to .kkrieger.
 
Haven't C compilers produced warnings about unassigned return values and unused locals since forever? What's the point of nodiscard then?
for gcc it only does so for functions with warn_unused_result attribute
otherwise it doesnt warn
for clang probably the same because thats the whole point of clang
i dont know what msvc uses

tl;dr: the 3 main c compilers never warned about unassigned return values unless an attribute was added to a function, which is the exact same behavior as [[nodiscard]]
 
constexpr
how useful is this in practice?
every opinion i read about it online praises it as the best thing ever, but personally i don't find myself writing things that are supposed to execute at compile time all that often
 
how useful is this in practice?
every opinion i read about it online praises it as the best thing ever, but personally i don't find myself writing things that are supposed to execute at compile time all that often
afaik for a constexpr function to actually evaluate at compile time the variable itself has to be constexpr
EDIT: misread the post
i do it to calculate LUT and precalculate stuff that can be precalculated (though in that case i use consteval)
it is useful when the algorithm to calculate something is the same as when you precalculate a result
in that case you do use constexpr because you cant use a consteval function at runtime
 
how useful is this in practice?
every opinion i read about it online praises it as the best thing ever, but personally i don't find myself writing things that are supposed to execute at compile time all that often
if constexpr is pretty cool with templates and concepts so you can avoid SFINAE.
 
I vibe-coded a console-based AI agent in Ruby using the new Grok 4.20 last night. Connects to llama.cpp using the web/JSON gateway. I gave it zero information beyond the system prompt but told it to download a picture of a cat off the Internet. This was how it responded.

2026-02-21-232154_1920x1036_scrot.png

I know there are a lot of skeptics about this tech out there, but this is just wild to me. I've never heard about "The Cat API" and I sure never told it to. This was a carte blanche test to see how well it could reason. And this is just one specific instance I can share without powerleveling. It picked up a persona without any prompting, contrary to how I had named the project, and then had opinions about renaming the project to match its persona.

Gave it a different task and it spent half an hour workshopping a busted-ass 30-line awk script to try do what I told it to do. It failed in the end, partially because I refused to tell it enough about what it was doing to succeed and it had to grope around blindly in a text file without any guidance. But this isn't even on big metal instances or anything, this is on the lowest tier of hardware that will run inference these days, on less than 64GB RAM, strictly CPU inference, old-ass Zen 2 CPU, Qwen-Coder-Next. https://huggingface.co/unsloth/Qwen3-Coder-Next-GGUF
 
I vibe-coded a console-based AI agent in Ruby using the new Grok 4.20 last night. Connects to llama.cpp using the web/JSON gateway. I gave it zero information beyond the system prompt but told it to download a picture of a cat off the Internet. This was how it responded.

View attachment 8604114

I know there are a lot of skeptics about this tech out there, but this is just wild to me. I've never heard about "The Cat API" and I sure never told it to. This was a carte blanche test to see how well it could reason. And this is just one specific instance I can share without powerleveling. It picked up a persona without any prompting, contrary to how I had named the project, and then had opinions about renaming the project to match its persona.

Gave it a different task and it spent half an hour workshopping a busted-ass 30-line awk script to try do what I told it to do. It failed in the end, partially because I refused to tell it enough about what it was doing to succeed and it had to grope around blindly in a text file without any guidance. But this isn't even on big metal instances or anything, this is on the lowest tier of hardware that will run inference these days, on less than 64GB RAM, strictly CPU inference, old-ass Zen 2 CPU, Qwen-Coder-Next. https://huggingface.co/unsloth/Qwen3-Coder-Next-GGUF
"create a c compiler. make no mistakes" ahh
but honestly when you think about it its insane that ai can code something up in the first place
 
If anyone has strong opinions on C project utilities, I could use some recommendations for:
- Unit Testing
- Linting
- Internal Dependency Tracking
- Dead Code Elimination Helpers

I've taken a brief gander at stuff CUnit, clang-tidy, even doxygen, but I'm a bit unsure of what would work best.
My codebase has passed 5kloc, and my ability to just do this kind of shit manually is starting to wane
There are no wrong answers, but if possible I'd like to know the pros and cons of a given recommendation

Thanks in advance

I liked Cutest. Very light and simple. There are probably more full featured libs but always worked for my use cases. https://cutest.sourceforge.net/
 
Back
Top Bottom