How Our Compiler Works
Understand the inner workings of Our Compiler. From client-side Monaco Editor interactions to cloud container sandboxing and sub-2-second execution output delivery.
🔄 Code Execution Flowchart
When you click Run Code in Our Compiler, your source program passes through five distinct technical layers to ensure fast, isolated, and safe execution:
Monaco Editor
The editor captures source code, language configuration, active tab state, and interactive custom inputs (stdin).
TLS 1.3 Payload
The code payload is securely serialized into JSON and sent over an encrypted HTTPS connection to execution API endpoints.
Docker Isolation
An ephemeral Docker container initializes with strict resource constraints (512MB RAM, 10s CPU limit, no root access).
Native Toolchain
The runtime toolchain (e.g. GCC 11, JDK 17, Python 3.10) compiles and executes the program against stdin buffers.
Console Display
Standard output (stdout), compilation errors (stderr), and execution status (exit code 0/1) are returned to the user console.
🛡️ Container Security & Isolation
Security is the highest priority when building a public online compiler. Allowing arbitrary user code execution means preventing malicious system calls, infinite loops, and resource exhaustion. Our Compiler handles security via:
- CPU & Time Limits: Programs execution is limited to 10 seconds. Infinite loops are terminated automatically.
- Memory Constraints: Each sandbox container is capped at 512MB RAM.
- Disabled Network Access: Execution containers operate in offline network modes to prevent unauthorized outbound requests.
- Ephemeral Disk Storage: Created temporary files are destroyed immediately after execution finishes.
⚡ High-Performance Latency Optimization
To deliver execution times under 2 seconds, Our Compiler utilizes pre-warmed container pools. Instead of spinning up a fresh container on every request, idle container runtimes stand ready to compile code instantly, eliminating cold-start delays.
Whether you write Python script, C++ template code, or Java object-oriented classes, your output appears almost instantly.