!EjsgbQQNuTfHXQoiax:matrix.org

BQN

463 Members
The BQN array programming language, an APL descendant25 Servers

Load older messages


SenderMessageTime
27 Sep 2022
@mlochbaum:matrix.orgMarshall Progress: getting full alignment for an odd factor k requires k vector writes, but I still get quite good performance by writing 4 vectors and discarding/overwriting the partial segment at the end. Importantly, the 4 is a constant, so I can just pass those 4 shuffle vectors in to a function. 02:23:07
@mlochbaum:matrix.orgMarshall Now I can do primes up to 64 with hardly any extra cost relative to 32. Except 32 still uses a bunch of space and I'm not sure where that's coming from. Will figure it out tomorrow. 02:25:14
@dallas_bruno:matrix.org@dallas_bruno:matrix.org joined the room.11:22:40
@profpatsch:augsburg.oneProfpatsch changed their display name from profpatsch to Profpatsch.13:32:38
@_discord_595317473247756288:t2bot.ioAlex Shroyer I was browsing the BQN source code and was pleasantly surprised to find the filenames are meaningful and there are comments.
It's still macro-heavy C, but comments and descriptive filenames go a long way. So... thanks BQN authors for making the codebase a little friendlier to the casual reader.
15:48:04
@dzaima:matrix.orgdzaima (I assume you mean CBQN) 15:48:29
@_discord_595317473247756288:t2bot.ioAlex Shroyer yep 15:49:09
@dzaima:matrix.orgdzaima would not have thought that the amount of comments nor clarity of filenames in CBQN would be anywhere near sufficient to warrant a "go a long way", but I definitely won't complain (I guess compared to ngn/k it's better, but not compared to much else) 15:51:39
@dzaima:matrix.orgdzaima src/README.md is the main description place I've written; if there's any aspect you feel would warrant some more description, do let me know though; I do want the codebase to be reasonably understandable where feasible 15:52:59
@dzaima:matrix.orgdzaima the fact that nearly everything is up to change means there'd not be much longevity to detailed comments though; I guess some new changes by now are somewhat in the phase of being roughly permanent by just being the optimal thing for the target architecture, but even then things might change non-insignificantly when making them more generic for allowing target multiple target architectures 16:01:20
@_discord_595317473247756288:t2bot.ioAlex Shroyer That's where I started reading. In the past I tried to dive into J, ngnk, kona codebases, but eventually gave up because just getting started is a big investment. Which is fine if you already know the conventions. It's a choice to be "optimized for the current devs" rather than "optimized for outsiders". But yeah I appreciate that there are some efforts to make it approachable to an outsider.

I will say the oK javascript is very terse but still very readable. I suspect much of its readability comes from using a higher level language and the fact that it fits in <1k LoC.
16:07:45
@_discord_595317473247756288:t2bot.ioAlex Shroyer I think oK is an exception. It's readable despite having almost no comments. 16:08:17
@_discord_595317473247756288:t2bot.ioAlex Shroyer https://github.com/JohnEarnest/ok/blob/gh-pages/oK.js 16:08:33
@dzaima:matrix.orgdzaima * (the fact that nearly everything is up to change means there'd not be much longevity to detailed comments though; I guess some new changes by now are somewhat in the phase of being roughly permanent by just being the optimal thing for the target architecture, but even then things might change non-insignificantly when making them more generic for allowing target multiple target architectures) 16:08:34
@_discord_595317473247756288:t2bot.ioAlex Shroyer Sure, that's to be expected. I'm just happy there are even footprints in the mud to indicate what someone was thinking at some point in the past regarding a chunk of code. 16:11:18
@dallas_bruno:matrix.org@dallas_bruno:matrix.org left the room.17:40:19
@_discord_596792333631225857:t2bot.iohr0m#6888 Is there a json library for bqn? 19:22:59
@_discord_596792333631225857:t2bot.iohr0m#6888 Ah, the docs say there will be, so I guess there is none yet 19:26:19
@mlochbaum:matrix.orgMarshall There is actually a CSV one in bqn-libs but I haven't finished JSON yet. 19:28:53
28 Sep 2022
@mlochbaum:matrix.orgMarshall Replicate update: this is 32KB, code on singelirep branch. 02:04:37
@mlochbaum:matrix.orgMarshall I think a lot of that is clang unrolling stuff, but the fixed 4-register shuffle thing is currently a function call with the shuffle registers in the argument, and that can be changed to a pointer argument. There are also various packing schemes to use for those shuffles, since they're very repetitive, but there should only be ~6KB of them now, about half for the 2 to 7 range and half for larger primes. 02:08:18
@_discord_870115701279584326:t2bot.ioDiscoDoug FWIW, here’s one in K but it chokes on very large json files: https://gist.github.com/gitonthescene/7c33209c4c48d0c51f25677ad749370f. It uses Marshall’s parent vector algorithm. 02:37:51
@_discord_326519812820041731:t2bot.ioTortus Can BQN do wasm stuff? 03:15:28
@smileybone:matrix.orggandermight take some effort but i dont see why not. cbqn can compile to wasm and be ran with wasmtime, and there is an ffi.04:13:51
@dzaima:matrix.orgdzaima
In reply to @mlochbaum:matrix.org
Replicate update: this is 32KB, code on singelirep branch.
don't see new code there?
05:20:02
@dzaima:matrix.orgdzaima32KB is still a 2.7% size increase; if unrolling really is that much of a reason for the size, I'd want to think about some way to annotate the fns with disabling the unrolling pass05:23:56
@_discord_326519812820041731:t2bot.ioTortus Interesting 05:53:15
@mlochbaum:matrix.orgMarshall dzaima Oops. Have pushed it now. 10:59:05
@dtgr:m.muum.orgDtgr

took a look at ngn/k source. that's some dense stuff

13:01:57
@suhr:matrix.orgsuhrAt least is has more reasonable line witdths than https://codeberg.org/ngn/st/src/branch/master/st.c14:14:40

There are no newer messages yet.


Back to Room List