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?
@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
@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.
@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.)
@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 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!).
@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.
@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)
@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.
@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)
@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.
@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.
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
@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
@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.
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.
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))