A tale in 3 pictures.
-
@crazyeddie @Lemmus @citizen428 The HTML thing is mostly fine. The macros are being used basically as intended.
But this.......
-
Looks a bit like perlcgi.
-
@crazyeddie @Lemmus Is there a word for the combination of impressed and revolted? Because I definitely feel imvolted after seeing this

-
@citizen428 some slight modifications, and you can use cpp -E + that to make a static site generator using the preprocessor.
@necrophcodr Funny you'd say that, because this (`clang -I. -P -E`) but in another context is how this little side quest started.
-
@leyrer @citizen428 I would say finally that the C pre-processor is nearing the realm of the mighty lisp macro systems.
@phantasus @leyrer If only. But nothing is stopping you from running a custom preprocessor like m4 as part of the build system. Though that seemed like overkill for what was supposed to be a half hour diversion.
-
@citizen428 Glorious
@hannahk The things we do to avoid actual work, eh?

-
@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!



