aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/running.html2
-rw-r--r--running.md2
-rwxr-xr-xtest/dc.bqn (renamed from dc.bqn)4
-rwxr-xr-xtest/dz_comp17
-rw-r--r--test/dzrt.bqn (renamed from bqn.bqn)9
5 files changed, 19 insertions, 15 deletions
diff --git a/docs/running.html b/docs/running.html
index b78b10ad..98e6ce01 100644
--- a/docs/running.html
+++ b/docs/running.html
@@ -14,7 +14,7 @@
<ul>
<li>Javascript, in this repository. Slow (compiles at ~5kB/s) but usable.</li>
<li><a href="https://github.com/dzaima/CBQN">C</a>, targetting high performance. Some parts are fast, some are not.</li>
-<li>dzaima/BQN (<a href="https://github.com/mlochbaum/BQN/blob/master/bqn.bqn">bqn.bqn</a>), mainly for testing.</li>
+<li>BQN (<a href="https://github.com/mlochbaum/BQN/blob/master/vm.bqn">vm.bqn</a>), for testing the compiler easily.</li>
<li><a href="https://github.com/cannadayr/ebqn">Erlang</a>, intended for embedding. Too slow to be practical; a <a href="https://github.com/cannadayr/ebqn-rs/">Rust version</a> is in progress to fix this.</li>
</ul>
<h4 id="javascript"><a class="header" href="#javascript">Javascript</a></h4>
diff --git a/running.md b/running.md
index 98790c04..51b6f1a0 100644
--- a/running.md
+++ b/running.md
@@ -15,7 +15,7 @@ This version of BQN is [implemented](implementation/README.md) mainly in BQN its
Support in the following languages has been implemented:
- Javascript, in this repository. Slow (compiles at ~5kB/s) but usable.
- [C](https://github.com/dzaima/CBQN), targetting high performance. Some parts are fast, some are not.
-- dzaima/BQN ([bqn.bqn](bqn.bqn)), mainly for testing.
+- BQN ([vm.bqn](vm.bqn)), for testing the compiler easily.
- [Erlang](https://github.com/cannadayr/ebqn), intended for embedding. Too slow to be practical; a [Rust version](https://github.com/cannadayr/ebqn-rs/) is in progress to fix this.
#### Javascript
diff --git a/dc.bqn b/test/dc.bqn
index cec675ba..5a0ccae8 100755
--- a/dc.bqn
+++ b/test/dc.bqn
@@ -4,8 +4,8 @@
# multiple bodies, and use variable names instead of counts.
# Rearrange and make up some names so the bytecode can be run.
-glyphs ← •Import∘"src/glyphs.bqn"⍟(0=≠) •args
-compile ← glyphs •Import "src/c.bqn"
+glyphs ← •Import∘"../src/glyphs.bqn"⍟(0=≠) •args
+compile ← glyphs •Import "../src/c.bqn"
special←<˘∘‿2⥊"𝕤𝕩𝕨𝕣𝕗𝕘"
DCompile⇐{
diff --git a/test/dz_comp b/test/dz_comp
index 9815bb40..e9bf1c06 100755
--- a/test/dz_comp
+++ b/test/dz_comp
@@ -5,12 +5,17 @@ files ← "simple"‿"syntax"‿"prim"⍟(0=≠) ('-'≠⊑)¨⊸/ •args
"Can't test runtime without the compiler!" ! ¬nc∧rt∨ref
Native ← •BQN
-exec ← ((rt⌈2×ref)¬nc)◶⟨
- Native˙ # Native
- {𝕤⋄ ⟨DRun⟩←•Import "../dc.bqn" ⋄ DRun} # Compiled; native runtime
- {𝕤⋄ •Import "../bqn.bqn"} # Self-hosted
- {𝕤⋄ ⟨DRun⟩←•Import "../dc.bqn" ⋄ (•Import"ref.bqn")⊸DRun} # Reference implementations
-⟩ @
+exec ← {
+ nc ? Native ;
+ # Otherwise compiled
+ ⟨DRun⟩ ← •Import "dc.bqn"
+ r ← {
+ ref ? •Import "ref.bqn" ; # Reference implementations
+ rt ? •Import "dzrt.bqn" ; # Self-hosted
+ •BQN∘⥊¨ ∾ •Import "../src/glyphs.bqn" # Native runtime
+ }
+ r⊸DRun
+}
Cases ← (0<≠)◶0‿('#'≠⊑)¨⊸/ · •FLines "cases/"∾∾⟜".bqn"
c ← ∾ Cases¨ files
diff --git a/bqn.bqn b/test/dzrt.bqn
index 254c8a7b..ae217e07 100644
--- a/bqn.bqn
+++ b/test/dzrt.bqn
@@ -1,10 +1,9 @@
-# BQN hosted in dzaima/BQN
-# Result is a function that executes BQN code.
+# Runtime hosted in dzaima/BQN
-⟨src,need⟩ ← •Import "src/pr.bqn"
+⟨src,need⟩ ← •Import "../src/pr.bqn"
⟨DRun⟩ ← •Import "dc.bqn"
⟨DCompile⟩ ← need •Import "dc.bqn"
-glyphs ← ∾ gl ← •Import "src/glyphs.bqn"
+glyphs ← ∾ gl ← •Import "../src/glyphs.bqn"
GroupLen ← {(𝕨⌈≠)⊸↑0•FillFn≠¨⊔𝕩}
extra ← ⟨ •Type, •FillFn, ⋆⁼, GroupLen, ∾⊔∘⊢, •_fillBy_ ⟩
@@ -21,4 +20,4 @@ sys ← {𝕩⊏˜𝕨⊸⊐}˝⍉>⟨
"glyph"‿(glyphs⊑˜PrimInd)
"decompose"‿Decompose
-BQN ← ⟨rt,Sys⟩⊸DRun
+⟨rt,Sys⟩