A tale in 3 pictures.
-
@ryanc Please don’t give me ideas

@citizen428 Fine. I will not inflict further ideas upon you, but why do you hate fun?
-
A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.
@citizen428
Finally somebody's optimised CGI.pm's html functions -
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 funny, because this idea is real (more or less). The https://penpot.app is made this way!
It's written in Clojure language, that also has a feature of creating macros (although with better syntax checks). We use the `rumext` framework, that defines macros that are expanded in compile time into HTML, react style.
GitHub - penpot/penpot: Penpot: The open-source design tool for design and code collaboration
Penpot: The open-source design tool for design and code collaboration - penpot/penpot
GitHub (github.com)
So here is your idea working in a hugely complex application, with the (little) issue that it's in a language with good macros...

-
@citizen428 this is funny, because this idea is real (more or less). The https://penpot.app is made this way!
It's written in Clojure language, that also has a feature of creating macros (although with better syntax checks). We use the `rumext` framework, that defines macros that are expanded in compile time into HTML, react style.
GitHub - penpot/penpot: Penpot: The open-source design tool for design and code collaboration
Penpot: The open-source design tool for design and code collaboration - penpot/penpot
GitHub (github.com)
So here is your idea working in a hugely complex application, with the (little) issue that it's in a language with good macros...

@citizen428 this is a real example of the code in the app:
[:div {:class (stl/css :modal-overlay)}
[:div {:class (stl/css :modal-dialog)
:data-testid "token-theme-update-create-modal"}
[:> icon-button* {:class (stl/css :close-btn)
:on-click modal/hide!
:aria-label (tr "labels.close")
:variant "action"
:icon i/close}]
[:> themes-modal-body*]]] -
The horrors:
C preprocessor abuse
C preprocessor abuse. GitHub Gist: instantly share code, notes, and snippets.
Gist (gist.github.com)
@citizen428 Thanks for sharing the code.
In a weird way, this is exactly what the C preprocessor is designed to do.
I still don't want to debug a bigger website though.

-
@citizen428 Thanks for sharing the code.
In a weird way, this is exactly what the C preprocessor is designed to do.
I still don't want to debug a bigger website though.

@dragonfi@jsteuernagel.de $DEITY no, I'd never want to actually work with this outside of a little late-night hack session.
-
@citizen428 Fine. I will not inflict further ideas upon you, but why do you hate fun?
@ryanc I'm just trying to avoid getting nerd sniped into spending any more time on this. I have a much bigger preprocessor abuse planned

-
@citizen428 @wonka @Lemmus that's exactly the place where it stabs you with a rusty spoon.
-
@citizen428 omg, you even serve it right from C code?! God, I want to unsee this...
@siguza Maximum cursed is what I was going for, so yes. If you prefer CGI and another web server you could use kcgi:
kcgi: minimal CGI and FastCGI library for C/C++
A C/C++ library for security-oriented web applications.
(kristaps.bsd.lv)
-
@citizen428 this is funny, because this idea is real (more or less). The https://penpot.app is made this way!
It's written in Clojure language, that also has a feature of creating macros (although with better syntax checks). We use the `rumext` framework, that defines macros that are expanded in compile time into HTML, react style.
GitHub - penpot/penpot: Penpot: The open-source design tool for design and code collaboration
Penpot: The open-source design tool for design and code collaboration - penpot/penpot
GitHub (github.com)
So here is your idea working in a hugely complex application, with the (little) issue that it's in a language with good macros...

@hirunatan Yeah, there are plenty of versions of this in all kinds of languages. But most of them have actual syntactic macros working on an AST, not just simple text replacement.
-
@citizen428 finally, webdev in C
@fx You might be the right kind of person to find https://learnbchs.org interesting then.
-
@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...
@malwareminigun Does the first image not make it clear that this is not a serious post?
-
@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…
@mirabilos It won't escape and won't do many other things anyone would reasonably want. It's just a late night shitpost.
-
@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.)
@aartaka Love the cursors, instant follow. Keep the web weird!
-
@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.
@luc0x61 Really? A cartoon calling it an "extremely bad idea" and an implementation covering a handful of tags wasn't enough of an indication that this was not a serious post?
-
@citizen428 *points and snaps* Nord Theme.
@prlg Always Nord theme, on everything. I even made one for the OCaml's utop so it looks less out of place in my terminal:
-
@nabijaczleweli You glorious madman, have a follow

-
@citizen428 for GCC, add #define true 1
@RueNahcMohr Works fine as-is. The Makefile targets `-std=c23` where `true` is an actual keyword. Unless I misunderstood your intention here.
-
@aartaka Love the cursors, instant follow. Keep the web weird!
@citizen428 yay, I didn’t make these in vain 🤩
-
@luc0x61 Really? A cartoon calling it an "extremely bad idea" and an implementation covering a handful of tags wasn't enough of an indication that this was not a serious post?
@citizen428 I've seen enough to witness that some humorous exits have been chosen as real solutions
Would you believe that I've seen someone printing a variable as binary text to further process it with binary logic on single ASCII digits, instead of using the logical operators native of any CPU?