Mine is: write a nroff document that executes at least one macro, and is a quine.
Mine is: write a nroff document that executes at least one macro, and is a quine.
Based on what LLMs have given me for answers so far, I'd look harder for the human-written source of the nroff code. I have written what I believe to be the only quine in the GPP macro processing language, LLMs only refer me to my code if I ask for a GPP quine. Google, Meta, OpenAI really have strip mined the entire web.
If I genuinely thought anything creative or new appeared, I'd probably be at a loss as well.
(I am assuming that the task is actually possible to accomplish. If it isn't possible, then it isn't a very good goalpost!)
If it's not possible, I'd love to see an explanation, so that task can quite weighing on me.
.de Q
.nf
.na
.pso awk 'BEGIN{bs=sprintf("%c",92); pre=bs"&"} {out=pre; for(i=1;i<=length($0);i++){c=substr($0,i,1); if(c==bs) out=out bs bs; else out=out c} print out}' "\n[.F]"
.ex
..
.Q
Invoke with: nroff -U -Tascii quine.roff | sed -Ez '$ s/\n+$//'
Possibly relies too much on awk + sed. So maybe not A+, but better than nothing.It's possible to write quines in pure C or perl or m4 or python, without shelling out to another language.