porffor 0.34.11 → 0.34.12

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
@@ -1,5 +1,5 @@
1
1
  # Porffor &nbsp;<sup><sub>/ˈpɔrfɔr/ &nbsp;*(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.<br>
2
+ A from-scratch experimental **AOT** optimizing JS/TS -> Wasm/C engine/compiler/runtime in JS. Research project, not yet intended for serious use.<br>
3
3
 
4
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%">
5
5
 
@@ -279,7 +279,6 @@ No particular order and no guarentees, just what could happen soon™
279
279
  - Support memory
280
280
  - Support exceptions
281
281
  - Exceptions
282
- - `try { } finally { }`
283
282
  - Rethrowing inside catch
284
283
  - Optimizations
285
284
  - Rewrite local indexes per func for smallest local header and remove unused idxs
@@ -323,8 +322,7 @@ Porffor intentionally does not use Wasm proposals which are not commonly impleme
323
322
  `purple` in Welsh is `porffor`. Why purple?
324
323
  - No other JS engine is purple colored
325
324
  - Purple is pretty cool
326
- - Purple apparently represents "ambition", which is.. one word to describe this project
327
- - The hard to speak name is also the noise your brain makes in reaction to this idea!
325
+ - Purple apparently represents "ambition", which is one word to describe this project
328
326
 
329
327
  ### 2. Why at all?
330
328
  Yes!
@@ -1146,8 +1146,9 @@ local.set ${x}`;
1146
1146
  return out;
1147
1147
  };
1148
1148
 
1149
- export const __String_prototype_repeat = (_this: string, count: number) => {
1149
+ export const __String_prototype_repeat = (_this: string, cnt: any) => {
1150
1150
  let out: string = Porffor.allocate();
1151
+ const count: number = ecma262.ToIntegerOrInfinity(cnt);
1151
1152
 
1152
1153
  count |= 0;
1153
1154
  if (count < 0) throw new RangeError('Invalid count value');
@@ -1179,8 +1180,9 @@ memory.copy 0 0`;
1179
1180
  return out;
1180
1181
  };
1181
1182
 
1182
- export const __ByteString_prototype_repeat = (_this: string, count: number) => {
1183
+ export const __ByteString_prototype_repeat = (_this: string, cnt: any) => {
1183
1184
  let out: bytestring = Porffor.allocate();
1185
+ const count: number = ecma262.ToIntegerOrInfinity(cnt);
1184
1186
 
1185
1187
  count |= 0;
1186
1188
  if (count < 0) throw new RangeError('Invalid count value');
@@ -1597,4 +1599,4 @@ export const __String_prototype_valueOf = (_this: string) => {
1597
1599
  export const __ByteString_prototype_valueOf = (_this: bytestring) => {
1598
1600
  // 1. Return ? ThisStringValue(this value).
1599
1601
  return _this;
1600
- };
1602
+ };
@@ -2224,14 +2224,14 @@ locals:[127,127,127,127,127,127,127,127,127,127,127],localNames:["_this","_this#
2224
2224
  hasRestArgument:1,
2225
2225
  };
2226
2226
  this.__String_prototype_repeat = {
2227
- wasm:(_,{builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[33,4],[32,2],[65,0],[114],[34,2],[65,0],[72],[4,64],...internalThrow(_,'RangeError',`Invalid count value`),[11],[32,0],[40,1,0],[65,2],[108],[33,5],[65,0],[33,6],[3,64],[32,6],[32,2],[72],[4,64],[32,4],[65,4],[106],[32,6],[32,5],[108],[106],[32,0],[65,4],[106],[32,5],[252,10,0,0],[32,6],[65,1],[106],[33,6],[12,1],[11],[11],[32,4],[32,5],[32,2],[108],[54,0,0],[32,4],[65,195,0],[15]],
2227
+ wasm:(_,{builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[33,4],[32,2],[184],[32,3],[16,builtin('__ecma262_ToIntegerOrInfinity')],[33,6],[252,2],[34,5],[65,0],[114],[34,5],[65,0],[72],[4,64],...internalThrow(_,'RangeError',`Invalid count value`),[11],[32,0],[40,1,0],[65,2],[108],[33,7],[65,0],[33,8],[3,64],[32,8],[32,5],[72],[4,64],[32,4],[65,4],[106],[32,8],[32,7],[108],[106],[32,0],[65,4],[106],[32,7],[252,10,0,0],[32,8],[65,1],[106],[33,8],[12,1],[11],[11],[32,4],[32,7],[32,5],[108],[54,0,0],[32,4],[65,195,0],[15]],
2228
2228
  params:[127,127,127,127],typedParams:1,returns:[127,127],typedReturns:1,
2229
- locals:[127,127,127],localNames:["_this","_this#type","count","count#type","out","thisLen","i"],
2229
+ locals:[127,127,127,127,127],localNames:["_this","_this#type","cnt","cnt#type","out","count","#last_type","thisLen","i"],
2230
2230
  };
2231
2231
  this.__ByteString_prototype_repeat = {
2232
- wasm:(_,{builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[33,4],[32,2],[65,0],[114],[34,2],[65,0],[72],[4,64],...internalThrow(_,'RangeError',`Invalid count value`),[11],[32,0],[40,1,0],[33,5],[65,0],[33,6],[3,64],[32,6],[32,2],[72],[4,64],[32,4],[65,4],[106],[32,6],[32,5],[108],[106],[32,0],[65,4],[106],[32,5],[252,10,0,0],[32,6],[65,1],[106],[33,6],[12,1],[11],[11],[32,4],[32,5],[32,2],[108],[54,0,0],[32,4],[65,195,1],[15]],
2232
+ wasm:(_,{builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[33,4],[32,2],[184],[32,3],[16,builtin('__ecma262_ToIntegerOrInfinity')],[33,6],[252,2],[34,5],[65,0],[114],[34,5],[65,0],[72],[4,64],...internalThrow(_,'RangeError',`Invalid count value`),[11],[32,0],[40,1,0],[33,7],[65,0],[33,8],[3,64],[32,8],[32,5],[72],[4,64],[32,4],[65,4],[106],[32,8],[32,7],[108],[106],[32,0],[65,4],[106],[32,7],[252,10,0,0],[32,8],[65,1],[106],[33,8],[12,1],[11],[11],[32,4],[32,7],[32,5],[108],[54,0,0],[32,4],[65,195,1],[15]],
2233
2233
  params:[127,127,127,127],typedParams:1,returns:[127,127],typedReturns:1,
2234
- locals:[127,127,127],localNames:["_this","_this#type","count","count#type","out","thisLen","i"],
2234
+ locals:[127,127,127,127,127],localNames:["_this","_this#type","cnt","cnt#type","out","count","#last_type","thisLen","i"],
2235
2235
  };
2236
2236
  this.__String_prototype_split = {
2237
2237
  wasm:(_,{builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[33,6],[65,0],[33,7],[65,195,0],[33,8],[32,5],[65,128,1],[70],[4,64],[65,255,255,255,255,7],[34,4],[65,1],[33,5],[26],[11],[32,4],[65,0],[114],[34,4],[65,1],[33,5],[26],[32,4],[65,0],[72],[4,64],[65,255,255,255,255,7],[34,4],[65,1],[33,5],[26],[11],[16,builtin('__Porffor_allocate')],[33,9],[65,0],[33,10],[32,0],[40,1,0],[65,2],[108],[33,11],[32,2],[40,1,0],[34,12],[65,1],[70],[4,64],[32,2],[34,15],[40,1,0],[33,14],[32,3],[33,18],[2,127],[32,18],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[2,127],[65,0],[34,16],[32,14],[78],[4,64],[65,127],[12,1],[11],[32,16],[65,2],[108],[32,15],[106],[47,0,4],[65,1],[33,17],[11],[12,1],[11],[32,18],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[2,127],[65,0],[34,16],[32,14],[78],[4,64],[65,127],[12,1],[11],[32,16],[32,15],[106],[45,0,4],[65,1],[33,17],[11],[12,1],[11],...internalThrow(_,'TypeError',`'charCodeAt' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[33,13],[65,0],[33,19],[3,64],[32,19],[32,11],[72],[4,64],[2,64],[32,0],[32,19],[106],[47,0,4],[34,20],[32,13],[70],[4,64],[32,7],[32,4],[78],[4,64],[32,6],[34,22],[32,7],[34,21],[54,1,0],[32,6],[65,208,0],[15],[11],[32,9],[34,22],[32,10],[34,21],[54,1,0],[32,6],[32,7],[65,9],[108],[106],[32,9],[184],[57,0,4],[32,6],[32,7],[65,9],[108],[106],[32,8],[58,0,12],[32,7],[65,1],[106],[33,7],[16,builtin('__Porffor_allocate')],[33,9],[65,0],[33,10],[12,1],[11],[32,9],[32,10],[65,2],[108],[106],[32,20],[59,0,4],[32,10],[65,1],[106],[33,10],[11],[32,19],[65,2],[106],[34,19],[12,1],[11],[11],[5],[65,0],[33,23],[65,0],[33,19],[3,64],[32,19],[32,11],[72],[4,64],[2,64],[32,0],[32,19],[106],[47,0,4],[34,20],[32,2],[34,15],[40,1,0],[33,14],[32,3],[33,18],[2,127],[32,18],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[2,127],[32,23],[34,16],[32,14],[78],[4,64],[65,127],[12,1],[11],[32,16],[65,2],[108],[32,15],[106],[47,0,4],[65,1],[33,17],[11],[12,1],[11],[32,18],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[2,127],[32,23],[34,16],[32,14],[78],[4,64],[65,127],[12,1],[11],[32,16],[32,15],[106],[45,0,4],[65,1],[33,17],[11],[12,1],[11],...internalThrow(_,'TypeError',`'charCodeAt' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[70],[4,64],[32,23],[65,1],[106],[34,23],[32,12],[70],[4,64],[32,7],[32,4],[78],[4,64],[32,6],[34,22],[32,7],[34,21],[54,1,0],[32,6],[65,208,0],[15],[11],[32,9],[34,22],[32,10],[32,12],[65,1],[107],[107],[34,21],[54,1,0],[32,6],[32,7],[65,9],[108],[106],[32,9],[184],[57,0,4],[32,6],[32,7],[65,9],[108],[106],[32,8],[58,0,12],[32,7],[65,1],[106],[33,7],[16,builtin('__Porffor_allocate')],[33,9],[65,0],[33,10],[12,2],[11],[5],[65,0],[33,23],[11],[32,9],[32,10],[106],[32,20],[59,0,4],[32,10],[65,1],[106],[33,10],[11],[32,19],[65,2],[106],[34,19],[12,1],[11],[11],[11],[32,10],[65,0],[74],[34,24],[4,127],[32,7],[32,4],[72],[65,2],[33,17],[5],[32,24],[65,2],[33,17],[11],[33,25],[32,17],[33,18],[2,127],[32,18],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,25],[40,1,0],[12,1],[11],[32,18],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,25],[40,1,0],[12,1],[11],[32,25],[11,"TYPESWITCH_end"],[4,64],[32,9],[34,22],[32,10],[34,21],[54,1,0],[32,6],[32,7],[65,9],[108],[106],[32,9],[184],[57,0,4],[32,6],[32,7],[65,9],[108],[106],[32,8],[58,0,12],[32,7],[65,1],[106],[33,7],[11],[32,6],[34,22],[32,7],[34,21],[54,1,0],[32,6],[65,208,0],[15]],
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.34.11+f7ca044b2",
4
+ "version": "0.34.12+a590b1020",
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.34.11+f7ca044b2';
3
+ globalThis.version = '0.34.12+a590b1020';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {