Note from the translator: a typical Friday article on Tuesday morning ... why not?
Most people are visuals. They use images to get to the core of the problem. But mainstream programming languages, by contrast, are based on a textual representation. The gap between text and graphics is filled by ASCII images drawn with text characters and inserted into the program source code. I love them! Once I threw a cry on Twitter and sent me a lot more examples than I expected. Thanks to everyone who participated. In this topic I came across several excellent examples that I collected and put into categories. For each image, a link to the corresponding repository is given.
Data structures
One of the most common uses of ASCII art in code is to visually show the data structure.
The first example from the LLVM source code:
Source codeLocation of fields in the data structure in Jikes RVM:
Source codeRotate the tree in musl:
Source codeTwo-sided queue in Rust:
Source codeSwift compiler internals:
Source codeThe location of the items in the Malloc header:
Source codeState machines
Javascript profiling:
Source codeRPC to Cloud Spanner:
Source codeI / O stream states:
Source codeDomain logic
Control flow in NWScript decompiled program:
Source codeECC internals:
Source codeFormatting numbers:
Source codeQuantum contour:
Source codeBalancing memory management tasks in the operating system kernel:
Source codeType compatibility (this is a particularly impressive case, because here ASCII art
is the code!)
Source codeDBF file format:
Source codeLookup-table for image processing:
Source codeThe shape of the color function:
Source codeURL structure:
Source codeA "brief" help on canceling operations in emacs:
Source codeTranslator's note: there are many more such graphs on the link.Geometry
Height control in the onboard computer Apollo (!!!):
Source codeSplit images into segments:
Source codeBoomerang trajectories in Nethack:
Source codeDrawing element borders in CSS:
Source codeQuad tree:
Source codeMachine speed control:
Source codeScrolling web pages:
Source codeHope you enjoyed it!
An additional example from a translator:Graph interpolation values:
Source code