forked from ircmaxell/php-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmissing-implementation.html
More file actions
305 lines (296 loc) · 16.7 KB
/
Copy pathmissing-implementation.html
File metadata and controls
305 lines (296 loc) · 16.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="php-compiler — what is still missing for self-host and native emit (May 2026).">
<title>A compiler for PHP in PHP that compiles itself</title>
<meta property="og:type" content="website">
<meta property="og:site_name" content="php-compiler">
<meta property="og:title" content="A compiler for PHP in PHP that compiles itself">
<meta property="og:description" content="php-compiler — what is still missing for self-host and native emit (May 2026).">
<meta property="og:url" content="https://purhur.github.io/php-compiler/docs/pages/missing-implementation.html">
<meta property="og:image" content="https://purhur.github.io/php-compiler/docs/pages/img/og-card.svg">
<meta property="og:image:alt" content="php-compiler logo">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="A compiler for PHP in PHP that compiles itself">
<meta name="twitter:description" content="php-compiler — what is still missing for self-host and native emit (May 2026).">
<meta name="twitter:image" content="https://purhur.github.io/php-compiler/docs/pages/img/og-card.svg">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><ellipse cx='50' cy='55' rx='42' ry='32' fill='%23777BB4'/><ellipse cx='50' cy='48' rx='38' ry='28' fill='%234F5B93'/><circle cx='35' cy='42' r='4' fill='%231a1a2e'/><circle cx='65' cy='42' r='4' fill='%231a1a2e'/></svg>">
</head>
<body>
<header class="site-header">
<div class="header-inner">
<a class="logo" href="index.html">
<svg viewBox="0 0 48 48" aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg">
<ellipse cx="24" cy="28" rx="20" ry="14" fill="#777BB4"/>
<ellipse cx="24" cy="24" rx="18" ry="12" fill="#4F5B93"/>
<circle cx="16" cy="22" r="2.5" fill="#0f0f1a"/>
<circle cx="32" cy="22" r="2.5" fill="#0f0f1a"/>
</svg>
php-compiler
</a>
<nav class="nav" aria-label="Primary">
<a href="index.html">Overview</a>
<a href="development-status.html">Status</a>
<a href="missing-implementation.html" aria-current="page">Gaps</a>
<a href="capability-comparison.html">PHP compare</a>
<a href="https://github.com/PurHur/php-compiler">GitHub</a>
</nav>
</div>
</header>
<main class="status-page">
<article class="status-prose">
<header class="status-prose__head">
<h1>Missing implementation</h1>
<p class="section-intro" style="margin-top: 0.5rem">
Real gaps toward the
<a href="https://github.com/PurHur/php-compiler/issues/1492">self-host north star (#1492)</a>.
Updated 29 May 2026 (<code>master</code> @ 7816b0bc; LLVM 9).
May wave: closures VM+JIT (<code>use()</code> value/ref, indirect invoke),
try/catch VM+JIT IR, generators VM-fallback, M3 inventory emit native (#3070),
stdlib expansion (321 builtins). <strong>Still open:</strong> MCJIT execute (#98),
generator/enum AOT, full <code>bin/compile.php</code> inventory path (#3024).
</p>
</header>
<section>
<h2>North star — still open</h2>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Milestone</th>
<th>Missing</th>
<th>Tracker</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>M3</strong> native compile</td>
<td>Native <code>bin/compile.php</code> emit; grow <code>Compiler::compileCfgBlock</code> in emit TU (smoke strict <code>emit_path=native</code> ✅; <code>compileEmitSmoke</code> routes via Compiler ([#2667](https://github.com/PurHur/php-compiler/pull/2667)))</td>
<td><a href="https://github.com/PurHur/php-compiler/issues/1492">#1492</a>, <a href="https://github.com/PurHur/php-compiler/issues/3024">#3024</a></td>
</tr>
<tr>
<td><strong>M4</strong> bootstrap loop</td>
<td>Gen-2→gen-3 full spine recompile ✅ (<code>make bootstrap-loop-gen2-recompile-spine</code>, **2643/2643**). Full revision: inventory argv driver compiles <code>bin/compile.php</code> → gen-3 ✅ (<code>make bootstrap-selfhost-full-revision-probe</code>, [#2880](https://github.com/PurHur/php-compiler/issues/2880))</td>
<td><a href="https://github.com/PurHur/php-compiler/issues/1492">#1492</a></td>
</tr>
<tr>
<td><strong>M5</strong> full self-host</td>
<td><code>north-star5-verify-fast</code> ✅ daily; <code>--strict</code> pre-merge; spine <strong>2643/2643</strong>; vendor prelink <strong>3/3</strong> <code>object_ok</code> ✅; committed <code>.o</code> cold boot without <code>vendor/</code> ✅; gen-0 sidecars refreshed ([#8559](https://github.com/PurHur/php-compiler/issues/8559)). Remaining: MCJIT execute ([#98](https://github.com/PurHur/php-compiler/issues/98)); honest full-spine PHP <code>main()</code> at runtime (native bundle-OK probe covers bootstrap smoke)</td>
<td><a href="https://github.com/PurHur/php-compiler/issues/1492">#1492</a></td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2>M3 native emit spine</h2>
<p>Smoke ladders use dedicated M3 emit helpers with <span class="status-yes">native strict gates</span> (<code>BOOTSTRAP_M3_*_STRICT=1</code>). Emit TU now routes <code>compileEmitSmoke</code> through Compiler spine ([#2667](https://github.com/PurHur/php-compiler/pull/2667)); native <code>bin/compile.php</code> and full <code>Compiler::compile()</code> remain open.</p>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Component</th>
<th>Status</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Runtime::parseAndCompileEmitSmoke</code></td>
<td class="status-wip">Partial</td>
<td>Lowered; depends on <code>Compiler::compileEmitSmoke</code></td>
</tr>
<tr>
<td><code>Compiler::compileEmitSmoke</code></td>
<td class="status-wip">Partial</td>
<td>Routes to <code>compileCfgBlock</code> for trivial scripts; multi-function sources use full <code>compile()</code> ([#2667](https://github.com/PurHur/php-compiler/pull/2667))</td>
</tr>
<tr>
<td><code>Compiler::compileCfgBlock</code> (+ callees)</td>
<td class="status-wip">Curated in emit TU</td>
<td>Compile-chain allowlist grows incrementally; full spine still LLVM 9–sensitive (track: <a href="https://github.com/PurHur/php-compiler/issues/3024">#3024</a>)</td>
</tr>
<tr>
<td>Native <code>bin/compile.php</code> emit</td>
<td class="status-no">Blocked</td>
<td>Production driver emit still incomplete (track: <a href="https://github.com/PurHur/php-compiler/issues/3024">#3024</a>)</td>
</tr>
<tr>
<td>PHPCfg property typing (<code>Script</code>, <code>Func</code>)</td>
<td class="status-wip">In progress</td>
<td>Wrong slots → segfault in full <code>compile()</code> path</td>
</tr>
<tr>
<td>Strict gates <code>BOOTSTRAP_M3_*_STRICT=1</code></td>
<td class="status-yes">Pass (smoke)</td>
<td>HelloWorld, compile-smoke, runtime smoke, compiler-unit: <code>emit_path=native</code></td>
</tr>
<tr>
<td>Inventory emit driver (<code>BOOTSTRAP_M3_USE_INVENTORY_EMIT_DRIVER=1</code>)</td>
<td class="status-yes">Pass</td>
<td>Thin-TU spine for emit-helper link — no argv-driver stubs ([#3070](https://github.com/PurHur/php-compiler/pull/3070), [#2540](https://github.com/PurHur/php-compiler/issues/2540))</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2>M3 LLVM 9 deny list (link-time)</h2>
<p>Still stubbed or PHP-only while expanding M3 real lowering (<code>lib/JIT.php</code>).</p>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Symbol / path</th>
<th>Reason</th>
</tr>
</thead>
<tbody>
<tr><td><code>Block::slotIndexForVariableName</code></td><td>LLVM 9 link crash</td></tr>
<tr><td><code>Runtime::__destruct</code></td><td>Not on compile spine; deny-listed</td></tr>
<tr><td><code>Runtime::loadJitContext</code></td><td>LLVM 9 link crash</td></tr>
<tr><td><code>Runtime::createJit</code></td><td>Split from <code>loadJit</code>; stubbed</td></tr>
<tr><td><code>Runtime::jitContextForLoadJit</code></td><td>Split from <code>loadJit</code>; stubbed</td></tr>
<tr><td><code>Runtime::loadJitCompileModuleFuncs</code></td><td>Nested foreach + <code>compileFunc</code> crash</td></tr>
<tr><td><code>Runtime::initParsePipeline</code> / <code>initCompiler</code> / <code>loadCoreModules</code></td><td>PHP CFG spine; deny during expansion</td></tr>
<tr><td><code>BootstrapAot\helloworld_compile_smoke</code> (in compile driver)</td><td>FUNCDEF link crash; separate emit entry</td></tr>
</tbody>
</table>
</div>
</section>
<section>
<h2>M2 spine — shim / native-floor notes</h2>
<p>SSOT: <code>script/bootstrap-spine-count.php</code> — <strong>2643/2643</strong> Phase A files in <code>compiler_lib_spine_smoke</code> ([#8559](https://github.com/PurHur/php-compiler/issues/8559), [#2543](https://github.com/PurHur/php-compiler/issues/2543)). <code>bin/vm.php</code> is in the spine ([#2134](https://github.com/PurHur/php-compiler/issues/2134)); VM driver execute probe ~<strong>20ms</strong> ([#2201](https://github.com/PurHur/php-compiler/issues/2201)). Native bundle-OK probe at standalone main entry (bootstrap smoke; honest PHP <code>main()</code> still open).</p>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Path</th>
<th>Note</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>lib/AOT/Linker.php</code></td>
<td>In spine smoke; external <code>clang</code> via <code>shell_exec</code> (expected M5 native floor)</td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2>Language & compiler (subset gaps)</h2>
<p>Not full Zend parity — selected constructs still missing or VM-only. Detail: repo <code>docs/unsupported-syntax.md</code>.</p>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Area</th>
<th>VM</th>
<th>JIT / AOT</th>
<th>Issue</th>
</tr>
</thead>
<tbody>
<tr>
<td>Try / catch / finally</td>
<td class="status-yes">VM yes</td>
<td class="status-wip">IR verify; execute → VM</td>
<td>[#3106](https://github.com/PurHur/php-compiler/pull/3106) return-through-finally; [#3107](https://github.com/PurHur/php-compiler/pull/3107) JIT IR; <code>bin/jit.php</code> VM fallback ([#2114](https://github.com/PurHur/php-compiler/issues/2114))</td>
</tr>
<tr>
<td>Closures / arrow functions</td>
<td class="status-yes">VM yes</td>
<td class="status-wip">JIT IR</td>
<td>[#3092](https://github.com/PurHur/php-compiler/pull/3092) indirect invoke; [#3108](https://github.com/PurHur/php-compiler/pull/3108) <code>use(&$x)</code>; bootstrap stubs <code>null</code>; MCJIT execute ([#98](https://github.com/PurHur/php-compiler/issues/98), [#72](https://github.com/PurHur/php-compiler/issues/72))</td>
</tr>
<tr>
<td>Generators (<code>yield</code>)</td>
<td class="status-yes">VM yes</td>
<td class="status-wip">VM fallback</td>
<td>[#3085](https://github.com/PurHur/php-compiler/pull/3085) keyed yield; native lowering ([#167](https://github.com/PurHur/php-compiler/issues/167), [#3074](https://github.com/PurHur/php-compiler/issues/3074))</td>
</tr>
<tr>
<td><code>array_map</code> / callback builtins</td>
<td class="status-yes">Closures VM</td>
<td class="status-wip">String / named</td>
<td>[#3086](https://github.com/PurHur/php-compiler/pull/3086) VM closures; JIT closure callbacks open ([#1154](https://github.com/PurHur/php-compiler/issues/1154))</td>
</tr>
<tr>
<td>Backed enums (AOT)</td>
<td class="status-yes">VM</td>
<td class="status-no">No</td>
<td>VM regression fixed ([#3091](https://github.com/PurHur/php-compiler/pull/3091)); AOT ([#1356](https://github.com/PurHur/php-compiler/issues/1356), [#3076](https://github.com/PurHur/php-compiler/issues/3076))</td>
</tr>
<tr>
<td><code>bin/jit.php</code> MCJIT execute</td>
<td>—</td>
<td class="status-no">SIGSEGV</td>
<td>IR verify passes for many scripts; runtime probe fails ([#98](https://github.com/PurHur/php-compiler/issues/98)); embed work partial on master</td>
</tr>
<tr>
<td>Method calls / class methods (general)</td>
<td class="status-wip">Subset</td>
<td class="status-wip">Gaps</td>
<td><a href="https://github.com/PurHur/php-compiler/issues/58">#58</a>, <a href="https://github.com/PurHur/php-compiler/issues/145">#145</a></td>
</tr>
<tr>
<td>Namespaces + full <code>lib/</code> bundle</td>
<td class="status-wip">Growing</td>
<td class="status-wip">Self-host</td>
<td><a href="https://github.com/PurHur/php-compiler/issues/1492">#1492</a></td>
</tr>
<tr>
<td>External JIT object properties</td>
<td>—</td>
<td class="status-no">Stubbed</td>
<td><a href="https://github.com/PurHur/php-compiler/issues/58">#58</a></td>
</tr>
</tbody>
</table>
</div>
</section>
<section>
<h2>Vendor & infrastructure</h2>
<div class="table-wrap">
<table>
<thead>
<tr>
<th>Item</th>
<th>Status</th>
<th>Issue</th>
</tr>
</thead>
<tbody>
<tr>
<td>Prelinked php-cfg / php-types / php-llvm (no Composer at cold boot)</td>
<td class="status-yes">Done</td>
<td><a href="https://github.com/PurHur/php-compiler/pull/3036">#3036</a>, <a href="https://github.com/PurHur/php-compiler/pull/3050">#3050</a></td>
</tr>
<tr>
<td>Attributes reflection in JIT/AOT</td>
<td class="status-wip">VM v1 only</td>
<td><a href="https://github.com/PurHur/php-compiler/issues/2467">#2467</a></td>
</tr>
</tbody>
</table>
</div>
</section>
<p style="margin-top: 2rem">
<a href="index.html">← Overview</a> ·
<a href="development-status.html">Development status</a> ·
<a href="https://github.com/PurHur/php-compiler/blob/master/docs/self-host-target.md">self-host-target.md</a> (contributors)
</p>
</article>
</main>
<footer class="site-footer">
<p>
<a href="https://github.com/PurHur/php-compiler">PurHur/php-compiler</a>
· MIT · tables reflect <code>master</code> May 2026
</p>
</footer>
</body>
</html>