« first day (1427 days earlier)      last day (349 days later) » 

2:53 AM
@rak1507 yes, @rak1507 I am! I should come in here more often, I like to read up on all this discussion after hours
@MartinJaniczek how's the JSON parsing going? that seems like an interesting problem. I wonder how your friends are accomplishing it in other languages.
are you streaming it into a tree like structure? and can you filter some info out or do you need it all
4 hours later…
6:53 AM
@ktye it's more of a british informal word for "!" than an apl term
7:33 AM
@ngn While that's what Wiktionary says, Wikipedia doesn't claim British slang, but rather calls "shriek" part of hacker culture. This would fit better with \360 being American.
@Adám could be. i've heard it casually used by brits while americans just say "factorial" and i'm extrapolating from that.
Oh, but factorial is the function, not the symbol.
> shriek: n.

See excl. Occasional CMU usage, also in common use among APL fans and mathematicians, especially category theorists.
yep, part of the hacker cultures around some US universities, and it made its way into apl
7:49 AM
My point.
8:32 AM
@Adám It'd be great to have a place to exclusively discuss about the "rationalised APL"
@Bubbler Well, it is certainly at least as on-topic as BQN is. Any particular reason you'd want an exclusive place for discussions? We could maintain a separate document of currently help proposals/decisions/questions.
While it maybe shouldn't be called "Dyalog", APL′ ("Prime") is intended as such a proposal.
I just have not gotten around to doing more than describing changes to primitives.
A document might be enough, I guess
For a while, we had an internal group at Dyalog called "YAG" (Young APLers Group) where we discussed all this. We isolated three tiers of possible "New APL":
∘ As close as reasonable to traditional APL, only fixing mistakes
∘ Reconsidering APL symbols and various minor aspects
∘ Reconsidering everything, including e.g. order of evaluation
We decided to work on the middle tier. There were a lot of big questions, and multiple symbol conventions were proposed. This eventually led to BQN. But then Marshall (who was the only member with the knowledge to actually implement anything) left Dyalog, and both YAG and proto-BQN ran into the sand.
APL′ is intended as a stab at the first tier. I just haven't had people to discuss it with, or for that sake time and resources to work on it much.
The last tier has so far been represented mostly by thought experiments (often denoted "LPA"), though dzaima did briefly try to reverse dzaima/APL, with mixed results.
8:47 AM
Also, what does "modern environment" mean in the context?
Text files as only container of source code, designed with project and package management in mind from the outset, built-in ability to communicate with the world around it.
Sounds the right thing to do, though "package management"...
No specifics, but it has to b easy to import libraries etc. keeping them isolated, while easy to use.
Probably needs a way to declare dependencies. Maybe not part of the core language, but some meta-file or something. At least better to have it in mind from day 1 than trying to tape it on later.
@Adám can't 10∘⊥⍣¯1 on APLCart be replaced with ⍎¨⍕? my one is shorter
@KamilaSzewczyk It fails when the given number is outside the limit of ⎕PP (or non-integer)
fair point, but it's often beneficial for golfs
APLcart is more about nifty snippets than golfy snippets
aplcart's snippet handles rationals, but it don't think that it does it in an useful way.
fair, whatever
but i think it'd be cool if aplcart had it
9:24 AM
@Adám I'm now reading the first Google hit on "how to write package manager", and it's arguably the hardest thing to make right
not necessarily replacing the previous one
you need to ask adam for than
9:55 AM
@KamilaSzewczyk APLcart isn't a golfing library, but maybe add it (edit in or comment on):
A: Tips for golfing in APL

Jeff ZeitlinBase Conversions The function b⊥v, where b is a numeric base and v is a vector of digit values in that base, converts the vector v into its decimal (base-10) equivalent. If you want to convert a base-10 number into base b, a naïve approach would be to try to use ⊤, but this requires figuring out ...

1 hour later…
11:08 AM
@Adám what happened to the "do you want to get a salary" argument? :) are there paying customers willing to accept such changes?
> "New APL"
yeees? and the group of "young" aplers are going to work for free?
While it was an internal Dyalog project, the idea was to share as much interpreter code as possible with the existing language's. All the YAG members were already paid employees. Development of the new language would happen in parallel to maintenance of the existing product, with the goal of eventually offering new code bases the option of using the new language.
i see :)
this feels like a small victory of sorts. i don't suppose there are people running around the (now virtual?) office screaming "oh no, nick was right!" :)
Did you also propose developing a new language in parallel?
11:17 AM
as you know, all sorts of major changes
ultimately i realised it's all been done 30y ago when i discovered k
@ngn Just as things were ramping up, with the first model written, we lost half of the core of YAG in quick succession, so the internal project is dead. There's therefore no need for anyone running around screaming that you were right.
@JoshD Last time I was working on writing the tree "eval" function for the full-blown problem, but I had to go to sleep early so I didn't finish :) That "query" JSON is thankfully small most of the time - surely under 100 nodes in that tree. I'll probably have more issues with preprocessing the rest of the source data. I've managed to split it from a huge JSON array (all on one line) to an "one object per line" format, so that I can do the JSON parsing per partes and not crash with WS FULL.
So the hope is that, together with a list of line lengths for that file, I'll be able to ⎕MAP or ⎕NGET separate rows, parse those, update my bit matrix with the results for that row, then "forget" the source string and parsed JSON so that I can go parse another.
It's a bit procedural, I should perhaps batch it somehow (I've tried 50 lines at once and that's still fine)
After that will be done, it's just a matter of some little details and learning how to spin up a JSONServer :)
The colleagues also read the source data JSON into a bitarray in D, last time I checked. But no SIMD / SSE parallelism :)
11:58 AM
Wider separator strips?
These bottom ones are exactly half as wide as the stroke width of the letters.
and they look better
@Razetime did you solve part2 in apl?
12:14 PM
@Adám the one on the bottom looks much better to me
Yeah, I agree, and the wider strips make it legible in small sizes too, e.g. 26px icon in 32px frame:
i like the design (esp. lower left) but not the association with fruit
Well, fruit names in tech are common, and the APL world has used an apple for a very long time.
this tiny version is adorable
12:35 PM
What is that prime implementation in the bottom right corner?
The apple as a symbol for APL is used here and there: edm2.com/index.php/APL
@Adám yes yes, i know.. but it's still wrong. apl is about multidimensional arrays, not groceries.
And Apple is about high-grade hardware and locked in ecosystems, not groceries.
more like low-grade hardware these days :) yet another reason apl shouldn't use apples - to avoid confusion with Apple
@ngn Python isn't about reptiles and Ocaml isn't about livestock either. Neither are Perl and Ruby about gemstones…
12:50 PM
@Adám if you're designing a logo for a language called apple, then sure - draw apples :)
but this is apl
python was named after monty python, btw
@ngn but its logo is still snakes
@ngn yep
@Razetime can i copy from you? :D
sure go ahead
1:01 PM
i resorted to python to solve mine
if it makes more sense that way, go on lol
I posted the link earlier
@Razetime strange. it prints just "1" for part2.
the last output before "1" is the final winner
@Razetime you compute the score by hand? :)
I just copy that and do +/(⊢×⍳∘≢)⌽
1:10 PM
I couldn't find a normal way to just return the final thing
@Razetime did you test with the sample input? i'm getting a different answer
hmm what
let me double-check
with my input it took 2-3 mins to achieve the final answer
1:21 PM
@Razetime ah.. running part1 affects the result from part2
yep part 1 modifies the input variables (my bad)
@Razetime that's ok - it's correct, it worked for the sample, now i'm trying it with my real input, still running
i'll stop it, it's taking too long
yeah it takes a few mins to complete
my python and k solutions are very slow too
i was thinking the deck(s) can be represented as a "ring buffer" - a large sparse vector with a pair of start&end pointers. we always drop from the start and append to the end, so the actual content would crawl slowly to the right, like a snake.
without ring buffers, array languages are at a disadvantage because they have to copy the whole content every time you 1↓ or append
1:41 PM
@ngn ye that's a problem with most of the recursion based questions
@Razetime i mean, we could use a ringbuffer for the normal course of the game
the recursive call in part2 always requires copying anyway
@ngn Doesn't matter. It is mnemonic, and allows puns for various things. That's useful. Just like Python's association with snakes allows calling something Anaconda, and Haskell (being named after a person) happens to also be a concept in Jewish mysticism, leading to calling something Yesod (a related mystical concept).
Similarly, JavaScript has nothing to do with coffee, but has lead to mnemonic things like Mocha and CoffeeScript.
@Adám "java" <-> indonesia <-> coffee
i think that's the chain of associations. meaningless for a programming language, of course.
Yes, but sure makes things easier to remember.
2:04 PM
645 ⎕DR 102 102 102 102 102 6 89 64
How do I get it an opposite way?
The last digit is type: 1:Boolean, 3:Int, 5:BinaryFloat, 7:DecimalFloat, 9:Complex
Leading digits specify bit-width.
⋄ 83 ⎕DR 100.1
│102 102 102 102 102 6 89 64│
I have been struggling with a simple APL problem and I'd appreciate some help.

I am trying to pick a value from a set at random where the probability of selection is defined by a set of non-negative integers. In the discussion below `⎕io` is zero.

If `counts ← 2 0 1 0 3` I'd like to return a 0 with probability 1/3, 2 with probability 1/6, and 4 with probability 1/2.

My solution so far: `{(g/⍳⍴⍺)[1⍳⍨((g←⍺>0)/+\⍺)≥1+⍵]}`
but that looks more complex than it needs to be.
Just use ?0 and with a list of cutoffs that are normalised to the range 0…1.
@RomillyCocking Hold on, what are your left and right arguments?
oops! ⍺ is the vector of counts, ⍵ is ?⍴counts
2:15 PM
So can be inferred from .
Wouldn't (/⍨counts)[?+/counts] work?
(/⍨⌷⍨∘?+/)counts if you want a tacit function.
Not quite, though it helps. The result should be an index in the range 0 to ¯1+⍴counts.
This even allows non-integer "counts", i.e. weights.
:56516756 You have ⎕FR←1287
@Adám Once again. Thank you very much!
@Adám Thanks! You're a star.

It's for the MENACE book. Now you get a credit in the preface :)
@RomillyCocking to avoid floating point you could also do (0,+\counts)⍸?+/counts (no credit needed for me)
2:27 PM
@RomillyCocking Actually, you can avoid floats with (0,+\counts)⍸?+/counts
ha! :D
Tacit function: (+/⍸∘?⍨0,+\)counts
Slightly more efficient: (⊢⍸∘?⊢/)0,+\counts
3:07 PM
@Adám ⎕FR is for floating point numbers, but do I have to use own functions for 64-bit integers? ⎕643 is still missing...
Now I change numbers via bits like this to64Int←{
},⌽[0]8 8⍴11 ⎕DR ⍵
@kimmolinna ⎕FR simply tells APL how to represent floats. Integers are always represented the same, but only up to 32 bits.
@kimmolinna This will still return a 64-bit float if the result cannot fit in a 32-bit number. What is your argument here? A bunch of bytes (signed small integers)?
@kimmolinna Btw, you can write ⌽[0]8 8⍴11 ⎕DR ⍵ as ⊖11 ⎕DR⍪⍵ but be aware that this code is specific to little-endian machines, so it will fail on AIX.
3:52 PM
Were people in the 'young APLers group' young as in young, or young as in young for APLers
Rotated 3 degrees to align bottom lobes:
Getting close, I think.
@rak1507 They were relatively young considering Dyalog's median age. I was the oldest.
Ah cool, sounds like an interesting project, shame that it died
BQN is alive.
is there some smart way to make a base-N vector out of a base-M vector?
where N is say, 112 and M is 113
4:04 PM
@KamilaSzewczyk Other than converting via a plain number?
yes, preferably
For certain combination, it can be done (e.g. base-4 ←→ base-16), but for most combinations you have to access all digits of a number, so no.
hmm alright
not sure how to state it using the array paradigm but i'll tinker with it
N⊥⍣¯1⊢M⊥vector ?
appears to work, let me process how
4:08 PM
And if Extended or dzaima: N⊤M⊥vector
5:00 PM
For AoC today, can I pop completely out of the stack of a dfn after a guard that was caught deep in recursion?
5:24 PM
Ok worked it out "game immediately ends" didn't quite mean what I think it meant
is it acceptable to do something like this during golf: tio.run/##SyzI0U2pTMzJT///qKM9TSHxf2L0o95JRjWPejc/6lyUGAsS/…
So I was trying to do this question in Dyalog Extended, but I couldn't do {+/!⍎¨⍕⍵}⌂traj and had to do this. Any idea why @Adám? Is it because of how house works?
@KamilaSzewczyk Only if you count 4 bytes for f a\r but then you might as well use a dfn.
yeah that's what I was thinking
5:40 PM
{+/!⍎¨⍕⍵}traj works in plain Dyalog.
@user Ah, it is because it runs traj in a new namespace that doesn't contain the cover functions.
I have a feeling that ⍒2|⍳≢⍵ can be somehow simplified, but I'm not seeing it
it essentially generates indices, so that the odd ones come first before the even ones
Oh ok
@KamilaSzewczyk ⍒≠\=⍨
for ≢⍵=5 returns 1 3 5 2 4
oh yeah that's smart
I wouldn't think of ≠\
5:45 PM
@KamilaSzewczyk The APL Orchard article on APL Wiki now describes how to write ≠\
it actually ends up the same length
What is the context?
A: Separate a list into even-indexed and odd-indexed parts

Kamila SzewczykAPL (Dyalog Unicode), 11 bytes {⍵[⍒2|⍳≢⍵]} Alternatively: {⍵[⍒≠\=⍨⍵]} Try it online! Explanation: {⍵[⍒2|⍳≢⍵]} ⍳≢⍵ ⍝ indices from 1 to the length of the input vector. 2| ⍝ their divisibility by two; essentially generate 1 0 1 0... ⍒ ⍝ grade down: put odd i...

6:23 PM
@Adám Yeah I figured that out too - turned out I didn't need it + my problem in the end was a typo
APLcart snippet idea: increment the smallest cell of Y: (⊢+⍳∘≢=⊃∘⍋)Y
@KamilaSzewczyk What if there are two equally small?
it increments the first one
⋄ (⊢+⍳∘≢=⊃∘⍋)3 1 4 1 5
│3 2 4 1 5│
6:30 PM
sadly it's longer than the dfn version :c (in the specific answer case)
⋄ (⊢+⊢=⌊/)3 1 4 1 5
│3 2 4 2 5│
@KamilaSzewczyk it only works on vectors, so "cell" is misleading
i yoinked the "cell" naming from other aplcart entries and I thought that's how APLers name vector elements
It is 2020, why do we not have leading axis agreement?
6:31 PM
no clue what this is
Allows pairing say a vector with the rows of a matrix, or with the layers of a 3D array.
@KamilaSzewczyk "cell" is specifically a subarray of rank one less than the argument. You can get the list of cells of an array with ⊂⍤¯1
Also allows pairing each element of a matrix with each row of a 3D array.
Anyway, can be fixed with +⍤¯1 0
@Marshall Leading axis theory has a circular link to Leading axis agreement. Do you think you can write the latter article?
7:30 PM
@Adám I could, but there are a lot of other things to write too. Is the circular link a problem?
7:47 PM
@Marshall Not in it self, but leading axis agreement is a fundamental concept I'd like to link to.
@dzaima Wait what? The bot has a persistent session? Per user?
@Adám for testing i just made it call regular dzaima/APL, where the simple one-line invocation keeps the session through calls. Of course, this is just for testing, as ⋄ ⎕sh'rm' '-rf' runs just fine
@dzaima Illegal code
@DyalogAPL oh right you're here
haha that could have been bad
@DyalogAPL Well done. Good bot!
7:57 PM
@rak1507 eh, i specifically used a vector of string argument which is only valid in dzaima/APL :p
@dzaima (not that a single string version should work either as the bot should see through my plans; also i forgot '/' at the end :P)
8:31 PM
@dzaima To be clear, that is a major cell - a cell is any subarray of any rank, often called a k-cell of rank k
8:59 PM
codegolf.stackexchange.com/questions/168765/… found a 10 for this (not better than the current 9) but can it be golfed? ∊⊢⊢∘⊂⌸⍨2|⊢
9:12 PM
@rak1507 yes (left as an exercise to the reader)
@rak1507 you want the answer right away? :)
I was looking for a bit so I doubt I'll find it
@rak1507 hint: try to rewrite 2|⊢ so it can go on the left of the operator, and then get rid of the
note that your expression works only if the input starts with odd
Oh yeah oops
9:17 PM
@rak1507 you found it :)
I was thinking about if ⌸ can be used instead of sorting in some challenges as it's generally a few characters
@rak1507 ⌸ processes the groups in the order it sees their first member, left to right, so it's not very suitable for sorting
also, like most primitives coming from j, it does an implicit mix, so you'd have to enclose(⊂) everything to neutralize it (like you did above)
@rak1507 in golfing, ⌸ could be convenient as a substitute for {↑(⍳≢⍵),¨⍵} or python's enumerate(). assuming the argument consists of distinct scalars, it's: ,⍨⌸
i remember using this in at least one of the "number spiral" challenges
Ah yeah that's clever
I'm thinking of making some sort of spreadsheet/document/website with some small snippets more aimed at golf, things like that maybe
A bit like aplcart I guess
@rak1507 there's a tips page
9:32 PM
Yeah, I know, but there are definitely some short things not covered that don't deserve an entire tip
10:28 PM
@rak1507 Could you bunch them together? Also, I don't think there's a minimum length for a tip answer.
10:44 PM
hey @Adám sorry for not asking to continue today, today is the day in which I've decided to back up everything and move to Linux, gonna install it tommorow, can we continue tommorow's evening? asking if you have time
@Konrad'Unrooted'Klawikowski sure.
does RIDE work also on Linux?
@user446322 Hi Russtopia, if you want to participate here, email me: adam@ with the domain of www.dyalog.com
@Konrad'Unrooted'Klawikowski Yes, it works on all platforms.
@Konrad'Unrooted'Klawikowski ^ but be warned that the default Dyalog installation will remap your left super key to the APL key which you probably don't want
is RIDE based on Electron?
10:56 PM
It is.
Don't like Electron?
Actually, RIDE itself isn't Electron-based. The stand-alone, installable RIDE is. The interpreter can also act as a webserver, serving RIDE for use through any browser.
11:14 PM
let's say I'm not a huge fan of JS nor Electron
@Konrad'Unrooted'Klawikowski there's nothing about RIDE (the protocol) that restricts it to JS/HTML either - see this WIP mobile-ish interface. (though that's java which may or may not be better)
everything's better than JS
imagine one guy making a 'language' in 10 days and people literally use it on server side
@Konrad'Unrooted'Klawikowski the features from those first 10 days definitely are awful, but the later changes make it mostly usable (it's actually my fallback prototyping language after APL)
<moon-child> js-the language and js-the runtime are completely separate entities. The latter has its own problems but is generally fine. destroyallsoftware.com/talks/the-birth-and-death-of-javascript this talk, though quite humourous, is a surprisingly lucid explanation
<moon-child> (and the former is really a mediocre scheme, which is just frequently misused as a java/c)
11:34 PM
@Konrad'Unrooted'Klawikowski OK, but while using RIDE, you won't be exposed to any JS (unless you press F12). Of course, you can use the TTY interface, but it isn't very pleasant, imo.
Also, you do realise that you're relying on JS just to read this, right?

« first day (1427 days earlier)      last day (349 days later) »