Skip to content

Easy and standardized docker images for 200+ esoteric (and non-esoteric) languages.

Notifications You must be signed in to change notification settings

dnek/esolang-box

 
 

Repository files navigation

esolang-box 2.3.0 Build Status

Easy and standardized docker images for 200+ esoteric (and non-esoteric) languages.

Usage

Distributed docker images are seperated for each esolangs.

For example docker image for Evil language is named as esolang/evil, which is hosted on Dockre Hub.

How to run your own esolang program

Suppose you have program in the current directory,

$ echo aeeeaeeewueuueweeueeuewwaaaweaaewaeaawueweeeaeeewaaawueeueweeaweeeueuw > program.evil

then you can run the program like the following.

$ docker run -v `pwd`:/code:ro esolang/evil evil /code/program.evil
Hello, World!

Observing usage of exec syscalls

esolang-box 2.2.0 supports tracing of execve and execveat syscalls by strace command. Setting STRACE_OUTPUT_PATH environment variables and enabling ptrace will produce strace log to the specified path.

$ docker run --cap-add=SYS_PTRACE --rm -v `pwd`:/code --env STRACE_OUTPUT_PATH=/code/strace.txt esolang/evil evil /code/program.evil
Hello, World!

Some considerations:

Simple benchmark:

~ # cat benchmark.rb
sum = 0
1000.times do |i|
  seq = `seq #{i}`.split.map(&:to_i)
  sum = seq.sum
end
p sum
~ # echo -n "" | time ruby benchmark.rb
499500
real    0m 3.57s
user    0m 0.78s
sys     0m 0.70s
~ # echo -n "" | time strace -f -q -o strace.txt -e trace=execve,execveat ruby benchmark.rb
499500
real    0m 28.90s
user    0m 1.19s
sys     0m 13.73s

List of boxes

Notes about some languages

Bash (pure)

Simulates behavior of "Bash (builtins)" in Anarchy Golf.

Brainfuck (bfi)

Unlike Brainfuck (esotope), this execution simulates behavior of "brainfuck" in Anarchy Golf.

To achieve this, I have patched a tricky line to the original code.

--- BFI.c
+++ BFI.c
@@ -46,6 +46,7 @@
   int pc, args, xc, prog_len, l = 0;
   int x[32768];
   int p[32768];
+  int xxx[1] = {'['};

   FILE *stream, *fopen();

Coq

You can use coq.io.

OpenOffice Calc

You can write CSV with the content below the B line.

The input is given in A1 cell.

Output the final result into B1 cell.

XSLT

The input is given as the content of tag <input/>.

Transform that into the desired value.

Pxem

The first line is the file name of the pxem code.

The rest is the content of the pxem code.

Compile-time C++ (Clang, C++11)

Write the constexpr function f that receives the const char* input as an argument and returns const char* output.

Blacklisted languages

Below are the list of the languages that cannot even do the minimal jobs needed for esolang-battle.

  • ArnorldC
  • CodeMania (whitespace is automatically trimmed from input)
  • Doubleplusungood (whitespace is automatically trimmed from input)
  • Gaia (whitespace is automatically trimmed from input)
  • Haystack
  • INTERCAL
  • LOGICODE (Can only take 0 or 1 from input)
  • ModanShogi
  • ~English
  • Python 1
  • РАПИРА (Input number/bool only)
  • Seed
  • STOP (Cannot input or output newlines)
  • ///
  • 🆒
  • TrumpScript
  • Velato
  • ZOMBIE

Build images

Prerequires dobi.

$ cd /path/to/esolang-box
$ ruby build.rb
$ dobi

Run spec

Tested with Ruby 2.7.1

$ bundle install
$ bundle exec rspec

About

Easy and standardized docker images for 200+ esoteric (and non-esoteric) languages.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 33.8%
  • Ruby 19.6%
  • Shell 16.8%
  • JavaScript 15.9%
  • Python 4.5%
  • 1C Enterprise 4.1%
  • Other 5.3%