porffor 0.50.23 → 0.50.24

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 CHANGED
@@ -67,7 +67,7 @@ Expect nothing to work! Only very limited JS is currently supported. See files i
67
67
  - `-O2` to enable advanced opt (partial evaluation). unstable!
68
68
 
69
69
  ## Current limitations
70
- - Limited async support
70
+ - Limited async support (`Promise` and `await` have known bugs)
71
71
  - No variables between scopes (except args and globals)
72
72
  - No `eval()`/`Function()` etc (since it is AOT)
73
73
 
@@ -99,8 +99,8 @@ Porffor can run Test262 via some hacks/transforms which remove unsupported featu
99
99
  ## Codebase
100
100
  - `compiler`: contains the compiler itself
101
101
  - `2c.js`: porffor's custom wasm-to-c engine
102
- - `allocators.js`: static and dynamic allocators to power various language features
103
- - `assemble.js`: assembles wasm ops and metadata into a wasm module/file
102
+ - `allocators.js`: static/compile-time allocator
103
+ - `assemble.js`: assembles wasm ops and metadata into a spec-compliant wasm module/file
104
104
  - `builtins.js`: all manually written built-ins of the engine (spec, custom. vars, funcs)
105
105
  - `builtins_object.js`: all the various built-in objects (think `String`, `globalThis`, etc.)
106
106
  - `builtins_precompiled.js`: dynamically generated builtins from the `builtins/` folder
@@ -114,22 +114,21 @@ Porffor can run Test262 via some hacks/transforms which remove unsupported featu
114
114
  - `havoc.js`: wasm rewrite library (it wreaks havoc upon wasm bytecode hence "havoc")
115
115
  - `index.js`: doing all the compiler steps, takes code in, wasm out
116
116
  - `opt.js`: self-made wasm bytecode optimizer
117
- - `parse.js`: parser simply wrapping acorn
117
+ - `parse.js`: parser simply wrapping acorn (or other acorn-like parsers)
118
118
  - `pgo.js`: a profile guided optimizer
119
119
  - `precompile.js`: the tool to generate `builtins_precompied.js`
120
120
  - `prefs.js`: a utility to read command line arguments
121
- - `prototype.js`: some builtin prototype functions
121
+ - `prototype.js`: some builtin prototype functions (~legacy)
122
122
  - `types.js`: definitions for each of the builtin types
123
123
  - `wasmSpec.js`: "enums"/info from wasm spec
124
124
  - `wrap.js`: wrapper for compiler which instantiates and produces nice exports
125
125
 
126
126
  - `runner`: contains utils for running JS with the compiler
127
127
  - `index.js`: the main file, you probably want to use this
128
- - `info.js`: runs with extra info printed
129
128
  - `repl.js`: basic repl (uses `node:repl`)
130
129
 
131
130
  - `rhemyn`: contains [Rhemyn](#rhemyn) - our regex engine (used by Porffor)
132
- - `compile.js`: compiles regex ast into wasm bytecode
131
+ - `compile.js`: compiles regex ast into wasm bytecode aot
133
132
  - `parse.js`: own regex parser
134
133
 
135
134
  - `test`: contains many test files for majority of supported features
@@ -143,38 +142,6 @@ Currently, Porffor is seriously limited in features and functionality, however i
143
142
  - Potential for SIMD operations and other lower level concepts.
144
143
  - More in future probably?
145
144
 
146
- ## Todo
147
- No particular order and no guarantees, just what could happen soon™
148
-
149
- - Asur
150
- - Support memory
151
- - Support exceptions
152
- - Exceptions
153
- - Rethrowing inside catch
154
- - Optimizations
155
- - Rewrite local indexes per func for smallest local header and remove unused idxs
156
- - Smarter inline selection (snapshots?)
157
- - Memory alignment
158
- - Runtime
159
- - WASI target
160
- - Run precompiled Wasm file if given
161
- - Cool proposals
162
- - [Optional Chaining Assignment](https://github.com/tc39/proposal-optional-chaining-assignment)
163
- - [Modulus and Additional Integer Math](https://github.com/tc39/proposal-integer-and-modulus-math)
164
- - [Array Equality](https://github.com/tc39/proposal-array-equality)
165
- - [Declarations in Conditionals](https://github.com/tc39/proposal-Declarations-in-Conditionals)
166
- - [Seeded Pseudo-Random Numbers](https://github.com/tc39/proposal-seeded-random)
167
- - [`do` expressions](https://github.com/tc39/proposal-do-expressions)
168
- - [String Trim Characters](https://github.com/Kingwl/proposal-string-trim-characters)
169
- - Posts
170
- - Inlining investigation
171
- - JS -> Native
172
- - Precompiled TS built-ins
173
- - Asur
174
- - `escape()` optimization
175
- - PGO
176
- - Self hosted testing?
177
-
178
145
  ## Wasm proposals used
179
146
  Porffor intentionally does not use Wasm proposals which are not commonly implemented yet (eg GC) so it can be used in as many places as possible.
180
147
 
@@ -184,20 +151,8 @@ Porffor intentionally does not use Wasm proposals which are not commonly impleme
184
151
  - Exception handling (optional, only for errors)
185
152
  - Tail calls (opt-in, off by default)
186
153
 
187
- ## FAQ
188
-
189
- ### 1. Why the name?
154
+ ## The name
190
155
  `purple` in Welsh is `porffor`. Why purple?
191
156
  - No other JS engine is purple colored
192
157
  - Purple is pretty cool
193
158
  - Purple apparently represents "ambition", which is one word to describe this project
194
-
195
- ### 2. Why at all?
196
- Yes!
197
-
198
- ### 3. Isn't this the same as AssemblyScript/other Wasm langs?
199
- No. they are not alike at all internally and have very different goals/ideals:
200
- - Porffor is made as a generic JS engine, not for Wasm stuff specifically
201
- - Porffor primarily consumes JS
202
- - Porffor is written in pure JS and compiles itself, not using Binaryen/etc
203
- - (Also I didn't know it existed when I started this, lol)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
4
- "version": "0.50.23",
4
+ "version": "0.50.24",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/runner/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.50.23';
3
+ globalThis.version = '0.50.24';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {