A universal compiler and interpreter wrapper. Detects language by file extension and runs it with the right toolchain.
Supports 50 languages — Python, JavaScript, Go, Java, C, C++, Rust, Ruby, PHP, and more. Implements Auto-Correction of Syntax errors and Auto-Applying Compilation Flags depending on Code.
curl -sSL https://raw.githubusercontent.com/velo4705/polyglot/main/scripts/install.sh | bashgit clone https://github.com/velo4705/polyglot.git && cd polyglot
make build && sudo make installpolyglot run hello.py # run any file
polyglot watch app.js # auto-rerun on changes
polyglot compile hello.cpp # compile without running
polyglot list # show supported languages
polyglot check # check installed toolchains
polyglot update # self-updatePolyglot auto-detects required compiler flags from your source code:
# Flags detected automatically (e.g. -std=c++17, -pthread, -lm)
polyglot run hello.cpp
# Override or add flags manually
polyglot run --compile-flags "-O3 -march=native" hello.cpppolyglot run --dry-run hello.c # see what would execute without runningecho 'print("hello")' | polyglot run --lang Pythonpolyglot run --args "arg1 arg2" hello.pyInterpreted: Python, JavaScript, Ruby, PHP, Perl, Lua, Shell, TypeScript, Dart, Elixir, Erlang, Groovy, R, Julia, Scheme, Common Lisp, Forth, Prolog, Tcl, Clojure, Gleam, PureScript, Roc
Compiled: Go, Java, C, C++, Rust, Zig, Nim, Crystal, D, Swift, Kotlin, Scala, Haskell, OCaml, Fortran, Pascal, Ada, COBOL, V, Odin, Elm
Assembly: NASM, GAS, ARM Assembly, MIPS Assembly, RISC-V Assembly
Esoteric: Brainfuck
Total: 50 languages with 55+ file extensions
Create .polyglot.yaml in your project:
auto_install:
enabled: true
prompt: false
languages:
python:
command: python3.11
custom_extensions:
.pyx: Python
.jsx: JavaScript
sandbox:
enabled: true
timeout: 30Or use the CLI:
polyglot config init
polyglot config set auto_install.enabled true
polyglot config showdocker build -t polyglot .
docker run -v $(pwd):/workspace polyglot run hello.pygo test -race ./pkg/... ./internal/... -vMIT