{"id":41840906,"url":"https://github.com/leocavalcante/vhp","last_synced_at":"2026-01-25T09:21:47.300Z","repository":{"id":330613319,"uuid":"1123353331","full_name":"leocavalcante/vhp","owner":"leocavalcante","description":"VHP: Vibe-coded Hypertext Preprocessor - A PHP superset built in Rust through AI-assisted development","archived":false,"fork":false,"pushed_at":"2026-01-19T21:21:01.000Z","size":2817,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-20T04:05:00.860Z","etag":null,"topics":["ai-generated","compiler","interpreter","language-implementation","lexer","parser","php","programming-language","rust","vibe-coding"],"latest_commit_sha":null,"homepage":"https://leocavalcante.github.io/vhp/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leocavalcante.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-26T17:36:54.000Z","updated_at":"2026-01-19T21:21:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leocavalcante/vhp","commit_stats":null,"previous_names":["leocavalcante/vhp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leocavalcante/vhp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fvhp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fvhp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fvhp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fvhp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leocavalcante","download_url":"https://codeload.github.com/leocavalcante/vhp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocavalcante%2Fvhp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28750872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T09:00:19.176Z","status":"ssl_error","status_checked_at":"2026-01-25T09:00:04.131Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-generated","compiler","interpreter","language-implementation","lexer","parser","php","programming-language","rust","vibe-coding"],"created_at":"2026-01-25T09:21:46.550Z","updated_at":"2026-01-25T09:21:47.294Z","avatar_url":"https://github.com/leocavalcante.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/leocavalcante/vhp/main/docs/assets/logo.png\" alt=\"VHP Logo\" width=\"200\"\u003e\n  \u003cbr\u003e\n  VHP\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eVibe-coded Hypertext Preprocessor\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eWhat if you could build an entire programming language... just by asking?\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/leocavalcante/vhp/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/leocavalcante/vhp/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/leocavalcante/vhp/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/leocavalcante/vhp\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/leocavalcante/vhp\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/leocavalcante/vhp\" alt=\"Stars\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://leocavalcante.github.io/vhp/features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"https://leocavalcante.github.io/vhp/installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"https://leocavalcante.github.io/vhp/usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"https://leocavalcante.github.io/vhp/examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"https://leocavalcante.github.io/vhp/roadmap\"\u003eRoadmap\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## 🚀 The Audacious Experiment\n\n**VHP** isn't just another PHP implementation. It's a **groundbreaking experiment** in AI-assisted development: **Can an entire production-grade language runtime be built purely through conversation with AI?**\n\nEvery. Single. Line. Written through prompts to AI agents. Zero manual coding.\n\n**The result?** A blazingly fast, memory-safe PHP 8.x bytecode VM written in pure Rust with **zero dependencies** — and it actually works.\n\n### 💎 Why This Changes Everything\n\n- **🔥 Blazingly Fast** — Stack-based bytecode VM compiled from Rust\n- **🛡️ Rock-Solid Security** — Memory safety guaranteed by Rust's ownership model\n- **🎯 Zero Dependencies** — Pure standard library, no external crates, no bloat\n- **✨ PHP 8.x Compatible** — Run your existing PHP code unchanged\n- **🔮 Modern Features** — Arrow functions, match expressions, fibers, attributes, pipe operator\n- **📈 Battle-Tested** — Comprehensive test suite\n\n## ⚡ Get Started in 60 Seconds\n\n```bash\n# Clone and build\ngit clone https://github.com/leocavalcante/vhp.git\ncd vhp\ncargo build --release\n\n# Your first VHP program\n./target/release/vhp -r 'echo \"Hello from the future!\";'\n\n# Run any PHP file\n./target/release/vhp script.php\n\n# Run tests\nmake test\n\n# Run performance benchmarks\nmake bench\n```\n\n**That's it.** You're now running PHP with Rust-level performance.\n\n## ⚡ Performance\n\nRun `make bench` to see performance characteristics:\n\n```\nSource Code → Lexer → Tokens → Parser → AST → Compiler → Bytecode → VM → Output\n```\n\nVHP uses a **stack-based bytecode VM** that compiles PHP to optimized bytecode. The compiler and VM are written in native Rust, providing:\n\n- **Zero-cost abstractions** from Rust's ownership model\n- **No garbage collection** overhead during execution\n- **Optimized built-in functions** written in native Rust\n- **Efficient memory management** with compile-time guarantees\n\nThe architecture follows a classic interpreter pipeline with compilation to bytecode for efficient execution.\n\n## 🎨 The Power of Modern PHP + Rust Performance\n\nVHP brings the **cutting-edge features** of PHP 8.x with the **raw speed** of Rust. Here's what you get:\n\n### Functional Programming That Actually Feels Good\n\n```php\n\u003c?php\n// Arrow functions with automatic capture (PHP 7.4)\n$numbers = [1, 2, 3, 4, 5];\n$doubled = array_map(fn($x) =\u003e $x * 2, $numbers);\n\n// First-class callables (PHP 8.1) - elegant function references\n$formatter = strtoupper(...);\necho $formatter(\"hello\"); // HELLO\n\n// Method callables (PHP 8.1) - create closures from methods\nclass Calculator {\n    public function add($a, $b) {\n        return $a + $b;\n    }\n    \n    public static function multiply($n) {\n        return $n * 2;\n    }\n}\n\n$calc = new Calculator();\n$add = $calc-\u003eadd(...);\necho $add(5, 3); // 8\n\n$double = Calculator::multiply(...);\necho $double(7); // 14\n\n// Pipe operator (PHP 8.5) - chain operations beautifully\n$result = \"hello world\"\n    |\u003e strtoupper(...)\n    |\u003e str_replace(\"WORLD\", \"VHP\", ...)\n    |\u003e strlen(...);\n```\n\n### Modern Language Features\n\n```php\n\u003c?php\n// Match expressions (PHP 8.0) - pattern matching done right\n$status = match($code) {\n    200 =\u003e \"Success\",\n    404 =\u003e \"Not Found\",\n    500, 503 =\u003e \"Server Error\",\n    default =\u003e \"Unknown\"\n};\n\n// Enums (PHP 8.1) - type-safe choices\nenum Status: string {\n    case Active = \"active\";\n    case Pending = \"pending\";\n    case Closed = \"closed\";\n}\n\n// Named arguments (PHP 8.0) - crystal clear function calls\ncreateUser(\n    name: \"Alice\",\n    email: \"alice@example.com\",\n    verified: true\n);\n```\n\n### Enterprise-Ready Concurrency\n\n```php\n\u003c?php\n// Fibers (PHP 8.1) - lightweight cooperative multitasking\n$fiber = new Fiber(function(): void {\n    echo \"Fiber started\\n\";\n    Fiber::suspend();\n    echo \"Fiber resumed\\n\";\n});\n\n$fiber-\u003estart();\n$fiber-\u003eresume(); // Non-blocking concurrent execution\n```\n\n### Full OOP Suite\n\n- ✨ **Anonymous Classes** — Create objects on-the-fly without declaring classes\n- 🏗️ **Constructor Property Promotion** — Less boilerplate, more productivity (PHP 8.0)\n- 🔒 **Readonly Properties \u0026 Classes** — Immutability for safer code (PHP 8.1/8.2)\n- 🎭 **Interfaces \u0026 Traits** — Flexible, composable design patterns\n- 🛡️ **Attributes** — Metadata that doesn't suck (PHP 8.0)\n- 🚫 **Exception Handling** — try/catch/finally with throw expressions\n- ✅ **Runtime Type Validation** — Full parameter and return type checking (PHP 7.0+)\n\n## 🔥 What Makes VHP Special\n\n## 🤖 The \"Vibe Coding\" Revolution\n\nHere's where it gets wild: **VHP is proof that AI can build production-grade systems.**\n\nEvery function, every test, every feature — built through **natural language conversations** with AI agents. No manual code writing. Just prompts, iteration, and AI doing the heavy lifting.\n\n**This is the experiment:** Can you \"vibe code\" an entire programming language runtime into existence?\n\n**The answer:** You're looking at it.\n\n### Why Not Just Vibe Code Your Own Rust App?\n\nFair question. Here's the thing: **existing codebases**.\n\nThere are **millions** of PHP applications in production right now. WordPress powers 43% of the web. Laravel runs countless startups. Drupal backs major enterprises. Custom PHP systems everywhere.\n\n**VHP gets you a new runtime for *all* of them** — without rewriting a single line of their code.\n\nVibe coding Rust gets you *one* new app. VHP gets you a platform for *all* PHP apps.\n\nThat's the difference between a tool and an ecosystem.\n\n## 📊 Full Feature Checklist\n\n**Core Language:**\n- ✅ PHP tags (`\u003c?php`, `?\u003e`, `\u003c?=`) with mixed HTML/PHP\n- ✅ Variables, operators, and expressions\n- ✅ Control flow (if/else, while, for, foreach, switch)\n- ✅ Arrays (indexed, associative, nested, with trailing commas)\n- ✅ User-defined and recursive functions\n- ✅ Variadic functions and argument unpacking\n\n**Modern PHP Features:**\n- ✅ Arrow functions with automatic capture (PHP 7.4)\n- ✅ First-class callables (PHP 8.1)\n- ✅ Match expressions (PHP 8.0)\n- ✅ Named arguments (PHP 8.0)\n- ✅ Attributes with reflection (PHP 8.0)\n- ✅ Enums - pure and backed (PHP 8.1)\n- ✅ Pipe operator (PHP 8.5)\n- ✅ Fibers for concurrency (PHP 8.1)\n- ✅ Generators with yield/yield from (PHP 5.5/7.0) - parsing complete, full execution in progress\n\n**Object-Oriented Programming:**\n- ✅ Classes \u0026 Objects (properties, methods, constructors, $this)\n- ✅ Static properties with late static binding (PHP 5.0/5.3)\n- ✅ Static methods\n- ✅ Inheritance\n- ✅ Anonymous classes (PHP 7.0)\n- ✅ Interfaces and Traits\n- ✅ Abstract classes and methods\n- ✅ Final classes and methods\n- ✅ Constructor Property Promotion (PHP 8.0)\n- ✅ Readonly properties (PHP 8.1)\n- ✅ Readonly classes (PHP 8.2)\n- ✅ Property hooks with get/set (PHP 8.4)\n- ✅ Asymmetric visibility (PHP 8.4)\n- ✅ #[\\Override] attribute (PHP 8.3)\n- ✅ Object cloning with `clone` and `clone with` (PHP 8.4)\n- ✅ Magic methods (__toString, __invoke, __get/__set, __call)\n\n**Type System:**\n- ✅ Runtime type validation for parameters and return types (PHP 7.0+)\n- ✅ Simple types (int, string, float, bool, array, object, callable, iterable, mixed)\n- ✅ Nullable types (?int, ?string, PHP 7.1)\n- ✅ Union types (int|string, PHP 8.0)\n- ✅ Intersection types (Iterator\u0026Countable, PHP 8.1)\n- ✅ DNF types ((A\u0026B)|C, PHP 8.2)\n- ✅ Class type hints\n- ✅ void and never return types\n- ✅ declare(strict_types=1) for strict type checking (PHP 7.0)\n\n**PCRE Regex (PHP 4+):**\n- ✅ preg_match - Perform a regular expression match\n- ✅ preg_match_all - Perform a global regular expression match\n- ✅ preg_split - Split string by a regular expression\n- ✅ preg_replace - Perform a regular expression search and replace\n- ✅ preg_replace_callback - Perform a search and replace with a callback\n- ✅ preg_grep - Return array entries that match a pattern\n\n**Date/Time Functions (PHP 4+):**\n- ✅ time - Current Unix timestamp\n- ✅ mktime - Get Unix timestamp from date components\n- ✅ strtotime - Parse date string to Unix timestamp\n- ✅ gmdate - Format GMT/UTC date\n- ✅ gmstrftime - Format date with locale\n\n**Namespaces:**\n- ✅ Namespace declarations (braced and unbraced syntax, PHP 5.3)\n- ✅ Qualified names (Foo\\Bar, \\Foo\\Bar)\n- ✅ Use statements with aliases\n- ✅ Group use declarations (PHP 7.0)\n- ✅ Namespace resolution for classes and interfaces\n\n**Error Handling:**\n- ✅ Exception handling (try/catch/finally)\n- ✅ Throw expressions (PHP 8.0)\n- ✅ Multi-catch blocks\n\n**[→ See complete feature documentation](https://leocavalcante.github.io/vhp/features)**\n\n## 🎯 What's Next\n\nWe're just getting started. Check out [roadmap](https://leocavalcante.github.io/vhp/roadmap) to see what's coming:\n\n- More built-in functions (date/time, advanced array functions)\n- Full generator execution with send/throw/return methods\n- Complete Fiber support\n- Composer compatibility\n- Performance optimizations\n- And much more...\n\n## 🤝 Join the Revolution\n\n**Want to be part of this experiment?**\n\n- 🐛 **Found a bug?** Open an issue\n- 💡 **Have an idea?** Submit a feature request\n- 📝 **Improve docs?** PRs welcome\n- ✅ **Add tests?** We love comprehensive coverage\n- ⭐ **Show support?** Star the repo\n\nEvery contribution helps prove that AI-assisted development can build real, production-grade software.\n\n**[→ Contributing Guidelines](https://leocavalcante.github.io/vhp/contributing)**\n\n## 📜 License\n\nBSD 3-Clause License - see [LICENSE](LICENSE) for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eBuilt with Rust 🦀 and AI 🤖\u003c/strong\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cem\u003eAn experiment in what's possible when humans and AI collaborate\u003c/em\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cstrong\u003eDon't just read about it. \u003ca href=\"https://leocavalcante.github.io/vhp/installation\"\u003eTry it now\u003c/a\u003e.\u003c/strong\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocavalcante%2Fvhp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleocavalcante%2Fvhp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocavalcante%2Fvhp/lists"}