Programming-related dream thread

I just dreamt that there was a strange hello world sample program in C++ that had a feature bounty for making it compatible with translate-c.
It took some hellish template construction (that isn’t syntactically possible in C++) as an argument to the main function, something like “Batch<[Benefit<T>]>
The feature bounty wasn’t for this in particular, but for a relate keyword that this template construction heavily leaned on in order to work
I remember that the specific difficulty in translating this hello world program was that it fundamentally represented some kind of I/O operation which could conceivably be expressed with std.Io, but was difficult to make into idomatic Zig while still keeping the exact same functionality as the C++ version

While I’d love for someone to be able to magically interpret my dream and tell me what the relate keyword does, I don’t expect that to happen, so I’d like to invite you guys to share your programming related dreams in this thread, cause I bet some of you have had 'em.

3 Likes

C++, std.Io, templating, it sounds more like a nightmare :wink: a desperate search for the key to simplicity?

I dont often dream code, because text normally gets scrambled in dreams. But I do somehow dream solutions to coding problems that I have been stuck on during the day before.

Slightly on topic, one of my earliest Amiga programs was Dream Machine. A small GUI that allowed recording an audio message, and then a repeating timer that would play back the message during the night. Basically a “You are dreaming” to try to trigger Lucid Dreams. Another trigger was trying to read text, because it changes as you try.

2 Likes

I once dreamed of a special PRO determined by the call point. It relies on a specific function call convention: for parameters that exceed a certain size, the callee always uses pass-by-reference, but the caller knows its semantics are pass-by-value. Therefore, if the caller passes in var, it must additionally copy it to the stack before passing the stack reference; whereas if const is passed in, copying to the stack is not required.

But later my dream was shattered, because I found a reason that made it not very practical. For the dereferencing of a constant pointer, it must be treated as a variable, so it cannot eliminate most copies as I initially imagined.

I also dreamed of a special kind of RLS. Simply put, it is about treating constant assignment, variable initialization, and variable assignment differently. Constant assignment and variable initialization both use =, which indicates that the result pointer is passed through. However, variable assignment must use =<=, which means that the assignment process semantically involves a temporary copy, so the result pointer cannot be passed through.

1 Like

Not exactly a dream, but a few days ago as I was falling asleep I thought of a bug in my code.
Then, instead of writing it down, I decided to just fall asleep. The next day I spent 45 minutes trying to recall the bug. Only to recall the wrong thing. Fast forwards to today I remembered what that bug was and fixed it.

3 Likes