2023-09-12 00:19:57 I just meant that it looks like line breaks are meaningful in APL. Like lines are processed one at a time and are self-contained expressions. 2023-09-12 00:20:21 Forth lines are processed one at a time too, as a matter of mechanics, but how you split your code across lines is more or less irrelevant. 2023-09-12 00:21:31 i only read by lines at the repl, and i'd like to change that 2023-09-12 00:21:55 but for example in a file i can have multiline strings with " 2023-09-12 00:22:32 I tend to put entire definitions on my lines - I keep the defs short. But it's equally possible (and often done) to structure Forth in a way that looks somewhat like C, with indentation and so on. 2023-09-12 00:23:00 I don't care for that style, but I can see how someone mostly familiar with C would gravitate toward it, at least initially. 2023-09-12 03:52:59 ok, this is just about the coolest one I've seen yet: 2023-09-12 03:53:02 https://www.youtube.com/watch?v=rGlpyFHfMgI 2023-09-12 04:17:24 Wow - do the rows of Pascal's triangle trend toward normal distributions? 2023-09-12 04:19:02 Because Pascal's triangle does give the path counts through a Galton Board, and it makes normal distributions. 2023-09-12 04:19:43 I plotted the last row of this: 2023-09-12 04:19:46 https://s3-ap-southeast-1.amazonaws.com/subscriber.images/maths/2016/08/01092351/Pascals_Triangle.png 2023-09-12 04:19:53 and it sure looks "normal-ish." 2023-09-12 04:20:56 meanwhile the Sierpiński triangle tends towards chaotic neutral 2023-09-12 04:22:14 You definitely begin to see why the normal distribution is so pervasive. You can take just about any "underlying" distribution and convolve enough copies of it and it goes to the normal distribution. The normal dist is like the "limit" of everything in the case of large numbers. 2023-09-12 04:44:18 KipIngram: APL is pretty much the same. Lines (or really expressions) are just processed one at a time in order. 2023-09-12 04:44:46 You can split multiple expressions on one like with the ⋄ symbol. They evaluate top to bottom, left to right. 2023-09-12 04:47:10 KipIngram: Ah, yes. Pascal's triange does converge to normal. It's essentially a good example of the Central Limit Theorem. 2023-09-12 04:54:15 Just gotta keep in mind that the underlying distribution is the binomial distribution. 2023-09-12 05:44:27 Astounding... 2023-09-12 05:44:29 https://www.youtube.com/watch?v=Yy7Q8IWNfHM 2023-09-12 05:44:47 Yes, I did know about the diamond char. 2023-09-12 05:45:13 But can you go the other way? 2023-09-12 05:45:27 Can you spread an expression across lines in any sort of arbitrary way? 2023-09-12 05:45:44 Without using ← to hold intermediate results, I mean. 2023-09-12 05:46:21 You could in Forth, I think. You'd just leave the intermediate on the stack. Maybe - I'd have to think about the exact behavior. 2023-09-12 05:46:38 I meant you could in an APL+Forth - you can obviously do it in Forth. 2023-09-12 05:47:11 It doesn't surprise me that Pascal's triangle goes to the normal dist. I just hadn't ever actually thought about it. 2023-09-12 05:53:24 I really like "Aha" moments like that. 2023-09-12 05:53:48 I knew about Galton boards, and that was how the ideas connected for me. 2023-09-12 05:54:30 xelxebar: Do you know about the Ising model? 2023-09-12 05:54:46 It's a low-level model scientists use to study phase transition hysics. 2023-09-12 05:55:06 Given some of the things you've said the last day or two, I suspect you'd like it. 2023-09-12 11:46:20 KipIngram: Ah, yes. The classic example of a second-order phase transition model. Trying to model the Curie temperature transition of ferromagnets is, surprising, still a really active area of research, AFAIU. 2023-09-12 11:46:35 How the heck did you end up there from Galton boards? :P 2023-09-12 11:47:06 Regarding diamond, if I understand you correctly, then no. APL expressions are always executed line-by-line or expression-by-expression. 2023-09-12 11:47:28 I guess I see what you mean about LF having semantics. 2023-09-12 15:55:23 Yes, I didn't mean to "overstate" the line semantic thing - I don't really see it as any kind of "show stopper." Just a small amount of "dissonance" between the two ecosystems. 2023-09-12 15:55:54 I think it will be easy enough to work around - I don't see any reason why APL expressoins couldn't come along and happily manipulate arrays living in the Forth system's data environment. 2023-09-12 15:56:23 It's really just a "toolkit" for doing sophisticated manipulations to sophisticated data structures. 2023-09-12 16:02:05 Apparently there was a big controversy some time back about the "computer aided" proof of the four color theorem. That's the notion that with just four colors you can color in any map such that no two adjacent regions share a color. 2023-09-12 16:02:21 Lot of math guys thought that the computer proof gave no "insight." 2023-09-12 16:02:30 But I think that's picking nits. 2023-09-12 16:02:58 If you just start drawing graph nodes, you can put down one node. Then a second, connected to the first. Then a third connected to the other two. You now have a triangle. 2023-09-12 16:03:33 You can add a fourth node and connect it to all three of the others (no crossed lines allowed), but in order to do so you have to "envelop" one of the first three. 2023-09-12 16:03:44 So you can't then add a fifth and connect it to all of the other four. 2023-09-12 16:04:21 So, I think that's the "insight" right there. It's a little sad that's not a complete proof, but I think the fact that the remainder of the proof gives no insight is just because we already got the insight in those first few steps. 2023-09-12 16:04:56 The fact that that last arc added for the fifth node "encloses" a node - that's the insight right there. 2023-09-12 16:05:27 That whole mountain of stuff they did with the computer was really just "shoring up" that first fundamental insight. 2023-09-12 17:07:02 The logistic map is fascinating. 2023-09-12 17:42:49 math types generally hated on computers (until the chaos stuff came around) 2023-09-12 18:20:55 I have no trouble accepting that such a thing can be a "proof" in the strict sense yet still not be as desirable as a "intuition building" proof. 2023-09-12 18:21:07 so, perhaps not the "best" proof, but a proof nonetheless. 2023-09-12 18:57:05 in your Forth implementations how do you manage output? is that a buffer that you write into when "." is encountered, and the the buffer is displayed onto the screen? 2023-09-12 19:27:13 I just write to some output device (mostly /dev/stdout on unix; serial on embedded targets) 2023-09-12 19:29:04 the output gets routed through a single word `c:put`, which can be altered to redirect or capture output to a buffer 2023-09-12 19:29:23 (see an example of this at https://retroforth.org/examples/capture-output.retro.html ) 2023-09-12 19:50:30 i see 2023-09-12 19:51:07 crc, is that your own version of Forth? 2023-09-12 19:51:26 yes 2023-09-12 19:51:49 that's interesting, its : used for namespaces? 2023-09-12 19:53:05 I use a : convention for word names 2023-09-12 19:54:00 i see 2023-09-12 19:56:27 another thing, let's say i have in the stack something, that maybe an integer, or even a more complex object like a rectangle. Usually in Forth, let's say you want to calc a property of this data, e.g. counting zeros for the integer, or area of the rectangle, you usually pop off the old object, and push into the stack the result, or just leave the original object and push the result? 2023-09-12 19:57:54 usually old goes away and result remains. but this can vary. 2023-09-12 20:01:01 thrig, ok i'm interested exactly on that 'vary', can you elaborate more? 2023-09-12 20:01:14 e.g. giving some example when the old doesn't go away 2023-09-12 20:02:17 It'd depend. If I need to do something else with the item on the stack, I'd leave it on the stack (or write the words that operate on them leave it). 2023-09-12 20:05:15 I normally write words to consume values though; I can easily `dup` or similar if I need to keep a value on the stack afterwards 2023-09-12 20:07:09 rendar: Yes, I suspect the most common approach is to just write to a device. I am wanting to try to have some kind of 'i/o stream' model in my upcoming one, though. 2023-09-12 20:07:44 At the application level, the code will just read from our write to a buffer, and threads running under the hood will know how to maintain those buffers. 2023-09-12 20:08:13 Sort of a "device" model. At the app level I'll just have something like stdin, stdout, stderr, or "other devices." 2023-09-12 20:08:34 The code that actually reads the keyboard / writes the screen might even be on a different system. 2023-09-12 20:09:02 So on the target a background thread would take the content from the device buffer and send it over some comm channel to my host. 2023-09-12 20:09:10 Or receive it from the host and place it in the buffer. 2023-09-12 20:09:16 Many details left to be worked out. 2023-09-12 20:10:04 There's a paper out there from way back, where Rob Pike talks about "communicating synchronous processes." I think those ideas come into play here. 2023-09-12 20:10:22 But all of this is well beyond where Forth normally "goes." 2023-09-12 20:11:50 rendar: In your rectangle example it would normally be that your application code totally kept up with that. You could code a word so that it took all of the parameters describing a rectangle from the stack and left the area. 2023-09-12 20:12:03 Or you might have on the stack a pointer to your rectangle. 2023-09-12 20:12:06 It's totally up to you. 2023-09-12 20:13:47 In this APL supporting effort, I plan to have the actual data - the arrays themselves - somewhere in RAM, and the stack will hold a pointer to the data. For all of this "typed" stuff that will be the approach. So I can use the pointer on the stack to find the data and one way or another also learn the type of the object. 2023-09-12 20:14:11 But those pointers will manipulate just like integers, so words like SWAP, OVER, DUP, etc. will be entirely standard. 2023-09-12 20:14:26 I've been referring to those as "agnostic" instructions. 2023-09-12 20:15:18 One possible rub there will be if I start trying to do reference counts; DUP would in theory increase your reference count, DROP would decrease it, etc. 2023-09-12 20:57:09 rendar: Yes . is usually done via a buffer, standard calls it the "pictured numeric output buffer" which is an awful nmae 2023-09-12 20:57:12 name* 2023-09-12 20:57:30 rendar: Look up standard words <# # #S HOLD #> 2023-09-12 20:57:44 Which are used for numerical output and formatted numbers in standard and most classic forths 2023-09-12 20:57:58 it's FORMAT but not as we know it! 2023-09-12 20:58:20 Simply because it's much easier to build a number in reverse, dividing/modding by BASE each step 2023-09-12 21:27:11 When was FORMAT invented anyway? 2023-09-12 21:28:36 ancient, lisp took it from fortran or maybe something even older 2023-09-12 22:00:20 I know FORTRAN had it. 2023-09-12 22:05:06 What did COBOL use? I know it was heavily about reporting. Did they have PICTURE or PIC or something like that? 2023-09-12 22:19:03 KipIngram, maybe you refer to Pike's Newsqueak paper? 2023-09-12 22:20:55 I don't think it was that one. I guess he had a bunch of papers. 2023-09-12 22:21:09 He may have mentioned it, though. it's been a while since I read it. 2023-09-12 22:22:16 yeah, interesting 2023-09-12 22:22:31 so, every words chooses if it want to 'consume' the last stack value or not.. 2023-09-12 22:22:56 I was looking into plan9 around that time. 2023-09-12 22:22:57 and consumers and producers words will live together nicely 2023-09-12 22:23:10 And Acme. 2023-09-12 22:25:00 I can't seen to turn it up right now. 2023-09-12 22:25:46 for instance, what about counting integer one and zeros bits? do you think it would be better to consume the integer itself? 2023-09-12 22:28:11 I see references to the paper in our logs, but can't find a link. 2023-09-12 22:28:29 I generally think inputs should be consumed. 2023-09-12 22:28:39 But it really depends on whether you're going to need it again or not. 2023-09-12 22:28:54 If you "occasionally" need it you can always DUP before running your consuming word. 2023-09-12 22:29:19 or have a DOES> that, uh, does fancy things 2023-09-12 22:29:39 KipIngram: If it was called PICTURE or PIC then that explains where "pictured numeric output" terminology in standard forth comes from 2023-09-12 22:29:41 But I think of Forth as generally removing inputs and loading up outputs. 2023-09-12 22:30:03 I suspect a few things in Forth come from COBOL 2023-09-12 22:30:06 Yeah. I think Cobol may have used # patterns too. 2023-09-12 22:30:21 Not surprising 2023-09-12 22:30:35 Not as individual things like in Forth, but rather, you'd just draw a picture of your number: #,###.## 2023-09-12 22:30:47 Yeah that looks familiar 2023-09-12 22:31:35 yes i see 2023-09-12 22:33:04 rendar: If you don't remove inputs, then they'll be in the way when you need to generate several intermediate solutions. Generally you'd like to be able to say 2023-09-12 22:33:47 (input1 input1 output1) (input 2 output 2) (input 3 input 3 output 3) 2023-09-12 22:34:04 and have it ready for (output 1 output 2 output3 final_output) 2023-09-12 22:34:05 i see 2023-09-12 22:34:08 If that makes sense. 2023-09-12 22:34:16 yeah i guess so 2023-09-12 22:38:59 thrig: 1956 https://web.archive.org/web/20220704193549/http://archive.computerhistory.org/resources/text/Fortran/102649787.05.01.acc.pdf 2023-09-12 22:39:07 So yeah I suppose it is pretty ancient 2023-09-12 22:40:16 Just think, 1956 is closer to 1890 than 2023 2023-09-12 22:40:26 Wow. 2023-09-12 22:40:52 I just watched a bunch OF Magnum PI episodes a week or two back - and it hit me one night... "This stuff is FORTY years old." 2023-09-12 22:41:16 Feels like yesterday when it premiered. 2023-09-12 22:41:35 I remember my 11th grade teacher gushing over it the next day. 2023-09-12 22:41:48 Day after the pilot ep, that is. 2023-09-12 22:42:13 we didn't really get TV where I grew up 2023-09-12 22:42:33 we got fuzzy TV. If we got the antenna pointed the right way. 2023-09-12 22:42:41 Had to go out and twist the pole when we changed channels. 2023-09-12 22:42:56 No TV stations in my town - they were all 50-ish miles away in various directions.