Code samples
TEXT Fibonacci sequence
HTML Fibonacci sequence
TEXT Palindrome (functional direct)
HTML Palindrome (functional direct)
TEXT Palindrome (imperative)
HTML Palindrome (imperative)
TEXT Palindrome (functional w/ pattern matching)
HTML Palindrome (functional w/ pattern matching)
99 bottles of beer (Batch)
TEXT Plain-text
HTML HTML
99 bottles of beer (C), no conditional branches
TEXT Plain-text
HTML HTML
99 bottles of beer (Lua), no conditional branches
TEXT Plain-text
HTML HTML
AES 128 in ECB mode in pure Lua
HTML HTML
TEXT Plain-text
DIR Conditional jumps in Lua
DIR Ruby hatred directory
DIR Iterators on Coroutines in Lua
Strict C code validation (compile main.c with both gcc and llvm):
for cc in 'scan-build gcc -c' clang gcc ; do $cc -O0 -g -Wall -Wextra -Wswitch-default -Wswitch-enum -Wshadow -Wwrite-strings -pedantic -Wformat=2 -Wconversion -Wdisabled-optimization -Werror -ftrapv -fsanitize=undefined -fsanitize=address -fsanitize=leak main.c || break ; done
# note scan-build may produce world-readable files under /tmp/scan-build-*
# will make sense to add -fno-sanitize-recover and
# -fsanitize=float-divide-by-zero once they are in stable releases