Smallest Self Reproducing Program
The 1994 IOCCC entry "Worst abuse of the rules" by Szymon Rusinkiewicz claims to be the smallest self-reproducing program, prompting judges to revise contest rules to prevent similar submissions.
Read original articleThe International Obfuscated C Code Contest (IOCCC) features an entry from 1994 titled "Worst abuse of the rules," authored by Szymon Rusinkiewicz from the United States. This entry claims to be the world's smallest self-reproducing program. The judges noted that while many submissions in previous years claimed similar titles, they often exceeded the expected size. This particular entry, however, is unique as it is not a valid C program in the traditional sense, yet it can be compiled into an executable that outputs its own source code. The judges decided to amend the contest rules to establish a minimum size requirement, preventing similar entries in the future. The author asserts that this program is guaranteed to replicate itself, producing a listing of its own code when executed. The entry includes primary files such as the source code (smr.c), a Makefile, and a script for testing the entry, along with secondary files for distribution and documentation.
- The 1994 entry "Worst abuse of the rules" is by Szymon Rusinkiewicz.
- It claims to be the world's smallest self-reproducing program.
- The judges plan to revise contest rules to prevent similar entries in the future.
- The program can compile into an executable that outputs its own source code.
- The entry includes various files for building and testing the program.
Related
Lisp with GC in 436 Bytes
SectorLISP, a compact programming language with garbage collection, fits in a 436-byte boot sector, surpassing FORTH and BASIC. It runs on 1981 PC models and emphasizes file size optimization.
Tic-tac-toe in a single call to printf
A C implementation of a tic-tac-toe game, created for the 2020 International Obfuscated C Code Contest, features highly obfuscated code using a single `printf` statement and checks for game conditions.
A tiny self-remaking C program
The article introduces a self-rebuilding C program using a minimal shell script, emphasizing the build process as computation, the importance of caching, and the need for improved security scrutiny in build systems.
SectorC: A C Compiler in 512 bytes (2023)
SectorC is a compact C compiler fitting within a 512-byte boot sector, supporting a significant subset of C with advanced features, achieving a size of 303 bytes for practical applications.
Ioccc Flight Simulator (2010)
The IOCCC Flight Simulator, created by Carl Banks, won "Best of Show" in 1998, operates on Unix-like systems, allows keyboard control of a Piper Cherokee, and supports customizable scenery files.
How do they define "invalid"? Section 6.7 (page 81) of the C89 standard defines a translation unit as a series of one or more external declarations.
I assumed that a main() function was a requirement, but section 5.1.2.2 (page 6) does not require this (which seems obvious in retrospect; that's how object files are compiled).
I think the shortest valid C program would be "f();". gcc accepts it. In fact, gcc agrees with my conclusion above, and says, for a blank file: "ISO C forbids an empty translation unit".
What do other compilers say?
Related
Lisp with GC in 436 Bytes
SectorLISP, a compact programming language with garbage collection, fits in a 436-byte boot sector, surpassing FORTH and BASIC. It runs on 1981 PC models and emphasizes file size optimization.
Tic-tac-toe in a single call to printf
A C implementation of a tic-tac-toe game, created for the 2020 International Obfuscated C Code Contest, features highly obfuscated code using a single `printf` statement and checks for game conditions.
A tiny self-remaking C program
The article introduces a self-rebuilding C program using a minimal shell script, emphasizing the build process as computation, the importance of caching, and the need for improved security scrutiny in build systems.
SectorC: A C Compiler in 512 bytes (2023)
SectorC is a compact C compiler fitting within a 512-byte boot sector, supporting a significant subset of C with advanced features, achieving a size of 303 bytes for practical applications.
Ioccc Flight Simulator (2010)
The IOCCC Flight Simulator, created by Carl Banks, won "Best of Show" in 1998, operates on Unix-like systems, allows keyboard control of a Piper Cherokee, and supports customizable scenery files.