[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"docs:\u002Fdocs\u002Fproject\u002Fcontributing":3},"\u003Cp>Phaenon is open source under the MIT license and pre-alpha: the language and the command line still change between releases. A bug report with a small reproduction is the most useful contribution there is. A change to the language starts as a change to its design.\u003C\u002Fp>\n\u003Ch2 id=\"the-repositories\">The repositories\u003Ca class=\"docs-anchor\" href=\"#the-repositories\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cdiv class=\"docs-table\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Repository\u003C\u002Fth>\u003Cth>Holds\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fphaenon\">phaenonlang\u002Fphaenon\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>The compiler \u003Ccode>phn\u003C\u002Fcode>, in Go: lexer, parser, type checker, emitter, \u003Ccode>migrate\u003C\u002Fcode>, \u003Ccode>fmt\u003C\u002Fcode>, the language server; the signatures of PHP&#39;s own library it checks against; the \u003Ccode>phaenon\u002Fphn\u003C\u002Fcode> Composer plugin\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fdesign\">phaenonlang\u002Fdesign\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>The language design and every decision, in Markdown: what the language is, what it will be, and why\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fdebug\">phaenonlang\u002Fdebug\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>The \u003Ccode>phaenon\u002Fdebug\u003C\u002Fcode> package: reads the line map, and points production errors at \u003Ccode>.phn\u003C\u002Fcode> positions through Monolog and Sentry\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fjetbrains\">phaenonlang\u002Fjetbrains\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>The PhpStorm plugin, in Kotlin\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fvscode\">phaenonlang\u002Fvscode\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>The VS Code extension, in TypeScript\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>Each code repository has a \u003Ccode>CONTRIBUTING.md\u003C\u002Fcode> that says what a pull request to it must satisfy, and an \u003Ccode>AGENTS.md\u003C\u002Fcode> that maps its code and its tests. The README of \u003Ccode>design\u003C\u002Fcode> says how to propose a change to it.\u003C\u002Fp>\n\u003Ch2 id=\"how-a-change-is-made\">How a change is made\u003Ca class=\"docs-anchor\" href=\"#how-a-change-is-made\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Every feature of the language goes through the same five steps, in order:\u003C\u002Fp>\n\u003Col>\n\u003Cli>\u003Cstrong>A design document.\u003C\u002Fstrong> The feature is a section in its document in \u003Ccode>design\u003C\u002Fcode>, and the decision is a row in that document&#39;s decision section: what was decided and why. Where the draft text and a decision differ, the decision wins.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Golden tests that fail.\u003C\u002Fstrong> The checker&#39;s corpus is one \u003Ccode>.phn\u003C\u002Fcode> file per feature under \u003Ccode>internal\u002Fchecker\u002Ftestdata\u002F\u003C\u002Fcode>, each finding the checker must report marked on its line, \u003Ccode>\u002F\u002F want P2202\u003C\u002Fcode>. The emitter&#39;s goldens are pairs, \u003Ccode>X.phn\u003C\u002Fcode> beside the \u003Ccode>X.php\u003C\u002Fcode> it must compile to.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>The implementation.\u003C\u002Fstrong>\u003C\u002Fli>\n\u003Cli>\u003Cstrong>PHPStan on the output.\u003C\u002Fstrong> The emitted PHP must pass \u003Ccode>php -l\u003C\u002Fcode>, load under \u003Ccode>php\u003C\u002Fcode> and pass PHPStan at level max with nothing beside it. The checker may be stricter than PHPStan, never more lenient.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>A real code base.\u003C\u002Fstrong> A feature is done when a real project&#39;s own test suite, PHPStan and coding-style checks pass on its compiled output. The language is developed against the code of the platform behind tequila.dev, from its libraries to its services.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>For everything that is PHP, \u003Ccode>php\u003C\u002Fcode> itself is the reference: the lexer, the parser and the printer are tested against the \u003Ccode>.phpt\u003C\u002Fcode> files of PHP&#39;s own source, with \u003Ccode>php\u003C\u002Fcode> as the oracle.\u003C\u002Fp>\n\u003Cp>A change to the language (new syntax, a new diagnostic, a change in what the checker accepts or the emitter writes) starts as a pull request to \u003Ccode>design\u003C\u002Fcode> that edits the draft and adds the decision. The maintainers decide design changes, so open an issue to discuss the idea before you write the code.\u003C\u002Fp>\n\u003Ch2 id=\"building-and-testing-the-compiler\">Building and testing the compiler\u003Ca class=\"docs-anchor\" href=\"#building-and-testing-the-compiler\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>The compiler needs the Go toolchain its \u003Ccode>go.mod\u003C\u002Fcode> names, Go 1.27, and nothing else: the module has no dependencies. With PHP 8.5 on your \u003Ccode>PATH\u003C\u002Fcode>, the tests that take \u003Ccode>php\u003C\u002Fcode> as the oracle run too.\u003C\u002Fp>\n\u003Cfigure class=\"docs-code phn-code-surface\">\u003Cdiv class=\"docs-code-body\">\u003Cpre class=\"shiki shiki-themes phaenon-light phaenon-dark\" style=\"--phn-light:#1f2127;--phn-dark:#e2e3e7;--phn-light-bg:#f9fafb;--phn-dark-bg:#0f1115\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">go\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> build\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#B4431A;--phn-dark:#F29D6B\"> -o\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> bin\u002Fphn\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> .\u002Fcmd\u002Fphn\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">go\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> test\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> .\u002F...\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cfigure class=\"docs-code phn-code-surface\">\u003Cdiv class=\"docs-code-body\">\u003Cpre class=\"shiki shiki-themes phaenon-light phaenon-dark\" style=\"--phn-light:#1f2127;--phn-dark:#e2e3e7;--phn-light-bg:#f9fafb;--phn-dark-bg:#0f1115\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>ok  \tgithub.com\u002Fphaenonlang\u002Fphaenon\u002Fcmd\u002Fphn\t85.892s\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>?   \tgithub.com\u002Fphaenonlang\u002Fphaenon\u002Finternal\u002Fast\t[no test files]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>ok  \tgithub.com\u002Fphaenonlang\u002Fphaenon\u002Finternal\u002Fchecker\t8.907s\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>…\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>ok  \tgithub.com\u002Fphaenonlang\u002Fphaenon\u002Finternal\u002Ftypes\t0.652s\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>?   \tgithub.com\u002Fphaenonlang\u002Fphaenon\u002Fstdlib\t[no test files]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>ok  \tgithub.com\u002Fphaenonlang\u002Fphaenon\u002Fstdlib\u002Fgen\t0.756s\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>?   \tgithub.com\u002Fphaenonlang\u002Fphaenon\u002Ftools\u002Frelease\t[no test files]\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cp>A green \u003Ccode>go test .\u002F...\u003C\u002Fcode> does not run everything. The suites that need a clone of PHP&#39;s source, a PHPStan, a PHP 8.6 or Composer skip unless an environment variable names it; the compiler&#39;s \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fphaenon\u002Fblob\u002Fmain\u002FAGENTS.md#test-variables\">\u003Ccode>AGENTS.md\u003C\u002Fcode>\u003C\u002Fa> lists every variable. Run the ones your change touches.\u003C\u002Fp>\n\u003Cp>Golden files are rewritten by the tests, never edited by hand, and their diff is read before it is committed:\u003C\u002Fp>\n\u003Cfigure class=\"docs-code phn-code-surface\">\u003Cdiv class=\"docs-code-body\">\u003Cpre class=\"shiki shiki-themes phaenon-light phaenon-dark\" style=\"--phn-light:#1f2127;--phn-dark:#e2e3e7;--phn-light-bg:#f9fafb;--phn-dark-bg:#0f1115\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">PHAENON_UPDATE\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#474C5A;--phn-dark:#B1B6C4\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\">1\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\"> go\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> test\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> .\u002Finternal\u002Femit\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cp>CI runs \u003Ccode>gofmt -l\u003C\u002Fcode>, \u003Ccode>go vet\u003C\u002Fcode> (native and WebAssembly) and \u003Ccode>go test .\u002F...\u003C\u002Fcode> on every pull request.\u003C\u002Fp>\n\u003Cp>The other repositories build with their own tools: \u003Ccode>composer test\u003C\u002Fcode> and \u003Ccode>composer stan\u003C\u002Fcode> in \u003Ccode>debug\u003C\u002Fcode>, \u003Ccode>.\u002Fgradlew test\u003C\u002Fcode> in \u003Ccode>jetbrains\u003C\u002Fcode>, \u003Ccode>npm test\u003C\u002Fcode> in \u003Ccode>vscode\u003C\u002Fcode>. Their \u003Ccode>CONTRIBUTING.md\u003C\u002Fcode> files give the details, among them how to run an editor&#39;s tests against a \u003Ccode>phn\u003C\u002Fcode> you built.\u003C\u002Fp>\n\u003Ch2 id=\"commits-and-pull-requests\">Commits and pull requests\u003Ca class=\"docs-anchor\" href=\"#commits-and-pull-requests\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>A pull request targets \u003Ccode>main\u003C\u002Fcode>. It is squash-merged, so its title becomes the commit on \u003Ccode>main\u003C\u002Fcode>, from which release-please sets the next version and writes the changelog. The pull request check holds it to \u003Ca href=\"https:\u002F\u002Fwww.conventionalcommits.org\">Conventional Commits\u003C\u002Fa>:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>The title is \u003Ccode>type(scope): subject\u003C\u002Fcode>, such as \u003Ccode>fix(checker): …\u003C\u002Fcode> or \u003Ccode>feat(emit): …\u003C\u002Fcode>, with \u003Ccode>!\u003C\u002Fcode> after the scope for a breaking change to the language or the command line.\u003C\u002Fli>\n\u003Cli>Every commit in the pull request is a Conventional Commit too, with a body that says what changed and why.\u003C\u002Fli>\n\u003Cli>The title&#39;s release impact is the highest of its commits&#39;: a breaking change, then \u003Ccode>feat\u003C\u002Fcode>, then \u003Ccode>fix\u003C\u002Fcode> and \u003Ccode>revert\u003C\u002Fcode>, then the rest (\u003Ccode>docs\u003C\u002Fcode>, \u003Ccode>refactor\u003C\u002Fcode>, \u003Ccode>test\u003C\u002Fcode>, \u003Ccode>build\u003C\u002Fcode>, \u003Ccode>ci\u003C\u002Fcode>, \u003Ccode>chore\u003C\u002Fcode>).\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Beyond what CI checks, the compiler&#39;s conventions hold:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>gofmt\u003C\u002Fcode>, and the standard library only: a new requirement in \u003Ccode>go.mod\u003C\u002Fcode> is the maintainers&#39; decision.\u003C\u002Fli>\n\u003Cli>Golden files and the embedded PHP stubs are byte-sensitive: no formatter or whitespace clean-up touches them.\u003C\u002Fli>\n\u003Cli>A PHPStan rule the checker deliberately lacks goes into the allow-list in \u003Ccode>internal\u002Fchecker\u002Fphpstan_test.go\u003C\u002Fcode>, with the reason.\u003C\u002Fli>\n\u003Cli>Diagnostic codes are stable once published, one mistake to one diagnostic.\u003C\u002Fli>\n\u003Cli>A language change links its change in \u003Ccode>design\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"how-phaenon-is-developed\">How Phaenon is developed\u003Ca class=\"docs-anchor\" href=\"#how-phaenon-is-developed\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Phaenon is developed AI-first: agents built on Anthropic&#39;s Claude Fable models write most of the code and the documents, and every change is a pull request a maintainer reads before it merges. A contribution is reviewed the same way, whoever or whatever wrote it.\u003C\u002Fp>\n\u003Ch2 id=\"reporting-a-bug\">Reporting a bug\u003Ca class=\"docs-anchor\" href=\"#reporting-a-bug\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>The compiler\u003C\u002Fstrong> rejects, mistypes or miscompiles something, or a command misbehaves: open an issue on \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fphaenon\u002Fissues\">phaenonlang\u002Fphaenon\u003C\u002Fa> with the smallest \u003Ccode>.phn\u003C\u002Fcode> or \u003Ccode>.php\u003C\u002Fcode> that shows it, the command you ran, what \u003Ccode>phn\u003C\u002Fcode> printed and what you expected. Add \u003Ccode>phn version\u003C\u002Fcode>, \u003Ccode>php -v\u003C\u002Fcode>, your operating system and how you installed \u003Ccode>phn\u003C\u002Fcode>. For anything that is PHP, what \u003Ccode>php\u003C\u002Fcode> itself does is the reference.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>An editor\u003C\u002Fstrong> misbehaves: open the issue on \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fjetbrains\u002Fissues\">phaenonlang\u002Fjetbrains\u003C\u002Fa> or \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fvscode\u002Fissues\">phaenonlang\u002Fvscode\u003C\u002Fa>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>An idea for the language\u003C\u002Fstrong>: open a feature request on the compiler&#39;s repository, where it is discussed before anything is designed.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>A security issue\u003C\u002Fstrong>: never a public issue. Report it privately through GitHub&#39;s \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fphaenon\u002Fsecurity\u002Fadvisories\u002Fnew\">private vulnerability reporting\u003C\u002Fa>; the compiler&#39;s \u003Ccode>SECURITY.md\u003C\u002Fcode> says what to include.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Contributions are licensed under the MIT license, as the rest of each repository is.\u003C\u002Fp>\n",1794925619756]