« first day (1830 days earlier)      last day (114 days later) » 

12:00 AM
x←y←0 ⋄ {disp∘←screen y,x ⋄ {x y+←(x,y)+⍵[0 2]-⍵[1 3]}'wsda'=ask'move: '}⍣≡'idk'
my script now works in a way but for some reason my x and y increase expenensually, so the higher your x the faster you move. like 10x or something like that. i can't figure out why.
 
you add x y twice - once in the assignment, and once manually
also (x,y) is just x y
but you don't even need the (x,y)+, just x y+←⍵[…
 
it works now thanks. but its now not accepting two consecutive w inputs. like second time inputing w it just spits out a 1 0 and stops
current version:
x←y←0 ⋄ {disp∘←screen y,x ⋄ {x y+←⍵[0 2]-⍵[1 3]}'wsda'=ask'move: '}⍣≡'idk'
 
that's what ⍣≡ will do - it repeats until the last two results are equal
 
ahhhh
 
you want ⍣{0}
 
12:06 AM
how do i use something else? i thought because i added 'idk' it would repeat forever
o alright
wait you sure? it just returns back the script
 
the first argument is the 'idk'; then it's the ⍵[0 2]-⍵[1 3], and if that repeats (which happens on equal input), it ends
@BrianBED seems to work fine for me
 
ya but i changed it now to:
x←y←0 ⋄ {disp∘←screen y,x ⋄ {x y+←⍵[0 2]-⍵[1 3]}'wsda'=ask'move: '}⍣{0}

but it just spits out:{disp∘←screen y,x ⋄ {x y+←⍵[0 2]-⍵[1 3]}'wsda'=ask'move: '}⍣{0}
 
oh you still want to give that some argument
 
@dzaima huh? let me try in dyalog instead of ride
@dzaima wdym?
like still keep the 'idk' ?
 
your 'idk' will work, but it's kind of more traditional to use
 
12:10 AM
no but like where? like where to insert it?
oh i figured it out
cool thanks a lot
 
same place as before - after ⍣g - {…}⍣{0} ⍬
wow that was a long delay
 
oh lol
 
 
14 hours later…
2:32 PM
someone should go back in time and tell Iverson that amogus isn't a good comment glyph
 
nah it is quite great
a nice lamp to illuminate your code
 
it doesnt even look like amogus
and i like the glyph
 
3:38 PM
yea true. lets replace it with ඞ
 
3:58 PM
I think I want multiline comment in APL
 
I've thought about implementing multiline comments starting and ending with ⍝⍝⍝
Has it ever been tried in APL dialects before?
 
In a jupyter notebook, the next line works:

]import # '/Users/<myusername>/src/test/test.apl'

But, the following doesn't. I think I can see why this naive approach doesn't work, but is there a way to make it work? What I would like is that the root directory is given by ⊃1⎕NPARTS'', so it can be independent of my local file structure.

fname←'/Users/<myusername>/src/test/test.apl'
]import # fname
 
@phantomics None that I know of
 
@FawnLocke Wouldn't be hard at all, maybe it's considered distastefully verbose
 
One thing I want more is an array notation that allows multi line strings amongst other things
 
4:10 PM
That's what I like CL for, I can have matrices, higher-rank arrays and strings with newlines represented in the code without line after line of M⍪←
There are Conga-based website servers with thousands of lines of HTML concatenated with ⍪←
 
Yep
Wish I loved Common Lisp, then I'd be laughing :)
 
Prefer not to use CL? I recall you were thinking about using April before
I think you're awagga correct?
 
Yes, and correct. I really like April but CL isn't my thing
 
Would it help if April could be used in a more standalone fashion? I've been considering options for creating a REPL mode for it in Emacs that would give you a UI similar to other APLs, it would mostly obscure the CL
 
I totally think so, yeah. I think that's what is keeping most people from using April as a serious tool. Infact, I've heard that exact sentiment echoed in the orchard recently.
Of course, that's ancedotal. It could also be wasted effort
People who are writing APL are using Dyalog because of the decades of backwards compat and excellent libraries. People who want a better APL and don't care much about those qualities are using BQN.
It's hard to find a place for April, although I'd certainly like it to be more popular
 
4:18 PM
That will be a good next step then. I've been busy finding and fixing bugs and it seems there's not much low-hanging fruit left to fix
 
The common lisp interlope is it's defining feature imo, I think the fact it's common lisp is the issue, a shallow and unfortunate coincidence
Hard to decide what direction is more important /shrug
 
Interoperability is one of the key features, another one is the ease of extending the language, you can add a new functional character in 10 lines
 
Yep
 
And via CL, you can interface with C, C++ (via Clasp), Python, Java (via ABCL) and others. CL is one of the best choices for implementing an APL because it has all the array features you need natively
I.e. in standard Python, you can't work with n-rank arrays from NumPy. But n-rank arrays passed back from April can be handled with standard CL array tools
 
Totally, I agree. I just think the average person sees that as strenuous? I also do recognize that CL is an appropriate choice for that reason
Either way, obscuring the CL could bring along new users, it just depends on your aim.
 
4:25 PM
Yes, for someone who isn't using CL and considers APL it would appear as a double burden to take on. It requires someone who sees the advantages of both languages to appreciate
 
Yeah
 
But the CL can certainly be more obscured than it is, I'll see how it affects user uptake
 
Are you aiming to be compatible with Dyalog?
Seems so
 
Mostly, although I've thought about creating a "branch dialect" that would implement first-class functions. April's core functions and operators are patterned after Dyalog's
This allows me to easily use Dyalog code, for example see: github.com/phantomics/april/tree/master/libraries/dfns
Check the .apl files in each of these folders, it's a collection of Dyalog's dfns packaged as standard libraries for April
 
Have you thought about addressing APL's historical baggage. I.e ⎕IO & / function-operator overloading. Adám had an idea for Dyalog, of creating a "branch dialect" that could seamlessly call the old language. Vica-verca I believe too. This could be an idea for April
 
4:34 PM
Check the demo.lisp files in the folders to see tests of these functions. There are some neat-looking printouts in github.com/phantomics/april/blob/master/libraries/dfns/array/… and github.com/phantomics/april/blob/master/libraries/dfns/tree/…
 
Awesome
 
That could be good, I like dzaima's idea of /\ as operators and ⌿⍀ as functions
And with my idiom extension system, a branch dialect can literally be applied as a patch to April
 
I see, awesome. Leading axis is one of the nicer aspects of modern APL, but if you make it a core feature it quickly becomes a different language - one that most prefer, still though
 
⎕IO I kind of see as helpful, I actually allow any integer as ⎕IO in April, more for fun than anything
The thing that really interests me is first-class functions, I did some really cool stuff with first-class functions in k
 
I would stick to ⎕IO ← 1 but everyone has a preference /shrug.
Yeah first class functions is a must have
 
4:38 PM
Making it zero helps in some situations, and the ability to lexically assign it (along with ⎕CT and other stuff) inside a function is nice
 
But then you need to rid of stranding too, or some other way of differentiating between calling a function and taking it as an argument
 
I had a k program where I was basically recording data with some conditions associated, for example "is this the beginning of a sequence" and "is this the end of a sequence"
I had four different recording functions for handling this recording, so I put them in a 2x2 nested list and indexed the lists using the results of two logical tests
I.e. I could get one of four functions ranging from [0;0] to [1;1] depending on the conditions, super elegant
 
i always have ⎕io being 0. idk why. maybe because I use [] and ⍳ in the same way as i do in python and js, like because its based on counting from 0
 
Nice, phantomics.
@BrianBED It's recommended to use ⎕IO ← 0 everywhere anyway :)
 
ah cool :D
 
4:42 PM
So I was thinking of multiple syntactic styles for first-class functions
First, capitalization - capitalize the first letter of a function's name to call it, lowercase to treat it as data
Then, the : character would be moved from use in guards to use as a "funcall" functional character. 3 {⍺+⍵}: 5 would call the function {⍺+⍵} on 3 and 5
3 {⍺+⍵} 5 is a vector of 3, the function and 5
For guards, $ would replace : since I already use it for k-style if statements
 
@phantomics wouldn't it be better to just use a prefix to refer to a function as data
and keep the current order otherwise
like &fn or &{...} or something
 
Perhaps, that kind of creates a new special syntactic rule
I've thought in terms of a model that would map 1:1 with the underlying first-order functions in CL and save a great deal of complexity in the compiler; entire classes of problems disappear and the language becomes simple to compile
 
5:48 PM
@bwanab Use ⎕SE.Link.Import # fname
 
@RikedyP Beautiful! Thanks!
 
@xpqz Not sure, seems like you'd have to loop over specifying which match you want to replace. Sounds like a job for the "transformation function": help.dyalog.com/latest/#Language/System%20Functions/r.htm
 
6:09 PM
Well maybe you can figure out a smarter way, but:
s←'ab ab ab'
inx←'ab'⎕S{⍵.(Offsets+⍳Lengths)}⊢s
loc←∊¨inx⊂⍤⌿⍤1⍨⍉2⊥⍣¯1⍳¯1+2*≢inx
{('ba'⍴⍨≢⍵)@⍵⊢s}¨loc
 
 
1 hour later…
7:28 PM
@xpqz That's what ⎕S is.
@bwanab ]import isn't a proper function (it is a so-called user command), which is why you don't need to quote its arguments. Use ⎕SE.Link.Import # fname
 
 
2 hours later…
9:21 PM
oh btw I found the apl keyboard layout to be very intrusive so i designed my own with AutoHotKey. super neat. the reason was because i use windows+space to switch between english and my own lang, and i was getting pissed when i kept switching to apl and my shortcuts kept not working. this was before getting ride btw, tho i prefer mine over ride's.

o also, is it alright if i post accomplishments on here? might be useless for y'all
¯\_(ツ)_/¯
 
9:32 PM
@BrianBED Maybe you want to share your AHK script? And yes, sharing achievements is perfectly fine — at least if you're open to feedback.
 
sure. some of my characters don't work just yet so i'll send my script in a bit. oh also, do i just share raw code? its gonna be like 100 lines :)
 
@BrianBED Well, you'd want to host it somewhere (e.g. GitHub repo or a Gist), not dump it here. Then we can link to it from apl.wiki/typing_glyphs
 
ah ofcorse yea i'll do that
oh it's gonna be complicated tho for some. i've only made it work for danish keyboard
 
10:08 PM
https://github.com/BrianEllingsgaard/APL-keyboard-with-AutoHotKey
this should work
 
@BrianBED Stick ``` on a line before and after the key list to fix the layout.
 
alright one sec
 
Actually, maybe you want to modify the Danish keyboard here for an easier-to-read layout?
 
I like the APL layout
 
@Adám alright ya i'll do that
 
10:27 PM
how do i edit one of these layouts? notepad messes stuff up
(first time im using imgur to link images so if it fails my bad)
https://imgur.com/a/pOnlhAl
 
@BrianBED (it worked) You just have to choose a font that has the characters, e.g. APL385 Unicode.
It will look a bit funny on GitHub too, but that's OK imo. People can always take the text and format it.
 
how do i change font on notepad or some editor?
oh nevermind i found it
 
10:50 PM
@user13838654 Hi del_dilettante. If you want to participate here, please email access@apl.chat
 
11:01 PM
what does ⍙ do?? i found it on the dyalog keyboard but it isn't a normal glyph that shows up on the top thing in RIDE
 
It doesn't do anything. It's just apart of the APL codepage (and a valid identifier)
⋄ ⎕ ← ⍙ ← ⍳5
 
@FawnLocke 1 2 3 4 5
 
@BrianBED Tip for next time you have a simple question: Try APLcart
 
alright will do
 
11:46 PM
Interesting little speedup I found. Using a boolean mask to filter vectors or rows of a matrix is a super common operation. If you are working on a table with headers, usually you want to keep the header (first) row, regardless of the filter. Of course, an alternative answer is that you should keep the header and the actual table data in separate variables, but in practice that isn't seen everywhere.

"1,1↓" is usually how you keep do this, but cool to see alternatives. In 18.0 :
      b ← ¯1+?1e6⍴2
      ]runtime -c "{1,1↓⍵}b" "{⍵∨(≢⍵)↑1}b" "{1(@1)⍵}b"

  {1,1↓⍵}b    → 4.0E¯5 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {⍵∨(≢⍵)↑1}b → 8.5E¯6 | -79% ⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {1(@1)⍵}b   → 3.2E¯6 | -93% ⎕⎕⎕
 
note that ¯1+?1e6⍴2 won't use bit booleans as + doesn't check for whether the result can
 
@JoshD Well noted, but this is very predictable.
Right. You should use b ← 1=?1e6⍴2
Still, it won't change much when it comes to the relative performance of the three expressions.
 
yeah. And it won't be in your actual code. But still a fun note
 
That's nice to note, is there a consistent way to check whether bit booleans were used. Will ⎕DR help? Or is this just based on your knowledge of the primitives
 
181⌶
@dzaima which is ⎕DR that doesn't also attempt to convert the argument to the smallest possible type, defeating the purpose
 
11:55 PM
1@1 is the obvious way to me not 1,1↓
 
I want 1⍢⊃
 
@rak1507 but 1,1↓ can be easily adapted to write to the last item, not the first, whereas 1@1 is a lot more complicated
 
I want 1⍢⊇
 
ok I'm done :D
did break as expected but still super useful
 
@dzaima true
 
11:56 PM
1⍢(⊃⌽) would of course be an option, if it was an option
 
but then 1,1↓ can't be easily adapted to write to the 27th term :p
 
but you don't usually want that
 
1@(≢⍵)
 
@dzaima true
 
@JoshD doesn't work if you're not modifying but the result of some expression; you'd have to assign it to something, making it messy
 
11:59 PM
anyway for that problem I like 1@1 for shortness not necessarily for speed (they're all super fast anyway)
 
Can't say I've needed to do 1,1↓ in recent memory
 
I want 1⍢(27∘⊃)
 
Also noted that the speed is pretty similar for smaller boolean vectors
 

« first day (1830 days earlier)      last day (114 days later) »