« first day (1501 days earlier)      last day (1163 days later) » 

12:00 AM
have you ever read dfns workspace @rak1507
 
the comment whitespace isn't what I was talking about
that's fine
 
like check out any of john scholes code
I'm talking about the vertical alignment of ← as well
take a look at john scholes code
in dfns
 
there's very little whitespace in expressions
 
he even goes so far as to choose names of equal length
are you kidding? have you watched the videos he did?
there's so much whitespace, also not to mention dyalog autoformats
which is heinous
 
you said dfns, not his videos which are aimed at a non-APLer audience
 
12:02 AM
yeah, but how do you read the dfns?
do you read them in HTML or in the session?
because dyalog auto fmts
 
html
any dfns sources are like that
even game of life in dfns is ↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵
 
well... I can't link you a project I worked on where other prominent APLers also do the same sort of fnName ← body to align vertically
and I do this in every language, alignment communicates form
that's why lisp and scheme uses an entire editor to make sure it indents according to a given form, even though indentation is fundamentally meaningless
it conveys subconscious meaning
 
ngn
whitespace for alignment is one thing. superfluous whitespace (not for alignment) is another.
 
^
 
whitespace conveys subconscious meaning
the fact that you're noticing it demonstrates that
you just reject that it might mean something, and I don't know why you'd do that
 
12:07 AM
yes, excess whitespace makes me subconsciously think you're using too much whitespace
 
it isn't excess
lol
 
ngn
@nathanrogers doesn't the fact i'm noticing it show it's not subconscious?
 
there are 2 kinds of whitespace here, alignment, and grouping
 
the alignment is fine I just don't buy the grouping
 
grouping implies phrasing implies meaning
then don't buy
 
ngn
12:08 AM
@nathanrogers ok, 3 - .. and unnecessary spaces around ←. they are not grouping or aligning anything
 
what unnecessary spaces are you referring to... ALL the spaces around ← are alignment spacing
its literally a single space on either side
for alignment
 
a  ← 1
bc ← 1

vs
a ←1
bc←1
maybe?
is that what you mean @ngn
 
ngn
@nathanrogers that^
 
incorrect
 
ngn
@rak1507 yes, thanks for clarifying
@rak1507 probably on the right side of ← too
 
12:10 AM
 
oh yeah
 
this is a single space
 
s03_1a←{...}
 
all names are of the form sNN_Nx so they all align to that form with a single space separator
@rak1507 see I hate this because it doesn't allow for fast vertical scanning of the page
 
why not
 
12:11 AM
too desne, text bunched up on all sides
 
ngn
@nathanrogers you need a better font.. ?
 
the vertical white space around a specific aligned column allows for vertical orientation
I mean... name it
name me a font with all the characters that actually has nice vertical separation
 
ngn
@nathanrogers i can't, as i'm not too interested in fonts, but i'm sure @Wezl can
 
I'll tell you, I've spent more time fineggling with fonts these past 4 or 5 years
I've done run through any kind of unicode font I can find
APL font is the best it gets for unicode support
 
ngn
@nathanrogers and still, you need to put whitespace around ← to be able to see it properly?
 
12:13 AM
and pragmata pro, which I paid for is second best because there is 0 vertical separation
@ngn to scan a page and reorient myself, yeah, I'm not writing 2-3 line golf expressions, I have files full of code and I need to scan constantly
formatting helps
and I mean, there's a whole bleeding field about research around whitespace
and how quickly humans are able to parse informaation
not just text
@Wezl which if you haven't already, read the link I @'d you before
@ngn so I'm far from alone in the idea that whitespace subconsciously aids visual communication
 
ngn
@nathanrogers i'm not disputing that - it does
 
just the same that phrasing in english subtly changes the nuance in meaning
 
ngn
@nathanrogers but do you really need to attract attention to the ← there? is that the most important, semantically dense part of the line?
 
the ← isn't what draws my attention, it is the separation of the name from its meaning that I'm interested in
like a header to a section in a text book
 
ngn
it's just an ordinary assignment, and it's screaming "look at me! look at ME!"
 
12:17 AM
it allows me to "bump into" the section I'm looking for and tell where the body begins
instead of it all just running together
I view almost like a vertical | column delineator in a text table, where the first column is a name and the second column is the body
just the same here
the ← is a column separator
with names on the left values on the right
I don't see the ←
also this was a thing I was toying with, got a stupid small portion of it transpiling to JS, but then I just decided to learn APL instead
structured like what you're doing, but notational like APL/J/K
 
12:40 AM
@ngn it separates the dense part - the impl - and the important part - what the result is. The name is usually the most importnt part when scanning through the code, so it should be clearly separated so the brain hopefully would find it quicker when needed
 
I did a bit of visual group here too
it makes it clear that the simple test cases are grouped on the left, easy to understand, base cases, and as you proceed to the right, more complex, with the most complex at the bottom right
there's a lot of subtext here besides just catenating a list of tuples
and the group can go so far as to lend further clarity as to the amount of brain space each successive column to the right will occupy
s03_1_tests←('' 1)('^v' 2)((400⍴'<>') 2)((100⍴'^') 101)('<>' 2)('<^v<' 4)((400⍴'^v') 2)
s03_1_tests←((200⍴'^>v<') 4)('<^v>' 3)('^>v<' 4)(i03 2565)(('<^'[?500⍴2]) 501)
or I could hav ejust written it that way, which doesn't even make it clear that these are all just tuples
let alone any kind of subtext as to what the tuples are meant to represent
 
ngn
@dzaima the ← already separates name/impl. why do you need to separate name/← and ←/impl?
 
brain eye connection
I'm not a program
 
@ngn is way less noticable than spaces when not already the focus of attention
 
I shouldn't have to mentally perform the task of a compiler/interpreter to extract meaning
 
12:48 AM
@dzaima like, in this chatroom, while reading one message, you can easily "see" that other messages here contain a lot of spaces (and extremely quickly find ones that don't). But you can't tell how many instances of the letter f there are
 
I can mentally parse that list in text I just pasted, and see that inded they're all tuples, with a distinct patter in the first and second columns of each tuple, or I can space it like I did in the image
one clearly conveys meaning
the other is just line noise
and then therer's the meta patterns
 
@dzaima the letter f within a word is a lot less visually distinct than name←value
 
@rak1507 value would usually be a more complex expression, and then would cease to be any special
 
you're thinking at the wrong scale, it isn't a letter in a word, it is the capital letter that begins a sentence, it is a column separator, it is a header at the beginning of a set of paragraphs in a text book
it is something which separates, and thus I use it to separate
 
ngn
@nathanrogers what is a capital letter? :D
 
12:53 AM
let's talk about the meta patterns in this section of test case definitions
there are a bunch of patterns inside the patterns of ← and (input expected) vertical alignment
first is that simpler test cases are on the top left, you can almost tell by the blocks of white text where the "." of the particular grouping is. each "day" of aoc is separated inta paragraph-like chunks
and the names are separated from the data, where it is almost intuitive that the left column is input to be tested and the right column is values to expect
the final test case i is always the last one, i being the input from the website that is used to validate you have the correct solution
the extraneous golf examples are at the bottom to lend further visual separation between the groups
there is much more meaning in the whitespace than you're allowing for
nah it isn't working
 
ngn
@nathanrogers edit the message and press ctrl-k to make it monospace
 
ctrl + k isn't working
still not
 
@nathanrogers there should also be a 'fixed font' button besides 'send' if you have a multiline message
 
      t.test aoc2015
┌─────────┬───┬──────┬──────┬─────┬──────┐
│#.AOC2015│RAN│PASSED│FAILED│ERROR│REPORT│
├─────────┼───┼──────┼──────┼─────┼──────┤
│TOTALS   │54 │54    │0     │0    │PASS  │
└─────────┴───┴──────┴──────┴─────┴──────┘
 
1:01 AM
wow nice
@ngn I'm assuming you take issue with the image
 
@dzaima (still may be ugly because SE default monospace fonts (though i override chat monospace fonts to BQN386))
 
ngn
@nathanrogers "take issue" - not really, but it would be nicer for everyone if you post code as copy-able text
 
if I could eliminate the need for any kind of semantic notation I would, but unfortunately grouping expressions and data is a necessity. I just wish there was a "nice" notation for it, rather than all the brackets and commas and semicolons and colons
 
@ngn the amount of people who'd copy that message would be 0 (or maybe 1 - you)
 
ngn
@dzaima well, not that particular one, but in general
 
1:05 AM
s03_1_tests   ←   (''     1)('^v'   2)((400⍴  '<>') 2)((100⍴     '^') 101)
s03_1_tests  ,←   ('<>'   2)('<^v<' 4)((400⍴  '^v') 2)(('<^'[?500⍴2]) 501)
s03_1_tests  ,←   ('<^v>' 3)('^>v<' 4)((200⍴'^>v<') 4)(i03           2565)
s03_2_tests   ← ,⊂(i03 2639)
see, isn't that nice
 
ngn
yay :)
 
the spacing by the ← is exaggerated because it aligns with a longer name above
 
@ngn being able to copy-paste when needed is indeed good, but in 99.9% of cases, if looking at it is enough, it's enough
 
ngn
@nathanrogers alignment is fine, but why take 5 columns for /,← instead of 2?
 
like I said, 1 space separating ,← on a longer name earlier in the block
so that they all align
they are logically parallel, so they are visually parallel
whereas the dfns all align because THEY are logically parallel with each other but not the test case tuples
 
ngn
1:06 AM
you're a waster of horizontal room :)
 
so they have different alignment
I just disagree that its a waste
I don't need to fit MORE on a single line... I'm accustomed to "bog standard" languages where I can't fit a single indexing operation on a single line
so this is PLENTY of space so far as I'm concerned
I want vertical clarity over horizontal density
 
@ngn and in this case, if that copy-pastable format wouldn't align the multiple rows, it'd be absolutely unreadable that "passed" corresponds to 54, and presenting which values match with which is the whole purpose of the array
 
ngn
@dzaima someone might want to show their favourite way of spacing/indentation/alignment using the same example
 
alignment creates logical grouping as well as vertical fluidity
yes, at the cost of horizontal space, which because of the notational aspect of the language, we're already maximizing
 
ngn
@nathanrogers ok, you don't need to advertise alignment to me, i'm fine with it
i'm only objecting to the spaces that don't serve any purpose other than make up for your choice of fonts, editors, syntax highlighting, etc
 
1:10 AM
if it were another font, I would do the same thing
except I would like the font less
Dyalog's font is one of the nicest fonts for vertical spacing that actually supports unicode characters
I've even messed with the VSCODE multiple font support to use DYALOG unicode with some other alphabet
and nothing else cuts it
 
I go to dinner and this is still the subject?
 
ngn
@nathanrogers apl385? it has a few minor issues, but yeah, it looks nice. and it's not dyalog's font.
 
yubetcha
 
as long as people are still learning something ;)
 
oh, well that one
I'm all about the bike shedding over textual formatting of code
and editors and fonts and color palette and keybindings
and extensions and process, and ... really I just like bikes... and sheds
 
ngn
1:14 AM
@nathanrogers btw, adrian smith wouldn't have bothered to explicitly release it in the public domain (it's on record), if i hadn't lobbied for dyalog to ask him to (i actually wanted an open-source-like license, not necessarily public domain)
 
I don't know my names very well
but I'm grateful you did
because its the nicest font certainly for unicode characters, and definitley in combination with the nice set of glyphs
and man how much time I've wasted over the years on experimenting with fonts
a lot
@Wezl I'm a bit confused over here about your interest in APL if you don't like the notational aspect of the language?
@Wezl chat.stackexchange.com/transcript/message/57241970#57241970 this chat message should put a fine enough point on my position with regard to notation
 
@nathanrogers I don't know why I'm still interested in the language! I do think it's useful for some things, though I've never tried using it for anything besides like art or code golf
I guess I agree with ngn a lot, that it's not fit for most things
 
@Wezl how about an APL to Excel xml compiler in less than 1k LOC?
in ptyhon that would have taken me somewhere to the order of 75-100k LOC?
which do you think is easier to grok?
and thats not just a csv writer
that's full excel support
 
¯\_ (ツ)_/¯
 
with all the fancy cellular formatting you want
average file size is less than 10 LOC
with 2 or 3 files in the neighborhood of 100 lines?
 
1:26 AM
I think it's best as a DSL. April is probably the right idea
 
ngn
@nathanrogers "apl to excel" is "most things"? :)
 
with all the side-effects and mutation in a singular place
@ngn I would that the project convinced me that it is useful for "most things"
it just isn't useful for "some things'
and a tiny bit of labor would make the language superfluous for me to use professionally
but that's closed off on the interpreter side where we don't get access, so unfortunately we're at the whim of the interpreter team
just because you don't like ¨ doesn't mean it can't get a whole lot done
and f¨a is still much nicer than x = [f(x) for x in a]
 
ngn
@nathanrogers yeah, sad story
 
I'm convinced that APL is useful for all things, but that we don't have an implementation with all the core features one might expect from a language in a form that programmers and people who write things other than scientific and financial applications would expect them to be in
 
ngn
@nathanrogers there's no point picking on slow and verbose languages like python
 
1:30 AM
except that its my day job
and it's the software industries "nice" language
like , this is as "nice" as most programmers ever get
maybe julia, or if they're really frisky, scheme
but people who have ever bothered to learn scheme or CL past the point of novelty is a fringe minority of the total software industry
most have only ever learned in the context of OO
and then there's the entire world of "engineers who write scripts" who barely know a thing about how programs work and basically just copy past their programs over and over with different static text... they're completely language illiterate but learn a minimal subset of python to get their work done
a LOT of the worlds engineers and scientists are this way, not using mathematica, scheme, lisp, or APL, they're just bolting together whatever hacking disgusting lines of completely non-pythonic mess that they can to just get any kind of output
slapdash is a word that comes to mind
not everyone is at the spearhead of language design research, or getting their doctorate in comp sci to do scientific research. most are just learning python from a youtube video, and making it work
all that said, I don't really have a problem with APL other than the fact that I can't write simple scripts when I need them, and interacting with the environment or filesystem or other programs is completely unpleasant, but doable... I just need professional help every time I try to do something I would consider "normal" as part of my day job
I would have no problem choosing to use APL for an application... I would write wrapper functions for all my filesystem and external interaction and be done with it
 
2:35 AM
@nathanrogers my apl font has consistent spacing, though whether it's nice or even readable is debatable
 
@nathanrogers just use a semi mono font
 
the one benefit my font has is that you can yell at me and I'll add whatever glyph you want
 
3:20 AM
@Wezl please add this glyph to your font
3 points to glyphindore
 
 
1 hour later…
4:33 AM
@Adám what is the difference between ⍤0 1 and ⍤0⍤1 ?
 
ngn
5:13 AM
@Bubbler still thinking about "tally" and how to define it so 1≡≢scalar is obvious: {⊃⍴⍪⍵}. this definition delegates the question to "table" - why should ⍪scalar return a 1x1 matrix? that could be justified by the fact that always preserves the total number of elements. does it sound any more convincing when put like this?
 
5:45 AM
@Adám could you direct RPark to take a look at the comments for his video? youtube.com/watch?v=jXz_g26gKJI
also, does RPark come here?
@ngn @dzaima I'd love your spin on golfing this array solution to "snail sorting" or "spiral sorting", ordering a 2d matrix by the outermost layer, spiraling inwards, or the inverse if you're feeling frisky (just reverse the indices :P)
      {(,⍵)[+\, a/ (⍴a←1↓ ⌽ 2/ ⍳n)⍴ (+,-)1,n←⊃⍴⍵]}3 3⍴⍳9
1 2 3 6 9 8 7 4 5
here's the bracket indexed version
      {(,⍵)⌷⍨⊂+\,(1↓2/⌽⍳⊃⍴⍵)/((¯1++/)⍴((+,-)1,⊃))⍴⍵}5 5⍴⍳25
1 2 3 4 5 10 15 20 25 24 23 22 21 16 11 6 7 8 9 14 19 18 17 12 13
and the squad version without temporary variables
or without the hideous train (¯1++/⍴⍵)⍴(+,-)1,⊃⍴⍵
 
ngn
@nathanrogers much simpler with recursion: {×≢⍵:(⊣⌿⍵),∇⍉⌽1↓⍵⋄⍬}
 
but this is loop free
array-oriented even
its an index map, and can be reversed trivially
snailsort←{0<+/⍴⍵:⍵[1;],∇⊖⍉⍵[1↓⍳1↑⍴⍵;]⋄⍬}
my first attempt was recursive
hadn't learned about ≢ when I wrote that haha
 
ngn
6:06 AM
@nathanrogers but in golfing we aim for shorter code, unless you specify another objective criterion
 
sorry, I should have specified an array oriented, loop and recursion free solution
 
ngn
ok, i'll try, though "array oriented" can be hard to judge sometimes
@nathanrogers btw, why just moi and dzaima? this could be a challenge for everybody
 
can I @ everyone?
 
ngn
@nathanrogers no, but there a convention of writing "cmc:" (meaning "chat mini challenge") if you want to pose the challenge to everyone
@nathanrogers if you search for cmc you can find many examples
@nathanrogers can we assume the matrix is square?
 
yes
my solution only works for square matrices
 
ngn
6:36 AM
@nathanrogers here's one attempt using complex numbers: {(,⍵)[⍒⍉⍪⍉(⌈/∘|,12○0j1⊥+/,-/)⍤1↑(⊖-⌽)⌽⊖⍳⍴⍵]}
turned out longer than i expected
is ⍤1 a "loop"?
 
@ngn while I have you here, can you link me to k6 docs?
 
6:59 AM
@Adám is there a way that, given a tuple of values I can pass them dyadically to a function?
 
ngn
7:10 AM
@nathanrogers another one with complex numbers: ⎕io←0 ⋄ {⍵[11 9∘○¨+\0,×\1↓∊1↓⌽2/,\0j1*1↑⍨≢⍵]}
@nathanrogers just @ adam?
⊃f/⍺⍵ is like ⍺f⍵
 
 
4 hours later…
10:50 AM
@nathanrogers Temporary variables are just the one-liner's DRY, I don't really take issue with the solution you've got there. However, I had a play with generalising to non-square using basically the same technique you've got there (if posed the problem, I'm with @ngn that the looping encoding is simpler to understand)
Here y'arrr:
⋄ {(,⍵)⌷⍨⊂+(l⍴(+,-)1,⊃⌽s)/⍨(-0,2/⍳¯1+r)+(l←¯1+2×r←⊃s)⍴⌽s←⍴⍵}5 7⍴⎕A
@nathanrogers FYI I'm not generally interested in Golf - but I might reply via YT about my thought process
{(,⍵)⌷⍨⊂+\(l⍴(+,-)1,⊃⌽s)/⍨(-0,2/⍳¯1+r)+(l←¯1+2×r←⊃s)⍴⌽s←⍴⍵}5 7⍴⎕A
sorry was losing a backslash
 
 
1 hour later…
12:13 PM
@ngn I’ve pondered, too, if rank constitutes a loop.
 
@xpqz Conceptually it is a loop (see my webinar on selecting from arrays) but some implementations of some functions applied with rank can be parallelised
Live now on twitch: twitch.tv/rikedyp
 
1:13 PM
@nathanrogers to get rid of the temporary variable, there's (1↓…) (⊣⌿⍴⍛⍴) (+,-)… in dzaima/APL ( being replicate, and being {(⍺⍺ ⍺) ⍵⍵ ⍵})
 
 
2 hours later…
3:21 PM
@RikedyP you're doing God's work. I wish you were doing this content when I was getting into it, but now that you are I have something to watch :)
You should collaborate with code report
If you want more views I would troll his comments on his newer apl videos and mention your videos. People seem really hungry for apl content
 
3:38 PM
@nathanrogers I'm in contact with @code_report - maybe some day we'll do something. It is very nice that he agreed to talk at the APL Seeds event: dyalog.com/apl-seeds-user-meetings/aplseeds21.htm
@nathanrogers I talk through a slight generalisation here youtube.com/watch?v=Isf1b-zblzU although afterwards I realised it doesn't work for matrices with ≤ 2 columns
 
ngn
@RikedyP @xpqz the same can be said about +
 
:D -- well, anything that scalar-extends, right?
 
ngn
anything that has to iterate through a collection of elements (maybe. depends on your definition of "loop")
 
@ngn I'd say it is, otherwise {,⍺⍺⍤1⍪⍵}, equivalent to ¨ for vectors, wouldn't "loop"
 
@ngn @xpqz about the loop question, for me it really depends on how its used. You can absolutely write code that turns ⍤ into not only a conceptual loop, but an inefficient, APL anti-pattern. That really depends more on the structure of the data than the use of ⍤ IMO
 
3:53 PM
I found that for example ×⍤0 1 is rather less efficient than ∘.×
 
it really depends on the data
size, rank, nested?, etc
@RikedyP also, map in python is idiomatically [f(x) for x in array], or filter [f(x) for x in array if condition], or to provide a default value [f(x) or default for x in array], or combine them with [f(x) or default for x in array if condition]
 
prod ← ∘.×
rank ← ×⍤0 1
X←⍳1000
]runtime -c "X prod X" "X rank X"
┌→───────────────────────────────────────────────────────────────────┐
↓                                                                    │
│  X prod X → 5.1E¯4 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕           │
│  X rank X → 6.8E¯4 | +33% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕ │
└────────────────────────────────────────────────────────────────────┘
 
I wouldn't say that usage of or is idiomatic I feel like most pythoners wouldn't get that instantly
 
Although the difference has halved between 18.0 and 18.1, it seems.
 
i mean, its just nice shorthand for [f(x) if condition else default for x in array]
especially if condition depends on the result of f(x)
and conceptually it may not be pythonic, but linguistically it is. THIS or THAT for each item in the list
 
4:32 PM
Good morning @MortenKromberg
 
5:29 PM
@nathanrogers what was the reasoning behind using the multi-line function and breaking those parts out into variables? From what I've seen in my short time in the community(I'm not great at APL and I don't use it enough), I would have thought it would be considered un-paradigmatic to break out those simple expressions (the row and column) into separate variables rather than just declaring them inline.
 
@lambda It's non-idiomatic for the golfing community, but for people who actually write APL in production, they will tell you NEVER to declare names inline
 
You'd have to ask him that, my guess is either it's what he prefers (evidence: his j porting), or that he's trying to cater to a non APL audience
@nathanrogers the names don't need to be declared as they are used once
 
n is used twice, and a is used twice
watchu talkin bout
 
also afaik his code doesn't actually work in general, because c|stuff also applies modulo to the first thing
@nathanrogers are we looking at the same video?
 
{(,⍵)[+\, a/ (⍴a←1↓ ⌽ 2/ ⍳n)⍴ (+,-)1,n←⊃⍴⍵]}3 3⍴⍳9
1 2 3 6 9 8 7 4 5
 
5:36 PM
oh, lambda was referring to the code_report APL advent of code video
 
Ah, I see
@lambda apologies. Lost context there for a bit
 
not sure if they knew that you aren't the person who made the video
 
ngn
@nathanrogers ooh, the "algorithms" guy strikes again :)
 
@ngn have you seen the title of his talk for APL seeds?
 
ngn
@rak1507 no
 
5:38 PM
But yes, actually giving names to smaller chunks of expressions is "proper" APL. one liners with inline names like even the one I just pasted from earlier is strictly a golfing idea, and in production is used quite sparingly
 
'Algorithms as a Tool of Thought'
 
@ngn wat you mean?
 
ngn
@rak1507 rofl! :D :D
 
did I miss something?
 
@nathanrogers to most people apart from c++ programmers algorithms are implementation details
 
5:39 PM
I'm not following... seems like some kind of in-joke
 
Jan 12 at 17:44, by code_report
@ngn on a different topic, you mentioned the primitives vs algorithms earlier
read from here
 
ngn
@nathanrogers he was here a couple of times and when we pointed out to him that a primitive is not the same as an algorithm, he kept arguing and even seemed offended when he left
his argument was that there's a c++ lib called "algorithms" which serves a similar purpose to apl primitives
 
@lambda there are various "styles" of APL. you can write pythonic APL no problem, use :FOR :REPEAT :SWITCH :IF etc etc. In fact, GNU APL doesn't even have support for proper DFNS so most of this slick golfing stuff isn't even supported. Most older APLers still write in this Procedural (aka pythonish) style of APL.
@lambda ...(contd) Very few people write in a purely functional fashion like John Scholes or Paul Mansoor, and then you have people like Aaron Hsu who writes in an almost strictly trains fashion in his CO-DFNS compiler
 
saying that aaron hsu writes in an almost strictly trains fashion is nonsense
 
In APL "Writing for shortness" is not the same as "Writing for clarity of meaning"
 
5:43 PM
I←{(⊂⍵)⌷⍺}
 
@rak1507 I said almost
almost strictly isn't strictly
 
@nathanrogers That was true of an older version of Co-dfns, but now it's pretty much all imperative plus dfns.
 
ok edited
 
but I've worked with him on projects, he leans on trains a lot
@Marshall last time I read through it was over a year ago, so probably has changed a lot
He does what, 50 rewrites every 30 seconds?
 
@nathanrogers clarity of meaning is more obvious when there isn't a bunch of bloat
isn't this the entire reason to have a notation
 
5:45 PM
right, but there's a difference between "terseness" and "brevity"
@rak1507 you have to admit there are certain encodings of things that do not elucidate the purpose
 
in what?
 
what do you mean in what
 
in what context
 
ngn
"clarity of meaning" says more about the experience and habits of the reader than anything about the code
 
there's an encoding that does something with signs, there's some kind of train that does unique denominators that isn't anything to do with numbers or fractions
I can't name them
but there's all sorts of patterns that would jar a reader who hasn't seen the tricks
and there's ways to write such that any APLer would understand the purpose
I can't believe I have to articulate it
 
5:47 PM
@nathanrogers I think the style has been pretty stable since he published his thesis. Work is mostly on the runtime now, which is in C/ArrayFire.
 
its obvious
like ×≢⍵ is not as clear to a non-golfer as 0<≢⍵
its cool, it saves a character
but the alternative isn't "bloat"
 
interesting that you are saying to not use things that aren't immediately obvious to someone when you suggested f(x) or default as idiomatic python earlier
 
yes, THIS or THAT is plain english
 
what is obvious and what isn't depends on the reader
 
wrong
 
ngn
5:48 PM
@rak1507 right
 
I think ×≢⍵ is extremely obvious and I've never seen it in code golf
 
the example I gave should be clear enough to anyone who reads APL
 
'the sign of the length' -> obviously non zero for non zero lengths
 
0≠2| is more clear than ~2| , and also depends on ⎕IO so isn't universal
 
Maybe a better term than "brevity" is "directness"? I definitely understand the concept: some pieces of code happen to solve the problem in question, and some seem to actually describe how it is solved.
 
ngn
5:49 PM
12 hours ago, by ngn
@nathanrogers much simpler with recursion: {×≢⍵:(⊣⌿⍵),∇⍉⌽1↓⍵⋄⍬}
 
lol
 
@rak1507 my impression is that you learned APL through golfing
 
your impression is wrong, I learned golfing through APL
 
like the community of golfers is not even a fraction of the active APL users
and the styles of APL that are used in production and the sensibilities of people who have to read and write it prefer direct expressions that are parallel to the domain in question
 
I 'learned APL' (extremely poorly) when I discovered the problem solving competition last year
 
5:51 PM
if you can reveal something about the domain of the arguments in question through the expression, then do it
 
and through the APL orchard I became more interested in code golf
 
golf strives for tersity, code in production strives for clarity of meaning and intent
those are 2 separate goals that have to separate valid domains of expression'
 
is that why most of the code that I've seen written by you is extremely unclear when compared to golfier alternatives?
 
"unclear" isn't the right word. "not as short as possible" is the right word
 
{{(2=/⍵)/1↓⍵} {⍵[⍋⍵]} +/¨ 3*⍨ {(0>-/¨⍵)/⍵} , ⍳ ⍵ ⍵} 33 is objectively worse than {⍵[⍋⍵]}∪{(~≠⍵)/⍵}⍣2,∘.+⍨3*⍨⍳33
 
5:55 PM
it appears I have sparked a somewhat pointed discussion.
 
lol yep, every few hours this discussion happens, it's the groundhog day of the APL orchard
 
you can't get much more clear than
 s4←{
     rows←⊃⍴⍵
     borders←1↓⌽2/⍳rows
     (,⍵)[+\,borders/(⍴borders)⍴1 rows, - 1 rows]
 }
 
@lambda I object to your mixed metaphors.
 
@nathanrogers yes you can
 
@rak1507 you're comparing my attempts at golfing... which is ridiculous. as I said it strives for a completely different objective
@rak1507 I can get shorter, sure
 
ngn
5:56 PM
@lambda i think the discussion was looking for a spark and it found it in your message :)
 
huh? your code on the left was an attempt at golfing?
 
s4←{(,⍵)[+\, b/ (⍴b←1↓ ⌽ 2/ ⍳r)⍴ (+,-)1,r←⊃⍴⍵]}
@rak1507 sorry I didn't look at yours on the right. That would baffle a large portion of regular APLers
First that they would do is rewrite it as a multiline DFN
 
that wasn't my code, it was bubblers
 
whoever
 
what's the point in using APL if you're going to write code that's as verbose as java, just use java in the first place and then you don't have to deal with the annoyances of APL
 
ngn
5:58 PM
@nathanrogers speak for yourself
 
@lambda you don't get a clear picture of what "normal" APL looks like either from this chat or from what you'll find in the golfing sections of Stack Overflow.
@ngn I mean, you too
 
yeah real APL looks like:
 
you make some pretty blanket claims about what is or isn't good based on your taste for golfing aesthetics
 
:Field Public AcceptFrom←⍬ ⍝ IP addresses to accept requests from - empty means accept from any IP address
:Field Public AllowFormData←0 ⍝ do we allow POST form data in JSON paradigm?
:Field Public AppInitFn←'' ⍝ name of the application "bootstrap" function
:Field Public AuthenticateFn←'' ⍝ function name to perform authentication,if empty, no authentication is necessary
:Field Public BlockSize←10000 ⍝ Conga block size
much better right
 
not necessarily
OOP APL might look like that
 

« first day (1501 days earlier)      last day (1163 days later) »