A tale in 3 pictures.
-
@citizen428 I mean, this is actually not *that* far off from what lispers do when generating sites in lisp
@reiddragon Sure, but compared to operating on an AST simple text substitution only gets you this far.
-
@millihertz 10/10 emoji reaction.
-
@citizen428 reminds me of the horrors me and @friz64 were up to, also serving an entire web page from an ESP32 as one big string iirc, base64 encoded images and all.
-
@citizen428 That's called GNU M4.
@jwo Technically it's called an ill-advised use of my time that should never have happened, but yeah.
-
@jwo Technically it's called an ill-advised use of my time that should never have happened, but yeah.
@citizen428 Well, something like this is provided as a quasi-standard Kotlin/Ktor library IIRC.
-
@citizen428
Macros are a really bad idea that should never be used in C. They are unfortunately needed in Assembler, but assembler, other than to boot strap a compiler is not needed for the last 30 years. Not even on microcontrollers (see Forth and JAL).@raymaccarthy I would have thought the "extremely bad idea" cartoon in the first image made it clear that I agree with this. But this is chaos.social and "Spaß am Gerät" (loosely "Fun with the device) is basically the CCC motto.
-
@overflo @citizen428 Kinky geeks wäre mindestens mit Seilen. Das ist nur vanilla "kreativ".
@phantasus @overflo Woher weisst du dass hier keine Seile involviert waren?
-
@citizen428 I did this with rust before!
@sashin Rust having proper macros makes this a lot easier, see e.g. https://maud.lambda.xyz
-
@citizen428 Well, something like this is provided as a quasi-standard Kotlin/Ktor library IIRC.
@jwo Yup, kotlinx.html. Rust has https://maud.lambda.xyz. There's plenty of precedent, but that doesn't make this specific late night digression a good idea.
-
@citizen428 if it works don't fix it i guess. Somehow it feels like react but without the reactivity

@m3tti Depends on your definition of "works"
I'd not be inclined to actually use this. -
@citizen428 old and busted: php as a c preprocessor¹
hot and new: c preprocessor as a php
¹ https://stackoverflow.com/questions/396644/replacements-for-the-c-preprocessor/16256052#16256052
Edit: Originalquelle verlinkt
@schaf That's exactly what the lolsob emoji is for.

-
@jrose @citizen428 to their credit, they did say it was a bad idea
-
@citizen428 @joe Yeah, sorry, I didn’t mean it as a mark against you either! It just rang a bell, having run into people attempting to do even a less silly thing.
-
@citizen428 @eniko Impressive!


-
@citizen428 @eniko The first words were "WTF????" - that's why the first emoji


-
@necrophcodr Funny you'd say that, because this (`clang -I. -P -E`) but in another context is how this little side quest started.
@citizen428 I mean it has simple uses too, like adding simple include statements in any file, or, as you've shown, macros.
I've used it to make a lockfile for my Containerfile, and I'd just build using cpp -E <file> | docker build -f- <...>
-
The horrors:
C preprocessor abuse
C preprocessor abuse. GitHub Gist: instantly share code, notes, and snippets.
Gist (gist.github.com)
@citizen428 I highly recommend combining this with a MAP macro.
-
@citizen428 I highly recommend combining this with a MAP macro.
@ryanc Please don’t give me ideas

-
The horrors:
C preprocessor abuse
C preprocessor abuse. GitHub Gist: instantly share code, notes, and snippets.
Gist (gist.github.com)
@citizen428 omg, you even serve it right from C code?! God, I want to unsee this...
-
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.
@citizen428 finally, webdev in C
