« first day (1451 days earlier)      last day (1204 days later) » 
01:00 - 22:0022:00 - 00:00

1:14 AM
CMQ: What factors did (would) you consider when you chose (get to choose) a host language for an APL implementation?
 
@pitr Hi there. Interested in APL? UW has a long history with APL…
 
ngn
@Bubbler only apl or any from the family?
 
@ngn Any in the family is fine.
 
ngn
@Bubbler ngn/apl - ease of use - js. ngn/k - performance - c.
 
Does Extended even count as an APL implementation?
 
1:20 AM
I guess not, but I'm open if you have something to say about it
 
APL: time until MVP
 
MVP meaning minimum viable product?
 
Yeah.
 
TIL.
I just googled it and that was the first hit, even above Most Valuable Player...
 
ngn
@Bubbler me too
 
1:27 AM
Wow, I thought that was a commonly used abbreviation within the software world.
 
I guess I'm strongly classified as a programmer/developer by Google
 
Why? it is the top Google result even for a fresh user.
 
ngn
@Bubbler what are you going to implement?
 
YAAPL, I presume. (Grammatically, that should be YAPL, no?)
 
ngn
there must be something about it that existing attempts don't do
 
1:32 AM
Anecdote: I got a big surprise when an APL old-timer (and still APL enthusiast) today posed that allowing 1 + 2 3 4 was a design mistake
 
Inspired by shaped arrays library in Factor (which is apparently only half-working), I'm thinking of implementing a more APL-like array (and APL primitives on them).
Hopefully I can also make some kind of APL DSL on top of it.
 
@ngn Something I'd like to explore, is an APL-like language where primitive functions default to applying on minimal rank arguments, but you have (magic?) operators that can force them to work on higher ranks. I'm sure if it is even possible, but I'd love to find out.
I have a feeling that it can be done using something like J's model where scalar functions cannot penetrate boxes, and then do something like ⍢(⊂⍤k)
Then 1 2 3 × 4 5 6 would be normal multiplication, and 1 2 3(×⍤1)4 5 6 would be like current +.×.
Similarly 1 2 3 = 1 2 4 would give 1 1 0 but =⍤1 would be like
 
So I guess × would be +.×⍤0 but can override the default rank?
Same for = being ≡⍤0
 
Exactly.
< would be as now, but <⍤1 would be like {>/⍒⍺⍵}
The idea stems from the observation that there's more power in primitives that operator on "larger" arguments, and you can define others in terms of those, like = being ≡⍤0, however, it is also the "lesser" primitives that are used the most.
So instead of including the larger primitives and having to use all over the place, one could include the lesser ones and use when a larger "grasp" is needed.
That'd allow you to use haystack(⍳⍤1 1)needles for PDI (the default rank being 1 0).
 
1:51 AM
Sounds cool
 
+/matrix would be as now, and +/⍤2⊢matrix would be like +⌿matrix.
would stay as now, which is more natural for the symbol (not like in BQN where it is used for ) and you'd use ⌽⍤∞ for first-axis flip.
÷ would be as now, but ÷⍤2 could be matrix inversion/division.
 
@Adám Sounds pretty fragile: wouldn't things like {⌽⍵}⍤2 break? How would you apply rank to +/÷≢?
 
@Marshall +/÷≢ would simply be row-averages, equivalent to the current +⌿⍤1÷≢⍤1. I've not thought much about user-defined functions, but I'd think the outer ⍤2 would force the function to see a matrix argument, and then ⌽⍵ would flip the last axis, i.e. the function would be equivalent to . Possibly user functions could have a header specifying their default rank.
Again, I'm not sure if this is at all viable, but if it is, then I have a feeling it'd make for a more natural way to express things.
 
 
5 hours later…
6:43 AM
Does Dyalog have a feature smilar to Lisp's UNWIND-PROTECT, or Java's try/finally?
 
7:03 AM
@EliasMårtenson Unfortunately not. This feature is regularly discussed in the devt team but hasn't managed to bubble up to the top of the list yet.
People sometimes fake this using destructors for objects that go out of scope, but it is an ugly business.
 
@MortenKromberg I'm implementing it in Kap now (specifically needed in the context of SQL support). What syntax has been discussed for Dyalog? If possible, I'd like to use the same.
 
@EliasMårtenson Both as part of a :Trap structure and stand-alone in a function.
:Trap
:Else
:Finally
:EndTrap
∇Foo
blabla
:Finally
No good idea for dfns yet
One camp (including me) has vowed to keep dfns free of control structures come hell or high water.
 
Wait, are guards control structures?
 
No, they are "definitions".
They do not manage control flow
error guards are perhaps borderline
 
cool
 
7:41 AM
We're trying to make plans to take action on the "Linux SuperKey" issue that Dyalog APL has under Linux. One problem that has come up in discussions is that it appears that WayLand still has no equivalent for setxkbmap. So I have a couple of questions for the Linux hacks out there...
1) Is this something that WayLand is likely to add (I read some comments to the effect that this was due to the "immaturity" of WayLand.
2) How quickly do you expect WayLand to become widely used, so that this becomes a serious issue?
3) Is it important to have a dynamic way to change the keyboard (I think yes)?
 
7:53 AM
<moon-child> I think that, in the long term, wayland is likely to support it. In the short-med term, wayland's lack of support is an acceptable reason not to support wayland, esp. since RIDE also lets you type apl glyphs with a backtick prefix instead
 
8:03 AM
Thanks. As I understand it, you can set Wayland keyboards up to support APL, you just have to do it in configuration at startup, and cannot change it dynamically.
 
@MortenKromberg Interesting. I was thinking of having an operator: {finally}OP{somecode}. I could then use Kap's custom syntax feature to build on that to create essentially Java's syntax.
 
@EliasMårtenson That might work, but would be less attractive for "industrial" systems where you would like to see the :Finally actions in the body of the same function that is doing the work.
A lot of the code that really needs "finally" is ugly procedural stuff
 
I don't remember who asked but yes I am interested in APL. Thanks for asking, I'm interested in the brevity because I at the moment cannot use the keyboard very much. But I do have to admit that it is fun to learn apart from that aspect.
For now I've only spent approximately one hour just learning the basics from the APL wiki. I intend to solve the advent of code next and to learn the necessary material along the way.
 
8:31 AM
@Dincio As a newbie myself I enjoyed going through rikedyp.uk/APLWorkshop
 
8:42 AM
@MortenKromberg True, but I don't expct a program to actually directly use the operator. Instead, they'd use the imperative syntax, something like try (..) finally {...}
It's similar how if/else is implemented in the standard library instead of using actual keywords: github.com/lokedhs/array/blob/master/array/standard-lib/…
 
@Bubbler are folks claiming bounties for golfed problems supposed to ping you, or is adding ourselves to the list enough?
 
I prefer it that way, because that way I can make changes to syntax without having to update the language.
(that's the reason why Common Lisp has lasted so long without any standard updates. The syntax itself is programmable)
 
8:57 AM
@EliasMårtenson OK, we are not able to play that sort of game in Dyalog APL. I would also worry about the error reporting / debugging experience using "tricks" like that.
 
@MortenKromberg Oh. I was about to suggest you add hooks into the parser so users could add their own syntax :-)
 
@MartinJaniczek I think adding yourself to the list is fine
 
@EliasMårtenson Ain't gonna happen. It isn't a notation any more if it becomes too fluid. This is one of the hard dilemmas in APL language design: Are we trying to create a notation or a quote programming language unquote. Many of the things that computer scientists see as weaknesses in APL that we should "fix to make it better" would threaten the value of APL as a notation and tool of thought. IMHO, of course.
 
@MortenKromberg I see. I understand that viewpoint. It's a viewpoint which is even stronger on the GNU APL mailing list. :-)
 
Isn't that what control structures already do? :If :While :EndWhile etc don't seem like part of any notation to me
dare I mention OOP
 
9:01 AM
I obviously disagree, and which is partly why I decided to make my own implementation so that I can experiment with this. So far, not all of my experiments have been successful to say the least :-)
My own opinions on this aren't fixed of course, and they have changed significantly since I started reading a lot of what people on this channel have been saying.
 
@rak1507 Oops, I had forgotten I was supposed to be in a meeting. Two, actually. Back later...
 
Enjoy
 
@rak1507 I think the control structure notation in Dyalog is intentionally ugly. It looks to me as though it's done in that way so as to make a very clear separation between "APL" and "imperative"
 
I agree, my point was that they've already added several changes to make APL more of a 'programming language', so they probably could add more if they saw it to be useful enough
 
Which is very different from Kap where you can do stuff like: foo ⍉ if(x) {2 3} else {2 3 4} ⍴ ⍳100
@rak1507 I agree. They clearly have different priorities. I think their implementation of various features are very much driven by customers. Dyalog themselves might not want the object orientation for example, but customers demand it so they do it.
 
9:11 AM
Yeah definitely
 
@MartinJaniczek thanks for the shout out - out of interest, how far did you get through it?
 
Makes me wonder what Dyalog would look like if they didn't have to worry about customers.
Something like BQN perhaps.
 
@EliasMårtenson Nah IMHO we'd just take the main warts out of APL, but keep the base notation the same
 
@EliasMårtenson fwiw personally I like a separation between data manipulation and control flow manipulation. But either way, allowing that makes sense, it's a question of if it's useful and how hard is it to squeeze into the syntax
 
@Adám was he saying that or (,1) + 2 3 4 was a mistake? to be honest I didn't follow what he was saying most of the time
 
9:20 AM
@EliasMårtenson BTWin ngn/apl you can reassign symbols
 
@MortenKromberg I think it'd be better to do:
∇ Foo
:Section
:Finally
:EndSection
∇
as this would allow you to control the point where the final code is run.
@Dincio Heh, I used to use APL while standing in packed transit trains. I was able to balance my laptop on one hand, typing one glyph at a time with the other. So yes, that works.
 
@Adám Yup, the design is not completed.
 
@Dincio I recommend problems.tryapl.org as those problems are simpler than AoC and are very geared towards APL solutions.
 
@EliasMårtenson What Dyalog would look like if they didn't have to worry about customers? Easy: It wouldn't exist at all.
@EliasMårtenson Dyalog APL was created by a group of consultants who were worried that mainframe APL was going to die, and the business would disappear.
 
@rak1507 Everyone (I think) agree that (,1) + 2 3 4 was a mistake. No, he knows his terminology. He thinks scalar extension was a mistake.
 
9:32 AM
@EliasMårtenson My personal experience is that things that are not designed with a customer/user focus, tend to lose their way very quickly. This is the foundation of agile programming, as I understand it.
 
@Adám My internet was cutting out lots so I could barely hear what people were saying most of the time. That really is strange
 
You have no way to know whether something is "good" unless people are using it in anger. Of course, that is a very personal opinion, I recognise that.
 
Interesting. I must have misread the ISO spec when implementing scalar functions. In KAP this is an error: (,1) + 1 2 3
 
@EliasMårtenson I think people here told you to deviate from the spec on that aspect.
Remember that the spec was largely a description of the current state. It wasn't an attempt at dictating something "good".
 
@Adám Yes, you have mentioned that about the spec. I'm not sure this specific case was mentioned before.
 
9:37 AM
⋄ ⋄ ∘.≡⍨ (2 3 4 + 1) (2 3 4 ∘.+ 1) (2 3 4 + ,1) (2 3 4 ∘.+ ,1)
 
@Adám
┌→──────┐
↓1 1 1 0│
│1 1 1 0│
│1 1 1 0│
│0 0 0 1│
└~──────┘
 
Even if it's a coincidence, it's a happy one
 
@EliasMårtenson I believe the control structure design was more or less adopted into Dyalog APL and APLX from APL*PLUS back in the day where they were the commercial juggernaut and we were the new kid on the block.
 
@MortenKromberg I see. I thought it was a Dyalog invention :-)
Speaking of mainframe APL. I wonder if it's possible to get hold of a copy of APL for MVS. I have an MVS 3.8j running in an emulator here, and getting APL on it would be cool (but probably very impossible)
 
Personally, I am very happy that the structured programming keywords and the OO keywords look completely different from regular APL. I think of them as the arrows in my control flow diagram, with the "notation blocks" in the rectangles. I think this is a very healthy situation.
 
9:40 AM
There are (afaik) three basic forms of control structures: begin…end, type{…}, and indented. I wonder what made Manugistics(?) choose begin…end.
 
brackets would be an interesting choice now as it would almost look like a dfn
 
@EliasMårtenson You mean APL\360?
 
When control structures were invented, there were fierce battles between the people who agree with that view, vs. the people who thought we should come up with squiggles to do control flow. I am SO happy that control flow is very, very obviously visually distinct from the "straight through" flowing notational blocks.
 
I just had a thought, what if `:If` was a function that conditionally ran a function, like
:If (foo) {
stuff
}
 
@rak1507 Sure, but {…} here isn't to be taken literally. Lua uses doend instead of glyphs.
 
9:42 AM
@Adám Probably. I don't know what version of APL was available back in the 70's.
 
@Adám yeah, but {stuff} already has a meaning in APL, so using that for control flow might look more APLy? I don't know
 
@MortenKromberg You pobably very much disagree with the kap syntax I showed just now then? (an if embedded in an apl expression)
 
@EliasMårtenson here
 
seeing as KAP is lazily evaluated can you do cond⊃(false)(true) without evaluating false and true?
 
@EliasMårtenson Would you be interested in a Z Linux interpreter? I don't have one right now, but it has been considered from time to time.
 
9:53 AM
@rak1507 Yes. You could.
 
neat
 
@rak1507 Well, I have to clarify: Both sides are evaluated. They just are not collapsed.
Evaluated means the code is run, but the computation of the result is delayed.
 
interesting
so if you had an error in one of them, it would error?
I guess I can try for myself
 
@rak1507 Depends on the error.
 
@EliasMårtenson I don't OBJECT to it, but I don't really see why it is better to write if(x) {2 3} else {2 3 4} ⍴ ⍳100 than ((2+x)↑2 3 4)⍴⍳100.
 
9:55 AM
It depends on whether it's evaluated as part of the execution or computation phase.
 
yeah, an unnamed variable
right, makes sense
 
@MortenKromberg Of course. It was just an example.
 
@EliasMårtenson One problem I do have with that it that it seems to me that it has "irregular" syntax compared to the rest of the language, with rules that I have to memorise. Is that correct? [next meeting in 3 mins...]
Unfortunately I do not have time to properly grok all the cool languages that y'all are working on.
 
10:15 AM
I know I can rotate a matrix by 90 degrees by ⍉⊖. Is there an idiomatic way to rotate it by a single step? So given ⋄ 4 4⍴⍳16
I want to get to ⋄ 4 4⍴5 1 2 3 9 10 6 4 13 11 7 8 14 15 16 12
 
@xpqz So inner and outer rings move at different speed?
 
Well... every element moves 1 step, for an even-sized matrix.
 
I think there was a code golf challenge for that.
 
So I'd expect that applying it ⍣4 would result in the same as ⍉⊖ in this case.
 
@xpqz No, because in a 4×4 matrix the inner ring does a full revolution in 4 steps, while the outer does 90 deg in 4 steps.
30
Q: Rotating a 2D Matrix

StepUpLet's say I have the following (2D) matrix: [[1, 2, 3, 4 ], [5, 6, 7, 8 ], [9, 10, 11, 12], [13, 14, 15, 16]] Rotate the matrix counterclockwise R times (not in 90 degree increments, just by 1 number each time), 1 2 3 4 2 3 4 8 3 4 8 12 5 6 7 8 -->...

@xpqz I guess you'd need around 50 bytes to do so.
 
10:27 AM
Don't feel so bad now about not being able to see a trivial solution.
 
I'd try to generate one mask per ring, and then use @ to rotate them.
 
maybe you could try porting the jelly solution
if it's 35 bytes in jelly, it must be tough
 
Ooh, I think I have a relatively short solution.
 
@MortenKromberg That's the foundation of XP. Agile was (IMO) more about applying continuous improvement to the software development process, and an awareness that 'good practice' always depends on the people and the context. But the term has been hijacked by people who make more money if they pretend there's a static process.
 
Meh, no that approach didn't work out.
 
11:01 AM
@RikedyP I still have to go through rikedyp.uk/APLWorkshop/course/6 and onward :)
 
11:27 AM
@xpqz Not golfed, but hey, it seems to work:
∇  mat←Rot mat;size;ranges;order;n;mask;rings;cutoffs;flat;grade
   size←≢mat
   rings←,(⌽⌊⊖)⌊/¨⍳2⍴size
   order←,{⌽⍉,⌸⍵+≢⍵}⍣2⍣size⍪⍬
   :For n :In ∪,rings
       mask←n=,rings
       grade←⍋mask/order
       (mask/,mat)←(1⌽(mask/,mat)[grade])[⍋grade]
   :EndFor
∇
 
Let me dissect that
Never think of doing tradfns -- always feels like cheating :)
2
 
Was just for the for-loop. Can easily be written with ¨ or /
 
Or even ⍣ maybe?
 
@MortenKromberg It is irregular, in a way. The if/else structure is defined using the defsyntax form which does directly affect how the parser processes code.
But, with custom syntax, the initial symbol always defines how the parsing is to be done, and it's defined in a kind of limited BNF notation.
 
@EliasMårtenson Our control structures are of course also irregular, which is why I like the :keyword syntax which tells me clearly exactly where I am looking at normal APL notation, and where I am not. This is similar to the (wonderful) separation APL gives you between user-defined names and squiggles, making it totally clear what is part of the platform, and what is "my stuff".
 
11:41 AM
@Adám That would be a candidate for addition to the dfns ws.
 
You cannot have name conflicts between your stuff and the APL language
 
@xpqz Only if rewritten as a dfn ;-)
 
A fair point, well-argued.
 
@MortenKromberg why not?
 
@rak1507 You cannot have name conflicts because the APL language uses symbols, or names which are illegal as user-defined names (⎕TS, :Trap).
 
11:45 AM
Ah right I misunderstood what you were saying
 
@MartinJaniczek I see - the beginning is currently the best of it so far, and it's still under development, so I'd appreciate any feedback you have (can do it here or via github issues or whatever) if you do decide to look at the rest of it. I suspect most independent learners would get far enough that they feel alright with the basics and then would go off and figure out their own stuff, but it is also gonna be a complete course so it should feel complete by itself
 
@MortenKromberg One of my favourite features of APL. (Though why are public and shared reserved words? I see no reason they need be.)
 
@Adám I don't think they are reserved in general, only as extensions of :Access, right? I agree it might have been better to add a colon, but given the restricted use case it feels unnecessary.
 
@MortenKromberg In Kap, the squiggles and user-defined names have exactly the same semantics. They are mostly similar in Dyalog too, are they not?
 
Not just access...
:field public public
is allowed (I think) and does look pretty odd, I grant you
 
11:56 AM
@xpqz Kap's "while" implementation is implemented on top of ⍣.
 
@EliasMårtenson Yes, I think that is true, although I would leave it to Adam to remind me of any edge cases :)
 
@EliasMårtenson An APL with scheme-y macros is a really appealing idea to me.
 
@MortenKromberg Although, if I'm not mistaken, Dyalog does not allow user-defined functions and operators to accept axis arguments, right?
 
@MortenKromberg It is NOT allowed, for no particular reason. Sure, code like
 :If If
L:EndIf
:End
is bad style, but shouldn't be disallowed.
 
@xpqz I've thought about bringing it to the level of Common Lisp macros (i.e. making the Kap runtime available during parsing). As I am adding more and more esoteric features to the defsyntax handler, I'm thinking that perhaps a fully-fledged macro-system would be better.
 
12:00 PM
@EliasMårtenson No, but then axis is something the current thought police think should be deprecated. Also, the variant operator is not defined on user-defined functions.
 
@MortenKromberg Neither is it on any squiggles.
 
@MortenKromberg Wait what? What should the axis be replaced with?
 
@EliasMårtenson and
 
@MortenKromberg What is the variant operator?
 
12:01 PM
I already hate ⍤ for all the pain it gave me during implementation :-)
 
@EliasMårtenson The thing is, you implement it once, and it works for all functions. Axis needs one special-case per primitive (except scalar ones).
 
@Adám There are no squiggles that make use of variant, but I do not believe there is anything preventing APL implementers in the Dyalog team from using it. APL users, on the other hand, have no way to make use of variant.
 
@Adám That part is true. I don't know how many times I've implemented some particular axis-handling.
 
@Adám I see you;re the "thought police" @MortenKromberg was referring to :)
 
We can do (⍳⍠1) any time we like.
 
12:04 PM
@MortenKromberg Right. Anyway, I think of Variant mostly as a stop-gap solution in waiting for named arguments.
 
@Adám So variant introduces a magic number that somehow changes the behaviour of a function in ways depending on the magicness of the number?
 
@xpqz Not at all. I don't believe in dictating thought. Notice how I defend use of tradfns etc. There are also cases where the and alternative to axis is too awkward compared to the simplicity of the operation, e.g. ,[⍳2]
 
@EliasMårtenson That's the exact same thing that bracket axis for functions does :)
 
@EliasMårtenson Nah, it can have a "principal" option which is a scalar, but usually it just takes name-value pairs.
It basically is a hack to allow an options object like you'd supply JavaScript methods with.
 
how can i check if a word is a subset of some chars (think, scrabble). ie. ('of' f 'foo') is true, ('flo' f 'foo') is false
 
12:08 PM
@Joshua You mean if every element is a member? With or without replacement?
 
without replacement
 
Basically you'd want membership without replacement.
 
if you're code golfing you can probably get away with using ⊆⍦ in NARS
(which is a really cool thing I wish APL had)
 
thanks @Adám
 
@Joshua Ooh, I think ∧/⊣≤⍥({≢⍵}⌸{⍵[⍋⍵]})∩⍨ works in this particular case.
No, wait, it doesn't if needed characters are entirely missing.
 
12:17 PM
@Adám Oh, I see. Wouldn't it be easy to supply this to user-defined functions as well. In a wasy similar to how GNU APL allows you to access the axis value through χ?
 
I think {∧/<⌿↑⊢∘≢⌸¨⍺,⍥⊂⍺,⍵} works
 
I think it'd be easy. E.g. though a ⎕OPTS namespace.
@rak1507 Ah, that's clever, forcing the same order.
@rak1507 Wouldn't replacing the right-hand , with make it a proper substitute for the classic APL expression, i.e. work on any rank?
 
probably
what classic APL expression do you mean?
 
The one on APLcart.
 
Oh, I haven't seen that, what should I look up
ah, progressive member of?
that uses ⍪
 
12:22 PM
13 mins ago, by Adám
Basically you'd want membership without replacement.
 
yeah
 
@Adám Do you have a writeup on how to get rid of axis? For example, what would X,[0.5]Y look like with your proposal?
Should I concloude that the fractional axis is special?
 
@EliasMårtenson We have a video series.
@EliasMårtenson Every axis is special.
@EliasMårtenson See also APL Wiki.
@rak1507 All the set operations could just have ben included as multi-set operations, as it is very simple to define the non-multi ones in terms of the multi-ones, using
 
that would've been nice
...⎕ML? :P
 
No, new language.
@rak1507 Did you see my (almost mono-)logue from last night about inverting rank?
 
12:33 PM
Yeah
 
Here again, the simpler constructs are easy to define in terms of the more powerful ones, but it is the simpler ones that are most often used.
So again, I'd want to be normal as we know it, but ∊⍤1 to be without replacement.
(The default being ⍤0 1)
 
Raku has a multiset type where I can just do X ⊆ Y
 
Sure, but I think one of the beautiful aspects of APL is how few data types it has.
 
@EliasMårtenson Slightly off topic, but the most common use of X,[0.5]Y is X,⍪Y in modern Dyalog APL
 
if ∩ worked with multisets in APL it would be ⊢≡∩ which is pretty much as simple
 
12:40 PM
Yup, exactly. There's no need to have non-multi set function if you have multiset functions.
 
@MortenKromberg seems different to me, what are X and Y in an example?
 
@EliasMårtenson Another alternative, assuming is added, would be ↑X⍮Y (⊃X⍮Y in ISO/GNU syntax, being {⍺←⊢⋄⍺⍵})
 
Seems more like ⍪⍥(↑,∘⊂) to me
 
@dzaima is ,⍥⊂ and not {⍺←⊢⋄⍺⍵}
 
Is there some "prior art" in APL (eg. in dfns -- which I looked at but didn't find it there) of parsing an expression string into a RPN notation and then evaluating it? Or some equivalent more-suited-to-APL approach?
 
12:43 PM
oh right, ↑,⍥⊂ works then
 
The one case where I like ⎕ML←3 better: ⊃⍤,⍥⊂
 
@rak1507 that's for "the most common" case, where X and Y are both vectors. Of course it breaks on higher rank args
 
yes
 
@MartinJaniczek apl.wiki/APL_Seeds
But be warned, it is mostly in BQN rather than APL.
 
Sweet!
 
12:47 PM
@dzaima what does ⍮ do?
 
@EliasMårtenson It is simply pair: ,⍥⊂
 
@EliasMårtenson ⍮←,⍥⊂ or ⍮←{⍺←⊢ ⋄ ⍺⍵}
 
@dzaima No, {⍺←,⊂ ⋄ ⍺⍵} if you really want a dfn.
 
@Adám oh right :|
 
1:18 PM
Two vectors:
1 2 3 ,⍪4 5 6
1 4
2 5
3 6
 
@EliasMårtenson ISO has only scalar extension; Dyalog modifies it by changing scalar to singleton extension pretty much everywhere it appears. Maybe you could argue that this is a conforming extension to the spec, but really it was just needed for compatibility with other APLs (I don't know which).
 
@MortenKromberg Another good modern alternative for that case is ⋄ 1 2 3(,⍤0)4 5 6
 
@Adám
┌→──┐
↓1 4│
│2 5│
│3 6│
└~──┘
 
@Adám Nah, too many moving parts
 
One function vs two. And same length too:
Join←,∘⍪
Join←,⍤0
 
1:21 PM
I beg to differ, your expression uses 5 symbols where mine uses 2
(and "Join" is 4)
 
:-)
 
... plus I then have to look up what Join means ...
 
I'd use ,⍪ or ,⍤0 depending on context: ,⍪ inline in explicit code, and ,⍤0 if the middle part of a train.
E.g. to add a "serial number" to the squares: ⍳⍤≢,⍤0×⍨ rather than {(⍳≢⍵),⍪×⍨⍵}
 
I'd rather use {⍵∘.*1 2} for that ;)
 
That's not the same. The left column consists of indices, not original values.
 
1:28 PM
I know, note the ;)
I cannot find trains like that beautiful, I apologise. There is something about trains that grates so badly with decades of reading APL. I may get there eventually but my brain suffers a pipeline stall every time.
 
You would probably find K's trains more natural.
They are just atops: f g h is simply f g h ⍵ or f g ⍺ h ⍵
 
Much more comfortable, I agree.
 
OK folks, note this historic moment when Morten and @ngn agree on something!
 
I suspect @ngn and I agree on many things, but there's no fun in discussing them ;)
 
Sure, of course, but here we're talking about being dissatisfied with an aspect of current APL.
 
ngn
1:37 PM
^^ i was going to say
 
Though I guess you two can also agree that singleton extension is bad.
 
ngn
being array programmers we all already agree 99%, but what's the point of discussing that
@Adám i do
 
@ngn :-D
 
ngn
it's not like tradfn-bad or ⎕io-bad but it's still bad :)
 
Reminds me of the "APL is more French than English" Perlin essay.
 
1:40 PM
Single-element vector extension was kind of excusable when we only had ⍴. But multi-dimensional singleton extension as we have in Dyalog APL is insanity.
 
ngn
i guess that was also the reason for the now-unfixable ⍳,n "feature"
 
yup, think so
 
2:39 PM
What do you mean by singleton extension?
 
@xpqz ⋄ 1 2 3+⍪4
 
@Adám
┌→────┐
│5 6 7│
└~────┘
 
oh. why is that bad?
 
      ⍴⍴(1 2 ⍴2)+(1 1 1⍴3)
2
      ⍴⍴(1 1 ⍴2)+(1 1 1⍴3)
3
I actually saw the above make an application crash one day after running successfully in production for years.
One day there happened to be only one column of data in the input... boom!
 
One day there happened to be only one variable:
      ≡⍳⍳3
2
      ≡⍳⍳2
2
      ≡⍳⍳1
1
CMC: Given a numeric scalar or vector, convert to scalar if length is 1.
 
2:52 PM
@Adám {1=≢⍵:⊃⍵⋄⍵}
 
@Wezl And if I told you I could do it in 2 characters?
 
@Adám then it would have to be in APL
 
;-) Yes.
 
Duh, think I got it. Am I allowed to participate?
 
2:58 PM
Pure pornography
 
Of course, Chat Mini code golf Challenges are open to everyone.
 
⍎⍕
 
Exactly.
 
Two tie fighters after a mid-space collision. Lord Vader will not be pleased.
 
wtf
 
3:01 PM
@xpqz Are you reacting to the solution or Morten's description?
 
I helped a customer once who had at least one of them on every line of code
He'd lost track of whether his variables contained character or numeric data
 
⋄(⍕,1)≡⍕1
 
@xpqz 1
 
Does that make sense?
@Adám the solution.
 
@xpqz Well, you can't say that a scalar number becomes a scalar character, as multi-digit numbers exist.
imo, the only questionable behaviour is ⋄ 'a'≡⍕'a'
 
3:05 PM
@Adám 1
 
Funny, that behaviour makes total sense to me.
But a vector and a scalar both formatting to scalar does not.
 
Since it is Friday Afternoon...
 
Or maybe it does. Not sure how a formatted vector of one element would present.
 
      ⍴⎕←⎕FMT 'A',(⎕UCS 8),'_'
Ⓐ
1 1
Argh that should be A underscore, of course.
 
⋄ ⎕FMT 'S',(⎕UCS 8),'|'
 
3:09 PM
@Adám
┌→┐
↓$│
└─┘
 
You beat me to it:
⋄ ⎕FMT '○',(⎕UCS 8),'*'
 
@Morten Kromberg
┌→┐
↓⍟│
└─┘
 
@MortenKromberg We should explain that Dyalog culture includes sending jokes and memes on Friday afternoons.
 
@Adám thank you. but it's not afternoon yet here
 
It goes by sender's TZ.
 
3:19 PM
mhm well I'll think of something by 17:00 here
 
What are the top-10 APL memes?
 
@Razetime wanted to put together an APL Wiki page to collect them all.
 
+←1
I recently got myself an Apple Pencil for my iPad. They offer free laser engraving, and I tried getting ⎕IO←0. But unfortunately they were seen as "illegal characters".
 
APL, the only programming language that can create diamonds: ⎕FMT'>∨',⍨'<∧',,⍨⊃⎕TC
 
@Adám Illegal code
 
3:25 PM
Oh well:
      ⎕FMT'>∨',⍨'<∧',,⍨⊃⎕TC
⋄⋄
 
3:41 PM
@Adám APL, the diamond in the rough
 
4:00 PM
wow I didn't know ⎕FMT can do that
Oh it's some overlaying trick
 
What's the difference between ⎕FMT and ⍕?
 
it seems ⎕FMT can take multi character things and turn them into single character things
⋄ ⎕UCS ⎕FMT ⎕UCS 83 8 124
 
@rak1507
┌→─┐
↓36│
└~─┘
 
⋄ ⎕UCS ⎕FMT ⎕UCS 12 8 13
 
@rak1507
┌→─┐
↓12│
│32│
└~─┘
 
4:09 PM
now that is bizarre
| doesn't work properly with ⍣¯1 :(
⋄ 10∘(⊣|⊣+⊢)⍣¯1⊢0
 
@rak1507 1.978426382E¯15
 
lol
 
@xpqz my fav was the one somebody posted titled "me at the apl orchard" where its anime and has different people labelled. wild.
 
RGS
@DyalogAPL This is almost 0
 
yeah I know
 
RGS
4:21 PM
It is being numerically inverted, that's why you are not getting 0 as a response.
Or by "doesn't work properly" you meant exactly that?
 
RGS
@cannadayr that is pretty good, yeah :D
 
@RGS gave me early aughts bbs vibes hah. like i posted it on a discord group im on and got a lot of quizzicle ??? replies
 
RGS
@cannadayr damn I have no idea what your first sentence was xD
 
early aughts ~2004-2006
bbs bulletin board system
 
RGS
4:25 PM
ah ahaha
thanks
 
altho it might be better classified as genz
 
 
3 hours later…
7:04 PM
@RikedyP I totally missed your message. Yes that is how I worked with it. My "learning APL from zero" was that I learned the basics through it, then kinda started checking out various other operators/fns more and more as I got more confident with the language. Picking a real problem to work on helped guide my learning too. The workshop, at least the parts I got through, in combination with this channel, "bootstrapped" me enough to be self-sufficient.
FWIW I missed/ignored the videos. Some pages were a bit more rough (depended on the video more than others), but it was doable :) I enjoyed the "little bit of description then a lot of small problems to work through" approach.
 
@Adám Thaks agin! I will try definetely try those before Aoc now
 
7:40 PM
Reading an interview with Arthur Whitney and he says 'In C I never learned to use the debugger so I used to never make mistakes' haha
 
ngn
7:58 PM
@rak1507 it must be this one
 
yep :)
 
8:31 PM
Came across this earlier @Bubbler codegolf.stackexchange.com/a/167646/95516 do you happen to remember the solution?
 
 
1 hour later…
9:39 PM
is there a way to )clear a saved workspace file?
(I have one saved which is pretty much just a convenience thing so I don't have do ]cd)
 
ngn
use plain text source files and you'll never need to )clear
 
I like the repl
and the editor is mostly bearable
 
01:00 - 22:0022:00 - 00:00

« first day (1451 days earlier)      last day (1204 days later) »