Skip to content

Brainfuck to sed compiler, written entirely in sed (proof that sed is Turing-complete)

License

Notifications You must be signed in to change notification settings

osvein/brainfuck2sed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

brainfuck2sed

Brainfuck to POSIX sed compiler written entirely in POSIX sed

Usage notes

brainfuck2sed.sed <prog.b >prog.sed && chmod +x prog.sed && ./prog.sed

brainfuck2sed output scripts use the unary numeral system for I/O (the , and . brainfuck commands) with each number (byte/cell) on a separate line. For instance, a classic "Hello World!" brainfuck program transcompiled with brainfuck2sed would output:

111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111111111111111111111111111
1111111111

The first line has 72 1s. ASCII character number 72 is H. The second line is 101 = e, third line 108 = l etc. To get ASCII output, you could pipe the output through awk '{printf "%c",length}'.

About

Brainfuck to sed compiler, written entirely in sed (proof that sed is Turing-complete)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages