A tale in 3 pictures.
-
@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
-
@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
