This page contains notes about using various runtime environments in ReCodEx as well as their internal usage inside [isolate](https://github.com/ioi/isolate) sandbox. Only special cases are noted here.
This page contains notes about using various runtime environments in ReCodEx as well as their internal usage inside [isolate](https://github.com/ioi/isolate) sandbox. At present ReCodEx supports
* C
* C++
* C#
* Data-only
* Go
* Haskell
* Java (OpenJDK)
* JavaScript (Node.js)
* Pascal
* PHP (CLI apps)
* Prolog (SWI)
* Python 3
* Rust
Exercises may be configured for multiple environments, so the student may choose the language for the solution. However, Data-only, Haskell, and Prolog have somewhat unique configurations. They are designated *separated* runtime environments which means an exercise must use such environment exclusively.
Only environments which needed some special treatment are noted here.
## Python
We use a wrapper script that translates exceptions to error codes. This script can be found in the [utils](https://github.com/ReCodEx/utils/blob/master/runners/py/runner.py) repository. The file is named `runner.py` during execution of solutions, so be aware of filename collisions.
Due to a [Python bug](http://bugs.python.org/issue10496), the interpreter
requires the `$HOME` variable to be set to something. Otherwise, it tries to
look up the UID used by Isolate in `/etc/passwd` and fails. Setting `HOME=/box`
seems to work.
## Java
By default, we use a script that looks for a class with a `main` method and executes it for running Java programs. There has to be only one class containing `main` method, otherwise error will be observed. The executed script is named `javarun.java` and can be found in the [utils](https://github.com/ReCodEx/utils/blob/master/runners/java/javarun.java) repository. In tested solutions we use its byte-compiled counterpart `javarun.class`, so be aware of name collisions.
## C#
@ -21,6 +26,22 @@ The C# solutions are executed with the help of [wrapper code](https://github.com
In C# language there are none of the handy functions to operate with textual inputs like `scanf` in C. Therefore for every C# build in ReCodEx there is [Reader](https://github.com/ReCodEx/utils/blob/master/runners/cs/Reader.cs) library included to make life of C# programmers easier. Please note that library is suppose to work only with ASCII files and some difficulties can be observed with modern Unicode (UTF-8) encodings. The `Reader` library is located in `ReCodEx_Csharp_Reader.cs` library contains namespace `CodEx` with class `Reader`, so again, be aware of filename and class collisions.
## Go
The solutions of Go has to be located only in one package, the standard `main` executable package. ReCodEx uses flat folder structure of submitted solution, therefore separate Go packages cannot be used. Multiple files are fine as long as they contain the same package.
## Java
By default, we use a script that looks for a class with a `main` method and executes it for running Java programs. There has to be only one class containing `main` method, otherwise error will be observed. The executed script is named `javarun.java` and can be found in the [utils](https://github.com/ReCodEx/utils/blob/master/runners/java/javarun.java) repository. In tested solutions we use its byte-compiled counterpart `javarun.class`, so be aware of name collisions.
## Python
We use a wrapper script that translates exceptions to error codes. This script can be found in the [utils](https://github.com/ReCodEx/utils/blob/master/runners/py/runner.py) repository. The file is named `runner.py` during execution of solutions, so be aware of filename collisions.
Due to a [Python bug](http://bugs.python.org/issue10496), the interpreter
requires the `$HOME` variable to be set to something. Otherwise, it tries to
look up the UID used by Isolate in `/etc/passwd` and fails. Setting `HOME=/box`