A tale in 3 pictures.
-
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.
@citizen428 The fact you can jump off the window isn't a good reason to do it. And don't mention someone brave who did: they're on the ground floor, stupid.
-
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.
@citizen428 yes, that’s a thing I built my website on, at some point <https://aartaka.me/this-post-is-cpp.html> (migrated to ed(1) since then.)
-
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.
@citizen428 ok, that’s a different kind of using
cpp(1)as a webpage templating engine than what I did.Won’t escape, of course…
-
The horrors:
C preprocessor abuse
C preprocessor abuse. GitHub Gist: instantly share code, notes, and snippets.
Gist (gist.github.com)
@citizen428 Glorious
-
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.
@citizen428 chef's kiss
-
@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.
@tea @citizen428 @friz64 reminded of tue gbs-control building a webpage into a byte array and spitting it out at runtime, as well as saving and loading files in a flash filesystem
and the gazillion associated race conditions -
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.
@citizen428 This is extra bad because cpp isn't specified in a way you can necessarily cough up matching text and different compilers resolve that problem in their preprocessed output in different ways...
-
@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?
