« first day (1471 days earlier)      last day (1480 days later) » 
00:00 - 18:0018:00 - 00:00

18:10
@Adám i think i somehow broke isolates
      {+/<⌿≢¨↑⍵∘{({⍵,⊂(2×big⊃¯1↑⍵)+big⊃¯2↑⍵}⍣⍺)1 ⍵}¨2 3} 1000
153
      {+/<⌿≢¨↑⍵∘{({⍵,⊂(2×big⊃¯1↑⍵)+big⊃¯2↑⍵}⍣⍺)1 ⍵}IÏ 2 3} 1000
FUTURE ERROR: 6: VALUE ERROR:       f←(1000∘({({⍵,⊂(2×big⊃¯1↑⍵)+big⊃¯2↑⍵}⍣⍺)1 ⍵}
)): iEvaluate[13] (,⍕(⍕rc),': ',(0⊃res),{(⍵∨.≠' ')/': ',⍵}1⊃res,'' '')iSpace.qsi
gnal rc
      {+/<⌿≢¨↑⍵∘{({⍵,⊂(2×big⊃¯1↑⍵)+big⊃¯2↑⍵}⍣⍺)1 ⍵}IÏ 2 3}1000
             ∧
i can't make any sense out of this error message
18:21
it seems like it's the fault of big
unfortunately, the error message isn't helpful.
edit: problem solved, i just had to _←'big'⎕cy'dfns'⋄ inside the dfn
  {_←'big'⎕cy'dfns'⋄(?⍵)+big(?⍵)}¨⍳1000 → 2.6E0  |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
* {(?⍵)+big(?⍵)}¨⍳1000                  → 1.3E¯1 | -96% ⎕⎕

      ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
importing things is horribly slow, though
18:38
yay for native bigints (yes that's 180x faster)
@KamilaSzewczyk You'd want to only import once, not 1000 times.
@dzaima not really surprising it's that much faster considering it's native
@Adám it doesn't work when i import it outside of the foreached scope.
⊢⌽⍤0 1⍨⍥⌽∘(⌽∘-⊥⍨⍤1)0=⌽ @xpqz up for another dfnification?
(monadic)
isn't dzaima/APL written in java
ah you meant native to the language
no native bigums in dyalog :c
18:50
{⍵⊣a←{}}1 how come this is a syntax error?
what is the expected behavior of that
same as {⍵⊣a←123}1
I can't see why the two would be different
oh ofc nvm ⊣ can't take a function as an argument
19:04
@KamilaSzewczyk what was your solution to 55?
I didn't solve 55 yet
Ah ok
@rak1507 Perhaps those words were a little bold, but this is a reference to several recent conversations with prospects with no history of using APL.
@rak1507 I do acknowledge the risk of confirmation bias.
@MortenKromberg Can you help @KamilaSzewczyk With that isolates' issue?
Interesting, it surprises me a bit (in a good way!) that new people are making things with APL, I thought 99% of commercial use was legacy code from decades ago
19:13
@rak1507 So far mostly small experiments. But on the other hand, the average time from someone starts using APL until Dyalog makes real money from support contracts or other licenses is 15-20 years. One might expect the cycle times to be shorter these days, we shall see.
What do you mean by 'real money'?
@rak1507 Our real competition, at least according to our own analysis, is not other array languages. It is Python, R, Matlab and other engineering workbenches. Even Excel.
Are python (in the form of numpy), R and matlab not array languages?
@rak1507 as always, it depends on who you ask
@rak1507 "Real money" is a fuzzy term, not sure how to make that a real number. perhaps a useful concept would be "increase our revenue by more than 1%"?
19:16
Right makes sense
<klg> 0=11○money
@KamilaSzewczyk It's a little while since I looked at isolates, but a "FUTURE ERROR" is a general exception which covers the fact that a future that you were waiting to materialise is not going to arrive. Taking a closer look at your expression to see if I can guess at why you got that VALUE ERROR.
why did it work with big imported inside then?
OK, big is a function from dfns, starting to get the picture now.
If you have functions that you are going to use all the time in your isolates, it is a good idea to launch the isolates from a different workspace than the bare isolate workspace.
If you were to )SAVE a workspace that contained the isolates workspace plus any code that you want to refer to, you can set
isolate.Config 'workspace' 'yourws'
This would give you isolates with the additional code (and perhaps data) pre-loaded.
oh, i see
19:26
Applications that have a lot of state often use pre-allocated isolates rather than using the operators that create new isolates on each call. That way you can manage the state of each isolate "namespace" directly. Have you read the user guide?
i wrote a "load balancer": spr←{x←⌊/⍵ ⋄ y←⌈/⍵ ⋄ v←({⍵,⊂(1+2⊃l),d+2⊃l←⊃¯1↑⍵}⍣(⍺-1))⊂x(1-⍨x+d←⌈⍺÷⍨y-x) ⋄ (2⊃⊃⌽v)←y ⋄ v}
it splits a range into multiple parts, which i want to use later with iota and parallel map
@MortenKromberg yeah, I read it, Adam linked it a few days ago
Recent isolate workspace also include a ll namespace containing ll.Each and ll.EachX, which reuse pre-conditioned isolates rather than creating them on the fly.
@rak1507 R and Matlab are "array languages", but it is not their array languages that makes them competitive against APL (everyone seems to agree the languages are pretty awful), it is the huge libraries of solutions, workbenches, statistical packages, etc that make many engineers pick them over APL.
Everyone seems to agree that R is awful? Really? Never used it myself but I thought it was quite popular for statistics etc
@rak1507 R is very popular for statistics. My point is it is not the R "array language" that makes it popular, it is the vast collection of excellent statistical libraries.
Right yeah, that's not a surprise, definitely the same for python too, unfortunately hands down better than APL for basically any task not solved trivially in APL
19:32
@rak1507 to some extent the same is true for Python, one of its main competitive strengths today is the availability of libraries.
A lot of the stuff that people use in R (and maybe also Python) is actually written in C, I think
Yeah exactly
You basically have to write no actual python, it's just a 'glue' for gluing together various packages written in faster languages
But they have reached critical mass, which we remain some distance away from in APL. However, when I look at what we need to do to make Dyalog APL more competicive, it is tooling, tooling and more tooling, a package manager, documentation and training materials that we need. A more powerful or slightly more consistent array language doesn't appear very high up on the todo list.
Agreed
As an APL language geek at heart, I would be very happy to see someone start to compete successfully against us on the basis of a cleaner, better array notation.
@rak1507 Wrt numpy, I once had lunch with Jim Hugunin in Seattle, back when he was a Microsoft employee working on "IronPython". He told me that numpy was "APL done right" :-).
I'm not sure I'd agree there! Most of the time I use numpy I end up thinking 'this would be so much nicer in APL...'
ngn
ngn
19:40
@MortenKromberg that has already happened :)
Depends what he means by 'done right', better in terms of the array language, or in terms of the ease of use in a real program, because there it definitely wins.
@ngn Is K popular because of the notation or because of the speed?
ngn
ngn
@rak1507 both
@ngn if it is K you are referring to, I think it is hard to argue that it is a cleaner, better array notation. And anyway, the owners have decided it doesn't exist any more ;-)
Well, they replaced a bunch of stuff with real words in Q and haven't lost any customers from it, so I'd argue that it's the speed + other factors that's important, not the array notation
@ngn Arthur worked on high frequency trading in APL for many years. He got tired of waiting for the people at I.P.Sharp to do what he needed to be even faster, and started with A+ and then k, which I think of as a DSL for timeseries with a high performance database built in. So again, I would claim that it is the "specialised tool" aspect of K that has allowed it to compete against APL rather than the array notation.
@ngn Don't get me wrong: I have HUGE respect for what Arthur has done and there are also some very, very nice language features in k
ngn
ngn
19:46
@MortenKromberg "specialised tool" - in one of his (few) interviews he said he wanted to make a general-purpose language
@user935886 @user14720249 Hi Sidharth Kulkarni and gbarboza. If you want to participate here, please email [email protected]
@ngn he also wanted to do that, but I think it is pretty clear from some of the compromises made that he had some very clear priorities
isolates are awesome
@kamil I am very please to hear you think so. They do take a bit of getting used to and I am sure the documentation could be improved.
19:49
@itdoesntwork Yes?
oops, hit enter too early, I'm Sidharth, just was on the wrong acct
Oh, welcome then. Interested in APL?
yeah, I've spent a lot of effort trying to get J to work on my ARM-based calculator (TI-Nspire)
ngn
ngn
@rak1507 other factors like fixing old bugs :) but the notation is superior too, wouldn't you agree?
is that known to be possible? (not specifically J, any of thes languages would be cool to have on that thing)
19:51
@ngn No, in general I'd say I prefer APL, but there are certainly some really nice features like the unification of function application and indexing
the biggest issue I had with J was that the compiler toolchain for the calculator didn't support dynamic linking, and was also missing some floating point headers
@ngn Did he ever define "general purpose language"?
ngn
ngn
@rak1507 i'm familiar with both, and i think it's very clear which is the better language (once you learn it, of course). i would like to know why you prefer apl?
@ngn I don't like all the overloading, I find digrams hard to parse visually especially in complicated expressions, I think the APL symbols are nice
ngn
ngn
@rak1507 digraphs? did you mean J then?
19:54
I mean like each left/each right
Is that not the right term?
@itdoesntwork That's very special hardware. Afaik, it isn't intended for general purpose computing other than TI's custom stuff.
ngn
ngn
@rak1507 ok..
@Adám yep, so my question basically boils down to: is there a highly portable, self-contained implementation of an APL-family language that doesn't use any dynamic linking? If that exists, I'm pretty confident I could convince the compiler to build it for the calculator (github.com/ndless-nspire/Ndless)
@ngn How about your K for this ^
19:57
@ngn I'm interested in what you think is so much better about K's notation, to me there's really not that much in it
can K be parsed context-free?
ngn
ngn
@Adám no idea what it is, i'll read later
@KamilaSzewczyk "can K be parsed?" - you could have stopped there :)
ngn
ngn
unlike apl, it can
unexpected
19:59
@HaoDeng Welcome. Interested in APL?
That's one advantage I forgot about I suppose, but it's more of an advantage from an implementation point of view rather than a using point of view
@rak1507 And the (huge, imo) downside is that you lose infix user-defined functions.
yes, @Adám. I'm actually a professional kdb developer that learned APL in 2000. Though never have chance to practice.
(Also, so many people! 3 rows!)
@HaoDeng Oh cool. Well then you've come to the right place. Anything we can assist you with in (re-)exploring APL?
ngn
ngn
20:02
@rak1507 i've been trolling this chat room for ages, pointing out the advantages. i'm tired of repeating.
looking at git.sr.ht/~ngn/k/tree, this looks very promising for cross-compilation since it has a wasm target, will definitely give it a try
@Adám Thanks, not much. Just hang on here. I guess it appropriate to promote my little side project here. github.com/co-dh/chess/blob/master/chess.md
@ngn Fair enough :)
@HaoDeng Something you might like to explore is apl.wiki
20:26
can I create custom 's?
cmc: given a character vector 'aabbcaaddd' return 1 1 2 2 3 4 4 5 5 5
@KamilaSzewczyk No, but usually taking an operand or a global state is enough.
@rak1507 +\1,2≠/⊢
@KamilaSzewczyk What do you actually want to do?
i thought i can somehow use variant to avoid having to take arguments in a wacky form
20:29
@CaseyRodarmor @agarttha Welcome. Interested in APL?
@KamilaSzewczyk Maybe consider taking a namespace with name-value pairs?
hmm, this could work
All really does is to side-load a bunch of name-value pairs.
20:43
Loads of people joining tonight, do you think it's from the dyalog article or something else?
@rak1507 That article is also on the front page of Hacker News.
That'll be it
@MarkO @semperos @iwilare @jhaavist Welcome to. Coming in from Hacker News?
"I feel like APL would really benefit from a shadertoy-like site" - I've thought numerous times about trying to get dzaima/APL/BQN to run in JS. Most recently I looked at TeaVM, but from what i can tell it absolutely requires maven which is just stupid
ngn/APL?
20:53
@rak1507 it's been quite abandoned, and I would prefer to have graphics implemented with namespaces or equivalent
@Adám thanks, and yes, from HN!
@dzaima fair enough I suppose
@user710850 @user5270761 Hi boundlessMath Navidfr, if you want to participate here, you can email [email protected]
@dzaima Uh oh, you're not suggesting adding mutable objects to ngn/apl, are you‽
With all these visitors I feel like an animal in a zoo
@Adám I'm not, and as such I'm also not making a graphical interface for it
20:55
@jhaavist Cool. The author of the article just went to bed, but he was here earlier. Can I interest you in anything regarding APL?
@rak1507 You should be honoured. The APL elite at IPSA used to be called "the zoo" :-)
@Adám Has there been much work on GPGPU front of APL? I have a paper that I am preparing in which I run APL on Vulkan for ML inference. Do you happen to know any related work beyond Hsus PhD thesis?
@rak1507 We passed 150e3 total messages today, wonder if we'll pass 250 total users too.
@Adám How many is it on at the moment?
@rak1507 249 :)
20:59
Well looks like it then
ngn
ngn
@rak1507 it doesn't exist anymore
well, it does
Just because you've deleted it doesn't mean it doesn't exist
@Adám ngn/apl has closures, so you can probably squeeze mutable data out of it somehow. Difficult with the static syntax though. But it does let you run native JS, and you can definitely work with objects through that.
ngn
ngn
@rak1507 abrudz/ngn-apl does :)
Same thing in my eyes
21:02
@jhaavist There's tail2futhark
@dzaima It has been on 249 for a while, though new people have written for the first time. I wonder if there's a minimum amount of activity required (like what makes generic avatars and userNNNNN names go away), or if the counter isn't continuously updated.
ngn
ngn
@Adám graphics ≢mutability
@jhaavist The thing about APL on the GPU is that (as I'm sure you know) it's very difficult to run a full APL with nested arrays and everything on the GPU, so APL programmers wouldn't usually be interested in working with a GPU-native language. APL on CPUs is fast enough for most use cases as well.
@Adám Thanks! The intermediate typing is quite interesting as well...
@dzaima Yup, it just jumped to 250 now. Time to mention it on APL Wiki.
@Marshall ... for the reasons laid on this reply. I have been thinking about lightweight typing of APL programs for GPU execution. And my project was more about having an APL runtime on GPUs. Basically, you give an APL source code and parameters and it runs on the GPU.
ngn
ngn
21:10
@jhaavist transfering data to/from the gpu is too expensive
@jhaavist You'd certainly have people interested in such a project, I just don't think there would be much overlap with current APL programmers.
@jhaavist Wouldn't it be very difficult to write a full interpreter that runs natively on a GPU?
I havent dealt with nested arrays though, since my work has been on scalars, vectors and matrices for now. But, I would imagine that with some lightweight typing you could maybe infer subprograms which you could run as independent parts.
@ngn I disagree, I am getting comparable execution times on numpy and Vulkan for workloads which take around 500ms.
ngn
ngn
@jhaavist large arrays? the avg array size is between 1 and 2 :)
in RealWorld(TM) code
1.5 byte arrays are the best.
21:13
@jhaavist Sometimes. What happens when the user calls Each to do computations on a hundred arrays and most are tiny but a few have millions of elements? Only known at runtime, of course.
@ngn doesn't quite work when you don't have nested arrays though
@ngn Yeah, I am bit biased here, I haven't tried super big datasets. My test run is 270M values.
More precisely, 150 of 6000x300 matrices.
Basically, barring a huge advancement in GPU compilers, the kind of programs an APLer (even a good one) naturally writes and the kind that run well in a GPU-native language are very different. But of course there are many fields where getting it on the GPU is very important and programmers are willing to change to a flat array style for it.
@Adám Full interpreter is hard yes because GPU side needs some typing to work out parallelism unless you want to copy data back to CPU on each step.
@jhaavist That's why I think Hsu's work is promising. It lets you compile specific parts of your APL code, so you can work on making performance-critical parts well-fitting for the GPU, leaving general stuff to the CPU.
21:21
That said, I wrote BQN's compiler in a flat array style. It's a much larger codebase than Co-dfns since only a small part of Co-dfns is designed to be run on the GPU. It still uses nested arrays occasionally: for example there's a fixed length-4 array for IDs of identifiers and numeric, string, and character literals to avoid repeating code.
@Marshall Good points, in the Each case you would most certainly end up waiting a lot of time. I think that in general, the question of whether you write an each loop on GPU code or whether you just submit N jobs instead is an application-specific thing.
@Marshall (Discussion of BQN versus Co-dfns compilers)
(and this is where it indeed deviates from traditional APL coding, since you have the concept of job queue and know how to use it)
22:23
yay got TeaVM to execute 2+2 in dzaima/BQN in JS/Chromium. Funnily enough, the only actual runtime issue after it compiled (removing •sh, file reading & similar) was in formatting the 4 to a string, the literal last step :D
@dzaima performance: +´↕10000000 executes in 160ms (regular jvm does it in 30ms and Dyalog takes 7.5ms for +/⍳10000000)
@dzaima How's the startup time? JVM is so slow for running scripts...
I mean, it's not terrible!
@rak1507 No, terrible's this way.
Haha
@Marshall I'd estimate <.2s for 2+2 from a page refresh
22:38
@dzaima Well, that's better. If it's easy to get it working on Node, I would try it out.
@Marshall why node? if you're running outside a browser, just use java
there's GraalVM nativeimage if you want faster startup time (it's a max of 2x slower than regular jvm, and has <10ms startup time (on a way simpler thing than BQN but still))
@dzaima Okay, I'll try that out.
with this, it appears to take 100-150ms
@dzaima which is like what i get with the regular jvm too (excluding the first run, presumably caching files from the hard drive, but node of course also has that overhead)
@Marshall executing an empty file with node is 350ms, which is already worse than java
@dzaima JDK is faster than I remembered. I was thinking like 1s, but it's about 0.3 to either run a small dzaima/BQN file or docs/bqn.js with no arguments.
Okay, I think I set up Java to use GraalVM, but now it's 0.6s!
@Marshall graalvm alone isn't enough, you need to compile with nativeimage to actually get an AOT-compiled thing (i'll see if i have any leftovers of commands i used to build dzaima/BQN with it)
iirc you needed to pass some flag so it wouldn't all fall back to a regular jvm because JComp exists (which also means that •compstart←¯1 is necessary, but you get your 99% faster startup time so)
ah, there we go: native-image --report-unsupported-elements-at-runtime -jar BQN.jar
23:02
@dzaima Compiling...
Ooh, that's fast.
it is
Probably deserves a section in the readme since those options are far from obvious.
Also it overwrites BQN, which it shouldn't.
By the way, to anyone coming from HN, you're free to ask questions about the forum or APL whenever. You're not interrupting anything.
@Marshall just adding another argument appears to make it the name of the output file
for it to be readme-worthy, I'd like to have it automatically do the equivalent of •compstart←¯1 since otherwise it's quite unfriendly
@dzaima Fair enough. Seems like it should be noted somewhere though.
./gendocs is way faster, down from over 5 seconds to 1.8.
huh
23:16
One of my music synthesis scripts was slower though (7.5 versus 5.7 seconds). Kind of the opposite of what I'd expect, since gendocs is a lot more interpretive and I'd think that's where the JVM transpiler is best.
@Marshall not sure why gendocs is faster, but slowdown on array-y things is expected (and also what i observed)
@KamilaSzewczyk Protip for PE: When something overflows, try (⎕FR⎕PP)←1287 34
@dzaima Oh, most of the time for the sound scripts is going to be filters, which use scalar code (I need to specialize that code for common lengths like I did in C).
@dzaima System.getProperty("org.graalvm.nativeimage.kind", "-").equals("executable") appears to be a sufficient test
My results are consistent with nativeimage being faster on array-like stuff and JVM being faster for interpretation.
23:37
pushed a note about native image. (also finally renamed the base package to BQN, long overdue..)
./gendocs on the JVM gets faster with •compstart↩¯1, so I guess the amount of code being run is slowing it down some.
@Marshall huh, adding •compstart↩¯1 makes it slower for me (3s→4s)
native image is still ahead at 1.3s, which is fun
i'll do more with TeaVM tomorrow i guess
00:00 - 18:0018:00 - 00:00

« first day (1471 days earlier)      last day (1480 days later) »