« first day (1636 days earlier)      last day (1019 days later) » 

3:11 AM
In J, I can compute the mean absolute deviation of the first 10 nonnegative integers like this: (+/%#)|(-+/%#)i.10
That gives 2.5. However, if I define mad=:(+/%#)|(-+/%#)
And then run this: mad i.10
I expected the same thing, but I got a vector as a result: 0 1 2 3 4 0.5 1.5 2.5 3.5 0
What gives?
 
3:24 AM
@jordancurve J trains are very different from K trains. Your mad can be written as f g h, and if you call mad x, it evaluates to (f g h) x which is (f x) g (h x).
So mad i.10 evaluates to ((+/%#) i.10) | ((-+/%#) i.10)
To dissect further, (+/%#) i.10 is 4.5 because +/i.10 is 45, #i.10 is 10, and 45%10 is 4.5
 
I guess I thought that <string of symbols>x would evaluate to the same thing as <identifier>x if I define <identifier>=:<string of symbols>
 
I guessed so because it's generally true for K :)
 
How do I change my definition of mad so that mad i.10 returns a scalar just like my original expression did?
 
There are several options.
You can use Atop composition like (+/%#)@:|@:(-+/%#)
 
That works! Cool.
 
3:32 AM
or "capped fork" for monadic application like [:(+/%#)[:|(-+/%#)
 
Neat.
 
Also if you have access to latest version of J, you can also use direct definition of {{(+/%#)|(-+/%#)y}}
Unlike K, y is always the right argument, and x is always the left argument, so a monadic direct definition uses y, not x
 
Makes sense. Thank you.
I think I like that last one the best.
 
Yeah, J trains get convoluted quickly and hard to keep track of things.
As a bonus, a traditional multiline definition:
mad =: verb define
(+/%#)|(-+/%#)y
)
 
How do I put two statements on one line? e.g. x=: i.10; mad x
I'd use a semicolon in C-like languages.
 
3:43 AM
There's no explicit statement separator in J.
 
I know I can combine them like mad x=:i.10
Interesting. Ok.
 
Inline multiple statements can be chained with [ (with the statements written from right to left)
 
Neat!!
 
4:35 AM
@Adám Thanks for the APL Campfire videos ! Glad to see there is a forthcoming one with Dr Ray Polivka. Will we have also Norman D. Thomson ?
 
 
5 hours later…
9:28 AM
@kimmolinna In each case, what does ⊢2⎕NQ#'GetEnvironment' 'DYALOG_NETCORE' give?
 
9:39 AM
Better with a thinner font, no?
 
RGS
Yeah I like these 2 better
 
@Adám It didn't give anything. I had to set up DOTNET_ROOT. I had done it in .bashrc but now I did it in /etc/profile.d. I was able to start Ride with Environmental variable.
 
@kimmolinna Ah, OK, so it is working now?
 
:58659262 According to documentation it should always be 1 in Linux.
 
Yeah, that's true. I wasn't sure if something else could have set it to 0, maybe due to a previous issue.
 
9:45 AM
@Adám Yes, it's working. Do you know is DOTNET_ROOT required by Dyalog or .NetCore?
 
10:07 AM
@Adám they look nice, maybe putting a solid background behind the letters would help
 
@Razetime You mean between them and the cube?
@Razetime We have an internal meeting later today about cataloguing materials. Do you want to send me an email with your estimate of how much you envision being able to work on this? (I assume you'll be happy with an hourly pay like for the last one you did, but if not, and also if you have other ideas for payment than per hour, include that in the email.)
 
 
1 hour later…
11:32 AM
@Adám yes
 
I kind of like how the edges are visible. Otherwise there's so little left to indicate the 3Dness. I could of course put an apple in there…
@Razetime Something like imgur.com/a/c7mOsy8?
 
@Adám i like the transparent apple
might work even better with a hexagon
@Adám Sure, I'll send a mail. How quickly is it required?
 
11:51 AM
@Razetime Can you do it within an hour?
@Razetime Like this?
 
@Adám sure
 
 
YES
 
Isn't the green too dull?
 
it can be slightly brighter, sure
 
11:56 AM
Not solid?
I wonder if it would be possible to make a cut-out at the top of the green cube to make it a stylised angular apple.
@Razetime Opinion? ^
 
interesting?
 
Hm, but now I kind of want to get rid of the grey, and simply go with a cube that has a cut-out to make it appley.
 
why not add a triangle on top to make it "fill" the hexagon shape
 
Ooh.
Only downside is that then the leaf isn't a .
Maybe better to stretch the leaf to be flat on top.
This isn't bad:
 
12:22 PM
i just like the symmetry
whatever works
 
@Razetime What symmetry are you talking about?
 
Any way to make the L similarly rounded?
 
like, having the full hexagon
 
I like the first one of these two better. The one with a kite-shaped leaf, even though you lose the ∇
 
@AviFS Uh, not while making it -like.
@AviFS "First" meaning?
 
12:24 PM
just lightly round the corner
 
@Razetime +←1
 
@Razetime Rounded glyphs are much better. Thank you!
And reminiscent of APL385 Unicode.
 
@Adám was about to say this
 
12:43 PM
@Razetime Got it.
 
 
2 hours later…
Cool.
 
nice post
 
Thanks for letting me blog :)
 
@Adám i was waiting for this to turn up
 
 
1 hour later…
3:46 PM
Those last two APL logos look great.
I like the apple symbolism as well as the cube representing an n-dimensional vector.
 
@jordancurve Thanks, but is it clear enough that the cube is a stylised apple?
 
Yes.
I also like the upside-down triangle symbol which I think is an APL character.
 
It is indeed
 
It looks like a green apple.
I love it.
 
Hey there APLers
 
4:00 PM
hello!
 
Is that the right way to say that? "APLers" ?
 
yep that's right
are you new to APL?
 
I have been interested for a while
but I never got past the whole unicode thing, ended up playing with J instead to get concepts
 
nice to know.
 
@Fresheyeball Was it the glyphs themselves that bothered you, font support, keyboarding…?
 
4:15 PM
I couldn't get the keyboard to work
 
@Fresheyeball Did you look at apl.wiki/Typing_glyphs?
 
 
1 hour later…
5:27 PM
@Adám Shouldn't the ⍴ be lowered, so it looks like ⍝⍴L?
Speaking of glyph input, I really like the way the Web version of BQN handles it. It's very smooth, and tryapl should do the same.
The JS version of Kap needs to do the same. I just wish I didn't hate web programming so much or I'd do it myself.
 
5:40 PM
@EliasMårtenson Can you explain in words what the web version of BQN does?
 
I don't think the BQN version does anything differently from tryAPL (besides `\)
 
@EliasMårtenson No, because 1) in principle, the symbols are "operators", so they should be centred on the line like + and ×` and 2) they mainly stand for the letters APL, not for ⍝⍴⌊
@dzaima In fact, the code looks strangely familiar…
@EliasMårtenson The BQN input is probably really awkward on many European layouts. E.g. on a Danish and Belgian layouts, \ is AltGr+key-between-Z-and-left-shift. On a French, is is AltGr+8. German and Finnish, AltGr+key-to-the-right-of-0 (Finnish also has AltGr+second-key-to-the-left-of-right-shift). Etc.
 
@Adám I did, but I could not get it to work with NixOS, maybe it will now
I am also just interested in people who work in divergent tech stacks, APL is pretty unusual as a language, and so I am curious in general about the people who do it professionally
 
@Fresheyeball Oh, I see.
@Fresheyeball While not the people per se, this might interest you.
@Fresheyeball Did you try installing RIDE?
 
5:57 PM
That is interesting
@Adám what are typical motivations for choosing APL?
 
@Fresheyeball A main one is allowing the domain or subject matter expert to implement algorithms instead of having to explain to a programmer (or even an IT team!).
 
@Adám that's interesting. What subject matter experts tend to also be skilled at APL?
I would think that since APL is so specialized and esoteric, that most subject matter experts would not overlap
 
Not so many these days, but learning APL is a rather quick affair, compared to learning a subject matter.
To many, writing APL doesn't feel like "programming" at all.
@Fresheyeball I liked this answer too.
 
@Adám "it defines edge cases correctly" ¨
(sorry, just had to)
 
@Adám I know you get paid to say this, but come on. This might have been true in the 70s but it's not true any more
 
6:07 PM
@dzaima Well, there, your problem is exactly that it defines edge cases correctly.
 
@Adám well, "correctly" depends on the subject matter
and in the context of mutating code, ¨ is just flat out horrible
 
@rak1507 It most certainly is. Do you have any insight into actual real world companies? They do have this problem of communicating between experts and programmers.
 
@Adám Actual companies? No, but github.com/interregna/arraylanguage-companies hardly looks promising. And I doubt there is basically anything easier to do in APL than a language like python where you can install a module that someone's already written that probably does what you want
 
@Adám the following example of java vs APL isn't nice either, given that the Java one does a lot more than the APL one - reading a file, proper error handling, not executing user input
 
@rak1507 That list is far from complete. I've only contributed companies I could find without insider info. True that APL's advantage is being eroded by off-the-shelf libraries and applications, but e.g. for what SimCorp does, you can't just use a Python library.
 
6:14 PM
@dzaima (this is a simple example of Java that does the same thing, but instead taking arguments and returning them. Of course, not as short as APL, but also not a whole 25 lines)
 
@Adám If simcorp started from scratch today would they really use APL?
 
@rak1507 I think there was a period where the answer was "definitely not", but I am not so sure now.
But hey, I was just answering "what are typical motivations for choosing APL?" not "are people's typical motivations for choosing APL, justified?" which isn't really for me to say.
(And no, not because of being biased.)
 
@Adám What are typical motivations for choosing APL in 2021, not in 1971
(fwiw, my answer to that would be that it's fun, different to all other languages, introduces you to a new way of thinking about some problems)
 
@dzaima (for what it's worth, I think there's still quite a bit of value in array languages. It's just that way too many arguments for it are outdated, or bad to the point of looking as they were made in bad faith)
 
@rak1507 @dzaima Maybe we should add a modern "Why APL?" page to APL Wiki?
 
6:33 PM
@Adám Two minor differences from TryAPL I found. If there's a selection, then the BQN version deletes it when typing a glyph, like any other character entry. Also, prefix-backspace leaves you in prefix mode in TryAPL. I thought we fixed this at some point when reviewing the APL competition, but in any case BQN doesn't have that problem.
 
@Adám sounds like a good idea
 
@Marshall Thanks for mentioning those two. I'll log them as issues.
@rak1507 Go ahead and create the page. I'm thinking we can rename the front page section "Running APL" to "Using APL" and add "Why use APL?" as a bod link at the bottom ― if the page turns out well.
 
6:55 PM
@Adám so I installed dyalog and ride
how do I get started? Ride says it's a remote IDE, but doesn't show what we are connecting to
oh ok
if dyalog is running ride just starts doing stuff
 
:-)
@Fresheyeball So it is all working now, including keyboarding?
 
I don't know if keyboard is working
trying that now
 
Simple test: Does backtick followed by p produce * ?
 
I have "grp:switch" but totally forget how to use it
yes, backtick followed by p produced *
 
With RIDE, you don't have to use a shifting key at all. (Backtick isn't used for anything in APL.)
 
7:03 PM
very cool!
 
7:35 PM
@user4808141 Hi aardwolf, the offer to give you write access (access@apl.chat) still stands.
 
7:47 PM
@hyper-neutrino Can you give ^ access?
 
@Adám yep, done
 
@user4808141 You should have access now. Your user name will update after you've chatted for a bit.
@hyper-neutrino Thanks,
 
8:21 PM
hello apl.chat! Some J-related work that might be of interest to the folks here: monument.ai/m/parallel . This is composable multi-threaded concurrency in J.
would love to hear thoughts on architecture and structure
 
I saw this on twitter (iirc) before, looks very interesting
 
cool. happy to answer questions on it. it does what it says on the label. I understand APL has this, and Kx has something like this, but not sure
 
@user4808141 I'm in a podcast that is being recorded tomorrow, and our special guest is Henry Rich. He was (is?) involved in that project. Any specific questions you'd like me to ask?
@user4808141 Are you involved in it as well?
@user4808141 Dyalog APL has reserved the glyph for what looks much like Monument J's .. but it hasn't been tied to the glyph yet, instead being represented as the magic cover II
 
I have been involved in that. I don't have specific questions.
from what I understand, Dyalog APL has futures and isolates, as well as some multi-threaded primitives. What is a magic cover?
is this stuff useful? Anything learned from using it?
 
@aardwolf It is just an imported name instead of a built-in glyph.
@aardwolf I think the most important lesson has been that for anything but pure number crunching where elements do not depend on each other, it is really hard to get a large benefit from parallelisation ;-)
For most arithmetic tasks, run time is bound by memory throughput.
 
8:34 PM
I'm curious about what's the overhead to scalar code from having everything supporting multiple threads
 
If I recall, overhead was ~ 12 atomic operations.
 
for what?
 
I think we tested on an i5. If you want to gain from parallel relative to single-thread (overcoming the cost of communication and moving data), you're going to want to complete > 12 atomic operations on the additional threads.
 
are there any benchmarks comparing this to regular j + other languages?
 
"moving data" what data needs to be moved if memory is shared?
 
8:43 PM
No methodical benchmarking has been attempted, just the stuff on the post and direct applications. The speedup over regular J is almost linear for parallelisable, compute-intensive computation. Data must move between caches. If it is already in L2 cache it must move to another L2 cache.
 
(did a test of marking object reference count with _Atomic in CBQN, my BQN impl in C, and that alone made the self-hosted compiler 13% slower on compiling all tests (each compiled individually, leading to small arrays being used in it, so high interpreter overhead))
 
@aardwolf FYI Jx is also the name of the BEST Foundation's extended version of J. Very confusing.
 
ah, very interesting. Never heard of that.
 
9:31 PM
@aardwolf Is it based on a fork of the J source code?
 
yes, it is
 
9:56 PM
@Marshall Do you have any naming suggestions?
 
Thanks for the C compiler @rak
@rak1507
 
they made me do it
don't judge me
 
@aardwolf How about something original like J+ or J++ or J* or J.. or J: or JJ…
 
Jp seems more appropriate for something focused on parallelism and performance.
 
I like J:
 
10:07 PM
Can anyone help out an @rak1507 in need?
 
"Monument J" is probably the clearest really. Giving it a new name makes it sound like a different language rather than a modified implementation.
 
@Joseph stop publicly shaming me
 
@Marshall Hence why an inflection is in order ;-)
@Joseph Hit Ctrl+Pause (Break) or choose Action>Interrupt.
 
There you go @rak1507 ^ ;)
 
10:10 PM
thanks (how do I do :For and stuff in multi line input mode though?)
 
I thought you said you were an APL expert @rak1507
 
@Joseph :(
 
Sorry for interrupting..
 
@rak1507 The syntax is :For i :in ⍳10
 
ah
thanks
 
10:23 PM
@Adám J++ is actually here: github.com/Pascal-J/jpp
Monument J is probably the most obvious and clear.
 
So there are now 3 incompatible J extensions?
 
"forks" for Monument J and BEST J rather than extensions. Jpp above is simply a J user codebase.
I don't know if Jpp has been maintained. I believe the goal there was to add reader macros to J.
 
10:43 PM
Does Dyalog APL have any way to display images inline (similar to numpy when using Jupyter notebook with Python)?
Seems like APL would be well suited for image manipulation type things
 
@Joseph Works similarly when using with Jupyter.
]html expression should work.
 
It can diplay images inline?
oh
didn't see second message.. oops
 
In the REPL, that instead pops up a window.
 
ah right!
And could you load a JPG/PNG?
 
Well, an <img> tag would.
 
No, that is a Windows GUI thing.
 
oh
Doesn't matter, was just wondering about things in general.. :)
 
Hm, in 18.1 I've extended ]html so it can take a URL, but it should of course be able to take a local file too. I'll add that. Thanks!
 

« first day (1636 days earlier)      last day (1019 days later) »