« first day (636 days earlier)      last day (2008 days later) » 

12:20 AM
@ngn Cool. I can't join because I have an insufficient reputation, but I can answer that one pretty easily. CALL/CC is SET!
@nathanrogers Regarding game design, while you can use Canvas an the like, one issues with the current approach is that 3D graphics in the browser is currently really heavily dependent on making JS calls. You can create a directional "REPL" to send signals to the JS engine and have it do things that you want to do on the Canvas or 3D rendering fields, but that's a pretty heavy weight solution.
The value of that is that you can scale that to just about any 3D engine anywhere then, simply by writing the code that reads the sockets and runs the commands.
However, to my knowledge, there is no fully fleshed out, 3-D game engine written in APL. That's a long term fantasy of the Co-dfns project at some point in the future.
However, what you can do is access a portable 3-D game engine library or access a 3-D rendering technology that is cross platform and use that.
However, this will require some level of C understanding.
Working with perhaps a few stub functions and the like, you will be able, for instance, to write an OpenGL program in APL simply by making the appropriate calls to the appropriate OpenGL library on whatever platform you are using.
I believe someone may have already created OpenGL bindings for APL, but I'm not sure about that.
There are currently some copy overheads in using the []NA interface for doing high-performance FFI stuff, but that might not be too much of a problem depending on what you are doing.
Additionally, if the bulk of the complicated work is not in the rendering, but instead in the computation of various elements, which is the case for the StormWind simulator (where APL is used to do a lot of the data munching, but not the literal rendering), then you can probably get away with a heavier weight solution like the HTMLRender + 3D Canvas type solution.
The higher your performance requirements are for the specific calling structure between APL an whatever rendering technology you are using, the more work you'll need to put in to making things go.
Eventually I would love to have a 3-D game engine or the like written with Co-dfns so that you could write all of your game engine logic and most of the other stuff purely in APL and have zero overheads in using it together with an integrated game engine that renders to OpenGL or DirectX.
But that is frankly a long ways off from reality at the moment.
 
12:49 AM
@nathanrogers I can't tell from your reply whether I was helpful or not in answering your question.
 
 
2 hours later…
3:00 AM
sigh Anyone here good with C++?
 
3:30 AM
@arcfide direct in what way?
@dzaima 6 2(,>⊖,[.5])4 9 gives 4 2 6 9, isn't that what was asked in the cmc?
 
@Cowsquack Direct meaning the expression of a solution with the least amount of semantic and syntactic indirection/abstraction.
Direct is in opposition to Abstraction.
Directness is a key principle design goal of APL.
 
so Each would fall under abstraction?
 
Yes. It is a type of indirection.
In the case of + vs. +¨ it's a matter of syntactic indirection, since in many cases they are semantically very close. However, that syntactic indirection means that the interpreter/compiler has to work harder to reach a direct implementation.
Technically there is a semantic difference as well, but not the one most people probably think of.
In the case of + is basically makes no real difference, but with other functions it does.
What I mean by that is that Each isn't a deep mapping to pointwise elements; it is only a shallow lifting of a function to element-wise application in a single depth.
+ and other scalar primitives are lifted to arbitrary depths.
 
 
5 hours later…
8:31 AM
What do you mean by great again? When did it stop being great in the first place? https://twitter.com/philipthrift/status/1052136481312178176
Roger Hui explores the FinnAPL Idiom Library's progressive index-of functions in his latest blog post – see https://www.dyalog.com/blog/2018/10/progressive-index-of/ to find out where his investigations took him
 
 
2 hours later…
10:41 AM
@Cowsquack oh I had ⎕io←0. yep it works fine
 
 
1 hour later…
ngn
11:59 AM
today i learnt the hard way: one must be very careful not to unref and attempt reuse of two arrays at once - they might be the same array
 
 
1 hour later…
1:16 PM
@ngn I imagine the interpreter panics and gives up on life?
 
ngn
@J.Sallé something like that :) it segfaults
 
Hahahahah I see
 
..I made it so every builtin keeps a reference to its scope whether it needs to or not, making {a←⍳4⋄plus⊢←+}⍬ keep a alive and now I'm manually going trough the ±50 builtins and removing that ._.
 
Regarding yesterday's problem, I've managed to get the following code: {{∊⍕¨⍵,⎕←+/(⍎¨⍕4335443554)[⍎¨⍕⍵]}⍣⍵⊢0}1. It still kinda doesn't work, 'cause I need it to print just the numbers, not the string the function returns (basically I need it to print at ⎕← and not the function's return)
Also it doesn't print 0 which is the result for 0.
 
ngn
@dzaima what does plus⊢←+ mean?
@J.Sallé i don't know what this is supposed to do but you can shorten it with (⍎¨⍕4335443554)[⍎¨⍕⍵] -> ⍎¨'4335443554'[⍎¨⍕⍵]
 
1:30 PM
@ngn oh good question. plus ← {a←⍳3 ⋄ +}⍬ would be more correct, setting the global variable plus to the plus created in the dfn
 
⍞←{{∊⍕¨⍵,⎕←+/⍎¨'4335443554'[⍎¨⍕⍵]}⍣⍵⊢0}7
 
@J.Sallé INDEX ERROR
 
ngn
@J.Sallé ⎕io←0
 
@ngn yeah I'm trying to remember the bot syntax
⋄⎕io←0⋄⍞←{{∊⍕¨⍵,⎕←+/⍎¨'4335443554'[⍎¨⍕⍵]}⍣⍵⊢0}7
 
@J.Sallé
4
8
13
21
27
35
44
 
1:33 PM
It's doing what it's supposed to do, except it prints the resulting string of the function. No idea why it didn't here.
Also it should print 0 for 0, not 4.
actually the result should start with 0 and end on 35, I mean.
 
ngn
@J.Sallé ah... i assumed wrongly ⎕io←0 for your expression
 
@ngn no no it is ⎕io←0, that's my problem
 
@J.Sallé Because ⍞← goes to stderr.
 
@Adám it omits the last line of the result then? I remember having to use that to show multiline results here
 
ngn
what is the ∊⍕¨⍵, for? shouldn't it be {{⍵++/(⍎¨⍕4335443554)[⍎¨⍕⍵]}⍣⍵⊢0}?
 
1:44 PM
@arcfide I'm not sure what response/question you were referring to. as for 3d or not, I'm not looking to make anything 3d. I just need some simple drawing. I haven't had time to continue on what I was working on since I last wrote here, so I have nothing new to ask, but I'm just looking to achieve some of what I'm finding in "the nature of code" videos on youtube
 
ngn
@J.Sallé ah... you're constructing the first n items of sequence. the challenge explicitly allows the output to be the n-th term only
 
which is mostly flat, simple shapes in 2d. thing is, I saw cellular automation as a fun rabbit hole to go down for leaning APL, I just don't know how to draw with APL
 
@ngn yeah but I found that much harder to do
 
and it isn't clear to me how to think about drawing with APL
canvas seemed an obvious choice, but I don't understand the interaction from APL to javascript to make drawing to the canvas happen
 
@ngn except this solves it apparently
I thought I tried doing that before
Aaaaah ffs I see it now, it's ⍵++/, I was using ⍵+/
 
1:48 PM
@J.Sallé The bot only prints stderr if there is nothing on stdout. The ⍞← prefix keyword is just a convenience to get an inline response without boxing, but it actually maps to ⎕←.
 
@Adám Ah, I see
 
ngn
@J.Sallé in apl n+/a is n-wise reduce (sliding window), in k x+/y is reduction with initial value x
 
Yeah that's probably what confused me.
 
ngn
@J.Sallé ok, so now you can apply my golf
 
ngn
1:54 PM
@J.Sallé now, how can we make that shorter...
 
6 2(,>⊖,[.5])4 9⊣⎕io←0
oops
⎕←6 2(,>⊖,[.5])4 9
 
@ngn I'm sure you have sorcerous ways of doing so
 
@Cowsquack
4 2 6 9
 
⎕←6 2(,>⊖,[.5])4 9⊣⎕io←0
 
@Cowsquack
2 4 6 9
 
1:55 PM
⎕←6 2(,[.5])4 9⊣⎕io←0
 
@Cowsquack
6 4
2 9
 
that's why huh
 
ngn
@J.Sallé hint: ⍎¨'4335443554'[⍎¨⍕⍵] ←→ 3+⍎¨'1002110221'[⍎¨⍕⍵] and you can encode the '1002110221' more efficiently
 
⎕←6 2(,[¯.5])4 9⊣⎕io←0
 
@Cowsquack
6 2
4 9
 
1:56 PM
@ngn yeah that's exactly what I'm looking at
 
@J.Sallé what is ⎕io here?
 
@Cowsquack 0
 
ngn
i still can't make it shorter though...
 
@ngn oh so I'm not alone
 
ngn
{{⍵++/3+⌊4÷⍨' 1260459'⍳⍕⍵}⍣⍵⊢0}
 
2:06 PM
{{⍵++/(⍎¨⍕⍵)⊇3+3⊤21490}⍣⍵⊢0} in my APL
 
@ngn 3+⌊4÷⍨' 1260459'⍳⍕⍵ is the more effective way to do ⍎¨'4335443554'[⍎¨⍕⍵]?
 
{{⍵++/3+3|⌊37558÷3*⍎¨⍕⍵}⍣⍵⊢0}
 
^ nice
 
did you guys use brute forcers?
 
No, I used 1002110221 spelt backwards in base 3
 
ngn
2:10 PM
@Cowsquack i can't imagine how else H.PWiz came up with that :)
@H.PWiz huh, what...
 
@H.PWiz oh got it makes sense now o.O
 
Not sure how the maths work with that though
 
@J.Sallé to get the nth digit in base 10, you'd divide by 10^n and floor, and %10 that. That's how the answer works too, but in base 3
 
@dzaima ah, I see
 
nicely done
 
2:39 PM
@J.Sallé Someone else found a shorter encoding: codegolf.stackexchange.com/a/174531/71256
 
ngn
@H.PWiz so: {{⍵++/3+3|⌊3÷⍨4-2×⍎¨⍕⍵}⍣⍵⊢0}
 
@H.PWiz They're doing something like {{⍵++/3+3|⌊3÷4-2×⍎¨⍕⍵}⍣⍵⊢0}
ninja
 
I have 22 bytes for this, just wondering if it's embarrassingly long or not
 
ngn
@J.Sallé i think you're allowed to write {...}⍣⎕⊢0 and claim it's a complete program
 
@ngn I suppose I could, it's just gonna be a pain to do the test cases :p
I'll do it later, my boss found me some work to do >.>
 
2:47 PM
I think i'll just post it
 
ngn
3:06 PM
@Quintec 22 is pretty good. i managed to bring it down to 20: +/'ROYGBRO'(⍷-⍷∘⌽)⍨⊢
or 19 if written as a complete program: +/⍞(⍷-⍷∘⌽)'ROYGBRO'
or 19 as a train: +/(⍷-⍷∘⌽)∘'ROYGBRO'
 
⍷-⍷ looks like a dude who hasn't slept in days
Also looks like me when I'm waiting for a project to compile for over 30 minutes and it throws an exception on the last couple of lines
 
ngn
@J.Sallé 30 min compilation!?
 
@ngn yup
Technically it compiles every project of the master branch of our product, but I need to run that at least once a day because Delphi.
My project is the 161st
 
3:52 PM
@dzaima is "sane" indexing, right? ⌷⍨∘⊂⍨
 
@Adám yeah, I've been going trough your extensions and adding them to my apl
 
@dzaima Cool. I'm happy to that you like them. What is TIO ETA?
 
@Adám I'm right now making normal command-line argument parsing which is the last thing on my pre-TIO checklist
oh, also a name, right.
 
4:09 PM
@dzaima why not "APL (dzaima/APL)"?
@dzaima I assume is "only expand". If so, it is missing from differences.txt
 
@Adám that's the default option, yeah, I just hoped to come up with better
 
@dzaima What does "dzaima" mean or stand for?
 
@Adám is not implemented yet, but yeah that's the intention
@Adám No idea, that's what I came up with many years ago by taking my names first 2 letters and adding stuff to it.
 
@dzaima APLX and APL+ are taken, but how about *APL (read as "power-A-P-L")?
@dzaima What are the two original letters (if you don't mind revealing such personal info)?
 
@Adám "Dz", the first 2 letters..
 
4:16 PM
@dzaima "Dzapl" or "DzAPL" or even "Dzapl"/"DzAPL" just to mess with people's Unicode support.
 
APPL where one of the Ps stand for processing
 
@dzaima Why isn't ⎕COND a function which must evaluate to 0 or 1?
 
@Cowsquack The Processing part is a completely different thing from the main APL
 
@dzaima Can't see video on train.
 
@Adám what do you mean? The idea of ⎕COND is to change conditional handling globally
 
4:22 PM
@Adám this is evil. I like it.
 
@dzaima Yes, so by default ⎕COND←{0≡⍥,⍵:0 ⋄ 1≡⍥,⍵:1}, but you could also set it to ⎕COND←{⍵≤0:0 ⋄ 1>⍵:1} etc.
 
@Adám ah, that way. I wanted to limit it so 0 = false & 1 = true always, and really don't want the overhead of calling a dfn for every boolean
 
4:40 PM
@dzaima Heh, Dyalog APL has )tokenize (with another name) but it is a secret.
 
4:57 PM
@Adám secret as in it exists and if I were to learn reverse-engineering now I could find & execute it? :p
 
@dzaima Yes.
 
5:14 PM
-1
Q: How can I do this operation without parens?

zeynelHere I read that "The Babylonians came up with the "quarter-square multiplication", which reduces multiplication to subtraction: a*b = (a+b)^2/4 - (a-b)^2/4 When I tried this in APL I ended up with this: (((a + b) * 2) ÷ 4) - (((a - b) * 2) ÷ 4) But isn't this ugly with all these parens? I ...

 
5:26 PM
oh realized my as console input has never worked. No idea how to implement it well either
 
ngn
@dzaima what's the problem? iirc java has a readLine() somwhere in its i/o classes
 
@ngn no, reading stdin (that part already was written) isn't the problem, but making ⎕←1 not also read input
 
@dzaima probably need to parse the following token and treat it then
 
currently that'd need to get the type of to see whether it's settable to a number or not, which would involve reading the console
@J.Sallé something like that is what I'm gonna do
 
Yeah it's probably not the most efficient way but hey, who cares about efficiency eh ⍨
 
ngn
5:31 PM
@J.Sallé I do :)
 
@J.Sallé the building blocks to do that are already there for me, I just need to add a couple more ifs
 
@ngn Hey, keep to your own APL :P
 
ngn
@Quintec lol :) i've kind of abandoned it in favour of k
 
@dzaima E.g. tokenise '{do ⍺⍺-⍵}⍨/5 2' gives:
┌─┬──┬──┬─┬─┬─┬─┬─┬─┬─┐
│{│do│⍺⍺│-│⍵│}│⍨│/│5│2│
└─┴──┴──┴─┴─┴─┴─┴─┴─┴─┘
 
@Feeds CMC: (a+b)^2/4 - (a-b)^2/4
 
5:45 PM
@dzaima are a and b scalars?
 
ngn
@dzaima 1-byte :)
 
@Adám sure
@ngn facepalm
 
@ngn wut
 
@J.Sallé ×
 
@dzaima But it has to be that formula, no?
 
5:47 PM
oh lol
 
@Adám that's hard to define
 
also I read $(a+b)^{2/4} - (a-b)^{2/4}$ which is just silly
 
@dzaima 4-.÷⍨2*⍨+,-
 
 
4 hours later…
10:06 PM
@dzaima Why are monadic ∧←∧/ "all" and monadic ∨←∨/ "any" but not monadic ⍲←~∧/ "some" and monadic ⍱←~∨/ "none"?
 
@Adám because writing TODO is simpler than implementing a function :p
 
@dzaima OK, but it's literally just the negation of code you've already written.
 
@Adám 5 seconds < 20 seconds insert mathjax large ":p" here
 
@dzaima Typo: should be first if enclosed; select.
 
@Adám yep, thanks
 
10:14 PM
@dzaima Wrong: monadic is not ⊃⍴⍵ but rather ⊃1,⍨⍴⍵.
 
also true..
 
10:51 PM
D: I can't make short-circuit upon hitting 1 because floats
I'm correct in thinking that ∧0,anything will always result in 0 though, right?
 
@dzaima Can't you check the data type before you begin? if int or bit, stop at first 1.
@dzaima Yes; least common multiple.
 
@Adám all numbers are doubles currently, sadly. I do want typed arrays at some point though
 
@dzaima JS style?
 
@Adám yeah. I really should've built the Num class for extension from the start (and really, Arr too), but didn't.
@dzaima though if I do that, ∧0 'hello' would result in 0 instead of domain-erroring. ¯\_(ツ)_/¯ worth it
 
@RaidelFonseca Welcome. Interested in APL?
@dzaima Wait, you can't distinguish between homogenous and heterogeneous arrays?
 
11:00 PM
@Adám nope. Everything's treated equally until you reach scalars.
 
@dzaima So every scalar is marked with its type?
 
@Adám every scalar is a class instance. Yes, it's that inefficient.
I haven't been joking about saying that I don't care about actual performance
Does Dyalog APL always make sure a heterogeneous array is heterogeneous? i.e. ¯2↓(1000/0),'hi'
 
@dzaima I'm not sure what you mean. It will tend to compact whenever possible:
⍞←⎕DR ¯2↓(1000/0),'hi'
 
@Adám 11
 
1-bit Boolean
 
11:06 PM
@Adám does "tend" mean "100% of the time" is what I'm asking
 
@dzaima You probably meant to ask Does Dyalog APL always make sure a homogenous array is homogenous?, no?
 
@Adám that works too
 
@dzaima The documentation for ⎕WA seems to imply that it isn't 100% of the time:
]help ⎕WA
 
#tio alias command ]help #TIO do apl-dyalog {0::⎕←⊃⎕DM⋄⎕←⎕SE.UCMD'help %args% -url'}(⎕NS⍬).(enableSALT⊣⎕CY'salt')
 
11:10 PM
@Adám Added alias for ]help
 
]help ⎕A
 
@Adám oh Dyalog APL does have a garbage collection command :D
 
]help ]save
 
@Adám ]save -?
 
11:12 PM
]save -?
 
@Adám
───────────────────────────────────────────────────────────────────────────────

]SALT.Save

Args: item [filename]
Save item in a specific file (default: same place if already SALTed)
]SALT.Save -??      ⍝ for more info and description of all options

]Save is a thin cover for the ⎕SE.SALT.Save function. See the SALT User Guide for full documentation.
 
@DyalogAPL OK, good.
 

« first day (636 days earlier)      last day (2008 days later) »