porffor README

The project's README from github.com/CanadaHonk/porffor. As one markdown file: README.md.

Porffor  (poor-for)

An ahead-of-time JavaScript compiler

curl -fsSL https://porffor.dev/install.sh | sh

$ cat hello.js
console.log('hello world!');
$ porf hello.js -o hello
[105ms] compiled hello.js -> hello (33.7KB)
$ ./hello
hello world!

Porffor is a 100% AOT compiled JS engine/runtime. There is nothing interpreted or compiled just-in-time. Porffor compiles JS to C (with an IR inbetween). We chose this approach because:

Versioning

Porffor releases use a single increasing release number. Releases are automatically published every git push after CI testing.

Name

purple in Welsh is porffor. Why purple?

porffor (CanadaHonk/porffor)

runtime
Searching Database…

5.3K ·GitHub
What is this?Porffor is an ahead-of-time JavaScript compiler: a 100% AOT compiled JS engine and runtime. Nothing in it interprets or just-in-time compiles your code.
How is that different from usual JavaScript engines like V8?Usual engines interpret or JIT-compile code while it runs; Porffor compiles your whole JS program ahead of time into C (with an IR in between), and that C is built like any other program.
How do I install it and compile my first script?The README documents no install command; new releases are published automatically after every git push passes CI, so grab the latest one from the project's GitHub releases page.
Do I need LLVM, Node or any other heavy tooling?No LLVM or Cranelift — avoiding direct dependence on such backends is a stated design goal. The output is plain C, so a regular C toolchain is what compiles it for your target.
Is it stable enough to use for real projects?It moves fast: versioning is one ever-increasing release number and every CI-passing push produces a new release, so expect frequent changes rather than a fixed stable line.
Where can the compiled output run?Porffor emits C, so compiled output can run essentially everywhere C compiles, and the emitted code is easily modifiable post-compile for diverse environments.
Why is it called Porffor?'Porffor' is Welsh for the color purple. The author picked it because no other JS engine is purple, purple is pretty cool, and purple reportedly represents ambition — which fits this project, as the README puts it.
What is Porffor itself written in?Mostly JavaScript: GitHub lists JavaScript as the project's primary language, with C in the mix too — fitting for a compiler whose output is C.
What are similar projects?CalcKernel, gcc, scriptc, mquickjs, ir, Singeli, raddebugger, tsx
Creator
CanadaHonk
Size
40.9 MB
Stars
5.3K
Age
3y
Commits · 90 Days