« first day (566 days earlier)      last day (2072 days later) » 

1:09 AM
@Zacharý dfns are just dfns, that syntax shouldn't interfere. Except if the dfn is preceded by , a {…} at a lines end will never be utilized in any way ever, so I'm using that for more syntax
and does RAD even have (or is planned to have) while/for/if statements?
 
@dzaima Yes&No: they will probably be operators.
 
@Zacharý and you'll need to give them dfns as arguments?
 
Yeah. The grammar of RAD is pretty set in stone (i.e. I don't want to break anything else)
 
@Zacharý will you do anything about / being overwritten/inaccessible in the inner dfns?
 
@dzaima As a weird consequence of how dfns work, if an inner dfn is called monadically, then it has access to the outside function's .
 
1:21 AM
@Zacharý I'm guessing that niladic dfns don't exist?
 
Yes/No, f&⍬ is a thing, but that's more boxing the function into a nilad.
The main change is that RAD is rankless. Everything is depth.
Oh yeah, and the workspace isn't a thing.
 
@Zacharý so is still inaccessible? I'd rather have special syntax than losing access to the arguments to a function
 
W←⍵ :p
 
@Zacharý that's just ugly
 
@dzaima I might overload omega underbar to do some weird shenanigans (omega underbar is a function though)
RAD's probably more accurately named Rankless APL Dialelct with how close it is to normal APL.
 
 
5 hours later…
6:21 AM
@Zacharý IIRC, GNU APL has ⍺⍺ and ⍵⍵ refer to the caller's and . ⍺⍺⍺ and ⍵⍵⍵ to the caller's caller, etc.
@dzaima So no trains? {⍵*2}{+/⍵} is a valid function.
 
@Adám if alone on a line, the +/⍵ would never be called/used in any way though
and I think it's reasonable to have lone functions/ops in a line be syntax errors
also, I'm probably gonna have an op for if-else which would return the result of the path, or just for those who don't like special syntax
 
@dzaima What's the result of the path?
 
@Adám e.g. {2}ifElse{3} ⊢ 1 returns 2
 
@dzaima ifElse←{⍺←⊢ ⋄ ⍵:⍺ ⍺⍺ ⍵ ⋄ ⍺ ⍵⍵ ⍵}?
 
@Adám yeah, something like that.
 
6:34 AM
@dzaima Then I can see how those operands need access to their caller's arguments. Wouldn't ifElse←{⍺⍺:⍺ ⋄ ⍵} make more sense, so you can write 2 (1 ifElse) 3?
 
@Adám that'd evaluate both possibilities when only one is needed
replace 2 with calculating the 1E50th prime and getting the 3 will take a while.
 
@dzaima Ah, I see what you mean. And guards are unpleasant because it is awkward to merge back the two paths. How about a way to make non-terminating guards?
{
 v←1+⍵
 5>v:v+←1
    :2|v:v+←1
 ,⍨v
}
@dzaima ^ A leading : means under the same condition as above.
And of course you need the (already proposed) multiple guards being "AndIf"
 
@Adám non-terminating guards were another thing I was thinking about, but 3 syntaxes is a bit much
 
@dzaima Yeah, and there's no obvious way to make the "else" clause. Maybe:
{
 v←1+⍵
 5>v:v+←1
    :2|v:v+←1
   ~:v+←10
 ,⍨v
}
 
@Adám so that'd be a 2 item array of 1+⍵ if ≤5, otherwise 2+⍵ if even, else 3+⍵?
 
6:45 AM
@dzaima No:
v←1+⍵
:if 5>⍵
    v+←1
    :If 2|v
        v+←1
    :EndIf
:EndIf
,⍨v
And the last example would be:
v←1+⍵
:if 5>⍵
    v+←1
    :If 2|v
        v+←1
    :EndIf
:Else    ⍝ literally :OrIf ~5>⍵
    v+←10
:EndIf
,⍨v
 
@Adám in that it's unclear (other than indentation) whether the ~: is for the 1st or 2nd guard
 
@dzaima Good point, and using :~: will make your face look like that, and cause Pythonesque issues with moving code around.
 
@Adám stacking the colons will have code moving problems too
 
@dzaima Yup. While I really dislike block indicators (not sure why), it may be the neatest solution if you don't want :Ends.
 
@Adám the inability to wrap an if around a piece of code pretty much rules the idea out for me
how about making guards non-terminating and making anything able to be terminating by adding a trailing ;?
 
7:00 AM
@dzaima As long as you stay functional, having absence of assignment indicate termination is adequate, imho. But how would you guard multiple expressions under one condition?
 
@Adám dfns aren't going to be forced functional
 
@dzaima They already aren't. If "monadic" was "assign to nothing" (i.e. sink) it would be neater, though.
 
if I do make classes a thing I want to be able to do obj.add 3 without it terminating the dfn if that returns something
 
@dzaima And ←obj.Add 3 is not good enough?
 
@Adám that is a waste of precious typing time. It's completely pointless as without it the next line would literally never be called, so either it should error, or go forward
 
7:08 AM
@dzaima Oh right, I forgot that dfns should just keep going if there are more code lines. But with non-terminating guards, you do need a way to say :Return. Still, you didn't answer how to do multiple things under a single condition.
 
@Adám :Return ≡ trailing ;. For the multiple lines I could just wrap the lines in {} after the colon
so that's 4 different uses for {} already? :D
 
@dzaima Ah, the multi-line is almost like the current technique of guard:⍺{code ⋄ code}⍵. Trailing ; just seems un-APL-like somehow. Maybe a leading instead? And if you really want trailing, maybe ?
@dzaima Do you have implicit output?
 
@Adám hm, a leading sounds nice
@Adám as in each line outputs if it isn't shy? no, that's an annoying feature imo
 
7:24 AM
@dzaima Good (I agree) so then you don't need a shying feature, and leading is available to terminate, as if result← but dfns' results are never named.
 
if the only use for shyness is whether or not a REPL should output a thing, it'd probably be worth it removing it and just making …← not implicitly output in the REPL
 
@dzaima I agree. Some edge cases maybe, e.g. should obj.Add 3 output in the REPL? and if so, what?
 
@Adám making class functions have to worry about shyness feels pointless. not printing the result only for setting globals feels understandable because they're always readable afterwards whereas functions could have important output inaccessible after discarding the result (e.g. arrObj.pop)
 
ngn
8:25 AM
@dzaima exactly what I think too
in The Nineteenth Byte, Jul 3 at 18:13, by ngn
@Zacharý why do you even need this "shy" stuff...
in The Nineteenth Byte, Jul 3 at 18:14, by ngn
@Zacharý there's a simpler way: if the leftmost part of the last expression is an assignment - don't print, otherwise - print
 
9:20 AM
@ngn I'd rather that nothing in functions print unless explicit. But in REPL, everything prints except assignments. It is really annoying to have to hunt down the statement which generates rogue output.
 
ngn
@Adám oh yeah, definitely not in functions, I meant that only for the repl
or top-level expressions in a file that are not in any function
 
@ngn Oh, then then we all agree on how it should have been.
@ngn No, not even that.
 
ngn
we have very little left to argue about :)
 
@ngn That would mean that #! scripts implicitly print? You'd have to silence all side-effect expressions.
 
ngn
@Adám given that ngn/apl behaves as you describe, but ngn/k does not, I'm not sure which side I'm on :)
 
9:27 AM
@ngn I wouldn't want to have to silence ⎕NPUT and GUI code, etc.
 
ngn
in k there's a special value that you can return (::) to indicate you don't want to print
@Adám would ⎕NPUT or the GUI code you're talking about ever return a value that would be useful to the caller?
 
@ngn my example would be a pop function. Sometimes you want to just remove a value off the top of a stack, sometimes you actually care what the result is.
another example would be a success boolean. If you know that a thing is gonna succeed you don't care that it gives 1, but if you don't, the result can be useful
 
@ngn Yes.
@ngn ⍬⊤⍬
 
ngn
@dzaima if you have ::, this one's easy - return :: on success and a useful value otherwise
 
9:44 AM
@ngn Hm, ⍬⊤⍬ should have a symbol, like .
 
ngn
@Adám ah, i thought that was an apl emoji :)
@Adám so, 0 0⍴0?
 
@ngn Yes.
 
ngn
@Adám that's a valid array, you need something separate as ::
 
@ngn Isn't :: a valid array?
 
@ngn it doesn't print anything though
 
ngn
9:48 AM
for pop(), ⎕NPUT, and the GUI, I think one just have to make up one's mind... can't have it both ways
@Adám it's actually a function (those are first-class values in k)
 
@ngn yes you can
 
ngn
the identity function
@dzaima well yes... with shyness?
 
@ngn well if I'd call arr.pop in a REPL I think it'd still be useful to have the result get printed
 
ngn
@dzaima so you're with Adam then - if it's a repl do one thing, if it's a file - another
 
@ngn it makes sense to me that there'd be a distinction - a REPL is for a human to use. A file is for a computer.
 
ngn
9:54 AM
@dzaima sometimes I like to pipe code into my interpreter - it's indistinguishable from a repl
so I wouldn't want to have it behave differently for $ interpreter code.file and $ interpreter <code.file or $ echo "code" | interpreter
 
@ngn usually REPLs print some "hello"/"help() for help" thing or a > before each input line though
 
ngn
@dzaima mine doesn't :)
not even a stupid copyright notice, not even a one-space prompt
I have a separate repl.k wrapper script that prints a one-space prompt; if rlwrap weren't so buggy I wouldn't even have that
rlwrap has an -S option to give you a prompt, but when your interpreter doesn't respond within a certain timeout, it assumes it should print a prompt already, and when the result arrives it gets printed after the prompt...
 
 
10 hours later…
7:38 PM
If you have a Linux machine you probably already have the APL keyboard layout installed
If not there are several options I'm sure Adám is about to list out
 
@Skidsdev How are you with mathematics?
 
Depends what area. I'm alright with basic algebra, trig and vector maths
cos y'know, those ones are the important ones in 2d game dev :P
 
@Adám There's also things like the language bar
 
@Skidsdev OK. It is much easier to learn APL if you forget what the three letters stand for. Instead. Look at APL as a competitor to traditional mathematical notation. (I'll explain why it is better momentarily.) The fact that APL happens to also be machine executable is just a bonus.
 
7:43 PM
@Adám hmm, interesting
 
@Skidsdev So, traditional mathematical notation grew over centuries without overall planning, and accreted all kinds of notations with no discernible system. It is even ambiguous (want examples?) and so not directly machine executable. Not to mention that typesetting math is a nightmare.
 
LaTeX is good
Ok, "acceptable". "good" is maybe the wrong word
 
@Pavel the problem is that you need latex at all
 
@Skidsdev Ken Iverson (a mathematician and the inventor of APL) realised some patterns where math could be generalised and harmonised, which makes Iverson's notation much more streamlined and powerful. Oh, and it fits neatly on a single line — and is machine executable.
 
@Adám hmm okay, so the language quite literally started as mathematical notation? Isn't that the premise for Mathematica too?
 
7:48 PM
No, Mathematica was always a programming tool
 
@Skidsdev Yes. The idea to make it into a programming language only came later. No, Mathematica tries to formalise existing maths so it can be machine executed.
 
Oh fair enough
 
I don't think APL and Mathematica are really all that comparable.
 
E.g. Iverson realised that ∑ and ∏ really are two instances of a general concept, namely reducing with a two-argument function, for instance + or ×.
So he (based on work by Oliver Heaviside) established two categories. Functions which take data and return data, and operators which take operands (they may be functions or data) and return (or "derive") functions.
Thus, the concept of reduction got its own symbol, / and sum in APL is +/ while product is ×/. (Yes, as a proper mathematical notation, APL uses × and ÷.)
 
The mathematical terms are Function and Functor I believe
 
7:54 PM
@Pavel Not function and higher-order function?
Ah, Wikipedia brings functor as an alternate name for that.
 
In practice, Functor is a term used almost exclusively by Haskell elitists
 
Anyway, APLers call them functions and operators or, if they are linguisticly minded, verbs and adverbs/conjunctions.
Similarly, he recognised that dot, inner, cross, and matrix product really are the same operation, just applied to varying types of arguments (we'll get back to what those types are), but that is is not a single operation, but rather a composition of two two-argument functions; summation and multiplication. Thus he generalised the concept of dot-application with the symbol . and dot/inner/cross/matrix product are all +.× in APL.
Therefore, in APL, if you just use a plain × between two vectors, it means element-by-element multiplication, just as if you used +. No need to remember any special cases there.
@Skidsdev Understand the basic philosophy behind APL's functions/operators now?
 
@Adám I think I get the concept yeah, I'm with you so far
 
@Skidsdev OK, let's look at the other fundamental part of APL: Arrays.
All data in APL resides in arrays. An array is a rectangular collection of numbers, characters and arrays, arranged along zero or more axes.
@Skidsdev Take a moment to let ^ sink in!
 
I feel like that needs more explanation before it can sink in properly
How is, e.g. the value 5, an array
 
8:07 PM
@Pavel Forget JSON arrays etc.
Just accept the fact that every data collection is called an array.
 
5 still isn't "a rectangular collection"
 
Now each individual element of an array has a set of coordinates.
@Pavel Wait for it…
 
Sorry if I'm a little slow to reply, dealing with some other stuff right now
 
@Skidsdev No problem at all.
 
note that rectangular doesn't imply 2D, just that the dimensions of the object can completely define the shape
 
8:09 PM
A set of coordinates is simply a list of positions along each of the axes of the array, in the canonical order of axes.
In a 3D array, we need exactly 3 coordinates, e.g. (3,1,4) to address an element.
In 2D array (a matrix/table), we need exactly 2 coordinates.
In a 1D array (a vector/list), we need exactly 1 coordinate.
In a 0D array (a scalar), we need exactly 0 coordinates.
So the number 5 is just a 0-dimensional array where the sole element has the coordinates [] (in JSON).
 
woah
 
Indeed, if you use the index or the pick function on a scalar, and use the empty list as indexer, you will get that sole element.
Of course, any element of an array may itself be an N-dimensional array.
Btw, APL doesn't have strings. We just use character vectors. In every regard, characters and numbers are equivalent as data. (Well, you can't do arithmetic on characters, but other than that.)
@Skidsdev Understand the basic philosophy behind APL arrays now?
 
Yeah that seems straightforward enough
I assume when referencing a scalar the 0 indices are implicit?
 
@Skidsdev I'm not sure what exactly you mean? You can always reference any array without indexing it, but of course, indexing into a scalar is a no-op.
 
Sorry I mean referencing the sole element within the scalar
Do you need to explicitly reference the contents of the scalar, or is it implicit?
 
8:21 PM
@Skidsdev the []th item in 3 is exactly equal to 3
 
@Skidsdev A simple scalar is the whole of the array.
 
Ah okay, I understand
 
@Skidsdev A little bit about values: Just like in mathematics, a number is a number is a number. You don't have to worry about type conversions or floating point inaccuracies. APL will handle those for you. Same thing goes for characters. A character is a character, no matter how many bits are needed to represent it. And those are the only two basic data types in APL. (There are a couple of other ones, but they are not for now. They still behave according to the same principles, though.)
Booleans are just the numbers 0 and 1.
 
what's the capacity of APL numbers? Or is it like python's arbitrary integer thing?
Also I'm guessing that, like in C, a string is an array of characters?
oh you already said that
 
@Skidsdev APL implementations differ. Dyalog APL includes 128 bit decimal floats, which should give you enough precision and range for most purposes.
 
8:28 PM
ooh 128bit, fancy
 
By default it's double precision floats
 
@H.PWiz Yeah, you have to manually activate 128 bit decimal floats, as it does have performance impact. Also, complex floats are limited to 2×64 bits of precision.
@Skidsdev But again, don't worry about the innards!
 
right
 
@Skidsdev OK, APL uses for assignment so that = always can be equality, and all comparison functions are just normal arithmetic functions returning 0s or 1s.
The box (i.e. the computer/console) is appropriately designated with a box symbol and assignment to that writes to stdout:
⎕←2+3
 
@Adám
5
 
8:33 PM
= checks for equality of scalars. So in the same way that (1 2) + (3 4) is (4 6), (1 2) = (1 3) is (1 0)
 
@Skidsdev Yeah, ^ and APL's list format is just juxtaposition, so the JSON list [1,2,3] is just 1 2 3 in APL. No unnecessary syntax there!
⎕← 1 2 = 3 4
 
@Adám
0 0
 
⎕←3 2=3 4
 
@Adám
1 0
 
Ah okay
 
8:36 PM
⎕←1 2 ≡ 1 2
 
@Pavel
1
 
I remember talking about the ⎕← construct before, because I asked if it was APL's "print" operator, and you explained it to me
 
≡ checks arbitrary constructs for equality
 
@Skidsdev If you don't already have an APL input method, you should definitely go here so you can make your own experiments with the chat bot.
 
oh that's really neat
⎕←4=4
 
8:41 PM
@Skidsdev
1
 
@Skidsdev Thanks. We have almost all basic building blocks of APL down. How are you holding up? Do you want a quick intro to user defined functions?
 
I think you skipped a step explaining how monadic/dyadic functions work
 
@Adám Might be a good time to put it on hold for the night, I need to go sort out what im gunna do with my life now that I dont have a job :P
 
@Skidsdev Of course. Just ping me if you want more, or maybe I'll ask you when I see you around.
 
I think I have a pretty good understanding of the concepts laid out so far, seems surprisingly straightforward actually
 
8:44 PM
@Pavel Yeah, I should have included that when I was addressing rationalisation of traditional mathematics. Oh well, we'll get to it.
 
Sounds good! Ill probably be around quite a bit more from now on.
 
@Skidsdev Looking forward!
 
@Skidsdev It pretty much is really simple, the hardest part is learning all the keys IMO
(Also trains, but you don't need to worry about that yet)
 
@Pavel Have you seen my mnemonic keyboard map?
 
@Adám I use it all the time
I just accidentally typed a and am wondering what it does
 
8:46 PM
@Pavel Nothing (at least in Dyalog)
 
Well then why's it in my standard APL layout
 
@Pavel In Dyalog APL, nothing. As far as I know, NARS is the only one to use it; Convolution Operator.
 
It's just in the APL section of Unicode...
 
Does Dyalog have it's own convolution operator?
(Also what's convolution)
 
Wait ... convolution like sum of two dice?
 
8:48 PM
@Pavel Dyalog has "Stencil" which is basically a generalised GoL operator.
 
Nice
 
@Pavel NARS docs.
 
I can't tell if this is a useful operation or not
It feels like it isn't, but I'm sure someone can come up with something
 
@Pavel Which one of them or ?
 
Both come to think of it
 
8:50 PM
Probably the former...
 
In mathematics (and, in particular, functional analysis) convolution is a mathematical operation on two functions (f and g) to produce a third function that expresses how the shape of one is modified by the other. The term convolution refers to both the result function and to the process of computing it. Convolution is similar to cross-correlation. For discrete, real-valued functions, they differ only in a time reversal in one of the functions. For continuous functions, the cross-correlation operator is the adjoint of the convolution operator. It has applications that include probability,...
 
A lot of 2D things can be done with
 
Stencil codes are a class of iterative kernels which update array elements according to some fixed pattern, called a stencil. They are most commonly found in the codes of computer simulations, e.g. for computational fluid dynamics in the context of scientific and engineering applications. Other notable examples include solving partial differential equations, the Jacobi kernel, the Gauss–Seidel method, image processing and cellular automata. The regular structure of the arrays sets stencil codes apart from other modeling methods such as the Finite element method. Most finite difference codes...
 
I know about convolution thanks to music
 
@Zacharý You mean nD, right?
 
8:52 PM
@Adám I would think mostly used for 2D, but n-D, yes.
 
@Zacharý It can be useful for 1D too.
 
@Adám {⍺,/0,⍵,0} though
To everyone who competed in the student competition: good luck. It would be awesome if PPCG got 1st-3rd.
 
Speaking of which, when are results anounced?
 
@Zacharý Uh, the 0s should say ((⌊0.5×⍺-1)⍴0⍴⊂⊃⍵) or something, no?
 
The one thing I find frustrating about stencil is that it errors on small sizes.
 
8:59 PM
@Zacharý Yes, I've logged the bug. Btw, dyadic f/ also errors on small sizes which is even more frustrating.
 
Well f/ erroring makes sense, it doesn't pad with prototypes.
 
@Zacharý No, quite on the contrary. It shouldn't error because it doesn't need to pad.
How many length-4 sub-arrays can you take from a length-2 array? None. So the result should be an empty vector of 4⍴the type of the first element..
 
I should add this to RAD at some point, now that the student competition's over.
 
9:54 PM
CMQ: are there any better APL interpreter/keyboard apps for Android than GEMESYS's? I don't mind that much regarding the variant, as long as there's a keyboard for it
the ones I've linked (including the one I've installed, sAPL) are borderline sub-par
 
@EriktheOutgolfer APLKeys
@EriktheOutgolfer ^ is temporarily not on the play store. Should be back soon.
 
@Adám yeah, just searched for it :/
 
@EriktheOutgolfer You could compile it yourself:
 
@Adám yeah, it looks like the ApkDownload version is 2 days older than the GH one (although I'm not sure if it's "official" in a sense)
looks like many .png files were changed, and a license has been added somewhere, so that's not unimportant
 
@EriktheOutgolfer Gil is busy working on RIDE, but somebody should fork it and update it a bit.
 
10:20 PM
@Adám the publisher Optima Systems Ltd doesn't seem to exist atm
pub:Optima Systems Ltd returns nothing
 
@EriktheOutgolfer Gil forgot to answer some questions Google sent him, so they took it all down. Optima still exists, though.
 
@Adám forgot or is just too busy? (or maybe on vacation, who knows)
(note: not sure if you can answer this)
 
@EriktheOutgolfer I can, because I asked what happened. He answered yesterday morning, saying he forgot and said he would follow up on it "now".
 
@Adám sounds like business (as in "busy"), or he just forgot again :-)...let's see, I don't demand much from an apparently hard-working man
 
@EriktheOutgolfer How long does it take to regain listing on Play after passing the deadline on emailed questions from Google?
 
10:31 PM
@Adám putting that sentence on Google, I can see that "Once your app is removed, the published version of your app won't be available on Google Play until a compliant updated [sic] is submitted."
so it probably has to do with being sure he still wants the app in a public state
 
@EriktheOutgolfer Hm, what is a compliant updated? ;-)
 
@Adám not sure, probably the "[sic]" I included myself ;)...hm, did Gil suddenly violate some policy though? I don't think so, since the app is there since September 21, 2014
 
10:48 PM
@Adám I just installed the keyboard, since I figured out 0.1.3 is indeed the latest version. unfortunately, it doesn't work for GEMESYS's sAPL, but it still looks useful. thanks
GEMESYS's is a DOS console and probably wants its own bytes :P
 
@EriktheOutgolfer Right, APLKeys it is a true Unicode. All the other APLs on play use special SBCSs.
 
so, eh, I'll have to resort to Hacker's Keyboard for that for now
 
@EriktheOutgolfer If you just want a little bit of APL on the phone, TryAPL may be best. I've updated the front end to be slightly responsive. The APL Keyboard won't work on mobile, but my language bar may just.
 
11:02 PM
@Adám eh, only with APL Keys, and for some chars the docs that pop up are inevitable :P
where "some chars" means "chars added after 14.1
 
@Adám Except compiling android apps is hell
 
@EriktheOutgolfer Inevitable? Can you screenshot?
 
Not as much of a hell as compiling iOS apps, but still hell
 
@Pavel Oh. I didn't know.
 
There's a bunch of crap you have to download and configure so that everything can find the android libs
But at least you don't have to buy a mac
 
@EriktheOutgolfer Toggle the left pane off, then use the bookmarklet language bar.
 
@Adám let's see how I'll manage to fit that inside MIUI's Browser app
well, there are bookmarks
 
@EriktheOutgolfer Oh, you're using a Xiaomi phone.
 
@Adám yeah, it's apparent from the fact that the buttons on the bottom row are reversed :P (normally, back goes to the left of home)
(and that I've mentioned it over TNB more than a week ago)
 
@EriktheOutgolfer Like Samsung.
@EriktheOutgolfer Can't you put Chrome on there?
 
11:17 PM
@Adám Chrome is already there, but I don't tend to use it that much, it hasn't really given me more satisfaction
like, it's in the form of bloatware
I've also installed Firefox
 

« first day (566 days earlier)      last day (2072 days later) »