Skip to main content
Commonmark migration
Source Link

###How?

How?

###Unpacked and formatted

Unpacked and formatted

###How?

###Unpacked and formatted

How?

Unpacked and formatted

minor update
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650
 seq. | mnemonic | base 3 | decimal
------+----------+--------+---------
 SS   |    PSH   |    100 |     9
 STS  |    CPY   |   1010 |    30
 STN  |    SLI   |   1012 |    32
 SNS  |    DUP   |   1020 |    33
 SNT  |    SWP   |   1021 |    34
 SNN  |    DIS   |   1022 |    35
------+----------+--------+---------
 TTS  |    PUT   |   1110 |    39
 TTT  |    GET   |   1111 |    40
------+----------+--------+---------
 NSS  |    LBL   |   1200 |    45
 NST  |    JSR   |   1201 |    46
 NSN  |    JMP   |   1202 |    47
 NTS  |    JZE   |   1210 |    48
 NTT  |    JMI   |   1211 |    49
 NTN  |    RTN   |   1212 |    50
 NNN  |    END   |   1222 |    53
------+----------+--------+---------
 TSSS |    ADD   |  11000 |   108
 TSST |    SUB   |  11001 |   109
 TSSN |    MUL   |  11002 |   110
 TSTS |    DIV   |  11010 |   111
 TSTT |    MOD   |  11011 |   112
------+----------+--------+---------
 TNSS |    CHR   |  11200 |   126
 TNST |    INT   |  11201 |   127
 TNTS |    RCH   |  11210 |   129
 TNTT |    RNU   |  11211 |   130
  • First pass (\$X=0\$): we store all labels and ignore the jumps and the stack errors are ignored so that the whole code is parsed linearly and all labels are stored
  • Second pass (\$X=1\$): the code is executed normally
s => I => (
  R = X => (
    H = {},
    o = P = [],
    S = [],
    z = x = p = i = 0,
    g = n => s[p] ? ~(j = ` \t\n`.indexOf(s[p++])) ? j : g() : 3,
    h = n => g() < 2 ? h(n * 2 + j) : V = n,
    G = n => x = z-- && S.pop(y = x),
    F = n => g(
      x = [
        /* PSH */ "z=S.push(g()?-h(0):h(0))",,,,,,,,,,,,,,,,,,,,,
        /* CPY */ "z=S.push(S[z+~(g()?-h(0):h(0))])",,
        /* SLI */ "S.splice((z-=V=g()?-h(0):h(0))-1,V)",
        /* DUP */ "z=S.push(G()),z=S.push(x)",
        /* SWP */ "G(),G(),z=S.push(y),z=S.push(x)",
        /* DIS */ "G()",,,, 

        /* PUT */ "G(),G(),H[x]=y",
        /* GET */ "z=S.push(H[G()])",,,,, 

        /* LBL */ "R[h(1)]=p",
        /* JSR */ "h(1),p=X?R[P.push(p),V]:p",
        /* JMP */ "h(1),p=X?R[V]:p",
        /* JZE */ "h(1),p=X&!G()?R[V]:p",
        /* JMI */ "h(1),p=X&G()<0?R[V]:p",
        /* RTN */ "p=X?P.pop():p",,,
        /* END */ "p=X?g:p",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 

        /* ADD */ "z>1?(G(),G(),z=S.push(x+y)):p=X?g:p",
        /* SUB */ "z>1?(G(),G(),z=S.push(x-y)):p=X?g:p",
        /* MUL */ "z>1?(G(),G(),z=S.push(x*y)):p=X?g:p",
        /* DIV */ "z>1?(G(),G(),z=S.push(x/y|0)):p=X?g:p",
        /* MOD */ "z>1?(G(),G(),z=S.push(x%y)):p=X?g:p",,,,,,,,,,,,,, 

        /* CHR */ "o+=Buffer([G()])",
        /* INT */ "o+=G()",,
        /* RCH */ "H[G()]=I[i++].codePointAt()",
        /* RNU */ "H[G()]=I[i++]"
      ][n - 9],
      x && eval(x, n = 1)
    ) < 3 && F(n * 3 + j)
  )(1)
)(0) || R(1) || o
 seq. | base 3 | decimal
------+--------+---------
 SS   |    100 |     9
 STS  |   1010 |    30
 STN  |   1012 |    32
 SNS  |   1020 |    33
 SNT  |   1021 |    34
 SNN  |   1022 |    35
 TTS  |   1110 |    39
 TTT  |   1111 |    40
 NSS  |   1200 |    45
 NST  |   1201 |    46
 NSN  |   1202 |    47
 NTS  |   1210 |    48
 NTT  |   1211 |    49
 NTN  |   1212 |    50
 NNN  |   1222 |    53
 TSSS |  11000 |   108
 TSST |  11001 |   109
 TSSN |  11002 |   110
 TSTS |  11010 |   111
 TSTT |  11011 |   112
 TNSS |  11200 |   126
 TNST |  11201 |   127
 TNTS |  11210 |   129
 TNTT |  11211 |   130
  • First pass (\$X=0\$): we store all labels and ignore the jumps and the stack errors
  • Second pass (\$X=1\$): the code is executed normally
s => I => (
  R = X => (
    H = {},
    o = P = [],
    S = [],
    z = x = p = i = 0,
    g = n => s[p] ? ~(j = ` \t\n`.indexOf(s[p++])) ? j : g() : 3,
    h = n => g() < 2 ? h(n * 2 + j) : V = n,
    G = n => x = z-- && S.pop(y = x),
    F = n => g(
      x = [
        "z=S.push(g()?-h(0):h(0))",,,,,,,,,,,,,,,,,,,,,
        "z=S.push(S[z+~(g()?-h(0):h(0))])",,
        "S.splice((z-=V=g()?-h(0):h(0))-1,V)",
        "z=S.push(G()),z=S.push(x)",
        "G(),G(),z=S.push(y),z=S.push(x)",
        "G()",,,,
        "G(),G(),H[x]=y",
        "z=S.push(H[G()])",,,,,
        "R[h(1)]=p",
        "h(1),p=X?R[P.push(p),V]:p",
        "h(1),p=X?R[V]:p",
        "h(1),p=X&!G()?R[V]:p",
        "h(1),p=X&G()<0?R[V]:p",
        "p=X?P.pop():p",,,
        "p=X?g:p",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
        "z>1?(G(),G(),z=S.push(x+y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x-y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x*y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x/y|0)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x%y)):p=X?g:p",,,,,,,,,,,,,,
        "o+=Buffer([G()])",
        "o+=G()",,
        "H[G()]=I[i++].codePointAt()",
        "H[G()]=I[i++]"
      ][n - 9],
      x && eval(x, n = 1)
    ) < 3 && F(n * 3 + j)
  )(1)
)(0) || R(1) || o
 seq. | mnemonic | base 3 | decimal
------+----------+--------+---------
 SS   |    PSH   |    100 |     9
 STS  |    CPY   |   1010 |    30
 STN  |    SLI   |   1012 |    32
 SNS  |    DUP   |   1020 |    33
 SNT  |    SWP   |   1021 |    34
 SNN  |    DIS   |   1022 |    35
------+----------+--------+---------
 TTS  |    PUT   |   1110 |    39
 TTT  |    GET   |   1111 |    40
------+----------+--------+---------
 NSS  |    LBL   |   1200 |    45
 NST  |    JSR   |   1201 |    46
 NSN  |    JMP   |   1202 |    47
 NTS  |    JZE   |   1210 |    48
 NTT  |    JMI   |   1211 |    49
 NTN  |    RTN   |   1212 |    50
 NNN  |    END   |   1222 |    53
------+----------+--------+---------
 TSSS |    ADD   |  11000 |   108
 TSST |    SUB   |  11001 |   109
 TSSN |    MUL   |  11002 |   110
 TSTS |    DIV   |  11010 |   111
 TSTT |    MOD   |  11011 |   112
------+----------+--------+---------
 TNSS |    CHR   |  11200 |   126
 TNST |    INT   |  11201 |   127
 TNTS |    RCH   |  11210 |   129
 TNTT |    RNU   |  11211 |   130
  • First pass (\$X=0\$): the jumps and the stack errors are ignored so that the whole code is parsed linearly and all labels are stored
  • Second pass (\$X=1\$): the code is executed normally
s => I => (
  R = X => (
    H = {},
    o = P = [],
    S = [],
    z = x = p = i = 0,
    g = n => s[p] ? ~(j = ` \t\n`.indexOf(s[p++])) ? j : g() : 3,
    h = n => g() < 2 ? h(n * 2 + j) : V = n,
    G = n => x = z-- && S.pop(y = x),
    F = n => g(
      x = [
        /* PSH */ "z=S.push(g()?-h(0):h(0))",,,,,,,,,,,,,,,,,,,,,
        /* CPY */ "z=S.push(S[z+~(g()?-h(0):h(0))])",,
        /* SLI */ "S.splice((z-=V=g()?-h(0):h(0))-1,V)",
        /* DUP */ "z=S.push(G()),z=S.push(x)",
        /* SWP */ "G(),G(),z=S.push(y),z=S.push(x)",
        /* DIS */ "G()",,,, 

        /* PUT */ "G(),G(),H[x]=y",
        /* GET */ "z=S.push(H[G()])",,,,, 

        /* LBL */ "R[h(1)]=p",
        /* JSR */ "h(1),p=X?R[P.push(p),V]:p",
        /* JMP */ "h(1),p=X?R[V]:p",
        /* JZE */ "h(1),p=X&!G()?R[V]:p",
        /* JMI */ "h(1),p=X&G()<0?R[V]:p",
        /* RTN */ "p=X?P.pop():p",,,
        /* END */ "p=X?g:p",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 

        /* ADD */ "z>1?(G(),G(),z=S.push(x+y)):p=X?g:p",
        /* SUB */ "z>1?(G(),G(),z=S.push(x-y)):p=X?g:p",
        /* MUL */ "z>1?(G(),G(),z=S.push(x*y)):p=X?g:p",
        /* DIV */ "z>1?(G(),G(),z=S.push(x/y|0)):p=X?g:p",
        /* MOD */ "z>1?(G(),G(),z=S.push(x%y)):p=X?g:p",,,,,,,,,,,,,, 

        /* CHR */ "o+=Buffer([G()])",
        /* INT */ "o+=G()",,
        /* RCH */ "H[G()]=I[i++].codePointAt()",
        /* RNU */ "H[G()]=I[i++]"
      ][n - 9],
      x && eval(x, n = 1)
    ) < 3 && F(n * 3 + j)
  )(1)
)(0) || R(1) || o
saved 35 bytes
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650

JavaScript (Node.js),  608 597 586  586551 bytes

s=>I=>eval([..."8;@CDEJKLMNQTUWYZ^_bkqw"]"@CDEJKLMNQTUWYZ^_bkmqw"].reduce((s,c)=>(a=s.split(c)).join(a.pop()),"(R=X=>(H={},o=P=[],S=[],z=x=p=i=0,gWs[p]gUs[p]?~(j=` 	\n`.indexOf(s[pDYs[p++]N?j:gLgK:3,hWgL<2hUgK<2?Tn*2+jMn*2+j):V=n,GWx=zGUx=z--&&S.pop(y=xJFWgy=x),FUg(`qb$qS[z+~x=`mbQQ$mS[z+~(b]KS;ceb])TSCce((z-=V=b-1,VKqkJqxKMqyJqxKk$MH[x]=y$qH@KR[T1V)$mkJLmyJkTTLH[x]=y$mHD)qR[M1)]=_?R[P8pJV]R[P@p),V]:_Z_&_Y_&!kZ_&k<0Zp$CkY_&k<0Yp$E?P.popLpopK:p$w+NwpT$^QQQQQqW+yw-Nw*Nwyw*yw/y|0Yy|0w%yN:w%NUo+=Buffer(@Ko+=k^.codePointAtL^`;t`$`.some(c=>^QTTo+=Buffer(v-=~[47E47EEQ,9Q10QEQ,3,597QEQ26Q2][yDD)$o+=k$Z.codePointAtKZ`Ct`$`[n-n?0:x=c9],y=v=0)&&evalx&&eval(x,n=3Y<3&&Fn=1N<3&&F(n*4+jYn*3+jN(3Y1N(0)||R(1)||owUz>1?(Mqxqz=S8kGLbgL||owN:^$WqTT$mz=S@kGKbgK?-T0M0):T0Y_p$T1JC^$H@=I[iDZM0N_p$M1),E^E?g:pZ$HD=I[i++]Y?R[V]:YWz>1?(LmxU=n=>T$$QqqN))W=n=>UC?g:p$ThMh(Q,,NyY:MkLk,k,L()K()$JJ),E,1D++]Cp=X@[k];mx)$Ep=XD[k]C.spli8spli@.pusT"pusM"))

Try it online!Try it online! (all test cases without comments)

Try it online!Try it online! (an example with a commented source code as input)

The sequences of spaces, tabs and linefeeds are converted to an integer in base-4 (with 3 with a leading \$3\$ for EOT)\$1\$ until they match a known value:

 seq. | base 43 | decimal
------+--------+---------
 SS   |  300  100 |   48  9
 STS  |  3010 1010 |   196 30
 STN  |  3012 1012 |   198 32
 SNS  |  3020 1020 |   200 33
 SNT  |  3021 1021 |   201 34
 SNN  |  3022 1022 |   202 35
 TTS  |  3110 1110 |   212 39
 TTT  |  3111 1111 |   213 40
 NSS  |  3200 1200 |   224 45
 NST  |  3201 1201 |   225 46
 NSN  |  3202 1202 |   226 47
 NTS  |  3210 1210 |   228 48
 NTT  |  3211 1211 |   229 49
 NTN  |  3212 1212 |   230 50
 NNN  |  3222 1222 |   234 53
 TSSS |  3100011000 |   832108
 TSST |  3100111001 |   833109
 TSSN |  3100211002 |   834110
 TSTS |  3101011010 |   836111
 TSTT |  3101111011 |   837112
 TNSS |  3120011200 |   864126
 TNST |  3120111201 |   865127
 TNTS |  3121011210 |   868129
 TNTT |  3121111211 |   869130

We store the delta values minus \$1\$, leading to:

[47, 147, 1, 1,,, 9,, 10,,, 1,,, 3, 597,,, 1,, 26,, 2]

Once the command has been identified, we pick the code fromThe commands are simply stored in a lookup table and invokeexecuted with eval().

###Unpacked and formatted

s => I => (
  R = X => (
    H = {},
    o = P = [],
    S = [],
    z = x = p = i = 0,
    g = n => s[p] ? ~(j = ` \t\n`.indexOf(s[p++])) ? j : g() : 3,
    h = n => g() < 2 ? h(n * 2 + j) : V = n,
    G = n => x = z-- && S.pop(y = x),
    F = n => g(
      x = [
        "z=S.push(g()?-h(0):h(0))",,,,,,,,,,,,,,,,,,,,,
        "z=S.push(S[z+~(g()?-h(0):h(0))])",,
        "S.splice((z-=V=g()?-h(0):h(0))-1,V)",
        "z=S.push(G()),z=S.push(x)",
        "G(),G(),z=S.push(y),z=S.push(x)",
        "G()",,,,
        "G(),G(),H[x]=y",
        "z=S.push(H[G()])",,,,,
        "R[h(1)]=p",
        "h(1),p=X?R[P.push(p),V]:p",
        "h(1),p=X?R[V]:p",
        "h(1),p=X&!G()?R[V]:p",
        "h(1),p=X&G()<0?R[V]:p",
        "p=X?P.pop():p",,,
        "p=X?g:p",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
        "z>1?(G(),G(),z=S.push(x+y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x-y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x*y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x/y|0)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x%y)):p=X?g:p",,,,,,,,,,,,,,
        "o+=Buffer([G()])",
        "o+=G()",,
        "H[G()]=I[i++].codePointAt()",
        "H[G()]=I[i++]"
      ]
      .some(c =>
        (v][n -= ~[47, 147, 1, 1,,, 9,, 10,,, 1,,, 3, 597,,, 1,, 26,9], 2][y++]) - n ?
          0
        :
          x = c,
        y = v = 0
      ) && eval(x, n = 31)
    ) < 3 && F(n * 43 + j)
  )(31)
)(0) || R(1) || o

JavaScript (Node.js),  608 597  586 bytes

s=>I=>eval([..."8;@CDEJKLMNQTUWYZ^_bkqw"].reduce((s,c)=>(a=s.split(c)).join(a.pop()),"(R=X=>(H={},o=P=[],S=[],z=x=p=i=0,gWs[p]?~(j=` 	\n`.indexOf(s[pDY?j:gL:3,hWgL<2?Tn*2+j):V=n,GWx=z--&&S.pop(y=xJFWg(`qb$qS[z+~(b]KS;ce((z-=V=b-1,VKqkJqxKMqyJqxKk$MH[x]=y$qH@KR[T1)]=_?R[P8pJV]:_Z_&!kZ_&k<0Zp$C?P.popL:p$w+Nw-Nw*Nw/y|0Y:w%NUo+=Buffer(@Ko+=k^.codePointAtL^`;t`$`.some(c=>(v-=~[47E47EEQ,9Q10QEQ,3,597QEQ26Q2][yD)-n?0:x=c,y=v=0)&&eval(x,n=3Y<3&&F(n*4+jY(3Y(0)||R(1)||owUz>1?(Mqxqz=S8kGLbgL?-T0):T0Y_p$T1JC^$H@=I[iDZ?R[V]:Y))W=n=>UC?g:p$Th(Q,,NyY:Mk,k,L()K)$J),E,1D++]Cp=X@[k];.spli8.pusT"))

Try it online! (all test cases without comments)

Try it online! (an example with a commented source code as input)

The sequences of spaces, tabs and linefeeds are converted to an integer in base-4 (with \$3\$ for EOT) until they match a known value:

 seq. | base 4 | decimal
------+--------+---------
 SS   |  300   |   48
 STS  |  3010  |   196
 STN  |  3012  |   198
 SNS  |  3020  |   200
 SNT  |  3021  |   201
 SNN  |  3022  |   202
 TTS  |  3110  |   212
 TTT  |  3111  |   213
 NSS  |  3200  |   224
 NST  |  3201  |   225
 NSN  |  3202  |   226
 NTS  |  3210  |   228
 NTT  |  3211  |   229
 NTN  |  3212  |   230
 NNN  |  3222  |   234
 TSSS |  31000 |   832
 TSST |  31001 |   833
 TSSN |  31002 |   834
 TSTS |  31010 |   836
 TSTT |  31011 |   837
 TNSS |  31200 |   864
 TNST |  31201 |   865
 TNTS |  31210 |   868
 TNTT |  31211 |   869

We store the delta values minus \$1\$, leading to:

[47, 147, 1, 1,,, 9,, 10,,, 1,,, 3, 597,,, 1,, 26,, 2]

Once the command has been identified, we pick the code from a lookup table and invoke eval().

###Unpacked

s => I => (
  R = X => (
    H = {},
    o = P = [],
    S = [],
    z = x = p = i = 0,
    g = n => s[p] ? ~(j = ` \t\n`.indexOf(s[p++])) ? j : g() : 3,
    h = n => g() < 2 ? h(n * 2 + j) : V = n,
    G = n => x = z-- && S.pop(y = x),
    F = n => g(
      [
        "z=S.push(g()?-h(0):h(0))",
        "z=S.push(S[z+~(g()?-h(0):h(0))])",
        "S.splice((z-=V=g()?-h(0):h(0))-1,V)",
        "z=S.push(G()),z=S.push(x)",
        "G(),G(),z=S.push(y),z=S.push(x)",
        "G()",
        "G(),G(),H[x]=y",
        "z=S.push(H[G()])",
        "R[h(1)]=p",
        "h(1),p=X?R[P.push(p),V]:p",
        "h(1),p=X?R[V]:p",
        "h(1),p=X&!G()?R[V]:p",
        "h(1),p=X&G()<0?R[V]:p",
        "p=X?P.pop():p",
        "p=X?g:p",
        "z>1?(G(),G(),z=S.push(x+y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x-y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x*y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x/y|0)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x%y)):p=X?g:p",
        "o+=Buffer([G()])",
        "o+=G()",
        "H[G()]=I[i++].codePointAt()",
        "H[G()]=I[i++]"
      ]
      .some(c =>
        (v -= ~[47, 147, 1, 1,,, 9,, 10,,, 1,,, 3, 597,,, 1,, 26,, 2][y++]) - n ?
          0
        :
          x = c,
        y = v = 0
      ) && eval(x, n = 3)
    ) < 3 && F(n * 4 + j)
  )(3)
)(0) || R(1) || o

JavaScript (Node.js),  608 597 586  551 bytes

s=>I=>eval([..."@CDEJKLMNQTUWYZ^_bkmqw"].reduce((s,c)=>(a=s.split(c)).join(a.pop()),"(R=X=>(H={},o=P=[],S=[],z=x=p=i=0,gUs[p]?~(j=` 	\n`.indexOf(s[p++]N?j:gK:3,hUgK<2?Mn*2+j):V=n,GUx=z--&&S.pop(y=x),FUg(x=`mbQQ$mS[z+~(b])TSCce((z-=V=b-1,V)$mkJLmyJkTTLH[x]=y$mHD)qR[M1)]=_?R[P@p),V]:_Y_&!kY_&k<0Yp$E?P.popK:pT$^QQQQQqW+yw-yw*yw/y|0w%yN:^QTTo+=Buffer(D)$o+=k$Z.codePointAtKZ`Ct`$`[n-9],x&&eval(x,n=1N<3&&F(n*3+jN(1N(0)||R(1)||owN:^$WqTT$mz=S@kGKbgK?-M0):M0N_p$M1),E^E?g:pZ$HD=I[i++]Y?R[V]:Wz>1?(LmxU=n=>T$$QqqN))Mh(Lk,k,K()J),mx)$Ep=XD[k]C.spli@.pusM"))

Try it online! (all test cases without comments)

Try it online! (an example with a commented source code as input)

The sequences of spaces, tabs and linefeeds are converted to an integer in base 3 with a leading \$1\$ until they match a known value:

 seq. | base 3 | decimal
------+--------+---------
 SS   |    100 |     9
 STS  |   1010 |    30
 STN  |   1012 |    32
 SNS  |   1020 |    33
 SNT  |   1021 |    34
 SNN  |   1022 |    35
 TTS  |   1110 |    39
 TTT  |   1111 |    40
 NSS  |   1200 |    45
 NST  |   1201 |    46
 NSN  |   1202 |    47
 NTS  |   1210 |    48
 NTT  |   1211 |    49
 NTN  |   1212 |    50
 NNN  |   1222 |    53
 TSSS |  11000 |   108
 TSST |  11001 |   109
 TSSN |  11002 |   110
 TSTS |  11010 |   111
 TSTT |  11011 |   112
 TNSS |  11200 |   126
 TNST |  11201 |   127
 TNTS |  11210 |   129
 TNTT |  11211 |   130

The commands are simply stored in a lookup table and executed with eval().

###Unpacked and formatted

s => I => (
  R = X => (
    H = {},
    o = P = [],
    S = [],
    z = x = p = i = 0,
    g = n => s[p] ? ~(j = ` \t\n`.indexOf(s[p++])) ? j : g() : 3,
    h = n => g() < 2 ? h(n * 2 + j) : V = n,
    G = n => x = z-- && S.pop(y = x),
    F = n => g(
      x = [
        "z=S.push(g()?-h(0):h(0))",,,,,,,,,,,,,,,,,,,,,
        "z=S.push(S[z+~(g()?-h(0):h(0))])",,
        "S.splice((z-=V=g()?-h(0):h(0))-1,V)",
        "z=S.push(G()),z=S.push(x)",
        "G(),G(),z=S.push(y),z=S.push(x)",
        "G()",,,,
        "G(),G(),H[x]=y",
        "z=S.push(H[G()])",,,,,
        "R[h(1)]=p",
        "h(1),p=X?R[P.push(p),V]:p",
        "h(1),p=X?R[V]:p",
        "h(1),p=X&!G()?R[V]:p",
        "h(1),p=X&G()<0?R[V]:p",
        "p=X?P.pop():p",,,
        "p=X?g:p",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
        "z>1?(G(),G(),z=S.push(x+y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x-y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x*y)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x/y|0)):p=X?g:p",
        "z>1?(G(),G(),z=S.push(x%y)):p=X?g:p",,,,,,,,,,,,,,
        "o+=Buffer([G()])",
        "o+=G()",,
        "H[G()]=I[i++].codePointAt()",
        "H[G()]=I[i++]"
      ][n - 9],
      x && eval(x, n = 1)
    ) < 3 && F(n * 3 + j)
  )(1)
)(0) || R(1) || o
saved 11 bytes and added an explanation
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650
Loading
saved 11 bytes
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650
Loading
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650
Loading