« first day (1836 days earlier)      last day (825 days later) » 
01:00 - 15:0015:00 - 22:00

1:57 AM
@phantomics I'm planning to make a discord bot that can eval april. Is there a way to get a "safe mode" from april?
 
Basically run it in a sandbox? The thing about April is it has no file IO, shell execution or other system interaction features built in unless you explicitly pass them in from the Lisp environment
However, I haven't set up a means to protect from DOS attacks, someone could instantiate a bunch of trillion-element arrays if they wanted
 
for that guess I could just limit the heap size on lisp side
 
There's already an APL-running bot in the APL Farm discord, is there another discord where you'd like to run it?
@LdBeth Correct, if you limit the memory available to the CL instance the worst someone can do is crash it
 
it's for demonstration purpose at school's computer club discord channel
 
codeberg.org/CptJimKirk/aplfarm i think this discode bot already evaluates april
you may be able to borrow from it
 
2:04 AM
Yeah using CptKirk's bot would probably be the quickest solution
I could also add on some image generation features if people are interested
Build animated .gifs and paste them into that chat, things like that
 
april can generate images?
 
thanks, I would try out the native CL discord API that someone has made instead of calling from python/js, but the multiline handle code seems useful.
you can like, import some CL lib that output images
 
@Razetime Yes, if you watch my talk you can see how it's used to power an LED display
 
i will have to see the talk then
 
The discussion of the Bloxl device starts around halfway in, the Bloxl device is what's behind me
Aside from custom hardware, I can have April output integer arrays that are then converted into .pngs and .gifs using CL libraries
 
2:10 AM
ah i remember this link
is it anywhere in the repo readme?
 
No, I'll add it
Here's a very simple image processing example: (april-c "{≢∪,(3⍴2*8)⊥2 1 3⍉⍵}" (opticl:read-png-file "/path/to/image.png"))
This counts the unique colors in a .png
 
K-style ifs? this looks fun to use.
i wonder how that decision came about
 
I like them better than :If :Else etc. I call them lexical statements
You can also use k-style functions with any number of named arguments. These functions won't work with operators though
 
@phantomics ah yes definitely, does it replace guards as well?
I suppose it does
 
April also has guards
They're a pain to compile, though (require special conditions in the compiler's "pass 1.5")
The benefit of $[] is that you can have any number of statements in any clause
In a guard only the final clause can have unlimited statements, because the ⋄ or newline separates the second and third clauses
 
2:25 AM
oh yeah $[a⋄b⋄c;d⋄e⋄f]
that does sound good
with tinylisp becoming the lotm i have found myself wondering how i would like a more convenient lisp distribution
 
The one for microcontrollers?
 
no, the tinylisp I tried isn't related to microcontrollers
 
A recent fun addition I made was an ncurses app that applies graphical filters to Conway's Game of Life: github.com/phantomics/april/blob/master/demos/ncurses/…
Gives an idea how I combine the strengths of APL and CL
 
what's a good place to start with common lisp?
 
My favorite book to start with is Practical Common Lisp
 
2:39 AM
ok will do then
 
And the other thing to learn is how to set up Emacs with Slime, that will give you a very powerful interactive REPL, you can find videos on youtube of how to do this
If you have more questions, you can find me in ##phantomics on Libera if you do any IRC
 
ok will do then
@phantomics yep i did check #phantomics earlier
I'll put it in my favourites
seems like i'm the only operator there right now
 
##phantomics with two hashes
 
no wonder
oh, ##phantomics.
 
 
3 hours later…
5:36 AM
0
Q: How to use onEnd command in Alexa Presentation Language(APL) video player template?

Ashiq Can anyone tell me how to use onEnd command for video players to know the video has ended and how to integrate it with Jovo.

 
 
3 hours later…
RGS
8:37 AM
@StackExchangeFeeds Well, that's not right :P
 
i sent an edit, still not approved yet lol
 
RGS
@PyGamer0 Ah so it's your edit that is blocking mine :P I tried suggesting the removal of the APL tag but couldn't because an edit is already pending!
 
oh lol
 
8:52 AM
looolll
 
9:24 AM
      ⊃src
v[1]←0= 10 |t
      ⍴⊃src
10
      'state'⍎⊃src
DOMAIN ERROR
      'state'⍎⊃src
             ∧
      'state'⍎'v[1]←0= 10 |t'
i wonder if this is a dyalog bug or i'm doing something wrong
 
RGS
@KamilaSzewczyk the left argument is a character vector
I don't think that's what you want.
 
yeah?
that's what I want
 
what are you trying to do
 
RGS
Do you mean something like (⍎'state')⍎⊃src ?
 
that doesn't make sense
 
9:27 AM
that's the eval-in-namespace demo
the namespace reference is a character vector
@rak1507 evaluate an expression in a namespace, obviously
 
oh, well it works without it
so try that maybe
 
RGS
@rak1507 also works if eval'ing the namespace first :P link
 
still DOMAIN errors.
 
RGS
@KamilaSzewczyk can you give us a TIO link w/ more context into the 'state' issue?
 
not really since it's a 100 line dfn that reads stuff from a file.
i can tell you anything you want about ⊃src, though
 
RGS
9:28 AM
Wait
Wait :)
⋄ ≢'v[1]←0= 10 |t'
 
@RGS 13
 
RGS
And above, you showed ⍴⊃src to be 10
 
      (⊃src)≡'v[1]←0= 10 |t'
0
      ⊃src
v[1]←0= 10 |t
something's wrong
 
RGS
So it's probably nested
 
i have boxing enabled, hm...
 
RGS
9:30 AM
Try ⊃,⌿⊃src?
well, g2g; good luck :P
 
      ⊃⊃src
v
 
RGS
Or maybe try ⍴¨⊃src
 
      (⊃,⌿⊃src)≡'v[1]←0= 10 |t'
0
      ⍴¨⊃src
┌┬┬┬┬┬┬┬┬┬┐
│││││││││││
└┴┴┴┴┴┴┴┴┴┘
 
@KamilaSzewczyk try ]boxing on -s=max?
 
      ⊃src
┌→────────────┐
│v[1]←0= 10 |t│
└+────────────┘
      'v[1]←0= 10 |t'
┌→────────────┐
│v[1]←0= 10 |t│
└─────────────┘
hmm.
hang on, what did + mean
i couldn't see this difference with normal boxing
 
9:35 AM
@KamilaSzewczyk Mixed data types. 10 is a number instead of '10' hence the spacing too.
 
oh, what, wait? that was legal?
i haven't ever seen something like this
 
Yes, 'a'1 is a valid flat ("non-nested" vector).
Oh, and btw, 'state'⍎ is perfectly valid syntax, although you don't need the quotes.
@KamilaSzewczyk For next time, you can use ]display src instead of actually changing boxing state. Another useful tool is ⎕DR which will give you 326 (pointer array) instead of the expected 80/160 (Unicode array).
 
i see, i see
well, i've seen it for the first time ever so i was very confused.
 
Our CEO thinks it was a bad idea to allow flat mixed-type arrays in the first place.
 
your CEO is right
 
9:41 AM
(J doesn't allow them.)
I'd say that once you have nested arrays, APL's array model kind of needs it. E.g. it is perfectly normal to have 'Kim' (3 1 4) but then you're supporting a prohibition of ⊃¨ on that?
 
Dyalog APL has the nested array model right?
 
Correct. (Well, Dyalog APL uses that.)
 
What is BQN's array model called?
 
Based.
 
when do we get the cringe array model?
 
9:45 AM
?
 
It'll happen eventually
 
 
ok
 
@Adám In terms of internet lingo, based ≡ vaguely good, cringe ≡ vaguely bad
 
Oh, didn't know that. (Also strikethrough uses triple dashes.)
 
9:46 AM
The fact that mixed datatypes is still considered flat in Dyalog APL confused me at first
 
@pmikkelsen Yeah, I don't think I've seen it be useful? Not in recent memory at least, I agree though, it doesn't make much sense to disallow it
 
Simple scalars are simple scalars, no? If a is a simple scalar and b is a simple scalar, then a b is a simple vector.
 
Yes it makes ok sense now :)
 
(And if you say that a b is (⊂a),(⊂b) which shouldn't be simple — although it is in APL2 style APLs — then I'll counter that at least a,b should be simple.)
 
It's fun tho, that the prototype depends on the type of the first item, so if we have s←'a' 1, then ⊃0⍴s will be a singe space character, while ⊃0⍴⌽s is a zero right?
 
9:49 AM
True.
Here, "fill item" is probably the better term, as that's what it is used as. I guess there's an argument that 3↑'a' 1 should be 'a' 1 0 while ¯3↑'a'1 should be ' ' 'a' 1
 
is there a display method that'd do 'v[1]←0=' 10 '|t'
 
But note that ⊃0⍴⊂'a' 1 is ' ' 0
@Razetime "do" or "reveal the truth of"?
 
because the annoying problem here is string spaces and display spaces are extremely confusing
 
Haha, so that would pick the fill item depending on the "end" of the array the filling happens? :)
 
@pmikkelsen Yes, but it wouldn't work for expand, e.g. 1 0 1\'a' 1. Should it fill from the left or the right neighbour‽
@Razetime If you run 1⎕JSON on it, you get ["v[1]←0=",10,"|t"] and in 18.2:
      ]repr 'v[1]←0=' 10 '|t'
'v[1]←0=' 10 '|t'
      ]repr -f=aplan 'v[1]←0=' 10 '|t'
(
  'v[1]←0='
  10
  '|t'
)
 
9:53 AM
aha ⎕JSON
I should just change my prettyprinter to ⎕JSON
 
It'd be lossy for higher-rank arrays and for character scalars.
 
well, gotta do some specialcasing then
 
@Adám It will also be just a bit too much "guesswork" for me at least, even if a consistent semantics could be defined.
Always depending on the first element is OK i guess
 
@Razetime Heh:
      ⎕SE.Print←{0::⎕←⍺ ⋄ ⎕←1⎕JSON⍠'HighRank' 'Split'⍠'Dialect' 'JSON5'⍠'Compact'0⊢⍺}
      ⎕SE.(onSessionPrint←'Print')
      2 3⍴3,/⎕A
[
  [
    "ABC",
    "BCD",
    "CDE",
  ],
  [
    "DEF",
    "EFG",
    "FGH",
  ],
]
 
@Adám interesting
@KamilaSzewczyk On the other hand, If there is a flat array model then there must also be a round array model
 
10:00 AM
sounds fun
 
@Razetime An alternative (your path to Serialise may vary):
      ⎕SE.Print←{0::⎕←⍺ ⋄ {⎕←⍵}¨⎕SE.Dyalog.Array.Serialise ⍺}
      2 3⍴3,/⎕A
[
  'ABC' 'BCD' 'CDE'
  'DEF' 'EFG' 'FGH'
]
      'v[1]←0=' 10 '|t'
(
  'v[1]←0='
  10
  '|t'
)
 
all arrays must be n-dimensional spheres
 
Once, the array notation becomes fully supported, we'll definitely have an output setting that uses it. That should avoid Kamila's problem.
 
ah that does sound nice
is it possible to have the Dyalog tty input characters right to left?
or RIDE or any other dyalog DE
 
      ⎕DR 1 0 1 0 1
11
      ⎕DR 1-⍨?1000⍴2
11
      ⎕DR 0.5×1000⍴2
11
Judging from ⎕DR booleans are always 1 bit?
I'm fairly certain this isn't the case though
 
10:07 AM
@Razetime I've experimented with such in the past, but it'd be odd for numbers and names.
 
yeah I know. just asking if I can try it.
 
@FawnLocke Depending on what you do, it will sometimes not squeeze immediately, but ⎕DR does squeeze before reporting, so… use 181⌶ as a non-squeezing ⎕DR
 
Ah, I see, thanks
 
@KamilaSzewczyk I lol'd
@MiljanNC I don't think so, I think maybe this falls under the "scalar looping algorithms" that conventional APL implementations don't prioritise in terms of implementation, although sometimes the encoding can still be quite elegant (e.g. dfns.dyalog.com/c_subvec.htm, not the same type of substring as your example, but similar type of searching maybe)
 
@Adám Are floating points numbers ever converted internally to integers, eg if they are close enough? Or do they stay floating forever
If so, what determines when they are close enough to their integer
 
10:25 AM
@pmikkelsen No, we always preserve as much precision as possible, and only ever squeeze if it'd round-trip bit-for-bit.
 
round-trip? as in float->int->float results in the same value again as before the conversion
 
Yes.
 
That is a good point, thanks
 
      1+⎕ct÷10
1
      1=1+⎕ct÷10
1
      181⌶1+⎕ct÷10
645
⎕ct is the comparison tolerance (but as you can see, not the conversion tolerance).
 
Nice, I had a suspicion that ⎕ct was the factor for when conversion happens, but i am glad that it was wrong
 
10:30 AM
Oh, the above should say ⎕DR (to force a squeeze), not 181⌶ but it'd give the same result.
@RikedyP What are we calling the Firday chat events? APL Quest or APL Chips?
CMP: What should we call the new event where we solve at one easy competition problem every Friday at 15:00 UTC?
 
I think APL Quest sounds fun and inviting
 
10:49 AM
true but it doesn't have any puns
 
An APL a week
 
Heh :)
 
@Adám APLevelup
@RikedyP did you have a go at Manacher's algorithm? I'm going to try to do a tradfn for it.
 
@xpqz Not sure we'll teach any new skills per se.
 
APL Tea & Biscuits?
 
10:55 AM
APL Bites
An APL a Friday
One Smart APL
 
https://github.com/kspalaiologos/apl-logic
i finished working on my logic gate emulator in APL
 
Adám is a lifelong APLer, you could say the APL doesn't fall far from the tree :)
@KamilaSzewczyk Awesome!
 
∊⍥∊ is somewhat satisfying to write/see for some reason lol
symmetrical APL code is fun.
 
@FawnLocke My father was an APLer. The APLer literally doesn't fall far from the APL tree.
 
You have had the power of puns bestowed upon you by fate :)
 
11:01 AM
@Someone Hi there. Interested in APL?
 
@Adám APL Bites seems to capture it well.
 
I'm still a fan of APL Quest, alas, no pun. If only the attenders could be rewarded with apples
 
QuestAPL
 
@Adám by the way, what's your opinion on the code
 
My only issues with it are minor and the nested multi-line dfns, although it's self contained and small so the flow of code might not be an issue.
 
11:12 AM
@KamilaSzewczyk Yeah the inline multi-line dfns bother me too. Could do with some comments too. You're using enlisting strands a lot where you probably could concatenate and stay flat. I'd also want a clear(er?) naming convention to distinguish fns and vars, esp. since you use inline dfns. [38] needs no and [39] needs no ' and [42] needs no
 
@RikedyP Here's my direct translation of the Wikipedia description of Manacher's algorithm in all its non-array glory: gist.github.com/xpqz/c19ca3ef97b5437761cad3925ba5388c
 
i know that the bind/tack are unnecessary but i like adding them just to be clear about my intent
 
@xpqz What is this, ALGOL‽
 
:)
 
You missed an obvious fork: (c-r)iota c+rc(-iota+)r
 
11:15 AM
@Adám I was quite pleased with myself for finding good use of :andif
:while c < ≢S
    :while 0≤c-r+1
    :andif (c+r+1)<≢S
    :andif S[c-r+1]=S[c+r+1]
 
@xpqz "±": S[c-r+1]=S[c+r+1] could be =/S[c(+,-)r+1]
@xpqz How does it not VALUE ERROR on r←s when 1=≢str?
 
Ah, that's a left-over from renaming the return variable name.
 
@xpqz You could name c-r+1 and c+r+1 so you can use those vars in the last :andif
 
@Adám i like this name
 
@Adám fixed
It would be interesting to see if this could be done 'properly' in APL.
It seems inherently scalar.
 
 
2 hours later…
1:48 PM
If you define dfns inside a tradfn, should you declare any variables defined inside the dfn as locals in the tradfn header?
 
@xpqz No, the dfn will always auto-localise (unless you circumvent it).
 
Ah yes, I see that the syntax highlighting 'does the right thing', too.
The last :while in my APLGOL program can be rewritten as
r c←1↓{(1⊃⍵)<ir←radii[⊃⍵]:(1+⊃⍵)ir(⊃⍵)⋄⍵+1 0 0}⍣{(⊃⍺)=≢radii} 0,radii[0],0
Not sure it's an improvement.
 
That's just another "while"
 
2:06 PM
Sure. That's what ⍣ is though, right?
This is quite an interesting problem, actually.
 
@xpqz Yeah. You could probably also write it tail-recursively.
@KamilaSzewczyk Remove the paren in (2|⎕DR)¨⍵
I'd also define an Assert function instead of using ⎕SIGNAL 8 directly.
 
2:28 PM
@Adám More inkeeping, the whole last bit is simply
r←⌈/radii
c←radii⍳r
 
2:54 PM
OOOOHHH so thats how you reverse a list in python! https://docs.python.org/release/2.3.5/whatsnew/section-slices.html
i'm gonna abuse this feature so much
 
@BrianBED myList.reverse() does it in-place?
 
:o damn
 
Well, if you want a copy, I suppose [::-1] would work, although I must say that ⌽myList is easier to read than myList[::-1]
 
@BrianBED That is not a great way to reverse a list in python, btw.
 
01:00 - 15:0015:00 - 22:00

« first day (1836 days earlier)      last day (825 days later) »