diff options
| -rw-r--r-- | bqn.bqn | 20 | ||||
| -rwxr-xr-x | test/dz_comp | 26 |
2 files changed, 25 insertions, 21 deletions
diff --git a/bqn.bqn b/bqn.bqn new file mode 100644 index 00000000..00c62cb4 --- /dev/null +++ b/bqn.bqn @@ -0,0 +1,20 @@ +# BQN hosted in dzaima/BQN +# Result is a function that executes BQN code. + +⟨DRun,DCompile⟩ ← •Import "dc.bqn" +⟨ref,glyphs⟩ ← •Import "src/pr.bqn" + +PrimInd ← {⊑rt⊐<𝕩} +Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩ +provide ← ⟨ + •Type # Type + Decompose # Decompose + glyphs⊑˜PrimInd # Glyph + •FillFn # Fill + ⋆⁼ # Log + ≠¨⊔ # GroupLen + ∾⊔∘⊢ # GroupOrd + !,+,-,×,÷,⋆,⌊,=,≤,≢,⥊,⊑,↕,⌜,`,•_fillBy_,⊘ +⟩ +rt ← •COMP provide⊸(⊣»«)⌾(1⊸⊑) DCompile ref +rt⊸DRun diff --git a/test/dz_comp b/test/dz_comp index 87cb44e6..2e4e6ffb 100755 --- a/test/dz_comp +++ b/test/dz_comp @@ -4,27 +4,11 @@ nc‿rt ← "-nocomp"‿"-rt" ∊ •args files ← "simple"‿"syntax"‿"prim"⍟(0=≠) ('-'≠⊑)¨⊸/ •args "Can't test runtime without the compiler!" ! ¬nc∧rt -⟨DRun,DCompile⟩ ← •Import "../dc.bqn" - -GetRT ← {𝕤: - ⟨ref,glyphs⟩ ← •Import "../src/pr.bqn" - PrimInd ← {⊑rt⊐<𝕩} - Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩ - provide ← ⟨ - •Type # Type - Decompose # Decompose - glyphs⊑˜PrimInd # Glyph - •FillFn # Fill - ⋆⁼ # Log - ≠¨⊔ # GroupLen - ∾⊔∘⊢ # GroupOrd - !,+,-,×,÷,⋆,⌊,=,≤,≢,⥊,⊑,↕,⌜,`,•_fillBy_,⊘ - ⟩ - rt ← •COMP provide⊸(⊣»«)⌾(1⊸⊑) DCompile ref -} - -Native ← {⍎𝕩} -exec ← (rt¬nc)◶⟨Native˙, DRun˙, {𝕩⊸DRun}∘GetRT⟩ @ +exec ← (rt¬nc)◶⟨ + {⍎𝕩}˙ # Native + {𝕤⋄ ⟨DRun⟩←•Import "../dc.bqn" ⋄ DRun} # Compiled; native runtime + {𝕤⋄ •Import"../bqn.bqn"} # Self-hosted +⟩ @ Cases ← (0<≠)◶0‿('#'≠⊑)¨⊸/ · •FLines "cases/"∾∾⟜".bqn" c ← ∾ Cases¨ files |
