« first day (1332 days earlier)      last day (1323 days later) » 

ngn
1:21 AM
@ngn @RGS -1: ' _'[×⍀1≠⍉↑,⍳1,⎕⍴3]
 
2:11 AM
good morning
 
ngn
good any time of day :)
 
lmao
how do you do
@dzaima I guess bubbler figured out the tiny optimized solution
 
2:26 AM
That could be why they're an award-winning APL'er. (or ... because)
 
 
3 hours later…
5:17 AM
codegolf.stackexchange.com/questions/77288/de-snakify-a-string "String snakes are dangerous, so you must make a program that takes a string snake as input and outputs it as a regular string." - doesn't say that you must not output the backwards snake as well. I wonder if that's implied
 
5:29 AM
> The first character of the string is the end character with the shortest Manhattan distance from the top-left corner of the input grid (i.e. the minimum number of moves it would take for a snake to go directly from the end character to the top-left corner). Both ends will never have the same distance.
@TessellatingHeckler ^
It's not implied, it's specified
 
 
1 hour later…
6:42 AM
How do I sum the codepoints of my APL PRogram?
not in Unicode, like, SBCS
 
@Razetime If you can, use Classic, then do +/⎕IO-⍨⎕AV⍳'my APL PRogram'
 
is the IDE Dyalog Classic?
 
@Razetime You don't need that, it will work in Dyalog Unicode too.
⎕AV is the Classic character set, even in Unicode.
 
great
 
If you need primitives not in Classic, or if you use Extended, follow the instructions here.
 
6:47 AM
How do I use dfns in extended?
 
@Razetime Exactly like always.
 
⎕CY 'dfns'
there's a 'home' symbol, was wondering how to use it
 
@Razetime Oh, the dfns workspace. Yeah, simply ⌂name
 
ok
 
@Razetime If you need to sum code points and use the dfns workspace in Extended, use 7F (127) instead of .
 
6:54 AM
cool
 
 
2 hours later…
8:46 AM
Morning.
 
Hello.
 
9:26 AM
Why's this sayin 'assertion failure'?
 
I see NumPy made Nature: nature.com/articles/s41586-020-2649-2 -- some nods to APL there.
 
9:46 AM
@Razetime what is the prime factorization of 0?
 
@dzaima something cool
 
@Razetime is an assertion error not cool? :)
 
not cool enough
 
@Razetime well then pco is just not up to your standards
 
does your version have one that is 'upto my standards?'
 
9:52 AM
@Razetime no, but if i did, 0 would still rightfully error
 
boooooo
 
 
2 hours later…
11:31 AM
@Razetime Can you give me a list of primes p such that 0=×/p ?
 
?
@Adám I was joking
 
 
2 hours later…
1:26 PM
@Adám what does the D in DFN stand for?
 
direct
 
Ah, I thought it was dynamic!
 
@TomCockram Today, nothing really. Historically, it was "direct" or "dynamic" (which is a terrible name)
 
oh
hahaha, had this exact debate at work. Is it direct or dynamic :D
 
Dfns have lexical scope, while tradfns have dynamic scope! If anything, they should be called Lfns…
 
1:28 PM
I guess I can use either
 
@TomCockram Btw, for next time, APL Wiki is your go-to place for information about APL. It links to:
A direct function (dfn, pronounced "dee fun") is an alternative way to define a function and operator (a higher-order function) in the programming language APL. A direct operator can also be called a dop (pronounced "dee op"). They were invented by John Scholes in 1996. They are a unique combination of array programming, higher-order function, and functional programming, and are a major distinguishing advance of early 21st century APL over prior versions. A dfn is a sequence of possibly guarded expressions (or just a guard) between { and }, separated by ⋄ or new-lines, wherein ⍺ denotes the left...
Look at the history section there.
 
Oooh, yes. Forgot about the wiki.
 
1:57 PM
@Moonchild Noticed the thread at lobste.rs/s/iwqpw8/bqn_finally_apl_for_your_flying_saucer . Mind giving me a Lobsters invite?
 
 
1 hour later…
2:58 PM
Finally it's Friday night, should do some APL to liberate my mind
 
3:33 PM
Friday night?
 
@matt Yea, my time is UTC+8
 
Makes sense.
 
At daytime I work intensely with SQL, which is also interesting, useful in its own right. But the syntax cannot compare to that of APL.
Maybe I should create a small library wrapping up SQL queries with APL functions. Then I can play with my data in APL workspace.
 
good idea
 
e.g. fetch_transaction←{⎕sql 'select * from tbl_transaction where id = "', ⍵, '"' }
@matt Thanks, gonna get started.
 
3:56 PM
kdb+/q has neat sql-like syntax built in.
 
I would really love to see APLers sharing their use with APL & ODBC
@xpqz Yes but my thing is operational data of some ticketing system, and is very relational in nature
And it would be good if I can manipulate the data with APL instead of SQL, at least occasionally...
 
I've been toying with the idea of building an APL query engine for CouchDB so that you could express its map-reduce views in APL instead of JavaScript.
 
@dzaima tio says ⍡ cannot be used dyadically
another thing, do you have a kb layout for your interpreter?
 
@Razetime it's not used dyadically there link, but if you're talking about other usages, i haven't given it a dyadic meaning
 
I mean here
 
4:09 PM
@Razetime i'm using this on linux (plus regular xcompose for more rarely used chars)
 
@xpqz Interesting. The other thing comes into my mind is Spark. I've been experimenting with it but the code verbosity was, once again, killing me
 
ngn
@jimfan classic sql injection :) '''; drop table tbl_transaction --'
 
@dzaima linux, probably portable to mac
tio.run/##ATEAzv9hcGwtZHphaW1h//… why isnt this function working?
 
@Razetime 1∊⌊{3×1|⍵}⍡10⊢((1)(∊)(⌊)({3×1|⍵}⍡10)(⊢))((1)(∊) ((⌊)({3×1|⍵}⍡10)(⊢)))(1∊ (⌊{3×1|⍵}⍡10⊢)), the right side is (⌊(…⍡10)⊢), and the center of a fork is always called dyadically
 
not sure what to do lol
 
4:15 PM
@ngn Yes that is horrible, all customer would lose their paid booking. Seems like Dyalog supports prepared statement though
 
@Razetime right, that's the hard part. Your problem is that you're doing a monadic function in the middle, and trains hate monadic functions that aren't applied directly on the input, it's usually solvable by jotting it to the function on the left (like this)
 
hmm ok
so I'm adding another function to the mix,
@dzaima is there any trains=parens in dzaima/APL
 
@Razetime that's the only option (but note that it may place parenthesis too non-aggresively around operators)
@Razetime your goal when writing a train is to write something like (g … f3 c2 f2 c1 f1) where f1, f2, and f3 are functions applied to the input (also can be constants, except f1), and each c_ "joins" the result of whatever's on the right and the function to its left, and g being an optional monadic function to post-process the result
 
tio.run/##ATEAzv9hcGwtZHphaW1h///… so far this is what I'm tryna do
this stuff still confuses me
 
@Razetime you still have …⍡10 at a center of a train (aka at an even position from the right, aka a c1 in my above message), so it's still called dyadically
 
4:31 PM
tio.run/##SyzI0U2pSszMTfz/… runs but there is some odd behaviour
 
@Razetime that's not even trains fault - you have f⍡10∘÷/, and, as operators are parsed left-to-right, it's ((f⍡10)∘÷)/. Then that's the right side of a fork (∊ ⌊ that), and then there's an A f- train (a dzaima/APL-specific thing, equivalent to {A f ⍵}), so you're actually ending up calling an n-wise reduce!
(also, if you want to, you can gaze into the mess that is dzaima/APLs parsing debug information (i don't expect that to actually be of much help, but ¯\_(ツ)_/¯))
 
gotta find a way to make this work lol
Maybe I'm just better off defining a dfn
 
@Razetime if what you want is to pass the result of ÷/ to {3×1|⍵}⍡10 (i.e. apply a monadic function to a monadic function), that's probably true (as here to use a you must use parentheses, wasting the 2 bytes you gain from not needing the {}; that's even forgetting the needed for )
 
I did make a dfn but it's still not giving the right result.
1/3 is supposed to return true.
 
@Razetime 1/3 in ternary is 0.10000, which contains a 1, which you negate
 
4:48 PM
A number is in Cantor’s set if and only if its ternary representation
contains only the digits 0 and 2
soooo
for some reason the question requires 1/3 to be true
 
(also i hope whatever this is for accepts things being wrong sometimes, as for 8/9 it gives 0.21222222… while the correct answer is 0.22000000…)
@Razetime ah i guess it doesn't
 
yeah lol
theoretically correct
1
3
= 1 · 3^−1
= 0.10000 . . .(3) = 0.022222
 
@Razetime it seems all other solutions are actually correct though
 
well they gotta be lmao
 
5:17 PM
@jimfan This?
 
 
2 hours later…
7:02 PM
@Marshall BQN is on the front page of lobste.rs, if you're into that kind of thing.
 
@Jonah Yeah, I was just asking for an invite here this morning. You're jonahx, I take it?
 
There are a lot of things that I really like about BQN, especially the use of roles to increase the amount that can be understood statically without compromising notation.
I find some of the primitives to be really hard to read after trying both fonts and increasing font size.
˙ vs ˜ are almost invisible to me, and even harder to distinguish. ` vs ´
almost all of the 1-modifiers...
 
7:19 PM
@eyepatch The 1-modifiers can definitely be hard to distinguish ˝ and ˜ are the two I have trouble with, although in context it doesn't seem to be a problem.
Fortunately ˙ is fairly rare, and means almost the same thing as ˜ most of the time it's used.
 
My screens are sometimes slightly dirty, and that makes it sometimes hard to tell if there even is a modifier. Having distinctive shapes also is a mnemonic imo.
But, I've been collecting a lot more positive feedback than negative feedback, I just haven't learned enough BQN to send it yet. :) Just seemed relevant with feature on lobste.rs
 
A BQN-specific font would definitely make them about the same size as ^ instead of much smaller. I wanted the BQN version of DejaVu to be basically compatible, but there's room for a similar modification with bigger changes.
 
I tried to install BQN DejaVu, I'm not 100% sure I was successful.
I think I was though. It has the same name, so that makes it harder to tell.
How were the symbols for the primitives chosen? ⍨ isn't used anywhere, and that could have been swap?
 
@eyepatch 1-modifiers are all superscripts. I also tried to stick with characters that are a single shape rather than having spots and accents everywhere, so ⍨⍤⍥ aren't included.
 
I mean, it is bike shedding, but it is a bit of a readability problem for me, and APLers traditionally care more about notation than most.
 
7:27 PM
@Marshall Yeah. I'll send you an invite if you still need it, what's your email? Or post it to a onetimesecret if you don't want to share publicly here.
 
@Jonah See my Github account.
 
@Marshall sent.
 
@Jonah Thanks!
 
sure thing.
 
@eyepatch A little frustrating that people (not you) seem to jump to that immediately, but it's definitely a real issue. There are a lot of constraints on the characters, so I usually just don't have the option of fixing many problems.
Superscripts that aren't combining characters are one area where Unicode definitely feels lacking.
 
7:33 PM
Constraints like the goal of superscripts?
 
That's one. It has to be in Unicode; I try to pick widely supported characters; nothing from alphabets since they might be rendered very differently from other symbols; can't look too much like another character.
 
@Marshall As someone with a lot of experience with both, do you have a personal preference between J and APL?
 
In a way, Iverson had the advantage of making the symbols first, and then Unicode adding them.
Glossing over decades of poor support ofc. :)
 
If font support wasn't such an issue, it turns out Canadians have been doing APL for centuries and you have all sorts of options.
 
Those are very nice.
 
7:38 PM
ah so that's where ᑈᐵ came from
 
@Jonah I use J but that's largely because it's what I started with and because APL tends to be difficult to run as a script. I like J's primitive choices and unified syntax better, but like modern APL's symbols, dfns, and modified assignment. Hard to choose overall.
 
those are fanstastic. when you refer to font support beign issue, does that mean even those these are unicode lots of fonts still won't render them?
 
Although I will say without having used it that A+ looks like the best designed APL-family language (discounting BQN).
@Jonah Exactly.
 
That sounds about right. The APL symbols are definitely nice.
 
So you prefer A+ to K? Why?
symbols I guess.
 
7:44 PM
@eyepatch I wasn't including K, which I don't know too well. "APL-family" wasn't the best term to use, but I meant only multidimensional array languages.
Nested-list languages do have a lot of advantages. I'm interested in multidimensional array design partly because I think existing languages don't take advantage of the design space as well.
On the back burner is another language I call Iridescence that aims to be a higher-level and more approachable array language, with somewhat Python-like syntax. Where BQN programming requires (or enables) you to keep track of all these array axes and left/right arguments in your head, Iridescence focuses on abstracting them.
 
@Marshall I'm not familiar with the term "nested-list" language. Is J nested-list?
 
@Jonah No: nested list langauges like K, Javascript, Python, etc. (and also my own language I) have only one-dimensional arrays or lists and store multidimensional data by nesting them.
 
oh K doesn't do J/APL style rectangular tables/records? That's surprising.
It seems so fundamental to the array paradigm
 
8:00 PM
@Jonah it's not actually that often that storing as a row or column vector is much worse. And without multiple dimensions implementations can get way simpler
 
@Jonah The leading axis model is where cracks start showing in the idea that multidimensional arrays are necessary, and if you follow that line of though all the way through you just might get K.
 
It would be very hard to do bin-packing tiled layouts for a nested list model though.
Or very much creative license with data layout.
 
@dzaima (for me there are mostly 2 cases of multidimensional array usage - either there's a constant or small row or column count (i.e. storing as a vector of rows or columns would be fine) or the shape isn't actually that important to the computation (i.e. pixels of an image and would otherwise be stored flat); though i don't do actual algebra-y things for which i could see matrices being very useful)
 
To me the difference is that the dimensions of an array are independent, whereas with nested lists the possible indices you can choose for a later axis always depend on earlier ones. This is related to dependently-typed versus traditional typed functional programming: you want the flexibility of dependent argument or index types, but also the ability to make them independent. Multi-argument functions and multidimensional arrays are a nice way to get independence.
 
8:29 PM
interesting.
 
9:00 PM
<moon-child> @Marshall if you follow the leading axis model all the way to k and beyond, arrays turn into functions; and since indices are arrays too, they also turn into functions
 
ngn
@DyalogAPL @moon-child what's beyond k? :)
 
@DyalogAPL I know: that's the model in Iridescence. An array is a function (of any number of arguments) with a finite domain, basically.
 
<moon-child> cool
<moon-child> have you also unified function rank and array rank?
 
@DyalogAPL I'm not sure how the details work out, but I think so. If the function's argument type has fewer parameters than the actual argument passed, then leading arguments get mapped over.
 
9:27 PM
<moon-child> @Marshall what I mean is, is it the case that for some relation f (where f could be a regular function or an 'array'), $ f and f b. 0 represent the same operation?
 
@DyalogAPL The shape of an array doesn't correspond to the ranks of a function f b. 0. It corresponds to the domain of each argument. The function shape(f[t*]) = t works on both functions and arrays; the domain of a 0-based array along a particular axis is the set of natural numbers less than the length, which is identical to the length itself, so the result on an array is a list of lengths.
 
<moon-child> err, that should be $$ f--rank, not shape
 
To get the function ranks, I think it would be ranks(f[{i:n}[r{i}*]]) = r. Every function rank of an array is 0 because its arguments are atomic numbers, which have rank 0.
@DyalogAPL Rank of an array or number of arguments of a function is rank(f[{n}*]) = n then.
That * might have to be a name like t instead.
 
9:42 PM
@Marshall In the HN thread, you mentioned that the JS interpreter for BQN is faster than the one you wrote in Go. Why is this? Is it something to do with the problem domain or did JS just get fast while I wasn't looking?
 
@Jonah Haven't looked into it deeply but I assume that costs are dominated by memory management and (V8) JS's memory management is better than Go's. The difference wasn't too big, and was mitigated somewhat by making the initial stack allocation for function calls larger in Go.
 
<moon-child> @Jonah go is less performant than you would expect from a compiled language; and, as @Marshall mentions, its gc is not very good. (Its gc gives very good latency, but not so much throughput.) And yes, javascript is very fast, especially once the vm has warmed up and functions have had a chance to get specialized
 
Thanks.
 
9:59 PM
<moon-child> @Marshall sorry I missed your ping earlier re. lobsters; you seem to have gotten an invite anyway, though
 

« first day (1332 days earlier)      last day (1323 days later) »