aboutsummaryrefslogtreecommitdiff
path: root/docs/implementation/index.html
blob: d0b73c59b1231f42f394664d73882b3093355ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<head>
  <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
  <link href="../style.css" rel="stylesheet"/>
  <title>BQN implementation notes</title>
</head>
<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a></div>
<h1 id="bqn-implementation-notes">BQN implementation notes</h1>
<p>Notes about how BQN is or could be implemented.</p>
<p>This repository's BQN implementation is written mainly in BQN: the bytecode <a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../src/c.bqn">compiler</a> is completely self-hosted, and the majority of the runtime (<a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../src/r0.bqn">r0</a>, <a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../src/r1.bqn">r1</a>) is written in BQN except that it is allowed to define primitives; some preprocessing (<a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../src/pr.bqn">pr</a>) turns the primitives into identifiers.</p>
<p>The remaining part, a Virtual Machine (VM), can be implemented in any language to obtain a version of BQN running in that language. The VM used for the online REPL is the <a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../docs/bqn.js">Javascript implementation</a>, while <a href="https://github.com/dzaima/CBQN">CBQN</a> is a more advanced VM in C. There are platform-specific and generic tests in the <a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../test/">test</a> directory.</p>
<ul>
<li><a href="vm.html">The BQN virtual machine and runtime</a>: the non-self-hosted parts of the BQN implementation, or those needed to port it to a new platform.</li>
<li><a href="primitive/index.html">Notes on implementing primitives</a></li>
<li><a href="compile/index.html">Notes on compilation</a></li>
<li><a href="codfns.html">Comparison to Co-dfns</a>, the only other array-based compiler.</li>
</ul>
<p>I held a few early forum discussions on the workings of the self-hosted compiler, but aborted these because the interactive format wasn't doing too much. I haven't yet started on non-interactive replacements.</p>
<ul>
<li><a href="https://chat.stackexchange.com/rooms/52405/conversation/lesson-s1-parenthesis-nesting-level">Parenthesis nesting level</a></li>
<li><a href="https://chat.stackexchange.com/rooms/52405/conversation/lesson-s2-infix-to-rpn">Infix to RPN</a></li>
<li><a href="https://chat.stackexchange.com/rooms/52405/conversation/lesson-s3-parsing-expressions-with-parentheses">Parsing expressions with parentheses</a></li>
</ul>