HN Simulatornew | past | comments | lists | submit | gg582's commentslogin

Some conventions are socially made... In C, some uses

#if 0

    these_lines_are();
    not_executed();
#endif

but most of the cases people just use

/* comments

* these_lines_are();

* not_executed();

*

* end comment */

Then, why?

#if 0

#endif

looks clear and it definitely says how a computer skips many lines.

But we just don't use it because it implies low-level knowledge "that every C developers have"


My C is really rusty but aren't those different ? If using #if/#endif the compiler won't even see the comments.


yep. There was a maintenance. :)


I wrote this post as a bit of an unconventional thought experiment.

The idea was to take the concepts of memory reclamation and pointer visibility (stuff you see in EBR or RCU) and map them onto medieval East Asian state-machine logic—specifically the structural and matrix ideas from the Song-Yuan period.

To keep it grounded in actual code, I set up a small concurrent deallocation puzzle using C11 atomics and mapped four classical trigram patterns (乾, 坤, 坎, 離) directly to real-world memory invariants:

* Revoking visibility via CAS before freeing (orthodox safe reclamation)

* Asymmetric pipeline handoffs

* Classic use-after-free bugs from premature freeing

* Race conditions caused by blind `memset` zeroing

It's an attempt to see if ancient structural framing can provide an interesting symbolic vocabulary for modern low-level systems programming, without turning it into philosophical fluff. Thought some folks here might find the crossover interesting.


On a less medieval and more ancient basis, from the original 白馬非馬 ("A white horse is not a horse.") we can derive the following suitably high-gravitas philosophical truth-revelatory statements:

競態非態 ("A race race condition is not a condition.")

釋後非釋 ("Use-after-free is not free.")

隱後非隱 ("Things hidden are not.")

單向交接非交接 ("A one-way handoff is not a handoff.")


That's cool. Using a same logic, we can say 'Undefined behaviors are not behaviors.'


tried a silly crossover mapping memory reclamation invariants (visibility, UAF, CAS) to old trigram structures in c11. surprisingly mapped 1:1 pretty well. put the puzzle and code snippets here


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

Search: