Runtime surface.
The useful question is not “Does Porffor support JavaScript?” It is “Does it support the language and host capabilities this program actually touches?”
Language core
Everyday modern JavaScript is the strongest part of the surface: closures, classes and private fields, async functions, generators, destructuring, spread, symbols, templates, exceptions, regular expressions, and strict or sloppy semantics are implemented.
| Feature | State | Boundary |
|---|---|---|
eval / new Function | Build-time only | A constant string can compile; runtime-generated code cannot. |
BigInt | Partial | Core behavior works; edge cases remain. |
| file and package imports | Bundle first | Plain builds consume one file. Server builds bundle automatically. |
Proxy | Stub | The target is returned unchanged; traps never run. |
with | Unsafe | The body compiles without correct scope semantics. |
Atomics | Mostly stubbed | Only isLockFree is useful. |
Proxy and with can compile without delivering spec behavior. Search dependencies for them during migration.
TypeScript is syntax, not a service
Annotations, interfaces, aliases, assertions, satisfies, generics, enums, and type-only imports are accepted. Types are erased, though annotations may inform code generation.
Namespaces and decorators parse but are not meaningfully supported. Keep tsc --noEmit in CI for semantic checking.
Host APIs are intentionally smaller
| Area | Available today |
|---|---|
| Language objects | Object, Function, primitives, arrays, maps, sets, weak collections, typed arrays, ArrayBuffer, DataView |
| Text and data | JSON, RegExp, URI codecs, base64 codecs |
| Numbers and time | Math, Date, Temporal, numeric parsers |
| Async | Promise, iterators, async iterators; timers only in event-loop server builds |
| Diagnostics | console, standard error classes, performance |
| Server-only web surface | Request, Response, Headers, Blob, minimal URL, UTF-8 encoders |
Not a Node.js host
There is no process object and no built-in fs, path, or other node: modules. Client fetch, crypto, URLSearchParams, workers, abort/event APIs, structuredClone, and WebAssembly are also absent today.
Command line, in one view
| Form | Result |
|---|---|
porf | Start the REPL. |
porf file.js | Compile to a temporary artifact and run it. |
porf file.js out | Keep a native executable. |
porf c file.js out.c | Stop at self-contained C source. |
porf -e 'code' | Run inline source; use -p to print the value. |
Controls worth remembering
-O0 through -O3 choose C optimization; -t forces TypeScript; --module forces module parsing; -d keeps debug signal; -s strips; --compiler and --cxx select toolchains; --event-loop enables pending async server work.
Use porf --help for the active surface and porf --help all for compiler-development controls.