2023-11-27 00:07:16 https://www.youtube.com/watch?v=lJ8ydIuPFeU&list=RDCMUC_QIfHvN9auy2CoOdSfMWDw&index=2 2023-11-27 00:07:32 ^^ How NOT To Measure Latency ^^ 2023-11-27 00:27:49 http://0x0.st/HwDX.forth 2023-11-27 00:28:42 I wrote this to try composing an array and a stack, but I'm not sure if the renaming would be considered good style. 2023-11-27 04:39:35 Word of the day? https://paste.centos.org/view/dccbc5b9 2023-11-27 04:39:43 From The great book 2023-11-27 04:39:44 for eFORTH Linux 2023-11-27 04:57:04 <# and #> etc 2023-11-27 08:03:09 user51: It's not quite clear to me what array>stack is doing; the CREATE in array>stack doesn't seem to have a name supplied in your ' a array>stack line. 2023-11-27 08:03:38 Can you elaborate a little on the idea in play there? 2023-11-27 08:06:13 In my system the ' a array>stack line would crash my system; the create in array>stack would redefine my null word, and that would be all she wrote. 2023-11-27 08:09:25 it at least seems to work in gforth, though. 2023-11-27 08:34:32 https://www.youtube.com/watch?v=yu-9dcSVNDs Episode 89 - Forth 2023-11-27 08:34:33 Advent Of Computing 2023-11-27 08:37:08 I'm still watching Strange Loop videos. Man, people sure do seem to obsess over lambda calculus. :-| 2023-11-27 08:38:09 The guy I'm watching now seems to be bending over backward to describe what's going on in some of his expressions, and it seems to me it would be so much easier to think about it by making explicit reference to a stack. 2023-11-27 08:38:33 But he seems to be trying to avoid mentioning that there's a stack there holding the arguments. 2023-11-27 08:38:47 He seems to be trying to avoid mentioning the actual arguments at all. 2023-11-27 08:39:21 Lambda is a classic 2023-11-27 08:39:36 What's `xd` btw? 2023-11-27 08:39:40 It strikes me as a "useful for theory discussion" thing. 2023-11-27 08:39:43 help #> shows xd 2023-11-27 08:39:51 '#>' ( xd -- addr u ) core "number-sign-greater" 2023-11-27 08:40:06 KipIngram: It seems very useful for type-theory research. 2023-11-27 08:40:11 I'm not sure what that means. 2023-11-27 08:40:19 Which one? 2023-11-27 08:40:22 Your xd thing. 2023-11-27 08:40:28 Ah 2023-11-27 08:40:31 It's from gforth 2023-11-27 08:40:42 Complete the pictured numeric output string by discarding XD and 2023-11-27 08:41:04 So it's referring to something on the stack, I guess/ 2023-11-27 08:41:06 ? 2023-11-27 08:43:24 Well yea :) 2023-11-27 08:43:24 I think it's referring to whatever has been leftover by the earlier words - normally you'd expect it to be a zero, after you've processed all of the digits out of whatever number you started with. 2023-11-27 08:44:05 Basically you use /mod to peel off each digit, and you're left with "the rest of the number." But that gets smaller each time, and once you get the last digit handled you should be left with zero. 2023-11-27 08:44:27 That's how you know you're done converting a number. 2023-11-27 08:45:04 Hm 2023-11-27 08:45:17 I guess #> might actually take care of some remaining digits. 2023-11-27 08:45:26 <# 123 #> 2023-11-27 08:45:30 stack underflow :( 2023-11-27 08:45:38 No, that's not how it's used. 2023-11-27 08:46:06 Sadly, `help <#` does not list example usage -.- 2023-11-27 08:46:08 Usually you have some number of # invocations in between. 2023-11-27 08:46:14 Aha 2023-11-27 08:46:18 It shouldn't be too hard to find a summary online. 2023-11-27 08:46:57 <# "sets up" a stack frame to start the process off. # does one digit of work, and somewhere in there you might want to output a decimal point. 2023-11-27 08:47:33 once you've dealt with the decimal point, though, you just want to "finish" and you use #> for that - it removes the leftovers and leaves you a string reference containing your converted number. 2023-11-27 08:47:46 I've never actually done it that way in any of my systems. 2023-11-27 08:48:03 I wrote a "printf" of my own instead. 2023-11-27 08:48:20 That took a format string pretty similar to the way C does it. 2023-11-27 08:48:41 Oh - I was supposed to look for that printf code for someone - was that you? 2023-11-27 08:48:53 I've got my work computer open now; I'll see if I can find it. 2023-11-27 08:49:12 Dunno :) 2023-11-27 08:49:48 KipIngram: dup >name name>string nextname create 2023-11-27 08:50:09 KipIngram: The 3 words preceding create supply it a name 2023-11-27 08:50:30 KipIngram: https://gforth.org/manual/Supplying-names.html#index-nextname_0028-c_002daddr-u-_002d_002d-_0029-gforth_002d0_002e2 2023-11-27 08:55:31 Oh, so you're pushing a string into the upcoming input stream? 2023-11-27 08:55:37 That's pretty unusual. 2023-11-27 08:56:07 I provided CREATE with an alternate entry point, (CREATE), that expected the string to already be on the stack instead of needing to be parsed out. 2023-11-27 08:56:31 Basically : create bl word : (create) ... 2023-11-27 08:56:47 (you can't do that in gforth0 2023-11-27 08:57:20 Ok, I guess it's not unusual, since it's actually documented. 2023-11-27 08:57:29 Just not something I've ever done. 2023-11-27 08:59:13 I don't see my printf anywhere. I'll write up a short description and post a pastebin later this morning. 2023-11-27 08:59:32 I was hoping it would be in the blocks.dat file of my older system, but apparently not. 2023-11-27 09:04:17 There is some interesting stuff in there I may want to port to my newer system, though. 2023-11-27 09:19:01 Here's a (very) cursory description of how I approached printf. 2023-11-27 09:19:04 https://pastebin.com/0SBDcrXc 2023-11-27 09:19:26 I didn't mention it there, but there was a jump table for interpreting each of the format string characters "executed" by the little printf vm. 2023-11-27 09:20:28 Basically it was just a way to extract numerical values for various purposes (radix spec, field width, decimal place count, etc.) from the format string one at a time and save them somewhere, so that when I finally went and did a conversion I could use those values. 2023-11-27 09:20:54 I saved those values in particular bytes of a stack cell. 2023-11-27 09:22:04 Actually that last is wrong - I used the bytes of a stack cell to implement a simple "vm stack," and saved the finished parameter values in other cells of a standard stack frame. 2023-11-27 09:22:51 That little "byte stack" was there to facilitate agregatin parameter digits into final values, all of which I assumed would be unsigned and in the 0-255 range, so bytes did the job fine. 2023-11-27 09:24:34 I'd start with a 0 byte on top of that "stack," and then a stream of digits would each do a 10* + action on it. Eventually I'd come to a non-digit character and it would instruct me what to do with the current value. : would store it in a radix spec, . would store it in a field width spec, and a final conversion char would take the most recently aggregated value as a decimal place count. 2023-11-27 09:25:54 Eventually everything would funnel into a word that did the conversion on the "next item down" in the stack, using the specified conversion parameters. When the whole strng was fully output, I'd drop all the conversion items from the stack. 2023-11-27 09:26:30 So I could do something like and if that string contained three format fields then all of that would be gone when I was done. 2023-11-27 09:26:59 Oh, well, #TYPE was needed after there. 2023-11-27 09:28:16 The big downside of this is that #TYPE had to echo out string characters one at a time, so it could check for % chars, whereas regular TYPE just slammed the whole string out with a single syscall. 2023-11-27 09:34:04 Cool, but micro blog > pastebin I think :d 2023-11-27 09:35:45 I'll check it out. 2023-11-27 09:36:11 Someone suggested an alternative a few months ago and I tried it, but I didn't like how it formatted my paste. 2023-11-27 09:36:25 Stuff didn't "line up" the way I expected it to. 2023-11-27 09:41:10 Generally speaking I prefer supporting "underdogs" on such things - just part of my general preference for small business over large. 2023-11-27 09:44:03 wordpress.com ;) 2023-11-27 09:44:07 Takes 1 min 2023-11-27 10:07:24 Wait - you mean make a blog account just to use for pastebin type stuff? 2023-11-27 10:07:35 That seems kind of overkilly. 2023-11-27 10:08:35 writing stuff about code can help you understand your understanding better (and others, maybe) 2023-11-27 10:09:25 Yeah, I do a good bit of that; I usually just open a notes file with vim somewhere. That's how a lot of my stuff initially evolves. 2023-11-27 10:09:41 Just last night I was scratching out C structures for organizing a blocks.dat file. 2023-11-27 10:10:08 That would support a basic file system; I was working on the structs that would hold all that structural info. 2023-11-27 10:58:03 KipIngram: pastbin dies tho, so it might be nice to build up a private library of snippets and explanations for newbies like I. 2023-11-27 10:58:21 pastebin has zero googleability too 2023-11-27 10:58:51 if you can find it through the seo spam 2023-11-27 11:00:24 Biggest issue for forth is the language name itself haha 2023-11-27 11:12:24 Yes, that does make it kind of hard to search up. You definitely have to "qualify it" to some extent. 2023-11-27 11:12:46 I once wanted to read up on electrical transformers, and had trouble wading past all the cartoon stuff. 2023-11-27 11:13:55 ^^ 2023-11-27 11:14:28 I've altered your search terms, pray tell I do not alter them farther 2023-11-27 11:15:04 Yeah, I get annoyed with search engines when they just decide i must have typed something wrong and change my term altogether to something else. They will do that sometimes. 2023-11-27 11:15:16 At least they put a link at the top you can click to get the search you actually asked for. 2023-11-27 11:15:30 "Yes, I really meant it." 2023-11-27 11:17:05 Or just + or "" 2023-11-27 11:17:07 use* 2023-11-27 11:37:43 I used to think "" would force an exact match search, but somewhere along the way I stopped believing in that. Is that known to still work? 2023-11-27 11:38:26 So many things of that nature you just can't count on to work today the same way they worked yesterday - they're constantly "tinkering," it seems. 2023-11-27 11:38:51 they would never tinker with things in ways that might help increase their profits 2023-11-27 11:39:03 don't be evil, etc 2023-11-27 11:39:48 Back when I used to mess around with Facebook (which I don't anymore), one of the things that I just found maddening was that they tried so hard to push "arbitrary" results order onto me. I wanted the stuff my followees did, and I wanted all of that stuff in strict chronological order, newest at the top. 2023-11-27 11:40:03 I did not want Facebook deciding what they thought I'd be most interested in seeing. 2023-11-27 11:40:17 gah, a free thinker 2023-11-27 11:40:26 Absolutely. 2023-11-27 11:41:11 To me that's the point of being human - our mind is what sets us apart form the rest of the animal kingdom. If we abdicate actually USING it, then we're reducing ourselves to that level. 2023-11-27 11:41:25 s/form/from/ 2023-11-27 11:42:00 I see thinking for myself as a birthright. 2023-11-27 11:45:12 Well being open-minded or not might be genetic. 2023-11-27 11:47:03 I guess that's possible. But surely there must be a "nurture" component ont that as well. I wouldn't try to argue there's zero genetic influence, though. 2023-11-27 11:47:29 In general, people believe in whatever they grew up in. 2023-11-27 11:50:00 That's definitely a strong factor. I grew up in Alabama in the 1960's, though, and didn't wind up with the standard (for that time and region) attitude toward race relations. I can point to the experiences in my youth that caused me to clearly see that a person's skin color had nothing to do with what kind of person they were. 2023-11-27 11:50:16 Maybe I was just lucky to have t hose particular experiences, strongly enough to pay attention to them. 2023-11-27 11:51:07 Seems like the latest gforth release is available via apt, but it complains about missing glib or something. Maybe it's telling me to write my own forth? 2023-11-27 11:51:30 ^ YES! :-) 2023-11-27 11:51:50 I think that's a great interpretation. 2023-11-27 11:51:52 GLIBC_2.29 GLIBC_2.33 GLIBC_2.34 to pre precise. 2023-11-27 13:18:55 So, I mentioned yesterday letting the type of my argument(s) direct exactly what some instructions do. Looks like there are multiple names for that, depending on that (s) - from what I saw last night "method polymorphism" would be when the top item on the stack fully specified the action. That is, the type of the "first" argument. But then there's also "multi-method polymorphism," where you'd also consider 2023-11-27 13:18:57 types deeper in the stack. 2023-11-27 13:19:45 A long time ago I envisioned a compile time implementation of multi-method polymorphism, though it would imply a pretty smart compiler and it runs into trouble if you have conflicting "type evolution trajectories" through your code. 2023-11-27 13:20:03 AND it would require that you actually call out how each word affected the stack type pattern. 2023-11-27 13:20:20 These more recent thoughts I've been having would produce run-time instruction polymorphism. 2023-11-27 13:20:51 It's easy to see how to do the "method" version of that - I imagine overhead would go up fast as you tried to add the "multi." 2023-11-27 13:22:54 https://www.youtube.com/watch?v=seVSlKazsNk 2023-11-27 13:23:17 ^^ Point Free or Die: Tacit Programming in Haskell and Beyond ^^ 2023-11-27 13:32:56 sounds like a major complication.. Far less in a traditional compiler environment, though 2023-11-27 13:33:52 I'm "lagged", kip - watching streaming series, checking news, and trying to decide on a Gallery/Squirrel load for the 223. 2023-11-27 13:36:47 I remember yer original concept, though - it wasn't really horrendous as you were able to explain it w/o 27 8x11 color glossies with w paragraph written on the back of each. 2023-11-27 13:36:52 https://www.youtube.com/watch?v=m57gzA2JCcM&pp=ygUSYWxpY2UncyByZXN0YXVyYW50 2023-11-27 14:23:31 speaking of quotations. what is the preferred word? 2023-11-27 14:24:08 i think i've seen {: :} before. factor uses [ ], but i want to keep those for breaking into immediate mode. 2023-11-27 14:24:40 not seeing anything in ANS 2023-11-27 14:26:05 oh, that {: :} i saw might have been locals actually 2023-11-27 14:33:07 zelgomer, >>For creating and executing words, Forth has a very simple interpreter called “]”, and a very simple compiler called “[“. The interpreter “]” is a simple loop: for every whitespace-separated group of characters, it first checks to see if it’s an interpreter word, and if so, executes it — otherwise, it checks if the characters are a number, and pushes it on the stack — otherwise, it raises a “word not 2023-11-27 14:33:07 error. The 2023-11-27 14:33:09 https://www.youset.com/archives/why-forth-simple 2023-11-27 14:34:36 seems like that guy got it backards. traditionally [ enters interpret mode, ] begins compilation 2023-11-27 14:34:45 anyway, that's not what i'm asking. read the question again 2023-11-27 14:35:57 " speaking of quotations. what is the preferred word?" - yeah, that's where I walked in - carry on 2023-11-27 14:36:30 that was the start of it 2023-11-27 14:37:18 quotations as in anonymous inlined words 2023-11-27 14:37:24 well, my "preferred word" is "Free primers and powder!: 2023-11-27 14:37:31 ahhhhhhh 2023-11-27 14:37:58 I understand now. I think I've used a few under Gforth, but they are not a fav 2023-11-27 14:38:22 :noname ? 2023-11-27 14:38:46 like :noname, but inlined. i thought this was a commonly known concept, i guess not? 2023-11-27 14:38:54 Not in standard Forth 2023-11-27 14:39:31 : sum ( list -- n ) 0 { + } map ; 2023-11-27 14:39:34 i know it's not in standard forth, that's why i'm asking what people like 2023-11-27 14:40:09 not map, reduce, rather 2023-11-27 14:40:12 I'm thinkin' you are viewing it like a macro: some word that layes down the body all over again, inline? 2023-11-27 14:41:35 no 2023-11-27 14:41:52 OK, well - I'll go sti in the corner 2023-11-27 14:42:21 sorry, i'm trying to think of a better example than what i posted above because that's too trivial i don't think illustrates it well 2023-11-27 14:45:17 oh! this is how i have implemented literal in mine -- : literal { r> dup cell + >r @ } compile, , ; immediate 2023-11-27 14:45:49 the part enclosed in { } is a quotation, it's compiled inline and when encountered at execution time, its execution token is pushed onto the stack 2023-11-27 14:57:11 zelgomer: :noname isn't really a "historical" part of Forth. it's come in in more recent years. 2023-11-27 14:57:29 I'm hardly very familiar with it - a lot of my Forth work is based on old styles of tooling. 2023-11-27 14:57:36 pretty sure there were clever ways to do it in olden times 2023-11-27 14:58:05 Probably; it just wasn't part of the "standard body of knowledge." 2023-11-27 14:58:27 there were no "olden times" - just variant forths ;-) 2023-11-27 14:58:32 You usually can figure out a way to do almost anything in forth, and of course ] lets you slip into compile mode anytime, without having to have called CREATE. 2023-11-27 14:58:38 FIG forever! 2023-11-27 14:58:49 (which one!?) 2023-11-27 14:59:00 the good one