Add Multi-Language Code Execution Support (20+ Languages)

Added support for 20 programming languages:

INTERPRETED LANGUAGES (9):
• Python 3.11
• JavaScript (Node 20)
• Bash/Shell 5
• Ruby 3.2
• PHP 8.2
• R (Statistical Computing)
• Julia (Scientific Computing)
• Perl 5.36
• Lua 5.4

COMPILED LANGUAGES (11):
• C (GCC 13)
• C++ (GCC 17)
• Java 17
• Go 1.22
• Rust 1.77
• Kotlin 2.0
• Swift 5.9
• TypeScript 5
• C# (.NET 7)
• Scala 2.13
• Groovy 4.0

IMPROVEMENTS:
✓ Expanded language_configs with 20+ languages
✓ Added comprehensive security patterns for each language
✓ Language aliases (py→Python, js→JavaScript, etc)
✓ Memory limits optimized per language (64MB-512MB)
✓ CPU throttling configured (0.25-0.8 cores)
✓ Timeout protection (8s-20s per language)
✓ Created SUPPORTED_LANGUAGES.md documentation

SECURITY FEATURES:
✓ Docker container isolation for each execution
✓ Memory and CPU limits per language
✓ Pattern-based code blocking for dangerous operations
✓ Network access disabled
✓ File I/O restricted to /workspace
✓ 20,000 character code size limit

API SUPPORT:
✓ Accept language full name or alias
✓ Input data streaming support
✓ Detailed execution metrics (time, memory, exit code)
✓ Comprehensive error reporting
This commit is contained in:
Stalin
2026-05-12 20:44:26 +05:30
parent ea05201167
commit 10d9baab76
3 changed files with 1053 additions and 1107 deletions
+438 -1101
View File
File diff suppressed because it is too large Load Diff