diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-24 11:00:52 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-24 11:00:52 -0400 |
| commit | 9bccc26a0c3231d7cc9adc37c1a850ef44fd436a (patch) | |
| tree | d9ee03b98126b14423af4d07ae4fd7d84589f1aa /docs | |
| parent | 3863c3837ded859328243ae42f524c45741c872e (diff) | |
Add breadcrumbs to generated html
Diffstat (limited to 'docs')
38 files changed, 39 insertions, 39 deletions
diff --git a/docs/doc/based.html b/docs/doc/based.html index 68407f38..2389481b 100644 --- a/docs/doc/based.html +++ b/docs/doc/based.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Based array theory</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="based-array-theory">Based array theory</h1> <p><em>"Like a normal programming language"</em></p> <p>This page explains how BQN's array model (christened "based" <a href="https://dl.acm.org/doi/abs/10.1145/586656.586663">in 1981</a>) differs from the models used by existing APL dialects, and why the choice was made to discard APL's "everything is an array" dictum. If you're not wondering what the difference is, and don't think everything should be an array, then you can probably just read about BQN's <a href="types.html">type system</a> instead.</p> diff --git a/docs/doc/block.html b/docs/doc/block.html index 8c7a7770..5aae039f 100644 --- a/docs/doc/block.html +++ b/docs/doc/block.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Blocks</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="blocks">Blocks</h1> <p>In BQN, a <em>block</em> is any piece of code surrounded with curly braces <code><span class='Brace'>{}</span></code>. Blocks can be used simply to group statements, or can define functions or modifiers. They are the sole large-scale structure used to organize programs.</p> <p>Blocks are most commonly used to define functions by including one of the special names for arguments, <code><span class='Value'>𝕨</span></code> or <code><span class='Value'>𝕩</span></code>. With the operands <code><span class='Function'>𝔽</span></code> or <code><span class='Function'>𝔾</span></code>, they can also define 1-modifiers or 2-modifiers.</p> diff --git a/docs/doc/context.html b/docs/doc/context.html index ba87f85c..a46a4659 100644 --- a/docs/doc/context.html +++ b/docs/doc/context.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN's context-free grammar</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="bqns-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/couple.html b/docs/doc/couple.html index ee145b54..69f85bab 100644 --- a/docs/doc/couple.html +++ b/docs/doc/couple.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Couple and Merge</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="couple-and-merge">Couple and Merge</h1> <p>Solo/Couple (<code><span class='Function'>≍</span></code>) and Merge (<code><span class='Function'>></span></code>) are functions that create a higher-rank array from lower-rank components. Each takes some number of inner arrays organized in an outer structure, and creates a single array combining all elements of those inner arrays. For example, let's couple two arrays of shape <code><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>3</span></code>:</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oqiIHAg4oaQIDPigL81w5fijJzihpUzCuKKoiBxIOKGkCAy4oC/M+KliiJhYmNkZWYiCnAg4omNIHEgICAjIHAgY291cGxlZCB0byBxCuKJoiBwIOKJjSBx&run">↗️</a><pre> <span class='Function'>⊢</span> <span class='Value'>p</span> <span class='Gets'>←</span> <span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>5</span><span class='Function'>×</span><span class='Modifier'>⌜</span><span class='Function'>↕</span><span class='Number'>3</span> diff --git a/docs/doc/depth.html b/docs/doc/depth.html index a80cf4c9..d67ce4ed 100644 --- a/docs/doc/depth.html +++ b/docs/doc/depth.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Depth</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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 an atom. 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/extensions.html b/docs/doc/extensions.html index e3244153..e781194f 100644 --- a/docs/doc/extensions.html +++ b/docs/doc/extensions.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN extensions</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="bqn-extensions">BQN extensions</h1> <p>This page describes features that are not part of the core BQN specification, but may be specified in the future. If specified, these features would be optional, so that an implementation could choose to support them or not.</p> <h2 id="complex-numbers">Complex numbers</h2> diff --git a/docs/doc/fromDyalog.html b/docs/doc/fromDyalog.html index be98d6ce..96320db6 100644 --- a/docs/doc/fromDyalog.html +++ b/docs/doc/fromDyalog.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN–Dyalog APL dictionary</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="bqndyalog-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="terminology">Terminology</h2> diff --git a/docs/doc/functional.html b/docs/doc/functional.html index 04205144..a2902fa1 100644 --- a/docs/doc/functional.html +++ b/docs/doc/functional.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Functional programming</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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 "ordinary" 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/glossary.html b/docs/doc/glossary.html index f6f2cc30..f8d2ded0 100644 --- a/docs/doc/glossary.html +++ b/docs/doc/glossary.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN glossary</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="bqn-glossary">BQN glossary</h1> <p>Below are short, and sometimes vague, definitions of terms used to describe BQN code.</p> <h2 id="types">Types</h2> diff --git a/docs/doc/group.html b/docs/doc/group.html index be2192b2..9b74f0f6 100644 --- a/docs/doc/group.html +++ b/docs/doc/group.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Group</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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> <h2 id="definition">Definition</h2> diff --git a/docs/doc/index.html b/docs/doc/index.html index 8668bba6..f578e4fc 100644 --- a/docs/doc/index.html +++ b/docs/doc/index.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN documentation</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</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>Overview:</p> diff --git a/docs/doc/indices.html b/docs/doc/indices.html index 2fa56e29..b50cd571 100644 --- a/docs/doc/indices.html +++ b/docs/doc/indices.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Indices</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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 <a href="leading.html">leading axis theory</a>, 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 (atomic) indices, which can refer to list elements or array major cells (or more generally indexing along any particular axis). When using atomic indices to select elements, the indexed array has to be a list. In contrast, elements of any array can be indicated by list indices with length equal to that array's rank. Only two BQN primitives use these list indices: Range (<code><span class='Function'>↕</span></code>), which returns an array of them if given a list argument, and Pick (<code><span class='Function'>⊑</span></code>), where the depth-1 components of an array left argument are list indices.</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 312a1f95..aa2637dd 100644 --- a/docs/doc/join.html +++ b/docs/doc/join.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Join</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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 <a href="couple.html">Merge</a> (<code><span class='Function'>></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'>></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/leading.html b/docs/doc/leading.html index b2f2cda6..b96c2d9a 100644 --- a/docs/doc/leading.html +++ b/docs/doc/leading.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: The leading axis convention</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="the-leading-axis-convention">The leading axis convention</h1> <p>Several primitive functions manipulate the right argument, or sometimes both arguments, along one or more axes. According to the <a href="https://aplwiki.com/wiki/Leading_axis_theory">leading axis model</a>, it's best to make the primitives operate on initial axes, because the Rank modifier then allows it to apply to later axes as well. Here we'll see how this pattern works in BQN.</p> <h2 id="monadic-functions">Monadic functions</h2> diff --git a/docs/doc/logic.html b/docs/doc/logic.html index e19e4e92..0ede46e7 100644 --- a/docs/doc/logic.html +++ b/docs/doc/logic.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Logic functions: And, Or, Not (also Span)</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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/prefixes.html b/docs/doc/prefixes.html index 34b52fc7..9aa3dd20 100644 --- a/docs/doc/prefixes.html +++ b/docs/doc/prefixes.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Prefixes and Suffixes</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="prefixes-and-suffixes">Prefixes and Suffixes</h1> <p>The Prefixes (<code><span class='Function'>↑</span></code>) function gives a list of all prefixes of its argument array along the <a href="leading.html">first axis</a>, and Suffixes (<code><span class='Function'>↓</span></code>) gives a similar list for suffixes. Because the result can be much larger than the argument, these functions may not be used often in high-performance code, but they are a powerful conceptual tool and can make sense for algorithms that are inherently quadratic.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4oaRICJhYmNkZSIK4oaTICJhYmNkZSI=&run">↗️</a><pre> <span class='Function'>↑</span> <span class='String'>"abcde"</span> diff --git a/docs/doc/primitive.html b/docs/doc/primitive.html index bca3ee06..4ce6a7c4 100644 --- a/docs/doc/primitive.html +++ b/docs/doc/primitive.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN primitives</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="bqn-primitives">BQN primitives</h1> <p><em>Primitives</em> are functions and modifiers that are built into the language.</p> <h2 id="functions">Functions</h2> diff --git a/docs/doc/shift.html b/docs/doc/shift.html index c9d84e1e..f96661d1 100644 --- a/docs/doc/shift.html +++ b/docs/doc/shift.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Shift functions</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="shift-functions">Shift functions</h1> <p>The shift functions <code><span class='Function'>«</span></code> and <code><span class='Function'>»</span></code> are two new primitives added to BQN based on a pattern used heavily in the compiler and a reasonable amount everywhere else. Shifts resemble but are more general than the bit-based shift operations used in low-level languages. They replace the APL pattern of a 2-wise reduction after appending or prepending an element (APL's <code><span class='Number'>2</span><span class='Function'>≠/</span><span class='Number'>0</span><span class='Separator'>,</span><span class='Value'>v</span></code> translates to <code><span class='Function'>»</span><span class='Modifier2'>⊸</span><span class='Function'>≠</span><span class='Value'>v</span></code>), one of the more common uses of 2-wise reduction.</p> <p>The result of a shift function always has the same shape as its right argument. The function adds major cells to the beginning (<code><span class='Function'>»</span></code>) or end (<code><span class='Function'>«</span></code>) of <code><span class='Value'>𝕩</span></code>, moving the cells already in <code><span class='Value'>𝕩</span></code> to accomodate them. Some cells on the opposite side from those added will "fall off" and not be included in the result.</p> diff --git a/docs/doc/syntax.html b/docs/doc/syntax.html index 5fc5ff3a..427f05c9 100644 --- a/docs/doc/syntax.html +++ b/docs/doc/syntax.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Syntax overview</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="syntax-overview">Syntax overview</h1> <p>BQN syntax consists of expressions where computation is done with a little organizing structure around them like assignment, functions, and list notation. Expressions are where the programmer is in control so the design tries to do as much as possible with them before introducing special syntax.</p> <h2 id="special-glyphs">Special glyphs</h2> diff --git a/docs/doc/transpose.html b/docs/doc/transpose.html index 96371227..b7ecac6d 100644 --- a/docs/doc/transpose.html +++ b/docs/doc/transpose.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Transpose</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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/types.html b/docs/doc/types.html index bf9a9c9e..258f026f 100644 --- a/docs/doc/types.html +++ b/docs/doc/types.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Types</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</a></div> <h1 id="types">Types</h1> <p>BQN supports the following fundamental types:</p> <ul> diff --git a/docs/doc/windows.html b/docs/doc/windows.html index 7a446b90..f2310333 100644 --- a/docs/doc/windows.html +++ b/docs/doc/windows.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Windows</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">doc</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/implementation/codfns.html b/docs/implementation/codfns.html index 3b15070a..563c4bfe 100644 --- a/docs/implementation/codfns.html +++ b/docs/implementation/codfns.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Co-dfns versus BQN's implementation</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">implementation</a></div> <h1 id="co-dfns-versus-bqns-implementation">Co-dfns versus BQN's implementation</h1> <p>The BQN self-hosted compiler is directly inspired by the <a href="https://github.com/Co-dfns/Co-dfns">Co-dfns</a> project, a compiler for a subset of <a href="../doc/fromDyalog.html">Dyalog APL</a>. I'm very grateful to Aaron for showing that array-oriented compilation is even possible! In addition to the obvious difference of target language, BQN differs from Co-dfns both in goals and methods.</p> <p>The shared goals of BQN and Co-dfns are to implement a compiler for an array language with whole-array operations. This provides the theoretical benefit of a short <em>critical path</em>, which in practice means that both compilers can make good use of a GPU or a CPU's vector instructions simply by providing an appropriate runtime (however, only Co-dfns has such a runtime—an ArrayFire program on the GPU and Dyalog APL on the CPU). The two implementations also share a preference for working "close to the metal" by passing around arrays of numbers rather than creating abstract types to work with data. Objects are right out. These choices lead to a compact source code implementation, and may have some benefits in terms of how easy it is to write and understand the compiler.</p> diff --git a/docs/implementation/index.html b/docs/implementation/index.html index d4d7c047..2ab839e4 100644 --- a/docs/implementation/index.html +++ b/docs/implementation/index.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN implementation notes</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a></div> <h1 id="bqn-implementation-notes">BQN implementation notes</h1> <p>Notes about how BQN is implemented. There's not too much here yet.</p> <ul> diff --git a/docs/implementation/vm.html b/docs/implementation/vm.html index cf39c1ce..c0608644 100644 --- a/docs/implementation/vm.html +++ b/docs/implementation/vm.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>The BQN virtual machine and runtime</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">implementation</a></div> <h1 id="the-bqn-virtual-machine-and-runtime">The BQN virtual machine and runtime</h1> <p>BQN's self-hosted compiler and runtime mean that only a small amount of native code is needed to run BQN on any given platform. For example, the <a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../docs/bqn.js">Javascript environment</a> requires about 200 lines of Javascript code even though it compiles BQN bytecode to Javascript, a more complex strategy than interpreting it directly. This makes it fairly easy to port BQN to new platforms, allowing BQN to run "natively" within other programming languages and interact with arrays in those languages.</p> <h2 id="bytecode">Bytecode</h2> diff --git a/docs/problems.html b/docs/problems.html index 8b6afb02..d8e920af 100644 --- a/docs/problems.html +++ b/docs/problems.html @@ -3,7 +3,7 @@ <link href="style.css" rel="stylesheet"/> <title>Problems with BQN</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="index.html">main</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 "doesn't have A". 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 9d7ad14b..91a52089 100644 --- a/docs/running.html +++ b/docs/running.html @@ -3,7 +3,7 @@ <link href="style.css" rel="stylesheet"/> <title>How to run BQN</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="index.html">main</a></div> <h1 id="how-to-run-bqn">How to run BQN</h1> <p>BQN is in an early stage of development, and no implementation is complete yet. However, it's a relatively simple language to implement, and a few implementations come close. At the moment, dzaima/BQN is the most usable version, with good performance and error reporting.</p> <h3 id="bqn">BQN</h3> diff --git a/docs/spec/evaluate.html b/docs/spec/evaluate.html index bfe9cbef..ab2b6bf4 100644 --- a/docs/spec/evaluate.html +++ b/docs/spec/evaluate.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Specification: BQN evaluation</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</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> diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html index 4928aed8..66734fc4 100644 --- a/docs/spec/grammar.html +++ b/docs/spec/grammar.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Specification: BQN grammar</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</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> diff --git a/docs/spec/index.html b/docs/spec/index.html index 8a7d2a69..3d9ae69a 100644 --- a/docs/spec/index.html +++ b/docs/spec/index.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN specification</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</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/inferred.html b/docs/spec/inferred.html index 7dc99db6..f01450ea 100644 --- a/docs/spec/inferred.html +++ b/docs/spec/inferred.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Specification: BQN inferred properties</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div> <h1 id="specification-bqn-inferred-properties">Specification: BQN inferred properties</h1> <p>BQN includes some simple deductive capabilities: detecting the type of empty array elements, and the Undo (<code><span class='Modifier'>⁼</span></code>) and Under (<code><span class='Modifier2'>⌾</span></code>) modifiers. These tasks are a kind of proof-based or constraint programming, and can never be solved completely (some instances will be undecidable) but can be solved in more instances by ever-more sophisticated algorithms. To allow implementers to develop more advanced implementations while offering some stability and portability to programmers, two kinds of specification are given here. First, constraints are given on the behavior of inferred properties. These are not exact and require some judgment on the part of the implementer. Second, behavior for common or useful cases is specified more precisely. Non-normative suggestions are also given as a reference for implementers.</p> <p>For the specified cases, the given functions and modifiers refer to those particular representations. It is not necessary to detect equivalent representations, for example to reduce <code><span class='Paren'>(</span><span class='Function'>+-×</span><span class='Paren'>)</span><span class='Modifier'>⁼</span></code> to <code><span class='Function'>∨</span><span class='Modifier'>⁼</span></code>. However, it is necessary to identify computed functions and modifiers: for example <code><span class='Function'>F</span><span class='Modifier'>⁼</span></code> when the value of <code><span class='Function'>F</span></code> in the expression is <code><span class='Function'>∨</span></code>, or <code><span class='Paren'>(</span><span class='Number'>1</span><span class='Function'>⊑∧</span><span class='Ligature'>‿</span><span class='Function'>∨</span><span class='Paren'>)</span><span class='Modifier'>⁼</span></code>.</p> @@ -44,7 +44,7 @@ </tr> <tr> <td><code><span class='Function'>√</span></code></td> -<td><code><span class='Function'>⋆</span><span class='Modifier2'>⟜</span><span class='Number'>2</span></code></td> +<td><code><span class='Function'>×</span><span class='Modifier'>˜</span></code></td> <td><code><span class='Function'>⋆</span><span class='Modifier'>˜</span></code></td> </tr> <tr> diff --git a/docs/spec/literal.html b/docs/spec/literal.html index 39ac864a..c9e9d362 100644 --- a/docs/spec/literal.html +++ b/docs/spec/literal.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Specification: BQN literal notation</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</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 ("characters"), 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><span class='String'>'</span></code> and its value is identical to the single character between them. A <em>string literal</em> is enclosed in double quotes <code><span class='String'>"</span></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. The <em>null literal</em> is the token <code><span class='String'>@</span></code> and represents the null character, code point 0.</p> diff --git a/docs/spec/scope.html b/docs/spec/scope.html index 95bb16c1..6e8dd6ac 100644 --- a/docs/spec/scope.html +++ b/docs/spec/scope.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Specification: BQN variable scoping</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div> <h1 id="specification-bqn-variable-scoping">Specification: BQN variable scoping</h1> <p>BQN uses lexical scoping for variables, where scopes correspond roughly to blocks, or pairs of curly braces separated by semicolons. At the top level in a scope, new variables are visible only after they are defined, but in the scopes it contains, all variables defined in that scope are visible. This system is specified more precisely below.</p> <p>A running BQN program manipulates variables during its <a href="evaluate.html">execution</a>, but it is important to distinguish these variables from the identifiers that refer to them. As defined in the <a href="token.html">tokenization rules</a>, an identifier is a particular kind of token found in a program's source code. The lexical scoping rules in this page define which identifiers are considered the same; these identifiers will refer to the same variables when the program is run. While each variable has only one identifier, an identifier can refer to any number of variables because a new variable is created for that identifier each time its containing scope is instantiated (that is, each time the contents of the block are evaluated).</p> diff --git a/docs/spec/token.html b/docs/spec/token.html index 87e738ac..799ae387 100644 --- a/docs/spec/token.html +++ b/docs/spec/token.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Specification: BQN token formation</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</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 "characters". 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> diff --git a/docs/spec/types.html b/docs/spec/types.html index 13345808..8c9c694a 100644 --- a/docs/spec/types.html +++ b/docs/spec/types.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Specification: BQN types</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div> <h1 id="specification-bqn-types">Specification: BQN types</h1> <p>BQN programs manipulate data of six types:</p> <ul> diff --git a/docs/tutorial/expression.html b/docs/tutorial/expression.html index 6098e7a4..7be7064f 100644 --- a/docs/tutorial/expression.html +++ b/docs/tutorial/expression.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>Tutorial: BQN expressions</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">tutorial</a></div> <h1 id="tutorial-bqn-expressions">Tutorial: BQN expressions</h1> <h2 id="arithmetic">Arithmetic</h2> <p>All right, let's get started! Since you can run BQN online from the <a href="https://mlochbaum.github.io/BQN/try.html">REPL</a> there aren't any real technical preliminaries, but if you'd like to look at non-web-based options head over to <a href="../running.html">running.md</a>.</p> diff --git a/docs/tutorial/index.html b/docs/tutorial/index.html index 9b145061..ac8b515d 100644 --- a/docs/tutorial/index.html +++ b/docs/tutorial/index.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN tutorials</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a></div> <h1 id="bqn-tutorials">BQN tutorials</h1> <p>BQN tutorials explain how to approach and use the language as a newcomer (or they try; please get in touch if you find that they skip ahead!). Tutorials are meant to explain key ideas and may ignore details that would be included in the <a href="../doc/index.html">documentation</a>; also unlike the documentation they're meant to be read in order, as each tutorial will build on ideas from the previous ones.</p> <p>Tutorials assume (pretty presumptively, really. Disgusting.) that you are already motivated to learn BQN and use simple rather than flashy examples. Documents to induce motivation beyond the README are not yet available. Do feel free to skim or jump around if you find you are reading a lot of things that are already obvious.</p> diff --git a/docs/tutorial/list.html b/docs/tutorial/list.html index bfeb2221..7895a891 100644 --- a/docs/tutorial/list.html +++ b/docs/tutorial/list.html @@ -3,7 +3,7 @@ <link href="../style.css" rel="stylesheet"/> <title>BQN: Tutorial: Working with lists</title> </head> -<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a></div> +<div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">tutorial</a></div> <h1 id="tutorial-working-with-lists">Tutorial: Working with lists</h1> <p>Enough with all these preliminaries like learning how to read basic expressions. Let's get into what makes BQN special.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=4p+oMSwgMiwgM+KfqQ==&run">↗️</a><pre> <span class='Bracket'>⟨</span><span class='Number'>1</span><span class='Separator'>,</span> <span class='Number'>2</span><span class='Separator'>,</span> <span class='Number'>3</span><span class='Bracket'>⟩</span> |
