From ae3be51b576657d68130040251f15e74ee6bdfcf Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 31 Oct 2021 18:08:32 -0400 Subject: Add tests based on vm.bqn --- rt.bqn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rt.bqn (limited to 'rt.bqn') diff --git a/rt.bqn b/rt.bqn new file mode 100644 index 00000000..3dd727a5 --- /dev/null +++ b/rt.bqn @@ -0,0 +1,19 @@ +# BQN runtime hosted in BQN + +⟨src,need⟩ ← •Import "src/pr.bqn" +compile ← need •Import "src/c.bqn" +glyphs ← ∾ •Import "src/glyphs.bqn" +vm ← •Import "vm.bqn" + +FillFn ← (⊑1↑0↑⥊)⊘{𝕩˙⌾⊢ <𝕨} +_fillBy_ ← {𝕘⋄𝔽} +GroupLen ← {(𝕨⌈≠)⊸↑0 FillFn≠¨⊔𝕩} +extra ← ⟨ •Type, FillFn, ⋆⁼, GroupLen, ∾⊔∘⊢, _fillBy_ ⟩ +provide ← { g←𝕩∊glyphs ⋄ (⍋⍋g)⊏extra∾•BQN∘⥊¨g/𝕩 } ∾need + +rt‿SetPrims ← VM ⟨provide,!∘0¨⟩ Compile src +PrimInd ← rt⊸⊐⌾< +Decompose ← ((≠glyphs)>PrimInd)◶⟨•Decompose,0⊸≍⟩ +SetPrims ⟨ Decompose, PrimInd ⟩ + +rt -- cgit v1.2.3