Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have done this from time to time, but often the notes are totally unintelligible.

However, I once solved a difficult code generation problem on a compiler project I was working on while sleeping. This is seriously not recommended.



You solved a problem while sleeping? Do you care to elaborate?


I remember on time I dreamed I was working in my 3D program continuing to create a model that I had been working on that day. Man, I was pissed when I woke up and realized I hadn't actually done the last half of the work in real life.


lmao

you know I think it is weird cause sometimes I wake up and I am clueless as to whether something happened in a dream or real life.

I gota say I love dreams, I mean you can get shot in them, feel what it is like and all, and still be alive when you wake up!

But having an answer from a dream seems super cool. What's more cool is that you remembered what the solution was when you woke up!


One strange thing that happened to me is when I had this dream (following some long and deep programming session) where the "reality rules" were very close to the logical spirit of programming. Suddenly if I had to reach a platform that was very high, I could just "imagine and build my own tools" to add new abilities to my being. Very difficult to explain. I could clone objects if needed. I could somehow "loop" things or actions. etc.

As far as I know I did not solve any programming problem with this dream though.


I was on a team of three building a compiler for a microprocessor. I was writing the code generator which included register allocation and other hairy stuff. We had to produce pretty good code, as assembler was being replaced by our compiled code. Well, register allocation can be pretty hairy, and we were under a deadline. I had stayed up very late working on the problem, but didn't really finish when I crashed. I was half dreaming nonsense most of the night, but had one flash of inspiration in the middle of the night that solved the core of the problem.

It was not exactly restful sleep. Not sure it was really sleep, I would say.


If I do enough coding late at night, I usually code review in my sleep and wake up knowing tons of things to change. I've learned to do my CS homework last thing before bed and wake up early enough to fix bugs.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: