Skip to main content
The Runtime service supports execution of code in 5 programming languages, each running in isolated Docker containers with specific configurations.

Supported Languages

Java

Compiled and executed using JDK 17

Python

Interpreted using Python 3.11

C

Compiled with GCC

C++

Compiled with G++

JavaScript

Executed with Node.js 18

Language Specifications

Java

  • Language Identifier: java
  • File Extension: .java (auto-detected from class name)
  • Docker Image: eclipse-temurin:17
  • Compilation: javac [ClassName].java
  • Execution: java [ClassName]
  • Requirements: Must include a public class declaration
Example:
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
The class name is automatically extracted from the code using regex pattern matching. The file will be named based on the public class declaration.

Python

  • Language Identifier: python
  • File Extension: .py
  • File Name: main.py
  • Docker Image: python:3.11
  • Execution: python main.py
Example:
print("Hello, World!")

C

  • Language Identifier: c
  • File Extension: .c
  • File Name: main.c
  • Docker Image: gcc:latest
  • Compilation: gcc main.c -o main
  • Execution: ./main
Example:
#include <stdio.h>

int main() {
    printf("Hello, World!\n");
    return 0;
}

C++

  • Language Identifier: cpp
  • File Extension: .cpp
  • File Name: main.cpp
  • Docker Image: gcc:latest
  • Compilation: g++ main.cpp -o main
  • Execution: ./main
Example:
#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

JavaScript

  • Language Identifier: js
  • File Extension: .js
  • File Name: main.js
  • Docker Image: node:18
  • Execution: node main.js
Example:
console.log("Hello, World!");

Resource Limits

All containers are executed with the following resource constraints:
Memory Limit
number
128 MB (134,217,728 bytes)
CPU Limit
number
0.5 CPU cores (500,000,000 nanoseconds)
Code execution that exceeds these limits will be terminated by Docker to prevent resource exhaustion.

Execution Flow

For each code execution request:
1

File Creation

Code is written to a temporary file with the appropriate extension in /tmp/code_[UUID]/
2

Container Setup

Docker container is created with:
  • Language-specific image
  • Volume binding to the temporary directory
  • Resource limits (memory and CPU)
  • Working directory set to /code
3

Execution

Container runs the compilation/execution command and captures output
4

Cleanup

Container is removed and temporary files are deleted

Error Handling

If an unsupported language is requested, the API returns:
{
  "success": false,
  "message": "Unsupported language: [language]",
  "data": null
}
Refer to the API Reference for details on making code execution requests.

Build docs developers (and LLMs) love