2022-04-16 11:40:25 KipIngram, did you show him the game of life in apl? 2022-04-16 11:40:56 No, but I did show him the Lisp running on CGoL. 2022-04-16 11:41:13 I haven't seen an APL CGoL - did that get linked here and I missed it? 2022-04-16 11:41:33 there's a few 2022-04-16 11:41:38 all one liners 2022-04-16 11:41:56 apl.wiki/wiki/Stencil 2022-04-16 11:42:00 should have one 2022-04-16 11:43:31 another thing is how fast APL is even though it's interpreter 2022-04-16 11:43:57 when there's so little to interpret the percentage of time spent interpreting vs calculating drops to almost nothing 2022-04-16 11:44:18 apl has to spend time parsing 2022-04-16 11:44:24 means dfns are quite slow 2022-04-16 11:46:00 I also saw a mention in the last day or two that APL is well-structured to take advantages of the vector processing capabilities the processor has. 2022-04-16 11:46:08 I've never used those - it's on my list of things to learn. 2022-04-16 11:46:18 Read a couple of things on it a day or two ago. 2022-04-16 11:46:53 eris: that Stencil link is out of date or something. 2022-04-16 11:47:11 I found it, though. 2022-04-16 11:47:21 https://aplwiki.com/wiki/Stencil 2022-04-16 11:47:26 Oh, you left out the .com. 2022-04-16 11:52:43 So, the CGoL imp on that page doesn't immediately want to work on my Dyalog install. 2022-04-16 11:54:02 Oh, the implementation is K, not straight APL. I'm not good enough to convert yet. 2022-04-16 12:00:16 Found this: 2022-04-16 12:00:18 https://www.youtube.com/watch?v=a9xAKttWgP4 2022-04-16 12:00:41 Not APL but Futhark is quite interesting, especially if you're into GPGPU.. https://futhark-lang.org/ 2022-04-16 12:01:25 Oh, I am interestedin GPU coding. That's also on the list. 2022-04-16 12:12:10 There a FORTH that targets the GPU? 2022-04-16 12:19:25 I'm not aware of one. 2022-04-16 12:19:40 But that seems like an obvious thing to eventually tackle. 2022-04-16 12:20:21 My reading on the SSE and AVX instructions gave me the impression that they pay off the best when you have a calculation you need to do a large number of times, like on all of the data in an image or something like that. 2022-04-16 12:20:33 It's not clear to me that you gain much on "one shot" calculations. 2022-04-16 12:21:01 And how you lay out your data in RAM seems critically important. 2022-04-16 12:24:04 It also adds a TON of state that needs to be saved on context switches. 2022-04-16 12:29:34 I think for either that stuff or a GPU interface I'd be tempted to just make the thing a lockable resource so only one process could use it at a time. 2022-04-16 12:29:52 And then not worry those things on context switches. 2022-04-16 12:30:24 It's already a little annoying to me that I've pretty much punted Forth's usual "very inexpensive context switching" by making use of so many registers. 2022-04-16 12:31:21 There used to be 'pusha' and 'popa' instructions, but those fell by the wayside somewhere as the instruction set evolved. 2022-04-16 12:32:12 I wrote macros 'mpush' and 'mpop' in my nasm source, but of course all they do is hide the effort. 2022-04-16 12:32:32 I'm pretty impressed with nasm's macro facilities. 2022-04-16 12:33:07 I was able to *completely* hide all the dirty work of creating Forth's required dictionary structure. 2022-04-16 12:33:57 And also the details of that "address -> offset" relocation stuff. 2022-04-16 12:53:48 I've also found the Chapel language interesting. 2022-04-16 12:54:01 It was developed by Cray and is targeted at massive parallelism. 2022-04-16 12:54:25 It's supposed to be a step beyond "message passing" approaches which expose more of the underlying architecture. 2022-04-16 12:54:43 Supposedly it just "takes care of things" for you; like if a node fails, it just works around it, and so on. 2022-04-16 12:54:47 do you have any links? 2022-04-16 12:55:09 https://chapel-lang.org/ 2022-04-16 12:55:45 Completely different from all of the thoughts I've had about multi-core and thread work in Forth - my kneejerk approach to it involved planning rather carefully what each thread would be doing. 2022-04-16 12:56:06 Which threads would run on which cores, and so on. 2022-04-16 12:56:17 I guess that's like an "assembly language" approach to parallelism. 2022-04-16 12:56:41 That shows up in my preference for structural Verilog over behavioral as well. 2022-04-16 12:56:50 I just gravitate toward "control." 2022-04-16 12:57:38 I'm installing Chapel now. I couldn't get it to use my pre-installed LLVM, but it can be built using a bundled one as well; just takes longer. 2022-04-16 12:58:08 I installed llvm and llvm-devel first though, so I don't know why it's not seeing them. 2022-04-16 12:58:14 Need something on my path, I guess. 2022-04-16 13:00:50 Yeah - it's slowly grinding through the compilation of all the bundled LLVM stuff. 2022-04-16 13:03:40 BTW, I raised the font size one notch in my Dyalog window (just ctrl-+'d it). Much better. 2022-04-16 13:05:43 Chapel looks an awful lot like C, but has some extra "parallel constructs." 2022-04-16 13:08:32 Oh, you know, we were talking last weekend or so about how legacy software has "steered" the evolution of CPUs. I realized last night that virtualization has added yet another layer to that. Early OS's had security needs - the CPU vendors responded by adding "privilege rings." The OS writers said "yippee" and duly ran their OS code in ring 0. Then someone wanted virtualization, so bam - the CPU vendors 2022-04-16 13:08:35 add hypervisor support. 2022-04-16 13:08:41 Move over, old gods - there's a new god in town. 2022-04-16 13:09:02 But this had to be done in a way that let the legacy OS code continue to believe that it was the one true god. 2022-04-16 13:09:45 I can't think of what yet another layer would be, but if someone does think of it, then the CPU guys will probably extend to that too. 2022-04-16 14:33:53 Geez guys, this Chapel build is still just 2/3 finished. Holy cow. 2022-04-16 14:34:11 My fan's singing like an opera star. 2022-04-16 14:34:28 cclplus: 95% CPU. 2022-04-16 14:35:03 (I keep a tiny little box in the bottom left of my console screen that shows me my charge status and my top 5 cpu gobblers.) 2022-04-16 14:35:43 The CPU percentage seems to be "of one core," because sometimes it goes over 100%. 2022-04-16 14:40:21 Oh, this is cute: 2022-04-16 14:40:23 https://www.amazon.com/Quimat-Oscilloscope-BNC-Clip-Assembled-Finished/dp/B07QML4LJL/ref=sr_1_3?crid=WMT8I1TLC4V3&keywords=oscilloscope&qid=1650134352&sprefix=oscilloscope%2Caps%2C98&sr=8-3 2022-04-16 14:40:35 Low performance, but looks damn handy for a lot of things. 2022-04-16 14:40:57 And cheap. 2022-04-16 14:45:56 Hmmm. Several low reviews, all citing "worked great one or two times, then didn't work any more." That's a shame. 2022-04-16 19:24:35 So, I'm trying to figure this futhork thing out. It says you can "easily use it" to create a Python importable module that will use pyopencl to do computations on your GPU. 2022-04-16 19:26:26 I was able to pip3 install pyopencl, but haven't tested it. Online research said that my graphics hardware (Intel CometLake GT2) is supported as of OpenCL 3.0. 2022-04-16 19:26:31 So, fingers crossed on that. 2022-04-16 19:26:55 Now I've got to figure out the futhark pyopencl targeting. 2022-04-16 19:27:26 So, in the futhark tutorial, there's an example of a line that computes the dot product of two vectors, u and v: 2022-04-16 19:27:28 reduce (+) 0 (map2 (*) x y) 2022-04-16 19:27:37 I immediately found myself seeing 2022-04-16 19:27:43 +/ u*v 2022-04-16 19:27:45 there. 2022-04-16 19:27:59 And realized there must be some similarities between futhark and APL. 2022-04-16 19:28:10 futhark is supposed to be related to Haskell. 2022-04-16 19:28:16 Which I don't know at all. 2022-04-16 19:44:29 in apl, dot product is +.× 2022-04-16 19:52:32 f.g is roughly f/a g w 2022-04-16 19:52:49 but thrres some weird corner cases that adam refuses to make clear 2022-04-16 19:56:08 That's one of those "tacit" functions, right? 2022-04-16 19:57:55 its a combinator 2022-04-16 20:00:48 Ok. I was just looking at it's superficial appearance. I was reading about tacit functions last night. 2022-04-16 20:01:24 You say "refuses to make clear" - does he actually duck certain questions? 2022-04-16 20:01:38 no 2022-04-16 20:01:49 im being coy here 2022-04-16 20:02:23 essentially f.g has semantics that are indescribable and not easily replicable 2022-04-16 20:02:51 `f/a g w` isnt accurate in the nested case for instance 2022-04-16 20:02:58 and so on 2022-04-16 20:03:27 it's the semantics of the f/ that simply arent present in f.g 2022-04-16 20:04:14 apl has a lot of stuff that turns out like this 2022-04-16 20:04:31 for instance, f/ has to reduce rank 2022-04-16 20:05:31 but im not sure if this limitation applies in f.g 2022-04-16 20:06:13 Ok, I kinda sorta followed that. I progressed a fair bit for just a couple of days, I think, but a long way to go still. 2022-04-16 20:06:29 basically 2022-04-16 20:06:51 I just thought it was interesting that on a completely different front (futhark / GPU) I ran into an expression that had such a similar look. 2022-04-16 20:06:59 Just used a wordy verbose notation instead of symbols. 2022-04-16 20:07:11 futhark is an array language 2022-04-16 20:07:18 at least, they say it is 2022-04-16 20:07:27 Yes - "pure functional array language," in their words. 2022-04-16 20:07:44 running functional-ish languages on a gpu isnt that strange either :p 2022-04-16 20:07:44 I guess that makes sense for a gpu "harnesser." 2022-04-16 20:07:48 co-dfns 2022-04-16 20:07:57 is an APL for the gpu 2022-04-16 20:08:45 I've always been resistant, historically, to functional languages. I think it's because of my embedded background - I think in terms of poking hardware and things like that. 2022-04-16 20:09:03 But this "tight connection to math" is wildly appealing to another part of my mind. 2022-04-16 20:09:23 So I think I've suddenly become a lot more open-minded. 2022-04-16 20:10:12 thats fair! 2022-04-16 20:10:30 i quite like array languages because they pick abstractions close to the CPU 2022-04-16 20:11:11 and then they dont let you build more abstractions 2022-04-16 20:11:21 Heh heh. 2022-04-16 20:11:26 I like "close to the cpu." 2022-04-16 20:11:30 Feels right. 2022-04-16 20:12:00 a good apl is cache and branch predictor friendly in a way that imperative code simply cannot be 2022-04-16 20:12:30 well 2022-04-16 20:12:38 simply isnt comfortable to write 2022-04-16 20:13:17 And when I was reading about the x86 vector instructions, it was advocating that same general style - stay away from branches that might affect some elements one way and others another way. 2022-04-16 20:13:32 Find a way to "calculate" the choice. 2022-04-16 20:13:56 calculate, dont choose! 2022-04-16 20:13:57 the forth motto 2022-04-16 20:13:58 Which looked like it could often involve doing both of the conditional cases - then use masks to apply one or the other. 2022-04-16 20:14:10 Yes - I noticed that. :-) 2022-04-16 20:14:23 apl sometimes does that 2022-04-16 20:15:00 See, if we'd embraced that idea at the beginning, we wouldn't have NEEDED branch prediction, speculative execution, etc., and all that logic that gets used for it could be doing real work for us instead. 2022-04-16 20:22:00 I've been thinking a lot the last few days about how "legacy" and the marketplace steered us down this particular path, which probably isn't "optimal" in the long run. 2022-04-16 20:22:29 Guess it depends on how you define optimal. 2022-04-16 22:41:40 Ok, I think I've got all the pieces of this futhark / opencl toolchain working except the actual hardware drivers required for my particular GPU. 2022-04-16 23:26:12 I found a site, hardware.org, that had instructions for how to install a package that creates a "probe" of your system. 2022-04-16 23:26:22 It uploads it to their website and gives you back a URL. 2022-04-16 23:26:31 You can then share the id of that probe when you ask questions. 2022-04-16 23:26:48 So I've asked for guidance on getting the right driver installed.