5:35 AM
<moon-child> $work has a DSL for data analysis et al. Currently design is ongoing for a tensor library 'modeled after numpy'. Crossing my fingers I can get it to be leading-axis instead of trailing-axis <moon-child> maybe a rank operator is too scary to pass...but maybe not, if I call it 'mapAtDepth' and 'mapEachAtDepths'? ;o 5:49 AM moon-child: What are the sizes of the datasets? (why not use just numpy if the new thing is modeled after it?) <moon-child> @Bubbler custom dsl, so not python. (Could wrap numpy, but dependencies are pain.) Being modeled after numpy is a convenience to make it easier to port numpy Then I guess they'd want to make every aspect as close to numpy as possible, including the trailing-axis <moon-child> @EliasMårtenson not 100% sure--I'm not super close to those bits of the corp--but the design doc mentions ease of use as the primary problem with current lang features, so I would guess not that big <moon-child> bubbler- maybe. People still have to actually use it (not just port legacy code), and implementing trailing axis in terms of leading axis is easier than the other way around 3 hours later… 8:57 AM @dzaima @Wezl Preview of 2021 site: 9:30 AM @ngn do you remember that bit of code supposedly solved by a debugging print? where was it actually placed? i can't really reproduce the "mitigation" yesterday, by ngn @KamilaSzewczyk very strange: when i put ⎕←⍬ at the beginning of inner (in lim), it works yeah, i tried it lim←{ max←⊃⌽⍺ inner←{⎕←⍬ ⋄ ⍺>max:0 ⋄ 1=⍺ once 1↓⍵:(⍺ blk ⍵)∇ ⍵ ⋄ 0} '⍣'≠⊃⊃⍵:(⊃⍺)inner ⍵ tmp←(⊃⍺)inner{(⊆1↓⊃⍵),1↓⍵}⍵,⊆'app⍵' vec } did it look like this? (for some reason ctrl+k broke formatting) this is the whole file that reproduces it: #!/bin/bash dyalog -script <(echo ∇M;tail -n+3 "$0";echo -e '∇\nM\n⎕off');exit \$?
⎕←⍬⋄⎕io⎕pp⎕pw←0 34 32767⋄{}⎕se.UCMD'←box on -s=max -f=on'⊣enableSALT⊣⎕cy'salt'

Stream←{
⎕TRAP←(11 'C' '')
blk←{(⍎∊'{'(⊃⍵)'}')⍺}
vec←⍬⋄app←{vec⊢←vec,⍵ ⋄ 1}
once←{0=≢⍵:1⋄'⍨'=⊃⊃⍵:⍺{0=(⍺{(⍎∊'{'⍵'}')⍺}1↓⊃⍵):0⋄⍺once 1↓⍵}⍵⋄d←(⍺blk⍵)∇1↓⍵⋄1}
op←{inner←{1=⍺once 1↓⍵:(⍺blk⍵)∇⍵⋄0}⋄'⍣'≠⊃⊃⍵:⍺ inner ⍵⋄tmp←⍺ inner{(⊆1↓⊃⍵),1↓⍵}⍵,⊆'app⍵'⋄vec}
lim←{max←⊃⌽⍺⋄inner←{⎕←⍬⋄⍺>max:0⋄1=⍺once 1↓⍵:(⍺blk⍵)∇⍵⋄0}⋄'⍣'≠⊃⊃⍵:(⊃⍺)inner⍵⋄tmp←(⊃⍺)inner{(⊆1↓⊃⍵),1↓⍵}⍵,⊆'app⍵'⋄vec}

okay, thanks a lot

@KamilaSzewczyk it seems to have something to do with salt too. without salt, ⎕← doesn't avoid the value error
@KamilaSzewczyk were dyalog asking you for a repro? :)

9:39 AM
yes
today i'll have plenty of free time so i'll try to understand your snippets :p

@KamilaSzewczyk :) tell them there's a smaller one - just remove "#." before "end" and run it with the same #! at the top of the file

alright, sent
thanks

i'm sure they are reading this chat, so..

Adam told me that it'd be nice if I mailed that

5 hours later…
2:36 PM
@KamilaSzewczyk and @ngn .. thanks for the code you sent to us .. Adam pointed me to this discussion when I mentioned a quite separate issue which I had found, and I'm hoping that they are one and the same underlying issue - your code is much smaller than the other issue I'm looking at. It appears that to avoid getting the value error in 18.0 requires not only that you include calling ⎕←⍬, but also that boxing is on. In 17.1 you always get the value error irrespective of these two conditions.

you're welcome, but i think ngn's contribution was a bit more helpful
do you have any guesses why could that happen?

2:52 PM
I must confess that at the moment I've not got the slightest idea, although I know that the code which is run when boxing is on does some rather clever stuff under the covers, so that's where I'll be starting ..

3:07 PM
@Adám wow that really is like a door
now MiServer needs a logo

Any ideas?

not yet, I've never actually tried it

Hm, I wonder why we don't use the logo from the MiServer website:
It just isn't very suggestive of anything.

neither is the DYALOG logo
except for suggestive of pick
I'm learning wren and trying to make an array library. What would be the best representation for multi-dimensional arrays in a language with only (1D) lists?

@Wezl a tuple of shape and ravel

3:19 PM
ok good because that's what I was starting to do

3:37 PM
⋄a←⎕ns⍬⋄a.f←{⍵:a}⋄a.f 1

@ngn
Illegal code
VALUE ERROR
VALUE ERROR

@dzaima i was wondering what these terms actually mean
in terms of ravel, shape, and stuff
i've seen it on the apl implementation guide but nothing interesting there

@ngn Wow, that's bad. (Not the bot erroring ― that's expected.)

@ngn unless i'm missing something that's supposed to demonstrate, isn't the ⍵: pointless?
@KamilaSzewczyk "ravel" is just the name of the monadic , function

3:41 PM
@dzaima it shouldn't be a value error

@ngn well yeah, but don't you like to golf your code?

:)

is there even any scenario where a ⎕ns-made namespace can access outside variables?

@dzaima it's a minimal repro for the bug kamila ran into

3:56 PM

@ngn and it is very much appreciated !

1 hour later…
5:00 PM
Is it possible to get the contents of a deleted wiki page? It was actually useful to me :( aplwiki.com/index.php?title=Special:Log&page=APL_Seeds
Ah, at least it's possible to find the bookmarked conversations on SE: chat.stackexchange.com/rooms/info/52405/… (searching for "Lesson S*")

5:25 PM
@MartinJaniczek The content is retrievable. I wonder if @Adám would be interested in just making it a section under Cultivation?

2 hours later…
7:21 PM
@KamilaSzewczyk I'm in search of a better term than "ravel", by the way. It's nonsensical to use in BQN, which doesn't even have a ravel function (it's called "Deshape"). I've tried "element list", but besides being clunky it fails to convey that the elements have to go in a specific order. Which I seem to be variously calling "index order" or "ravel order".

7:40 PM
i,... don't have a clue what it is in terms of storing a matrix in memory

@KamilaSzewczyk "it"? If you understand how the ravel function , works, and you understand how to store a list in memory, then you know how to store the elements of a matrix: ravel it, and store the resulting list.

@Marshall oh yeah, that's an operation that catenates things, but the naming isn't obvious
i'd name it data or something

unravel is what you do to a sweater by pulling a thread

it may make sense, because i'm not a native speaker, and i had no idea what ravel means, besides the fact that it's an APL/J function/verb

@KamilaSzewczyk Ravel (monadic ,) isn't very closely related to Catenate (dyadic ,). In BQN I paired it with Reshape instead and called it Deshape (both ⥊).

7:51 PM
@Marshall where's conor hoekstra when you need him!

8:36 PM
@Marshall ,a is ⊃,/⍣≡a for simple a (,// in k)

@ngn Non-scalar, non-empty. I've seen this and wouldn't consider it a close relation as I think / is doing most of the work.

@Marshall why "non-empty"?

@ngn Okay, Dyalog actually does make it work, but it shouldn't. See Smith's Reduction of Singletons (pdf).
Oh, it's broken for singletons as well.

8:51 PM
@Marshall right
this reminds me of the problem with ,\ - in dyalog the first from ,\vec is a scalar, but a vector would make more sense

@ngn it's indeed stupid. one of the reasons i don't like scalar,scalar not erroring

@dzaima if that errors, ,/scalar should error too
as there are no axes to work on

@ngn isn't f/scalar always a no-op?

@Marshall well, ∾˝4, but that also errors

8:59 PM
@dzaima according to the paper it shouldn't be

@ngn so be it. why is that notable?

@dzaima By the way, I tried turning unit∾unit into an error but haven't been able to get all the resulting bugs out of various markdown generation code. One interesting case is ∾⎉1 when both arguments are units.

@ngn I have nothing to do with the web version

@dzaima oh, sorry then

9:03 PM
I should be working on performance soon, now that Under and fills are basically correct.
I think I should add VM stack operations that extract or copy an element from the stack and start eliminating variable slots and inlining functions.

dzaima/BQN evaluates ∾˝⎊0 4 (which is just catching the error and returning 0) in 0.001ms. Most of that's java creating the stacktrace and whatever mess that entails
@Marshall for variables I think it'd be simpler to track which variables are local-only and store those in JS vars in the bytecode→JS transpiler

what does it mean?

@dzaima I would rather optimize the compiler than the VM.
@ngn It's just an AST. "Explain" isn't the best name for it.

@Marshall wouldn't it easier to expose something like •parse?

@ngn Easier than clicking a button and seeing a diagram? This is a tool for array programming beginners.

9:18 PM
there's value in homoiconicity, i think

@ngn BQN compiling doesn't have to involve an AST, everything can be done straight in bytecode

@ngn Then you have to have some sort of code quoting mechanism though. I'm not a fan of macros, so I haven't included anything like that.
I think APL is more focused on providing useful tools than on allowing the user to create abstractions, which is a pattern I followed in BQN.
I don't think every language has to work that way, of course.

@Marshall you can have parse without a lisp-style ' or macros. but as you wish.
@dzaima well, the thing "explain" displays, whatever it's called

@ngn "explain" creates its own AST from the bytecode given from the compiler afaik
and viewing the bytecode is, like, not at all useful for beginners

@dzaima That's right: here's the source code and here's how it's called.
I think tools like •Parse (that would presumably take a string input) are reasonable but it's not obvious what form the output should have. Maybe it would be different depending on the implementation.

9:30 PM
(dzaima/BQN does have a •Decomp to view the bytecode/objects/blocks of a given fn)

if you can convert bidirectionally to/from bytecode, it's as good as exposing parse, only slightly more complicated internally

@ngn what would your parse be?
(Neither my nor Marshalls compiler ever really create an AST, the bytecode is the primary means of parsed code information)

@dzaima "my" as in ngn/k?

@ngn I mean, you can also literally copy and paste the compiler into the BQN session, so the functionality is there without writing any new code (excepth that you have to provide the list of all primitives as the left argument).

@ngn your as in what you'd expect one to do in BQN. just return the bytecode+object array+block info+etc from a string?

9:39 PM
@dzaima i would expect just string->ast, which can be amended by the user and converted back to your internal bytecode
@Marshall yeah, almost all languages are turing complete, but some make some things easier

meow! the chat has become enabled?

@ngn creating & standardizing a whole new AST (which must be inefficiently stored as many small arrays mind you) just for a rarely used thing is a lot of effort

@dzaima ok, if it's not that important that you users can play with ast transformations, don't do it :)

@ngn My point is BQN does make things easier, by having the code written for you. When I start working on libraries/packages, I expect I'll make the compiler into a system-provided library.

i like lispy things (and arrays, obviously). but everyone has a taste :)

9:43 PM
@ngn I have thought about having a to/from AST thing in a library form, but exposing that as the primary custom modification mechanism, especially when it doesn't at all use it, is a bit weird

10:02 PM
@ngn I mean, I do like playing with transforming code too. (this was made by transforming the bytecode; i once also made a thing which transformed math ops in BQN code to using fractions instead of floats)
@dzaima (intention being that i can have one app for both APL and BQN, and have tooling that works on both (function graphing, general graphics (APLP5 or whatever comes after it), etc), possibly with Dyalog there too at some point, and whatever else i may decide to do)
(also if i ever decide to try to figure out how k is even tokenized/parsed, having a k subsystem in dzaima/BQN would be fun)

10:25 PM
@dzaima because why not :)
@dzaima theoretically you can also insert breakpoints in the bytecode. self-modifying code is powerful

@ngn interesting how my mindset here is often "because why not", when irl i'm much more of a "what's the point/why bother (no good translation from native language :/)" kind of person

@ngn did you already introduce @dzaima to the apl subset with unicode-enabled ngn/k?

@ktye I do look at the k room

@ktye ^i assumed that

@ktye the main problem with it is that it can't define operators (definitely not dyadic ones), which are imo pretty important to APL

10:32 PM
are user defined operators used a lot? i left that out, when i wrote apl/iv.

@dzaima op[f;a;b] instead of a f op b

@ngn that's 0) cheating; 1) much more ugly :)
2) it's also not that golfy

but more powerful :) op[f;g;h;a;b] :P

@ngn true
@ngn i got kind of stuck choosing between using self-modification and special bytecode execution in the VM for debugging, so i went with none