!EjsgbQQNuTfHXQoiax:matrix.org

BQN

928 Members
The BQN array programming language, an APL descendant34 Servers

Load older messages


SenderMessageTime
24 Jul 2024
@mlochbaum:matrix.orgMarshall And I could do some optimization for findmatches{x, range{n}} and findmatches{x, x} to improve them somewhat. 18:41:20
25 Jul 2024
@dzaima:matrix.orgdzaima also a thing in my current code is that I can't use the indices widening to widen u8 to u64 as that reduces the index count from 32 to 8, and [8]u8 loads aren't implemented (and, while that could be made, [4]u8 would still be a problem); so I'd need some abstraction for sub-native-size vectors and thus be unable to destructure their types 01:37:03
@dzaima:matrix.orgdzaima (of course here the index widening shouldn't be done by per-loop generated code but rather outside so that the actual loops are shared, but whatever) 01:41:54
@dzaima:matrix.orgdzaima unrelatedly, def flip{a} = each{tup, ...a} 01:53:46
@dzaima:matrix.orgdzaima has the side-effect of making flip{tup{0}} be tup{0} rather than an error though 02:00:25
@mlochbaum:matrix.orgMarshall Restriction in that it won't handle different lengths any more, but the current version breaks if any element is shorter than the first. So I'll go with that definition, thanks. 02:00:42
@mlochbaum:matrix.orgMarshall Oh, I can add a condition to make sure all elements are tuples. 02:01:46
@mlochbaum:matrix.orgMarshall I think the only reason each{} accepts non-tuples is that I was lazy about the checking, but I'm not totally sure. 02:04:58
@dzaima:matrix.orgdzaima I wouldn't oppose making it an error 02:06:10
@mlochbaum:matrix.orgMarshall Yeah, each{tup, 0, 1, 2} returns tup{tup{0},tup{1},tup{2}} which is like a totally different function. 02:06:24
@dzaima:matrix.orgdzaima oh huh 02:07:13
@mlochbaum:matrix.orgMarshall (Although a fairly useful one, but of course if it were supported it should also accept tuple arguments) 02:07:34
@mlochbaum:matrix.orgMarshall Also picked up your printf changes, so those will go out when I push stuff. 02:08:24
@mlochbaum:matrix.orgMarshall Pushed stuff. 02:16:16
@_discord_724421839924756480:t2bot.io_elcaro_ Minor quibble... In the FromJ docs, /: Dyad ⍋⊸⊏ is missing a swap. It should be ⍋⊸⊏˜.
Same for \:
J:
   'listen' /: 3 2 1 6 4 5
silent

BQN:
   "listen" ⍋⊸⊏˜ 3‿2‿1‿6‿4‿5
"silent"
02:48:53
@mlochbaum:matrix.orgMarshall Changed that. I always got those wrong when programming in J too... 10:49:13
@_discord_171360495385706496:t2bot.ioparker changed their profile picture.21:26:52
26 Jul 2024
@_discord_671689100331319316:t2bot.iobrian_e 00:32:49
@dzaima:matrix.orgdzaima some weird Singeli behavior: if (0) = {} doesn't error; def g = if (0) = 2 says that 2 isn't a known infix operator (found via having written a if (0) = { … } else { … } and taking a couple minutes to figure out that the error is at the = despite it pointing at else) 02:04:49
@dzaima:matrix.orgdzaima (can replace = with any undefined operator character sequence) 02:16:09
@mlochbaum:matrix.orgMarshall = {} is an operator expression, equivalent to __set{}. So def __set{} = 5; show{ if (1) = {} } prints 5. 02:17:45
@dzaima:matrix.orgdzaima ah. fun 02:18:06
@mlochbaum:matrix.orgMarshall The unknown infix operator is a pretty bad error message. Operator parsing is bad about this generally and I doubt it's too hard to improve. 02:21:01
@mlochbaum:matrix.orgMarshall Pushed an improved version: now if the erroring node can't be an operator it infers that instead the previous one was supposed to be a prefix operator but wasn't recognized, and otherwise it gives a missing operand error if there's no right operand and the old unknown infix operator if there is. 14:03:42
@mlochbaum:matrix.orgMarshall I think this might be better handled by assigning operator arity based on whether there's a non-operator to the left, so then it can look up prefix or infix definition based on that and error if it's not found. I don't know if this loses any capabilities. The current Pratt parser will parse + * 1 treating the left + as a non-operator, but I don't think this can ever do anything since in evaluation it tries to look it up as a variable with name "+". 14:11:32
@mlochbaum:matrix.orgMarshall So hopefully this would be an initial error checking step that has clear reporting, and then the Pratt parser gets handed something that will always parse without error, and just has to resolve precedence. 14:14:35
@_discord_1262574255451668500:t2bot.iobusy_hamster_48992 joined the room.15:07:22
@mlochbaum:matrix.orgMarshall I keep wanting to write a page to argue against statements like "APL is linear algebra made into a programming language" or "since it's in the APL family, BQN must be all about math", and stop when I realize I hardly have anything to say. This time I decided to strip it down to the essentials instead, so here it is. 17:05:35
@_discord_180028909969080320:t2bot.ioicen I’m enjoying the repeated theme of docs via fanfic and eagerly await the next instalment 17:42:40
@rpanades:matrix.orgpanadesteinWhen I program in BQN I feel the same joy I felt years ago when proving some tricky identity or solving a transcendental equation. In that regard, I think BQN is like algebra, but not exclusively linear algebra.19:24:28

There are no newer messages yet.


Back to Room ListRoom Version: 6