home.social

#quine — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #quine, aggregated by home.social.

fetched live
  1. @evacide Me too. Who has the time to write stuff, though? My best approximation of writerly pursuits is half choose-your-own-adventure stuff and half PoC||GTFO.

    #CutUps #Quine #FixedPointTheorem

  2. So I saw a quine earlier and had to make my own. tatwd. The code half stays byte-identical every run, only the stack of turtles in the source grows. No bottom. Just turtles all the way down

    #python #quine #buildinpublic

  3. Write a program that outputs an exact copy of its source code (without reading any files).

    Additional constraints:

    • Write the program in portable standard C.
    • All output must come from a single fputs(src, stdout) call where src is an array of char.
    • The main function must be exactly int main(void) { fputs(src, stdout); return 0; }.

    #programming #exercise #quine

  4. On the tangential topic of quines.

    Here is my "due diligence".
    By the way, in October I realized on my own a quine could be done with
    `lambda' and `let', tried to work it out, ran out of time, left it
    aside, and, alas, never went back to it...

    (defun quinep (form)
    "Test whether a non-atom FORM evaluates to itself.
    Test equality with `equalp' for better coverage (of implementations
    that construct structures when reading backquoted expressions)."
    ;; A justified use of `eval'.
    (and (not (atom form))
    (equalp form (eval form))))

    ;; NB: `*print-pretty*' may affect the printing of backquotes.

    (defconstant pitmanual-funnies-eni-mmcm
    '(LET ((LET '`(LET ((LET ',LET)) ,LET)))
    `(LET ((LET ',LET)) ,LET))
    "MMcM's quine.
    See <maclisp.info/pitmanual/funnies>,
    «MMcM@MIT-AI 09/17/79 15:37:16 Re: ''s».")

    (defconstant pitmanual-funnies-eni-rwk-kmp
    '((LAMBDA (LAMBDA) (LIST (LIST 'LAMBDA '(LAMBDA) LAMBDA)
    (LIST 'QUOTE LAMBDA)))
    '(LIST (LIST 'LAMBDA '(LAMBDA) LAMBDA)
    (LIST 'QUOTE LAMBDA)))
    "RWK-KMP's quine.
    See <maclisp.info/pitmanual/funnies>,
    «KMP,RWK@MIT-ML (Sent by KMP@MIT-ML) 09/18/79 03:37:32».")

    (assert (quinep pitmanual-funnies-eni-mmcm))
    (assert (quinep pitmanual-funnies-eni-rwk-kmp))

    #CommonLisp
    #ForKicks
    #Pitmanual
    #PitmanualFunnies
    #Quine

    @kentpitman @dougmerritt @screwlisp @nosrednayduj

  5. Thanks to the #c23 #embed macro, I may have written the world's shortest #quine.
    ```c
    #include<stdio.h>
    int main(){puts((char[]){
    #embed"q.c"
    ,0});}
    ```
    (I doubt that I'm the first to do this)
    We just need to politely ignore the extra `\n` injected by `puts`. Otherwise, replace `puts` with `printf`.

  6. Very similar to my interpretation of last year's Genuary 3 "42 Lines of Code" (link below), this code is a "Quine" that outputs itself into a stylized image using SVG curves and gradients.

    universeodon.com/@codeismycanv

    #genuary #genuary2026 #genuary11 #quine #svg

  7. This is an unbirthday present for @screwlisp,
    who posted earlier about quines.

    To give it as a puzzle at first:

    find a Python quine as a string Q such that eval(Q) == Q.

    A spoiler to follow.

    _________
    The term "fixed point" comes to mind. And the Y combinator comes into
    this picture as well; wie another day.

    (Estimating Python's degree of homoiconicity is left as an exercise.)

    #ComputerProgramming
    #Homoiconicity
    #ProgrammingPuzzle
    #Puzzle
    #Python
    #Quine

  8. The Law-German wird fer “quine“ wad be "Deern".

    ---
    #DoricWordOfTheDay by Doric Books: #quine (girl, young woman)
    #WriteInScots #Doric #Scots

  9. Worth noting: there is already a Rockstar quine, and it's actually quite pretty, as are most Rockstar programs.

    the world is a sea
    burn the world in fire
    the song says shout "the world is a sea" with fire, "burn the world in fire", fire, "the song says " with the song, and fire with the song
    shout "the world is a sea" with fire, "burn the world in fire", fire, "the song says " with the song, and fire with the song

    #quine #rockstarlang

  10. I should write a quine in Rockstar that actually outputs itself in reverse, i.e. a quine that only works via back-masking.

    #quine #rockstarlang

  11. A couple of #Python #Quine one-liners.

    s='s=%r;print(s%%s,)';print(s%s,)

    (lambda s: s%s)('(lambda s: s%%s)(%r)')

    E.g.:

    >>> s = "(lambda s: s%s)('(lambda s: s%%s)(%r)')"
    >>> eval(s) == s
    True

  12. I don't remember where I found this, a "naturally occurring" #quine in #Python exception handling.

    $ python exceptionQuine.py
    File "exceptionQuine.py", line 1
    File "exceptionQuine.py", line 1
    IndentationError: unexpected indent

  13. CW: Respond with your personal quine cold

    Or, does this #commonLisp #programming #quine even work. Using a lambda instead of a complex format.

    Oh, yeah, I guess this one is way better.

    (let ((a '(lambda (a) `(progn (print "Side effects") (terpri) (funcall ,a ',a)))))
    `(,a ',a))

  14. CW: Respond with your personal quine cold

    #quine #programming #commonLisp #computerScience #practice

    (FORMAT
    T
    "(FORMAT T ~A~S~A ~0@* ~S (QUOTE ~S) ~S)"
    #\"
    (QUOTE
    (PROGN (terpri)
    (princ '|\;\;|) (princ '(can put anything here))
    (terpri)
    (princ '|\;\;|) (princ '(doublequotes are hard though.))
    (terpri)
    (FORMAT T ~A~S~A ~0@* ~S (QUOTE ~S) ~S)))
    #\")

    I feel like I forgot how to do this

  15. Next episode of Super Tipiak75: all stars in AoC world. ⭐

    Day17 was interesting : part1 involved running machine language on an imaginary CPU and lookup output, pretty straightforward. Part2 was about modifying the output in order for the program to output a quine. Pure logic and little coding got me that last star in the end.

    I just completed "Chronospatial Computer" - Day 17 - Advent of Code 2024 adventofcode.com/2024/day/17

    #AdventOfCode #php #programming #quine

  16. C. F. Santos が批判する、直観に基づく論理学における「直観」は心理主義的な意味におけるそれだが、哲学における直観は超越論的でありベイズ主義的なものではない。つまり、超越論的な直観と論理体系は整合しうるが、心理主義的な直観と論理体系は独立したものでありうる。これは超越論的言語観と同型をなす。超越論的言語観において、私の言語は世界に等価である。同じように超越論的論理観では、私の直観的論理体系は先験的でしかありえない。論理における反例外主義(AEL)において修正される直観とは、心理主義的な意味におけるそれであり、超越論的なそれではない。

    dos Santos, César Frederico (2021). Intuitions, theory choice and the ameliorative character of logical theories. Synthese 199 (5-6):12199-12223.

    #論文メモ #philosophy #logic #Quine

  17. #quine #commonLisp #functionalProgramming #lisp

    ((LAMBDA (X &AUX (XX (EVAL X))) (LIST (FUNCTION-LAMBDA-EXPRESSION XX) `',X))
    '(LAMBDA (X &AUX (XX (EVAL X))) (LIST (FUNCTION-LAMBDA-EXPRESSION XX) `',X)))

    dedicated to @brokenix . In my last version, I forgot to make the lambda expression list back into a quoted list.
    @Reiddragon @mdhughes @louis

    EDIT: Somehow even more elegant

  18. I made an interactive quine.Un fichier HTML qui se met à jour quand vous l'éditez. un peu comme TiddliWiki, mais dans une version minimaliste pbt.dev/blog/quine/ #html #quine #bizarre #programming