Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Self-introspective code is trivial, and it's been done before. I suggest looking at LISP :)


This is precisely the same thing as a quine. A Lisp program able to "introspect" its own source contains somewhere in the binary a quoted representation of the source code in some format (stored as a list instead of a string if we aren't worried about whitespace, comments and line breaks). Of course, with Lisp, you essentially bundle the compiler or interpreter with the binary. At any rate, the first known quine was apparently written in a derivative of ALGOL, not LISP.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: