Cloud Compiler // WebSockets, Linux Containers, Python

Sandboxing Untrusted Code

Building a remote code execution service is inherently dangerous. Allowing untrusted, anonymous users to submit raw C/C++ code opens the door to catastrophic Remote Code Execution (RCE) vulnerabilities. The Cloud Compiler v2.0 solves this by operating as a distributed system designed for secure, low-latency feedback.

System Architecture & WebSockets

The platform replaces traditional HTTP polling with persistent WebSocket connections, enabling interactive coding (REPL-like behavior) over the web.

Each client connection generates a unique UUID-based session directory. All temporary files are created within this isolated sandbox and are automatically wiped upon disconnection, preventing data leakage between concurrent users.

Execution Engines

Each language runs in a specialized, isolated subprocess on the backend, stripped of sensitive environment variables.

AI Auto-Debug System

The compiler actively monitors the output stream for common error patterns (like Segmentation fault or Traceback). If triggered:

  1. The client buffers the last 4KB of terminal output.
  2. The Code + Error Log is routed to Google's Gemini 3.1 Flash Lite model.
  3. The AI generates a JSON patch containing an explanation and the corrected code, which the user can apply instantly to the CodeMirror editor.