aboutsummaryrefslogtreecommitdiff
path: root/commentary
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-10-31 21:56:56 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-10-31 21:56:56 -0400
commitdd3f993803386d28b3966c6b6ebcc5d1d372b99d (patch)
tree9f9d24b7b9ff1f4043fd19feb5b1ffc7937233c0 /commentary
parent60b5ea7b3c26fd385bdfc275579117fdadd674d1 (diff)
Listing problems doesn't mean I'm expecting solutions; [] implemented now
Diffstat (limited to 'commentary')
-rw-r--r--commentary/problems.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/commentary/problems.md b/commentary/problems.md
index 507c248a..a4aaec32 100644
--- a/commentary/problems.md
+++ b/commentary/problems.md
@@ -4,7 +4,9 @@
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?
-This list is meant to be specific, so it addresses particular features rather than overall philosophy, and only includes missing functionality if some feature would be expected to provide it but doesn't. 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).
+At this point I'm not actively looking for ways to solve any of these, although I'd take one if it fell in my lap. I am certainly not looking for ways that break existing functionality; [stability](stability.md) is important.
+
+However, the list is meant to be specific, so it addresses particular features rather than overall philosophy, and only includes missing functionality if some feature would be expected to provide it but doesn't. 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).
### Empty arrays lose type information
A pretty fundamental problem with dynamically-typed array languages: when computing something (say, a sum) that depends on all elements, if there are no elements then the structure of the result is indeterminate. Shape arithmetic means the shape of a cell is always known, except when using the Rank modifier so that every cell is computed independently. [Fills](../doc/fill.md) are BQN's solution for deeper structure, but they're incomplete. They store only types and not data, but operations like Reshape that use data to determine type are common enough to make this unreliable.
@@ -151,7 +153,7 @@ It's unergonomic, and also quadratic in a naive runtime. The problem of course i
Called dyadically, both functions shuffle cells of the right argument around, which is consistent with other selection-type functions. But the monadic case applies to what would be the left argument in the dyadic case.
### High-rank array notation awkwardness
-The notation `[]` will be added for high-rank arrays, the same as BQN's lists `⟨⟩` except it mixes at the end. It looks okay with BQN strands but clashes with BQN lists. At that point it becomes apparent that specifying whether something is a high-rank array at the top axes is kind of strange: shouldn't it be the lower axes saying to combine with higher ones? A more concrete point of awkwardness is that literal notations can only form arrays with rank 1 or more, preventing unit arrays from being destructured. Syntax with `<` and `[]` would be complete over non-empty arrays.
+The notation `[]` looks okay when the elements are strands but clashes with `⟨⟩` lists. At that point it becomes apparent that specifying whether something is a high-rank array at the top axes is kind of strange: shouldn't it be the lower axes saying to combine with higher ones? A more concrete point of awkwardness is that literal notations can only form arrays with rank 1 or more, preventing unit arrays from being destructured. Syntax with `<` and `[]` would be complete over non-empty arrays.
### Assert has no way to compute the error message
In the compiler, error messages could require expensive diagnostics, and in some cases the message includes parts that can only be computed if there's an error (for example, the index of the first failure). However, Assert (`!`) only takes a static error message, so you have to first check a condition, then compute the message, then call Assert on that. Kind of awkward, but better than it used to be before one-argument Assert was changed to use `𝕩` for the message. The issue generally applies to high-quality tools built in BQN, where giving the user good errors is a priority.