github.com/smuuf/primi ↗
Primi language: A scripting language written in PHP.
Open this visualization on its own page →
Contributors
3
Lines of Code
2,169
From
2017-05-07
To
2020-03-28
About smuuf/primi
Primi is a scripting language implemented entirely in PHP that allows developers to safely execute untrusted code provided as strings within a sandboxed environment. It was created to solve the practical problem of enabling non-technical users to write custom logic in applications without requiring external dependencies like v8js. The language borrows familiar syntax from PHP, C, and JavaScript, making it accessible to developers already comfortable with those languages.
The project provides both standalone use and library integration through Composer. Users can run Primi code via a command-line interface with the `-c` flag for direct execution, or launch an interactive REPL mode for experimentation. The language includes a full parser that can be rebuilt when grammar definitions change, and the project is thoroughly tested with a test suite included in the repository.
Primi targets PHP developers who need to offer their clients a way to write custom business logic safely without compromising security. By executing within a pure PHP environment with no external binary dependencies, it provides a lightweight alternative to other scripting solutions while maintaining the safety guarantees of a sandboxed interpreter.