porffor 0.34.11 → 0.34.13
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 +5 -9
- package/compiler/builtins/string.ts +5 -3
- package/compiler/builtins_precompiled.js +4 -4
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
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.
|
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
|
|
@@ -67,12 +67,10 @@ Expect nothing to work! Only very limited JS is currently supported. See files i
|
|
67
67
|
- `-O2` to enable advanced opt (inlining). unstable!
|
68
68
|
- `-O3` to enable advanceder opt (precompute const math). unstable!
|
69
69
|
|
70
|
-
##
|
71
|
-
-
|
72
|
-
- No object prototypes yet
|
73
|
-
- No async/promise/await
|
70
|
+
## Current limitations
|
71
|
+
- Limited async support
|
74
72
|
- No variables between scopes (except args and globals)
|
75
|
-
- No `eval()` etc (since it is AOT)
|
73
|
+
- No `eval()`/`Function()` etc (since it is AOT)
|
76
74
|
|
77
75
|
## Sub-engines
|
78
76
|
|
@@ -279,7 +277,6 @@ No particular order and no guarentees, just what could happen soon™
|
|
279
277
|
- Support memory
|
280
278
|
- Support exceptions
|
281
279
|
- Exceptions
|
282
|
-
- `try { } finally { }`
|
283
280
|
- Rethrowing inside catch
|
284
281
|
- Optimizations
|
285
282
|
- Rewrite local indexes per func for smallest local header and remove unused idxs
|
@@ -323,8 +320,7 @@ Porffor intentionally does not use Wasm proposals which are not commonly impleme
|
|
323
320
|
`purple` in Welsh is `porffor`. Why purple?
|
324
321
|
- No other JS engine is purple colored
|
325
322
|
- Purple is pretty cool
|
326
|
-
- Purple apparently represents "ambition", which is
|
327
|
-
- The hard to speak name is also the noise your brain makes in reaction to this idea!
|
323
|
+
- Purple apparently represents "ambition", which is one word to describe this project
|
328
324
|
|
329
325
|
### 2. Why at all?
|
330
326
|
Yes!
|
@@ -1146,8 +1146,9 @@ local.set ${x}`;
|
|
1146
1146
|
return out;
|
1147
1147
|
};
|
1148
1148
|
|
1149
|
-
export const __String_prototype_repeat = (_this: string,
|
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,
|
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,
|
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","
|
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,
|
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","
|
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