🚀 Oh joy! Another deep dive into the C Preprocessor authored by Kafka's ghost, promising #enlightenment once the tears of despair dry up. 🤡 Spoiler alert: It's just another way to make you question your life choices while hopelessly entangled in recursive macro spaghetti. 🍝🔄
https://h4x0r.org/big-mac-ro-attack/ #CPreprocessor #RecursiveMacros #LifeChoices #Kafkaesque #HackerNews #ngated
Recursive macros in C, demystified (once the ugly crying stops 😭) | H4X0R****

#define LM_IS_EMPTY_TUPLE(x) LM_SECOND_(_LM_IS_EMPTY_TUPLE x, LM_F)
#define _LM_IS_EMPTY_TUPLE(...) bogus, __VA_OPT__(LM_F,) LM_T

Yes, this is a good way to write code. There is nothing wrong with the language forcing you to do things like this. #CPreProcessor

Ah, the C preprocessor—because nothing screams "optimize" like using a tool meant for text substitution to interpret #Brainfuck 🧠💩. GitHub's cutting-edge #innovation has finally made it possible to over-engineer obsolescence. Next up: using Excel macros to land rockets 🚀📉.
https://github.com/camel-cdr/bfcpp #CPreprocessor #Overengineering #GitHub #ExcelMacros #HackerNews #ngated
GitHub - camel-cdr/bfcpp: Optimizing Brainfuck interpreter in the C preprocessor

Optimizing Brainfuck interpreter in the C preprocessor - camel-cdr/bfcpp

GitHub
GitHub - camel-cdr/bfcpp: Optimizing Brainfuck interpreter in the C preprocessor

Optimizing Brainfuck interpreter in the C preprocessor - camel-cdr/bfcpp

GitHub

C++ isn't a serious language.

today's bullshit:

template<typename T, typename U, U T::* Member>
struct get_offset {
static constexpr size_t offset = offsetof(T, Member);
};

struct Example {
int x;
};

const size_t N = get_offset<Example, int, &Example::x>::offset;

This doesn't compile with clang. because...

1/2

#cpp #clang #cxx #macros #cpreprocessor #doomed

I wonder if anyone has seriously thought about adding some kind of namespacing to the C preprocessor.

for example, it would be nice if you could say

#namespace FOO
#include "foo.h"
#endnamespace

and then all the preprocessor defines from foo.h are brought into your file with names like FOO###BOOL

#c #preprocessor #cpreprocessor #cpp #wg14

my #DecemberAdventure has mostly been implementing in #Lua a #compiler from a subset of Lua to #C99, eventually aiming to target #OpenCL #C, with the end goal of number-type-generic #GPU -accelerated #fractal #graphics stuff.

Previously I was doing it with #CPreProcessor macro hell, compare this #MandelbrotSet inner loop:

before, lines 44 to 65 https://code.mathr.co.uk/carrottuba/blob/9784fdd2a4aac8390d22d5dca252b9ba5ea963ea:/c/bin/mandelbrot.h#l44
after, lines 22 to 38 https://code.mathr.co.uk/carrottuba/blob/9784fdd2a4aac8390d22d5dca252b9ba5ea963ea:/lua/fractals.lua#l22

code.mathr.co.uk - carrottuba/blob - c/bin/mandelbrot.h

Found a bug in #zoomasm's 360 projection (the distance estimate scaling was wrong).

Trying to do the maths by hand is too hard, so I copied my #GLSL #DualNumber implementation (for #AutomaticDifferentiation) from my fragm-examples repository, minus the #CPreProcessor macro hell, plus some quaternion-to-rotation-matrix code ported from Python that I found online.

Now it looks okish in the #equirectangular view, need to render some tests at various orientations and inject spatial metadata for viewing in VLC to be more sure I got it right...