porffor 0.21.1 → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/compiler/2c.js +1 -1
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Porffor <sup><sub>/ˈpɔrfɔr/ *(poor-for)*</sup></sub>
|
2
|
-
A from-scratch experimental **AOT** optimizing JS/TS -> Wasm/C engine/compiler/runtime in JS. Not serious/intended for (real) use
|
3
|
-
|
2
|
+
A from-scratch experimental **AOT** optimizing JS/TS -> Wasm/C engine/compiler/runtime in JS. Not serious/intended for (real) use.<br>
|
3
|
+
|
4
|
+
<img src="https://github.com/CanadaHonk/porffor/assets/19228318/de8ad753-8ce3-4dcd-838e-f4d49452f8f8" alt="Screenshot of terminal showing Porffor running and compiling a hello world" width="60%">
|
4
5
|
|
5
6
|
## Design
|
6
7
|
Porffor is a very unique JS engine, due many wildly different approaches. It is seriously limited, but what it can do, it does pretty well. Key differences:
|
@@ -8,7 +9,7 @@ Porffor is a very unique JS engine, due many wildly different approaches. It is
|
|
8
9
|
- No constant runtime/preluded code
|
9
10
|
- Least Wasm imports possible (only I/O)
|
10
11
|
|
11
|
-
Porffor is primarily built from scratch, the only thing that is not is the parser (using [Acorn](https://github.com/acornjs/acorn)). Binaryen/etc is not used, we make final wasm binaries ourself. You could imagine it as compiling a language which is a sub (some things unsupported) and super (new/custom apis) set of javascript. Not based on any particular spec version
|
12
|
+
Porffor is primarily built from scratch, the only thing that is not is the parser (using [Acorn](https://github.com/acornjs/acorn)). Binaryen/etc is not used, we make final wasm binaries ourself. You could imagine it as compiling a language which is a sub (some things unsupported) and super (new/custom apis) set of javascript. Not based on any particular spec version.
|
12
13
|
|
13
14
|
## Usage
|
14
15
|
Expect nothing to work! Only very limited JS is currently supported. See files in `bench` for examples.
|
@@ -218,6 +219,8 @@ Mostly for reducing size. I do not really care about compiler perf/time as long
|
|
218
219
|
## Test262
|
219
220
|
Porffor can run Test262 via some hacks/transforms which remove unsupported features whilst still doing the same asserts (eg simpler error messages using literals only). It currently passes >14% (see latest commit desc for latest and details). Use `node test262` to test, it will also show a difference of overall results between the last commit and current results.
|
220
221
|
|
222
|
+

|
223
|
+
|
221
224
|
## Codebase
|
222
225
|
- `compiler`: contains the compiler itself
|
223
226
|
- `builtins.js`: all built-ins of the engine (spec, custom. vars, funcs)
|
package/compiler/2c.js
CHANGED
@@ -811,7 +811,7 @@ _time_out = _time.tv_nsec / 1000000. + _time.tv_sec * 1000.;`);
|
|
811
811
|
break;
|
812
812
|
}
|
813
813
|
|
814
|
-
log.warning('2c', `unimplemented op: ${invOpcodes[i[0]]} \x1b[90m(${f.name})`);
|
814
|
+
// log.warning('2c', `unimplemented op: ${invOpcodes[i[0]]} \x1b[90m(${f.name})`);
|
815
815
|
}
|
816
816
|
|
817
817
|
lastCond = false;
|
package/package.json
CHANGED