porffor 0.2.0-31c2539 → 0.2.0-3272f21

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.
Files changed (52) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +143 -82
  3. package/asur/README.md +2 -0
  4. package/asur/index.js +1262 -0
  5. package/byg/index.js +237 -0
  6. package/compiler/2c.js +317 -72
  7. package/compiler/{sections.js → assemble.js} +63 -15
  8. package/compiler/builtins/annexb_string.js +72 -0
  9. package/compiler/builtins/annexb_string.ts +19 -0
  10. package/compiler/builtins/array.ts +145 -0
  11. package/compiler/builtins/base64.ts +151 -0
  12. package/compiler/builtins/crypto.ts +120 -0
  13. package/compiler/builtins/date.ts +1370 -0
  14. package/compiler/builtins/escape.ts +141 -0
  15. package/compiler/builtins/int.ts +147 -0
  16. package/compiler/builtins/number.ts +527 -0
  17. package/compiler/builtins/porffor.d.ts +42 -0
  18. package/compiler/builtins/string.ts +1055 -0
  19. package/compiler/builtins/tostring.ts +45 -0
  20. package/compiler/builtins.js +601 -272
  21. package/compiler/{codeGen.js → codegen.js} +1184 -372
  22. package/compiler/decompile.js +3 -3
  23. package/compiler/embedding.js +22 -22
  24. package/compiler/encoding.js +108 -10
  25. package/compiler/generated_builtins.js +1262 -0
  26. package/compiler/index.js +36 -34
  27. package/compiler/log.js +6 -3
  28. package/compiler/opt.js +55 -29
  29. package/compiler/parse.js +35 -27
  30. package/compiler/precompile.js +123 -0
  31. package/compiler/prefs.js +26 -0
  32. package/compiler/prototype.js +177 -37
  33. package/compiler/types.js +37 -0
  34. package/compiler/wasmSpec.js +31 -7
  35. package/compiler/wrap.js +141 -43
  36. package/package.json +9 -5
  37. package/porf +4 -0
  38. package/rhemyn/compile.js +5 -3
  39. package/rhemyn/parse.js +323 -320
  40. package/rhemyn/test/parse.js +58 -58
  41. package/runner/compare.js +34 -34
  42. package/runner/debug.js +122 -0
  43. package/runner/index.js +55 -10
  44. package/runner/profiler.js +102 -0
  45. package/runner/repl.js +40 -7
  46. package/runner/sizes.js +37 -37
  47. package/compiler/builtins/base64.js +0 -92
  48. package/runner/info.js +0 -89
  49. package/runner/profile.js +0 -46
  50. package/runner/results.json +0 -1
  51. package/runner/transform.js +0 -15
  52. package/util/enum.js +0 -20
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 CanadaHonk
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2023 CanadaHonk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -10,6 +10,65 @@ Porffor is a very unique JS engine, due many wildly different approaches. It is
10
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, focusing on function/working over spec compliance.
12
12
 
13
+ ## Usage
14
+ Expect nothing to work! Only very limited JS is currently supported. See files in `bench` for examples.
15
+
16
+ ### Setup
17
+ 1. Clone this repo (`git clone https://github.com/CanadaHonk/porffor.git`)
18
+ 2. `npm install` - for parser(s)
19
+
20
+ ### Running a file
21
+ The repos comes with easy alias files for Unix and Windows, which you can use like so:
22
+ - Unix: `./porf path/to/script.js`
23
+ - Windows: `.\porf path/to/script.js`
24
+
25
+ Please note that further examples below will just use `./porf`, you need to use `.\porf` on Windows. You can also swap out `node` in the alias to use another runtime like Deno (`deno run -A`) or Bun (`bun ...`), or just use it yourself (eg `node runner/index.js ...`, `bun runner/index.js ...`). Node and Bun should work great, Deno support is WIP.
26
+
27
+ ### Trying a REPL
28
+ **`./porf`**. Just run it with no script file argument.
29
+
30
+ ### Compiling to native binaries
31
+ > [!WARNING]
32
+ > Compiling to native binaries uses [2c](#2c), Porffor's own Wasm -> C compiler, which is experimental.
33
+
34
+ **`./porf native path/to/script.js out(.exe)`**. You can specify the compiler with `-compiler=clang/zig/gcc`, and which opt level to use with `-cO=O3` (`Ofast` by default). Output binaries are also stripped by default.
35
+
36
+ ### Compiling to C
37
+ > [!WARNING]
38
+ > Compiling to C uses [2c](#2c), Porffor's own Wasm -> C compiler, which is experimental.
39
+
40
+ **`./porf c path/to/script.js (out.c)`**. When not including an output file, it will be printed to stdout instead.
41
+
42
+ ### Compiling to a Wasm binary
43
+ **`./porf compile path/to/script.js out.wasm`**. Currently it does not use an import standard like WASI, so it is mostly unusable.
44
+
45
+ ### Options
46
+ - `-target=wasm|c|native` (default: `wasm`) to set target output (native compiles c output to binary, see args below)
47
+ - `-target=c|native` only:
48
+ - `-o=out.c|out.exe|out` to set file to output c or binary
49
+ - `-target=native` only:
50
+ - `-compiler=clang` to set compiler binary (path/name) to use to compile
51
+ - `-cO=O3` to set compiler opt argument
52
+ - `-parser=acorn|@babel/parser|meriyah|hermes-parser` (default: `acorn`) to set which parser to use
53
+ - `-parse-types` to enable parsing type annotations/typescript. if `-parser` is unset, changes default to `@babel/parser`. does not type check
54
+ - `-opt-types` to perform optimizations using type annotations as compiler hints. does not type check
55
+ - `-valtype=i32|i64|f64` (default: `f64`) to set valtype
56
+ - `-O0` to disable opt
57
+ - `-O1` (default) to enable basic opt (simplify insts, treeshake wasm imports)
58
+ - `-O2` to enable advanced opt (inlining). unstable
59
+ - `-O3` to enable advanceder opt (precompute const math). unstable
60
+ - `-no-run` to not run wasm output, just compile
61
+ - `-opt-log` to log some opts
62
+ - `-code-log` to log some codegen (you probably want `-funcs`)
63
+ - `-regex-log` to log some regex
64
+ - `-funcs` to log funcs
65
+ - `-ast-log` to log AST
66
+ - `-opt-funcs` to log funcs after opt
67
+ - `-sections` to log sections as hex
68
+ - `-opt-no-inline` to not inline any funcs
69
+ - `-tail-call` to enable tail calls (experimental + not widely implemented)
70
+ - `-compile-hints` to enable V8 compilation hints (experimental + doesn't seem to do much?)
71
+
13
72
  ## Limitations
14
73
  - No full object support yet
15
74
  - Little built-ins/prototype
@@ -18,10 +77,15 @@ Porffor is primarily built from scratch, the only thing that is not is the parse
18
77
  - Literal callees only in calls (eg `print()` works, `a = print; a()` does not)
19
78
  - No `eval()` etc (since it is AOT)
20
79
 
21
- ## Rhemyn
80
+ ## Sub-engines
81
+
82
+ ### Asur
83
+ Asur is Porffor's own Wasm engine; it is an intentionally simple interpreter written in JS. It is very WIP. See [its readme](asur/README.md) for more details.
84
+
85
+ ### Rhemyn
22
86
  Rhemyn is Porffor's own regex engine; it compiles literal regex to Wasm bytecode AOT (remind you of anything?). It is quite basic and WIP. See [its readme](rhemyn/README.md) for more details.
23
87
 
24
- ## 2c
88
+ ### 2c
25
89
  2c is Porffor's own Wasm -> C compiler, using generated Wasm bytecode and internal info to generate specific and efficient/fast C code. Little boilerplate/preluded code or required external files, just for CLI binaries (not like wasm2c very much).
26
90
 
27
91
  ## Supported
@@ -86,20 +150,29 @@ These include some early (stage 1/0) and/or dead (last commit years ago) proposa
86
150
  - `for...of` (arrays and strings)
87
151
  - Array member setting (`arr[0] = 2`, `arr[0] += 2`, etc)
88
152
  - Array constructor (`Array(5)`, `new Array(1, 2, 3)`)
153
+ - Labelled statements (`foo: while (...)`)
154
+ - `do...while` loops
89
155
 
90
156
  ### Built-ins
91
157
 
92
- - `NaN` and `Infinity` (f64 only)
93
- - `isNaN()` and `isFinite()` (f64 only)
94
- - Most of `Number` (`MAX_VALUE`, `MIN_VALUE`, `MAX_SAFE_INTEGER`, `MIN_SAFE_INTEGER`, `POSITIVE_INFINITY`, `NEGATIVE_INFINITY`, `EPSILON`, `NaN`, `isNaN`, `isFinite`, `isInteger`, `isSafeInteger`) (some f64 only)
95
- - Some `Math` funcs (`Math.sqrt`, `Math.abs`, `Math.floor`, `Math.sign`, `Math.round`, `Math.trunc`, `Math.clz32`, `Math.fround`, `Math.random`) (f64 only)
158
+ - `NaN` and `Infinity`
159
+ - `isNaN()` and `isFinite()`
160
+ - Most of `Number` (`MAX_VALUE`, `MIN_VALUE`, `MAX_SAFE_INTEGER`, `MIN_SAFE_INTEGER`, `POSITIVE_INFINITY`, `NEGATIVE_INFINITY`, `EPSILON`, `NaN`, `isNaN`, `isFinite`, `isInteger`, `isSafeInteger`)
161
+ - Some `Math` funcs (`sqrt`, `abs`, `floor`, `sign`, `round`, `trunc`, `clz32`, `fround`, `random`)
96
162
  - Basic `globalThis` support
97
163
  - Basic `Boolean` and `Number`
98
164
  - Basic `eval` for literals
99
165
  - `Math.random()` using self-made xorshift128+ PRNG
100
- - Some of `performance` (`now()`)
101
- - Some of `Array.prototype` (`at`, `push`, `pop`, `shift`, `fill`)
102
- - Some of `String.prototype` (`at`, `charAt`, `charCodeAt`)
166
+ - Some of `performance` (`now()`, `timeOrigin`)
167
+ - Some of `Array.prototype` (`at`, `push`, `pop`, `shift`, `fill`, `slice`, `indexOf`, `lastIndexOf`, `includes`, `with`, `reverse`, `toReversed`)
168
+ - Some of `Array` (`of`, `isArray`)
169
+ - Most of `String.prototype` (`at`, `charAt`, `charCodeAt`, `toUpperCase`, `toLowerCase`, `startsWith`, `endsWith`, `indexOf`, `lastIndexOf`, `includes`, `padStart`, `padEnd`, `substring`, `substr`, `slice`, `trimStart`, `trimEnd`, `trim`, `toString`, `big`, `blink`, `bold`, `fixed`, `italics`, `small`, `strike`, `sub`, `sup`, `trimLeft`, `trimRight`, )
170
+ - Some of `crypto` (`randomUUID`)
171
+ - `escape`
172
+ - `btoa`
173
+ - Most of `Number.prototype` (`toString`, `toFixed`, `toExponential`)
174
+ - `parseInt`
175
+ - Spec-compliant `Date`
103
176
 
104
177
  ### Custom
105
178
 
@@ -108,42 +181,8 @@ These include some early (stage 1/0) and/or dead (last commit years ago) proposa
108
181
  - Intrinsic functions (see below)
109
182
  - Inlining wasm via ``asm`...``\` "macro"
110
183
 
111
- ## Todo
112
- No particular order and no guarentees, just what could happen soon™
113
-
114
- - Arrays
115
- - More of `Array` prototype
116
- - Arrays/strings inside arrays
117
- - Destructuring
118
- - Objects
119
- - Basic object expressions (eg `{}`, `{ a: 0 }`)
120
- - Wasm
121
- - *Basic* Wasm engine (interpreter) in JS
122
- - More math operators (`**`, etc)
123
- - `do { ... } while (...)`
124
- - Rewrite `console.log` to work with strings/arrays
125
- - Exceptions
126
- - Rewrite to use actual strings (optional?)
127
- - `try { } finally { }`
128
- - Rethrowing inside catch
129
- - Optimizations
130
- - Rewrite local indexes per func for smallest local header and remove unused idxs
131
- - Smarter inline selection (snapshots?)
132
- - Remove const ifs (`if (true)`, etc)
133
- - Use type(script) information to remove unneeded typechecker code
134
- - Cool proposals
135
- - [Optional Chaining Assignment](https://github.com/tc39/proposal-optional-chaining-assignment)
136
- - [Modulus and Additional Integer Math](https://github.com/tc39/proposal-integer-and-modulus-math)
137
- - [Array Equality](https://github.com/tc39/proposal-array-equality)
138
- - [Declarations in Conditionals](https://github.com/tc39/proposal-Declarations-in-Conditionals)
139
- - [Seeded Pseudo-Random Numbers](https://github.com/tc39/proposal-seeded-random)
140
- - [`do` expressions](https://github.com/tc39/proposal-do-expressions)
141
- - [String Trim Characters](https://github.com/Kingwl/proposal-string-trim-characters)
142
-
143
184
  ## Performance
144
- *For the things it supports most of the time*, Porffor is blazingly fast compared to most interpreters, and common engines running without JIT. For those with JIT, it is not that much slower like a traditional interpreter would be; mostly the same or a bit faster/slower depending on what.
145
-
146
- ![Screenshot of comparison chart](https://github.com/CanadaHonk/porffor/assets/19228318/76c75264-cc68-4be1-8891-c06dc389d97a)
185
+ *For the features it supports most of the time*, Porffor is *blazingly fast* compared to most interpreters and common engines running without JIT. For those with JIT, it is usually slower by default, but can catch up with compiler arguments and typed input, even more so when compiling to native binaries.
147
186
 
148
187
  ## Optimizations
149
188
  Mostly for reducing size. I do not really care about compiler perf/time as long as it is reasonable. We do not use/rely on external opt tools (`wasm-opt`, etc), instead doing optimization inside the compiler itself creating even smaller code sizes than `wasm-opt` itself can produce as we have more internal information.
@@ -165,10 +204,12 @@ Mostly for reducing size. I do not really care about compiler perf/time as long
165
204
  - Remove unneeded blocks (no `br`s inside)
166
205
  - Remove unused imports
167
206
  - Use data segments for initing arrays/strings
207
+ - (Likely more not documented yet, todo)
168
208
 
169
209
  ### Wasm module
170
210
  - Type cache/index (no repeated types)
171
211
  - No main func if empty (and other exports)
212
+ - No tags if unused/optimized out
172
213
 
173
214
  ## Test262
174
215
  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 >10% (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.
@@ -176,7 +217,7 @@ Porffor can run Test262 via some hacks/transforms which remove unsupported featu
176
217
  ## Codebase
177
218
  - `compiler`: contains the compiler itself
178
219
  - `builtins.js`: all built-ins of the engine (spec, custom. vars, funcs)
179
- - `codeGen.js`: code (wasm) generation, ast -> wasm. The bulk of the effort
220
+ - `codegen.js`: code (wasm) generation, ast -> wasm. The bulk of the effort
180
221
  - `decompile.js`: basic wasm decompiler for debug info
181
222
  - `embedding.js`: utils for embedding consts
182
223
  - `encoding.js`: utils for encoding things as bytes as wasm expects
@@ -184,7 +225,7 @@ Porffor can run Test262 via some hacks/transforms which remove unsupported featu
184
225
  - `index.js`: doing all the compiler steps, takes code in, wasm out
185
226
  - `opt.js`: self-made wasm bytecode optimizer
186
227
  - `parse.js`: parser simply wrapping acorn
187
- - `sections.js`: assembles wasm ops and metadata into a wasm module/file
228
+ - `assemble.js`: assembles wasm ops and metadata into a wasm module/file
188
229
  - `wasmSpec.js`: "enums"/info from wasm spec
189
230
  - `wrap.js`: wrapper for compiler which instantiates and produces nice exports
190
231
 
@@ -201,47 +242,67 @@ Porffor can run Test262 via some hacks/transforms which remove unsupported featu
201
242
  - `test262`: test262 runner and utils
202
243
 
203
244
  ## Usecases
204
- Basically none (other than giving people headaches). Potential ideas to come?
245
+ Basically none right now (other than giving people headaches). Potential ideas:
246
+ - Safety. As Porffor is written in JS, a memory-safe language\*, and compiles JS to Wasm, a fully sandboxed environment\*, it is quite safe. (\* These rely on the underlying implementations being secure. You could also run Wasm, or even Porffor itself, with an interpreter instead of a JIT for bonus security points too.)
247
+ - Compiling JS to native binaries. This is still very early!
248
+ - More in future probably?
205
249
 
206
- ## Usage
207
- Basically nothing will work :). See files in `test` for examples.
250
+ ## Todo
251
+ No particular order and no guarentees, just what could happen soon™
208
252
 
209
- 1. Clone repo
210
- 2. `npm install`
211
- 3. `node test` to run tests (some will fail)
212
- 4. `node runner path/to/code.js` to run a file (or `node runner` to use wip repl)
253
+ - Arrays
254
+ - More of `Array` prototype
255
+ - Arrays/strings inside arrays
256
+ - Destructuring
257
+ - Objects
258
+ - Basic object expressions (eg `{}`, `{ a: 0 }`)
259
+ - Asur
260
+ - Support memory
261
+ - Support exceptions
262
+ - More math operators (`**`, etc)
263
+ - Typed export inputs (array)
264
+ - Exceptions
265
+ - Rewrite to use actual strings (optional?)
266
+ - `try { } finally { }`
267
+ - Rethrowing inside catch
268
+ - Optimizations
269
+ - Rewrite local indexes per func for smallest local header and remove unused idxs
270
+ - Smarter inline selection (snapshots?)
271
+ - Remove const ifs (`if (true)`, etc)
272
+ - Memory alignment
273
+ - Add general pref for always using "fast" (non-short circuiting) or/and
274
+ - Runtime
275
+ - WASI target
276
+ - Run precompiled Wasm file if given
277
+ - Docs
278
+ - Update codebase readme section
279
+ - Cool proposals
280
+ - [Optional Chaining Assignment](https://github.com/tc39/proposal-optional-chaining-assignment)
281
+ - [Modulus and Additional Integer Math](https://github.com/tc39/proposal-integer-and-modulus-math)
282
+ - [Array Equality](https://github.com/tc39/proposal-array-equality)
283
+ - [Declarations in Conditionals](https://github.com/tc39/proposal-Declarations-in-Conditionals)
284
+ - [Seeded Pseudo-Random Numbers](https://github.com/tc39/proposal-seeded-random)
285
+ - [`do` expressions](https://github.com/tc39/proposal-do-expressions)
286
+ - [String Trim Characters](https://github.com/Kingwl/proposal-string-trim-characters)
287
+ - Posts
288
+ - Inlining investigation
289
+ - JS -> Native
290
+ - Precompiled TS built-ins
291
+ - Asur
292
+ - `escape()` optimization
293
+ - Self hosted testing?
213
294
 
214
- You can also use Deno (`deno run -A ...` instead of `node ...`), or Bun (`bun ...` instead of `node ...`).
295
+ ## VSCode extension
296
+ There is a vscode extension in `vscode-ext` which tweaks JS syntax highlighting to be nicer with porffor features (eg highlighting wasm inside of inline asm).
215
297
 
216
- ### Options
217
- - `-target=wasm|c|native` (default: `wasm`) to set target output (native compiles c output to binary, see args below)
218
- - `-target=c|native` only:
219
- - `-o=out.c|out.exe|out` to set file to output c or binary
220
- - `-target=native` only:
221
- - `-compiler=clang` to set compiler binary (path/name) to use to compile
222
- - `-cO=O3` to set compiler opt argument
223
- - `-parser=acorn|@babel/parser|meriyah|hermes-parser` (default: `acorn`) to set which parser to use
224
- - `-parse-types` to enable parsing type annotations/typescript. if `-parser` is unset, changes default to `@babel/parser`. does not type check
225
- - `-opt-types` to perform optimizations using type annotations as compiler hints. does not type check
226
- - `-valtype=i32|i64|f64` (default: `f64`) to set valtype
227
- - `-O0` to disable opt
228
- - `-O1` (default) to enable basic opt (simplify insts, treeshake wasm imports)
229
- - `-O2` to enable advanced opt (inlining). unstable
230
- - `-O3` to enable advanceder opt (precompute const math). unstable
231
- - `-no-run` to not run wasm output, just compile
232
- - `-opt-log` to log some opts
233
- - `-code-log` to log some codegen (you probably want `-funcs`)
234
- - `-regex-log` to log some regex
235
- - `-funcs` to log funcs
236
- - `-ast-log` to log AST
237
- - `-opt-funcs` to log funcs after opt
238
- - `-sections` to log sections as hex
239
- - `-opt-no-inline` to not inline any funcs
240
- - `-tail-call` to enable tail calls (experimental + not widely implemented)
241
- - `-compile-hints` to enable V8 compilation hints (experimental + doesn't seem to do much?)
298
+ ## Wasm proposals used
299
+ 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.
242
300
 
243
- ## VSCode extension
244
- There is a vscode extension in `porffor-for-vscode` which tweaks JS syntax highlighting to be nicer with porffor features (eg highlighting wasm inside of inline asm).
301
+ - Multi-value **(required)**
302
+ - Non-trapping float-to-int conversions **(required)**
303
+ - Bulk memory operations (required, but uncommonly used)
304
+ - Exception handling (optional, for errors)
305
+ - Tail calls (opt-in, off by default)
245
306
 
246
307
  ## Isn't this the same as AssemblyScript/other Wasm langs?
247
308
  No. they are not alike at all internally and have very different goals/ideals:
package/asur/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # asur
2
+ a basic experimental wip wasm engine/interpreter in js. wasm engine for porffor. not serious/intended for (real) use