💾 Archived View for gemini.ctrl-c.club › ~stack › gemlog › 2022-01-28.procrastoc.gmi captured on 2023-07-22 at 17:18:26. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

-=-=-=-=-=-=-

Procrastinating in C...

I've been coding in C lately. I am kind of enjoying it, but I find myself procrastinating a lot more than when I work in Lisp.

When I was younger, I avoided C with a vengeance. I wound up writing languages just to avoid C, when everyone was gung-ho on it. Now that C is considered an old underdog, I realized that I am actually kind fond of C.

My coding skills are at a point where I look for the language to not get in my way. I can code in assembler almost as efficiently as anything else. C does get in the way quite a bit - the macro language, the declaration syntax, the type system... Wait a minute, maybe I still hate C!

To be fair, if the problem is small enough, I can work around C without it becoming terribly unpleasant, and in fact enjoy myself, after some cursing with getting the makefile right and whatnot. But I procrastinate a lot.

I've been running my SpellBinding game for a couple of months now. For the entirety of the last month I've been saying to myself "I really need to verify games before deploying them". It's almost a trivial task - all the code to load a game is there for the taking, but instead I wind up dicking around. I've blown several games, waking up to error messages and stuck games.

Finally I did write a game checker today, and it took me maybe half an hour. I also made the game core a little more error-proof in the process. Was it that hard?

Yes, it was. It's like pulling teeth.

It's not as much the language. C is very much 'blub', with an uninspired syntax and an intrusive type system. It's the environment that sucks.

When I work with Lisp, I can just try things instantly. I can make different versions of a function and try them out interactively, without losing the old work, and sometimes, even while the code is running. When I try it with C, changes propagate exponentially, especially if I have to change the type of something. Then I have to hunt through the header files and call sites to get everything just to compile, and when it does not work, I have to rely on things like git to look at old versions...

So naturally, I procrastinate when it comes to messing with C code.

I wish I could just stay in Lisp. But at tilde.cafe I need to run my games as cgis, and they don't have Common Lisp installed anyway. The idea of cranking up a new instance of CL from each cgi hit is not pleasant to my minimalist self. If I had my own server I would just run a server written in CL and be very happy.

For now I will just write a few more cgi games in C. After working out the details in Lisp.

I think a wordle-like game is next.

index

home