aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/doc/context.html1
-rw-r--r--docs/doc/depth.html1
-rw-r--r--docs/doc/fromDyalog.html1
-rw-r--r--docs/doc/functional.html1
-rw-r--r--docs/doc/group.html1
-rw-r--r--docs/doc/index.html1
-rw-r--r--docs/doc/indices.html1
-rw-r--r--docs/doc/join.html1
-rw-r--r--docs/doc/logic.html1
-rw-r--r--docs/doc/transpose.html1
-rw-r--r--docs/doc/windows.html1
-rw-r--r--docs/problems.html1
-rw-r--r--docs/running.html1
-rw-r--r--docs/spec/evaluate.html2
-rw-r--r--docs/spec/grammar.html2
-rw-r--r--docs/spec/index.html1
-rw-r--r--docs/spec/literal.html2
-rw-r--r--docs/spec/token.html2
-rw-r--r--docs/spec/types.html2
-rw-r--r--docs/style.css4
20 files changed, 28 insertions, 0 deletions
diff --git a/docs/doc/context.html b/docs/doc/context.html
index f511c1ef..90963840 100644
--- a/docs/doc/context.html
+++ b/docs/doc/context.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="bqn-s-context-free-grammar">BQN's context-free grammar</h1>
<p>APL has a problem. To illustrate, let's look at an APL expression:</p>
<pre><span class='Value'>a</span> <span class='Value'>b</span> <span class='Value'>c</span> <span class='Value'>d</span> <span class='Value'>e</span>
diff --git a/docs/doc/depth.html b/docs/doc/depth.html
index ea3ad9c7..92e05dd3 100644
--- a/docs/doc/depth.html
+++ b/docs/doc/depth.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="depth">Depth</h1>
<p>The depth of an array is the greatest level of array nesting it attains, or, put another way, the greatest number of times you can pick an element starting from the original array before reaching a non-array. The monadic function Depth (<code><span class='Function'>≡</span></code>) returns the depth of its argument, while the 2-modifier Depth (<code><span class='Modifier2'>⚇</span></code>) can control the way its left operand is applied based on the depth of its arguments. Several primitive functions also use the depth of the left argument to decide whether it applies to a single axis of the right argument or to several axes.</p>
<h2 id="the-depth-function">The Depth function</h2>
diff --git a/docs/doc/fromDyalog.html b/docs/doc/fromDyalog.html
index 723b832b..70bdb134 100644
--- a/docs/doc/fromDyalog.html
+++ b/docs/doc/fromDyalog.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="bqn-dyalog-apl-dictionary">BQN–Dyalog APL dictionary</h1>
<p>A few tables to help users of Dyalog APL (or similar) get started quickly on BQN. Here we assume <code><span class='Value'>⎕</span><span class='Function'>ML</span></code> is 1 for Dyalog.</p>
<h2 id="for-reading">For reading</h2>
diff --git a/docs/doc/functional.html b/docs/doc/functional.html
index bc1b7c73..7e208167 100644
--- a/docs/doc/functional.html
+++ b/docs/doc/functional.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="functional-programming">Functional programming</h1>
<p>BQN boasts of its functional capabilities, including first-class functions. What sort of functional support does it have, and how can a BQN programmer exercise these and out themself as a Schemer at heart?</p>
<p>First, let's be clear about what the terms we're using mean. A language has <em>first-class functions</em> when functions (however they are defined) can be used in all the same ways as &quot;ordinary&quot; values like numbers and so on, such as being passed as an argument or placed in a list. Lisp and JavaScript have first-class functions, C has unsafe first-class functions via function pointers, and Java and APL don't have them as functions can't be placed in lists or used as arguments. This doesn't mean every operation is supported on functions: for instance, numbers can be added, compared, and sorted; while functions could perhaps be added to give a train, comparing or sorting them as functions (not representations) isn't computable, and BQN doesn't support any of the three operations when passing functions as arguments.</p>
diff --git a/docs/doc/group.html b/docs/doc/group.html
index 4f3a6b62..8a562285 100644
--- a/docs/doc/group.html
+++ b/docs/doc/group.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="group">Group</h1>
<p>BQN replaces the <a href="https://aplwiki.com/wiki/Key">Key</a> operator from J or Dyalog APL, and <a href="https://aplwiki.com/wiki/Partition_representations">many forms of partitioning</a>, with a single (ambivalent) Group function <code><span class='Function'>⊔</span></code>. This function is somewhat related to the K function <code><span class='Function'>=</span></code> of the same name, but results in an array rather than a dictionary.</p>
<p>The BQN prototype does not implement this function: instead it uses <code><span class='Function'>⊔</span></code> for a Group/Key function very similar to <code><span class='Brace'>{</span><span class='Value'>⊂⍵</span><span class='Brace'>}</span><span class='Value'>⌸</span></code> in Dyalog APL, and also has a Cut function <code><span class='Value'>\</span></code>. The new BQN Group on numeric arguments (equivalently, rank-1 results) can be defined like this:</p>
diff --git a/docs/doc/index.html b/docs/doc/index.html
index a822c0a9..2e873e3c 100644
--- a/docs/doc/index.html
+++ b/docs/doc/index.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="bqn-documentation">BQN documentation</h1>
<p>Here is the documentation for BQN, describing what features BQN has, how to use them (with examples), and why they were chosen. As it is considerably more in-depth than the <a href="../spec/index.html">specification</a>, the documentation is much less complete. The following pages are present now:</p>
<p>Concepts:</p>
diff --git a/docs/doc/indices.html b/docs/doc/indices.html
index 68651b13..5366bdb6 100644
--- a/docs/doc/indices.html
+++ b/docs/doc/indices.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="indices">Indices</h1>
<p>One-dimensional arrays such as K lists or Python arrays have only one kind of index, a single number that refers to an element. For multidimensional arrays using the leading axis theory, there are several types of indexing that can be useful. Historically, nested APL designs have equivocated between these, which I believe can lead to subtle errors when programming. BQN focuses on single-number (depth 0) indices, which can refer to list elements or array major cells (or more generally indexing along any particular axis). When using this kind of element index, indexed arrays are required to be lists. Only two functions allow the use of list element indices: Range (<code><span class='Function'>↕</span></code>), which can accept a list argument, and Pick (<code><span class='Function'>⊑</span></code>), which uses the depth-1 arrays in its left argument as index scalars or lists. Others use single-number indices to refer to cells.</p>
<p>The following functions take or return indices. Except where marked, the indices are in the result; this is by far the most common type of index use. <code><span class='Function'>⊔</span></code> is given two rows as it falls into both cases. Note that in the result case, there is usually no possibility for the programmer to select the format of indices. Instead, the language should be carefully designed to make sure that the kind of index returned is as useful as possible.</p>
diff --git a/docs/doc/join.html b/docs/doc/join.html
index 4df484c4..b6ac1ace 100644
--- a/docs/doc/join.html
+++ b/docs/doc/join.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="join">Join</h1>
<p>Join (<code><span class='Function'>∾</span></code>) is an extension of the monadic function <a href="https://aplwiki.com/wiki/Raze">Raze</a> from A+ and J to arbitrary argument ranks. It has the same relationship to Join to, the dyadic function sharing the same glyph, as Merge (<code><span class='Function'>&gt;</span></code>) does to Couple (<code><span class='Function'>≍</span></code>): <code><span class='Value'>a</span><span class='Function'>≍</span><span class='Value'>b</span></code> is <code><span class='Function'>&gt;</span><span class='Value'>a</span><span class='Ligature'>‿</span><span class='Value'>b</span></code> and <code><span class='Value'>a</span><span class='Function'>∾</span><span class='Value'>b</span></code> is <code><span class='Function'>∾</span><span class='Value'>a</span><span class='Ligature'>‿</span><span class='Value'>b</span></code>. While Merge and Couple combine arrays (the elements of Merge's argument, or the arguments themselves for Couple) along a new leading axis, Join and Join to combine them along the existing leading axis. Both Merge and Join can also be called on a higher-rank array, causing Merge to add multiple leading axes while Join combines elements along multiple existing axes.</p>
<p>Join can be used to combine several strings into a single string, like <code><span class='Value'>array.join</span><span class='Paren'>()</span></code> in Javascript (but it doesn't force the result to be a string).</p>
diff --git a/docs/doc/logic.html b/docs/doc/logic.html
index 2235259a..7ac951d8 100644
--- a/docs/doc/logic.html
+++ b/docs/doc/logic.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="logic-functions--and--or--not--also-span-">Logic functions: And, Or, Not (also Span)</h1>
<p>BQN retains the APL symbols <code><span class='Function'>∧</span></code> and <code><span class='Function'>∨</span></code> for logical <em>and</em> and <em>or</em>, and changed APL's <code><span class='Value'>~</span></code> to <code><span class='Function'>¬</span></code> for <em>not</em>, since <code><span class='Value'>~</span></code> looks too much like <code><span class='Modifier'>˜</span></code> and <code><span class='Function'>¬</span></code> is more common in mathematics today. Like J, BQN extends Not to the linear function <code><span class='Number'>1</span><span class='Modifier2'>⊸</span><span class='Function'>-</span></code>. However, it discards <a href="https://aplwiki.com/wiki/GCD">GCD</a> and <a href="https://aplwiki.com/wiki/LCM">LCM</a> as extensions of And and Or, and instead uses bilinear extensions: And is identical to Times (<code><span class='Function'>×</span></code>), while Or is <code><span class='Function'>×</span><span class='Modifier2'>⌾</span><span class='Function'>¬</span></code>, following De Morgan's laws (other ways of obtaining a function for Or give an equivalent result—there is only one bilinear extension).</p>
<p>If the arguments are probabilities of independent events, then an extended function gives the probability of the boolean function on their outcomes (for example, if <em>A</em> occurs with probability <code><span class='Value'>a</span></code> and <em>B</em> with probability <code><span class='Value'>b</span></code> independent of <em>A</em>, then <em>A</em> or <em>B</em> occurs with probability <code><span class='Value'>a</span><span class='Function'>∨</span><span class='Value'>b</span></code>). These extensions have also been used in complexity theory, because they allow mathematicians to transfer a logical circuit from the discrete to the continuous domain in order to use calculus on it.</p>
diff --git a/docs/doc/transpose.html b/docs/doc/transpose.html
index 43b51b48..51e8b91a 100644
--- a/docs/doc/transpose.html
+++ b/docs/doc/transpose.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="transpose">Transpose</h1>
<p>As in APL, Transpose (<code><span class='Function'>⍉</span></code>) is a tool for rearranging the axes of an array. BQN's version is tweaked to align better with the leading axis model and make common operations easier.</p>
<h2 id="monadic-transpose">Monadic Transpose</h2>
diff --git a/docs/doc/windows.html b/docs/doc/windows.html
index fa2202dc..79d18e77 100644
--- a/docs/doc/windows.html
+++ b/docs/doc/windows.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="windows">Windows</h1>
<p>In BQN, it's strongly preferred to use functions, and not modifiers, for array manipulation. Functions are simpler as they have fewer moving parts. They are more concrete, since the array results can always be viewed right away. They are easier to implement with reasonable performance as well, since there is no need to recognize many possible function operands as special cases.</p>
<p>The Window function replaces APL's Windowed Reduction, J's more general Infix operator, and Dyalog's Stencil, which is adapted from one case of J's Cut operator.</p>
diff --git a/docs/problems.html b/docs/problems.html
index 5f053696..b2ea1faa 100644
--- a/docs/problems.html
+++ b/docs/problems.html
@@ -1,4 +1,5 @@
<head><link href="style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="problems-with-bqn">Problems with BQN</h1>
<p>Every language has some issues that everyone can agree make programming harder. Sometimes there is a simple solution that has not yet been discovered; sometimes the problem is inherent to the language because it's caused by fundamental choices (or anywhere in between). Below are problems I have identified in BQN, ordered from what I consider the most severe to the least. This is independent of whether the issue can be solved—if it somehow went away, how much better would the language be?</p>
<p>I've omitted problems that are obviously addressed by speculated extensions. Of course adding A fixes the problem &quot;doesn't have A&quot;. Problems that only exist in reference to some existing convention (e.g. unfamiliarity to APLers) are also left out, unless the convention manifests technically (Unicode support).</p>
diff --git a/docs/running.html b/docs/running.html
index 02ad00db..a8c9a2e0 100644
--- a/docs/running.html
+++ b/docs/running.html
@@ -1,4 +1,5 @@
<head><link href="style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="how-to-run-bqn">How to run BQN</h1>
<p>BQN is in a very early stage of development, and there is currently no complete implementation of the language. However, it's a relatively simple language to implement, and a few implementations come close.</p>
<h3 id="bqn-ngn">BQN2NGN</h3>
diff --git a/docs/spec/evaluate.html b/docs/spec/evaluate.html
index 7ebbe147..66e49930 100644
--- a/docs/spec/evaluate.html
+++ b/docs/spec/evaluate.html
@@ -1,4 +1,6 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<h1 id="specification--bqn-evaluation">Specification: BQN evaluation</h1>
<p>This page describes the semantics of the code constructs whose grammar is given in <a href="grammar.html">grammar.md</a>. The formation rules there are not named, and here they are identified by either the name of the term or by copying the rule entirely if there are several alternative productions.</p>
<p>Here we assume that the referent of each identifier, or equivalently the connections between identifiers, have been identified according to the <a href="scope.html">scoping rules</a>.</p>
<h3 id="programs-and-blocks">Programs and blocks</h3>
diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html
index 09d0bafa..8a3ead18 100644
--- a/docs/spec/grammar.html
+++ b/docs/spec/grammar.html
@@ -1,4 +1,6 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<h1 id="specification--bqn-grammar">Specification: BQN grammar</h1>
<p>BQN's grammar is given below. Terms are defined in a <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form">BNF</a> variant. However, handling special names properly is possible but difficult in BNF, so they are explained in text along with the braced block grammar.</p>
<p>The symbols <code><span class='Value'>s</span></code>, <code><span class='Function'>F</span></code>, <code><span class='Modifier'>_m</span></code>, and <code><span class='Modifier2'>_c_</span></code> are identifier tokens with subject, function, 1-modifier, and 2-modifier classes respectively. Similarly, <code><span class='Value'>sl</span></code>, <code><span class='Function'>Fl</span></code>, <code><span class='Modifier'>_ml</span></code>, and <code><span class='Modifier2'>_cl_</span></code> refer to literals and primitives of those classes. While names in the BNF here follow the identifier naming scheme, this is informative only: syntactic classes are no longer used after parsing and cannot be inspected in a running program.</p>
<p>A program is a list of statements. Almost all statements are expressions. However, explicit definitions and valueless results stemming from <code><span class='Nothing'>·</span></code>, or <code><span class='Value'>𝕨</span></code> in a monadic brace function, can be used as statements but not expressions.</p>
diff --git a/docs/spec/index.html b/docs/spec/index.html
index 17a06dd4..33705b4e 100644
--- a/docs/spec/index.html
+++ b/docs/spec/index.html
@@ -1,4 +1,5 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
<h1 id="bqn-specification">BQN specification</h1>
<p>This directory gives a (currently incomplete) specification for BQN. The specification differs from the <a href="../doc/index.html">documentation</a> in that its purpose is only to describe the exact details of BQN's operation in the most quickly accessible way, rather than to explain the core ideas of BQN functionality and how it might be used. Since it is easier to specify than to document, the specification is currently more complete than the documentation; for example, it includes nearly all primitives.</p>
<p>The following aspects define BQN and are or will be specified:</p>
diff --git a/docs/spec/literal.html b/docs/spec/literal.html
index 2d03bc68..1a8e3406 100644
--- a/docs/spec/literal.html
+++ b/docs/spec/literal.html
@@ -1,4 +1,6 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<h1 id="specification--bqn-literal-notation">Specification: BQN literal notation</h1>
<p>A <em>literal</em> is a single <a href="token.html">token</a> that indicates a fixed character, number, or array. While literals indicate values of a data type, <a href="primitive.html">primitives</a> indicate values of an operation type: function, 1-modifier, or 2-modifier.</p>
<p>Two types of literal deal with text. As the source code is considered to be a sequence of unicode code points (&quot;characters&quot;), and these code points are also used for BQN's character <a href="types.html">data type</a>, the representation of a text literal is very similar to its value. In a text literal, the newline character is always represented using the ASCII line feed character, code point 10. A <em>character literal</em> is enclosed with single quotes <code>'</code> and its value is identical to the single character between them. A <em>string literal</em> is enclosed in double quotes <code>&quot;</code>, and any double quotes between them must come in pairs, as a lone double quote marks the end of the literal. The value of a string literal is a rank-1 array whose elements are the characters in between the enclosing quotes, after replacing each pair of double quotes with only one such quote.</p>
<p>The format of a <em>numeric literal</em> is more complicated. From the <a href="token.html">tokenization rules</a>, a numeric literal consists of a numeric character (one of <code><span class='Number'>¯∞π.0123456789</span></code>) followed by any number of numeric or alphabetic characters. Some numeric literals are <em>valid</em> and indicate a number, while others are invalid and cause an error. The grammar for valid numbers is given below in a <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form">BNF</a> variant. Only four alphabetic characters are allowed: &quot;i&quot;, which separates the real and imaginary components of a complex number, &quot;e&quot;, which functions as in scientific notation, and the uppercase versions of these letters.</p>
diff --git a/docs/spec/token.html b/docs/spec/token.html
index f1408172..9a121561 100644
--- a/docs/spec/token.html
+++ b/docs/spec/token.html
@@ -1,4 +1,6 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<h1 id="specification--bqn-token-formation">Specification: BQN token formation</h1>
<p>This page describes BQN's token formation rules (token formation is also called scanning). Most tokens in BQN are a single character long, but quoted characters and strings, identifiers, and numbers can consist of multiple characters, and comments, spaces, and tabs are discarded during token formation.</p>
<p>BQN source code should be considered as a series of unicode code points, which we refer to as &quot;characters&quot;. The separator between lines in a file is considered to be a single character, newline, even though some operating systems such as Windows typically represent it with a two-character CRLF sequence. Implementers should note that not all languages treat unicode code points as atomic, as exposing the UTF-8 or UTF-16 representation instead is common. For a language such as JavaScript that uses UTF-16, the double-struck characters <code><span class='Value'>𝕨</span><span class='Function'>𝕎</span><span class='Value'>𝕩</span><span class='Function'>𝕏</span><span class='Value'>𝕗</span><span class='Function'>𝔽</span><span class='Value'>𝕘</span><span class='Function'>𝔾</span></code> are represented as two 16-bit surrogate characters, but BQN treats them as a single unit.</p>
<p>A BQN <em>character literal</em> consists of a single character between single quotes, such as <code><span class='String'>'a'</span></code>, and a <em>string literal</em> consists of any number of characters between double quotes, such as <code><span class='String'>&quot;&quot;</span></code> or <code><span class='String'>&quot;abc&quot;</span></code>. Character and string literals take precedence with comments over other tokenization rules, so that <code><span class='Comment'>#</span></code> between quotes does not start a comment and whitespace between quotes is not removed, but a quote within a comment does not start a character literal. Almost any character can be included directly in a character or string literal without escaping. The only exception is the double quote character <code>&quot;</code>, which must be written twice to include it in a string, as otherwise it would end the string instead. Character literals require no escaping at all, as the length is fixed. In particular, literals for the double and single quote characters are written <code><span class='String'>'''</span></code> and <code><span class='String'>'&quot;'</span></code>, while length-1 strings containing these characters are <code><span class='String'>&quot;'&quot;</span></code> and <code><span class='String'>&quot;&quot;&quot;&quot;</span></code>.</p>
diff --git a/docs/spec/types.html b/docs/spec/types.html
index f1d5ee2a..4570d2da 100644
--- a/docs/spec/types.html
+++ b/docs/spec/types.html
@@ -1,4 +1,6 @@
<head><link href="../style.css" rel="stylesheet"/></head>
+<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div>
+<h1 id="specification--bqn-types">Specification: BQN types</h1>
<p>BQN programs manipulate data of six types:</p>
<ul>
<li>Character</li>
diff --git a/docs/style.css b/docs/style.css
index 566caa2b..cb125c39 100644
--- a/docs/style.css
+++ b/docs/style.css
@@ -5,6 +5,10 @@ body {
padding: 0 0.62em;
line-height: 1.6;
}
+.nav {
+ text-align: right;
+ margin-bottom: -2em;
+}
h1, h2, h3 {
line-height: 1.2;
}