Code Execution
ZetoPad can execute code snippets in multiple languages, showing output directly in the app.
Running Code
- Open a code snippet
- Press
Cmd+Rto run - Output appears in the Output Panel at the bottom
Supported Languages
Native Execution
These languages use your system’s installed interpreters:
| Language | Interpreter |
|---|---|
| Python | python3 or python |
| JavaScript | node |
| TypeScript | ts-node or tsx |
| Ruby | ruby |
| Go | go run |
| Rust | rustc + run |
| Shell | bash or sh |
| PHP | php |
| Perl | perl |
| R | Rscript |
WASM Sandboxed Execution
For safe execution without system access, ZetoPad includes WebAssembly-based runtimes:
| Language | Runtime |
|---|---|
| JavaScript | QuickJS |
| Lua | Lua WASM |
| Python | Pyodide |
WASM execution is:
- Sandboxed - No file system or network access
- Fast startup - No external interpreter needed
- Consistent - Same behavior on any system
Output Panel
The Output Panel shows:
- stdout - Standard output from your code
- stderr - Error messages and warnings
- Exit code - Success (0) or failure
Panel Controls
- Clear - Remove output
- Copy - Copy output to clipboard
- Close - Hide the panel
Timeout Handling
Code execution has a configurable timeout to prevent runaway scripts:
- Default: 30 seconds
- Configurable in Settings
- Execution is terminated if exceeded
Size Limits
Output is limited to prevent memory issues:
- Maximum output size: 1MB
- Truncated with “[Output truncated]” message
Security Considerations
For untrusted code, use the WASM sandbox mode which has no system access.
Tips
Quick Testing
Create a “scratch” snippet for quick code experiments:
x = [1, 2, 3, 4, 5]print(sum(x))print([i**2 for i in x])Environment Variables
Native execution inherits your shell’s environment variables.
Working Directory
Code runs from a temporary directory. Use absolute paths for file operations.