Skip to content

Commit

Permalink
fix new blog post typos and a markdown bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Nov 25, 2024
1 parent 2be2a74 commit f3cbd97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions site/blog/subscripts-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ However, subscripts on some functions and modifiers allow you to express things

## A brief history of Uiua's rank functionality

Uiua has gone through a few iterations of ways to express operating at a certain *rank* of an array. The other array languages simply have a `rank` operator that allows the directly specification of the rank to operate at. This approach works and is very general. At one point, Uiua had something similar in a modifier called `≑ level`. This took a number or list of numbers indicating the ranks to operate at, as well as the function to operate on the array. While this worked, something about it never sat right with me. In an array language, the structure and rank of an array are, in most cases, the structure of the computation itself. There's something odd about having some numbers in your code that refer to actual *numbers*, and then other numbers that refer to the computation.
Uiua has gone through a few iterations of ways to express operating at a certain *rank* of an array. The other array languages simply have a `rank` operator that allows the direct specification of the rank to operate at. This approach works and is very general. At one point, Uiua had something similar in a modifier called `≑ level`. This took a number or list of numbers indicating the ranks to operate at, as well as the function to operate on the array. While this worked, something about it never sat right with me. In an array language, the structure and rank of an array are, in most cases, the structure of the computation itself. There's something odd about having some numbers in your code that refer to actual *numbers*, and then other numbers that refer to the computation.

The first attempt to alleviate this discomfort I felt was the infamous *Ocean Notation*. It was a series of glyphs that had special parsing rules but whose function was *only* to create rank lists for use with level `≑ level`. This mostly eliminated rank-indicating numbers from the code. While this system was kind of neat, it added too many new symbols for the programmer to learn with very little payoff, and it was not general enough to handle all cases.

`≑ level` was eventually replaced with Uiua's current system involving [`≡ rows`](https://uiua.org/docs/rows) and [`¤ fix`](https://uiua.org/docs/fix). This system is simple, composable, and easy to learn. However, it cannot handle a common use of `rank` in other array languages: how do you operate on rank-N subarrays of an array of arbitrary rank. To fill this hole, the `☇ rerank` function was added. This set the rank of the *rows* of an array to the given number. This also worked, and the system was complete.
`≑ level` was eventually replaced with Uiua's current system involving [`≡ rows`](https://uiua.org/docs/rows) and [`¤ fix`](https://uiua.org/docs/fix). This system is simple, composable, and easy to learn. However, it cannot handle a common use of `rank` in other array languages: how do you operate on rank-N subarrays of an array of arbitrary rank? To fill this hole, the `☇ rerank` function was added. This set the rank of the *rows* of an array to the given number. This also worked, and the system was complete.

But there were those numbers in the code again. You'd most often write `☇1` or `☇2` to change the rank of an array, collapsing the leading dimensions, sometimes temporarily. The thing is, you *never* need this number to be dynamic. It is *always* a number sitting there in the code itself, a static value, known at compile time. Sometimes it had to be relative to the rank of the array, in which case you would use a static negative number, but a static value nontheless.

Expand Down
2 changes: 1 addition & 1 deletion site/src/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fn node_view<'a>(node: &'a AstNode<'a>) -> View {
return view!(<Prim prim=prim/>).into_view();
}
}
view!({text}" ").into_view()
text.into_view()
}
NodeValue::Heading(heading) => {
let id = all_text(node).to_lowercase().replace(' ', "-");
Expand Down

0 comments on commit f3cbd97

Please sign in to comment.