2023-11-03 00:04:02 sounds somewhat like the "fair from unfair coin" trick 2023-11-03 04:04:21 http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm - this seems like a nice intro 2023-11-03 06:01:15 Using festival to read it for me. Since there are no videos. :D 2023-11-03 08:37:30 I'm not familiar with the fair from unfair coin trick. 2023-11-03 08:44:24 There's one by Von Neumann that was features on Hacker News recently 2023-11-03 08:44:28 featured* 2023-11-03 08:46:00 https://en.wikipedia.org/wiki/Fair_coin#Fair_results_from_a_biased_coin 2023-11-03 08:50:24 The Wikipedia entry does a good job making it seem more complicated than it is 2023-11-03 08:50:42 The 3 steps at top are the important bit 2023-11-03 08:52:22 What I will say is that knowing the algorithm, I'm tempted to do this from now on 2023-11-03 08:52:33 It's a good nerd ice breaker anyway 2023-11-03 08:53:16 The big question on my mind is how can I automatically manage time/memory resources in the same way a piped process does in Forth? 2023-11-03 08:53:36 I can replicate everything: separate tasks or processes, I/O buffers etc, but is there a simpler/better interface for all this? 2023-11-03 08:53:46 Especially one that can leverage existing forth words better? 2023-11-03 08:54:33 When I say piped process I actually mean a 'pipe' from shell, where commands break down a job with simple I/O between them 2023-11-03 08:55:18 Either doing stuff with tiny buffer one-by-one or maybe also using big files that can't fit in memory but are wholly required for algorithm e.g. sorting 2023-11-03 08:55:24 Ah, that makes sense. 2023-11-03 08:57:06 I think some kind of file or blocks interface is necessary for 'sort' on massive data, because it needs to go on disk anyway 2023-11-03 08:57:09 For sorting a file that can't fit in ram, can't you sort sections of it then merge them serially? 2023-11-03 08:58:41 That merge could be painful, though, if you're really badly RAM limited and only have a few disk buffers. I.e., if you have many more "pieces" than you do buffers. You can probably find a way to merge them piecewise too, but it would require multiple passes. 2023-11-03 09:04:30 You can sort a big file in place, whether that's a good idea really depends on the file! 2023-11-03 09:06:20 There are two features I'm interested in really, the 'file' which is nothing new to forths, either as a range of blocks or an actual filesystem file 2023-11-03 09:06:32 Hm `create` is postfix? o0 2023-11-03 09:06:40 Why not `x create`? 2023-11-03 09:06:43 Not really. 2023-11-03 09:06:53 Forth has no place to store that "x" string. 2023-11-03 09:07:02 Back to my complaint about lack of literal support. 2023-11-03 09:07:19 Hmmm 2023-11-03 09:07:28 You indeed could "name" create if you could enter literal strings. 2023-11-03 09:07:36 create is usually written like this: 2023-11-03 09:07:40 Right it would try to execute x, looking in the current dict. 2023-11-03 09:07:45 : create bl word (create) ; 2023-11-03 09:08:03 bl word parses the next word out of the input string and leaves its address on the stack. 2023-11-03 09:08:15 and then (create) works postfix. 2023-11-03 09:08:35 but, that uses a special system reserved place to save the word, and it's the same place the interpreter puts every word it parses out. 2023-11-03 09:08:47 So you can't type bl word create from the interpreter - it has to be compiled. 2023-11-03 09:09:01 But (create) is available in case you want to use it anywhere. 2023-11-03 09:09:07 Or it can be made to be. 2023-11-03 09:09:12 :help bl 2023-11-03 09:09:16 No bot in here? :D 2023-11-03 09:09:26 bl is a constant. 2023-11-03 09:09:30 k 2023-11-03 09:09:31 the ascii space char. 2023-11-03 09:09:36 ah 2023-11-03 09:09:39 "bl"ank 2023-11-03 09:10:00 Hehe 2023-11-03 09:10:13 veltas: I was just noticing the efficiency difficulties of sorting a big file. 2023-11-03 09:10:19 Say you only have three disk buffers. 2023-11-03 09:10:39 You can load two blocks of the file and sort them in place, then merge them into the third disk buffer, which you will fill twice. 2023-11-03 09:10:53 Then load a new block and sort it in place, and merge it into what you merged before. 2023-11-03 09:11:01 Incrementally work through all the blocks that way. 2023-11-03 09:11:16 If you really only had three buffers that may be the best you can do. 2023-11-03 09:11:43 You'll be reading in a lot of pre-merged blocks, but there may be no help for it. 2023-11-03 09:12:04 Is backtick special? 2023-11-03 09:12:25 see `on - does not exist 2023-11-03 09:12:32 Someone familiar with the standard will need to answer that. 2023-11-03 09:12:47 Backtick is xt? 2023-11-03 09:12:48 olle: Are you using gforth 0.7.3? 2023-11-03 09:12:49 I know standard tick is a word; I'm not sure about backtick. 2023-11-03 09:12:51 rec-tick 2023-11-03 09:12:55 veltas: ehm some gforth 2023-11-03 09:13:02 Which one 2023-11-03 09:13:33 veltas: Gforth 0.7.9_20230726 2023-11-03 09:13:37 Good 2023-11-03 09:13:52 see `on would just look for the word "`on" 2023-11-03 09:13:57 Forth's word delimited 2023-11-03 09:14:06 Right. 2023-11-03 09:14:19 ` on would be what you're going for there. 2023-11-03 09:14:23 Tick gets the xt 2023-11-03 09:14:27 on usually just sets a cell to true. 2023-11-03 09:14:28 I don't know what backtick does in gforth 2023-11-03 09:14:34 on 2023-11-03 09:14:38 off 2023-11-03 09:15:23 : ON ( addr -- ) -1 SWAP ! ; \ typical implementation 2023-11-03 09:15:36 veltas, that sort looks like it would be O(n^2) in number of blocks in your file. 2023-11-03 09:15:45 Not pretty. 2023-11-03 09:15:53 Use merge sort then 2023-11-03 09:15:56 As your baseline 2023-11-03 09:16:07 No, I mean if your buffer limited. 2023-11-03 09:16:18 If you have three buffers. 2023-11-03 09:16:30 hmmm `x <==> ' x 2023-11-03 09:16:41 I think 2023-11-03 09:16:46 olle: Ah yes, gforth is supporting that syntax 2023-11-03 09:17:01 it'll take two reads and two writes to get the first two blocks sorted onto disk. Then 3 reads and 3 writes to get the next block included, 4 and 4 to get the next one, etc. 2023-11-03 09:17:07 It's treated like a literal, it sees prefix ` and looks up x 2023-11-03 09:17:14 veltas: Not idiomatic? 2023-11-03 09:17:17 This is a modern feature, not something classic forths do 2023-11-03 09:17:22 Yeah not idiomatic for forth 2023-11-03 09:17:37 gforth also allows "string" and 'c' etc 2023-11-03 09:17:38 olle: Traditional Forth rigorously requires spaces between words. 2023-11-03 09:17:43 $FFFF 2023-11-03 09:17:52 It's intercepting the NUMBER logic 2023-11-03 09:18:05 This is a feature being proposed for new standards called a recognizer 2023-11-03 09:18:11 I would say that by just saying NUMBER recognizes certain prefixes. 2023-11-03 09:18:18 That's contained in NUMBER. 2023-11-03 09:18:22 Yeah 2023-11-03 09:18:36 I just don't like that kind of parsing, I'm old-school 2023-11-03 09:18:53 KipIngram: EXCEPT for ." ... " :D 2023-11-03 09:18:56 Or? 2023-11-03 09:18:59 The only prefix parsing I like is crc's because it's simplified 2023-11-03 09:19:10 Well, in that case it has a place to store the string. 2023-11-03 09:19:18 It stores it inliine in the definition you're compiling. 2023-11-03 09:19:27 ." jumps through special hoops to work interpreted. 2023-11-03 09:19:51 But it still uses the interpreters parsed word storage to store the string, but it can print it and be done with it before it needs to move on. 2023-11-03 09:20:04 On gforth ." checks STATE to see if it should just print 2023-11-03 09:20:06 No need to store the string long-term. 2023-11-03 09:20:16 Well actually I think gforth has separate interpreter/compiler definitions 2023-11-03 09:20:17 Right, that's the common way. 2023-11-03 09:20:32 So gforth will skip compiler-only definitions in lookup 2023-11-03 09:20:38 It will have WORD in it at the beginning. 2023-11-03 09:20:53 Classic Forths would check STATE in an IMMEDIATE word to simulate this 2023-11-03 09:20:57 ACTION considering doing special hack for string interpolation for a Forth-PHP transpiler... 2023-11-03 09:20:59 Which parses the whole string into the WORD buffer. 2023-11-03 09:21:17 The standard print mechanism at interpreter is the .( word 2023-11-03 09:21:32 And CR et al work everywhere 2023-11-03 09:21:52 CR isn't special - it's just a word that can compile normally. 2023-11-03 09:22:08 They work everywhere because they're just plain old words yeah 2023-11-03 09:22:28 olle: You understand the idea of immediate words at this point? 2023-11-03 09:22:41 KipIngram: Run even during compilation mode? 2023-11-03 09:22:52 Yes. Run right now, regardless. 2023-11-03 09:23:02 It lets you do things that aren't standard compiler behavior. 2023-11-03 09:23:07 That word can do anything it wants. 2023-11-03 09:23:16 IF and THEN are immediate words. 2023-11-03 09:23:30 IF compiles a conditional jump forward, but it doesn't know where to jump to yet. 2023-11-03 09:23:41 So it leaves the address where the jump target needs to be stored on the stack. 2023-11-03 09:23:51 THEN picks that address up and back-patches in the jump target. 2023-11-03 09:24:00 Yea, still dunno how a transpiler would deal with that, need to read more. 2023-11-03 09:24:36 You can't use IF and THEN in interpreter mode, because you're just not making a definition, and because you the user are using the stack - it's unavailable for that kind of system communication. 2023-11-03 09:25:08 But within a definition, no user activity is going on, so the compiler can own the stack for the duration of the definition. 2023-11-03 09:27:00 The main source of words that interpret is just getting a 'string', which is cumbersome in Forth 2023-11-03 09:27:09 And that's impure to some and acceptable to others, I personally don't mind it 2023-11-03 09:28:01 If you want to work around this then really you need a very non-standard dialect, someone should tell the committee because they've been trying to achieve prefix string notation since the 90's and it doesn't fit 2023-11-03 09:28:23 See e.g. making S" stateful, and stuff like S" filename" INCLUDED 2023-11-03 09:29:35 Fortunately I don't mind changing things to some extent. :-) 2023-11-03 09:30:28 I think prefix strings work well in retro, but not in the standard 2023-11-03 09:30:55 Standard Forth is an old dog, they need to stop teaching it new tricks 2023-11-03 09:31:30 A totally different dialect can make a lot of changes and make it consistent 2023-11-03 09:33:57 A person on reddit suggested, to make a proper transpiler, you need a forth system inside the transpiler itself. 2023-11-03 09:35:12 Which subreddit? 2023-11-03 09:35:21 /r/forth 2023-11-03 09:35:26 I asked about it there 2023-11-03 09:37:11 olle I told you this as well 2023-11-03 09:37:21 No doubt. Memory, tho... 2023-11-03 09:37:25 Brains gonna brain. 2023-11-03 09:39:31 You can transpile at runtime as well, use https://www.php.net/manual/en/function.eval.php 2023-11-03 09:40:04 Write a Forth inside PHP, have it use eval() to generate more efficient code than it would as a real-eval loop 2023-11-03 09:40:08 Btw, why is `variable x` needed if I can do `create x`? 2023-11-03 09:40:14 veltas: Hmmmmm 2023-11-03 09:40:49 It's just to express intention really, CREATE is used for any data including arrays, you still need to allocate variable space 2023-11-03 09:41:13 CREATE is better for initialised variables: `CREATE X 0 ,` vs `VARIABLE X 0 X !` 2023-11-03 09:42:15 but `create x 123 x ! x @ .` works? 2023-11-03 09:42:27 Or am I butchering the memory? 2023-11-03 09:43:07 variable also allocates the space 2023-11-03 09:43:13 : variable create cell allot ; 2023-11-03 09:43:23 create doesn't allocate any space. 2023-11-03 09:43:36 It just makes a header that points to HERE 2023-11-03 09:43:51 So why does that snippet work? Or? 2023-11-03 09:43:57 it 'works," but try this: 2023-11-03 09:44:13 create x 123 x! variable beta 0 betta ! x @ . 2023-11-03 09:44:23 beta and x will use the same RAM 2023-11-03 09:45:17 create x variable beta x . beta . 2023-11-03 09:45:30 The dictionary space is usually a preallocated large space 2023-11-03 09:45:43 So you're just writing to RAM but it will get overwritten if you don't manage HERE correctly 2023-11-03 09:45:47 yes, and you just nibble your way through it. 2023-11-03 09:45:59 Oh 2023-11-03 09:46:15 It's like renting the same apartment to two tenants. 2023-11-03 09:46:17 CREATE doesn't allocate any space for the data itself, that's what e.g. , is for 2023-11-03 09:46:24 And ALLOT 2023-11-03 09:46:32 `create x variable beta x . beta . 139903079641872 139903079641912 ok 2023-11-03 09:46:37 C, etc 2023-11-03 09:46:50 Wait - what? 2023-11-03 09:46:54 :) dunno 2023-11-03 09:46:56 gforth still 2023-11-03 09:46:56 Those should be the same. 2023-11-03 09:47:01 hang on I'm trying it. 2023-11-03 09:47:20 The header is in the data dictionary in gforth 2023-11-03 09:47:24 Might be the same in your forth though KipIngram 2023-11-03 09:47:42 Yeah. GForth is playing some kind of trick. 2023-11-03 09:47:47 olle: HERE advanced to make room for beta's header 2023-11-03 09:47:54 :O 2023-11-03 09:47:58 But, in any case olle, create doesn't properly allocate space. 2023-11-03 09:48:02 Got it 2023-11-03 09:48:09 I don't know what those are different, but i'm sure gforth knows that it's doing. 2023-11-03 09:48:10 If you write to x you will overwrite beta's header and destroy the wordlist links 2023-11-03 09:48:21 I believe gforth puts next word link at front of header 2023-11-03 09:49:17 Here it is in mine: 2023-11-03 09:49:19 create x var beta x . beta . 140524170303304 140524170303304 ok 2023-11-03 09:49:21 var alpha var beta alpha . beta . 140524170303312 140524170303320 ok 2023-11-03 09:49:33 Hm 2023-11-03 09:49:35 Yeah and that's because your headers are separate to data 2023-11-03 09:49:40 Yes. 2023-11-03 09:49:51 so those two variables sit immediately next to each other. 2023-11-03 09:50:33 olle, in my system the headers live "somewhere" and the bodies live somewhere else. Variable cells, constant cells, definition lists, they all go in that second place. 2023-11-03 09:50:39 Lets me do this: 2023-11-03 09:50:47 : foo ...code1... 2023-11-03 09:50:52 ; bar ... code2... ; 2023-11-03 09:51:04 foo will run ...code1... ...code2... 2023-11-03 09:51:08 : bar you mean? 2023-11-03 09:51:17 No, foo runs both. 2023-11-03 09:51:23 bar runs only ...code2... 2023-11-03 09:51:37 No I mean second source line should start with : not ; 2023-11-03 09:51:39 Right? 2023-11-03 09:51:46 Oh, yes - sorry. 2023-11-03 09:51:48 Typo. 2023-11-03 09:52:02 I think my shift key is wearing out. :-( 2023-11-03 09:52:15 Excuses :P 2023-11-03 09:52:25 olle: ...code2... will just immediately follow ...code1... in RAM. 2023-11-03 09:52:35 Which is a big advantage of that method 2023-11-03 09:52:38 it's all just a wall of implementation bodies - the headers "point into it." 2023-11-03 09:53:08 Chuck did it that way in colorforth; that was when I picked up the practice. 2023-11-03 09:53:17 olle: Have you done much C or C++? 2023-11-03 09:53:35 veltas: Nah, just another transpiler from PHP to C. Polyglot C even, heh. 2023-11-03 09:53:38 In those languages as well, just because you can build and run something without errors doesn't mean it's correct 2023-11-03 09:53:46 Sure sure 2023-11-03 09:54:23 Yeah this is the wild west, there's no rules here 2023-11-03 09:54:44 :-) 2023-11-03 09:54:52 ACTION likes it like that. 2023-11-03 09:55:07 the west was never that wild 2023-11-03 09:55:09 Mavericks have always appealed. 2023-11-03 09:55:21 I'm sure it is heavily dramatized. 2023-11-03 09:55:23 Just to be clear, `create x` never makes sense without something else coming after it? 2023-11-03 09:55:39 Not most of the time no 2023-11-03 09:55:42 +1 2023-11-03 09:55:43 There are reasons to do that 2023-11-03 09:55:45 Well, I won't say "never." You could contrive some situation, I imagine. 2023-11-03 09:55:48 but generally yes. 2023-11-03 09:55:55 As a marker for FORGET 2023-11-03 09:56:04 If you're just doing "standard coding,' you probably don't actually need to use CREATE directly. 2023-11-03 09:56:09 Just use the words that use it. 2023-11-03 09:56:11 To use with DOES> without any allocated data 2023-11-03 09:56:18 Oh yeah 2023-11-03 09:56:18 And combine in whatever allocation needs to be done. 2023-11-03 09:56:32 ; calls create of course. It changes the header to mark it as a colon definition instead of a variable. 2023-11-03 09:56:36 Because you need a unique address that can't be equal to another address for a sentinel, but don't need anything at that address 2023-11-03 09:56:45 But then it leaves it to the compiler to allocate the compiled words into RAM one at a time. 2023-11-03 09:56:55 ^ right. 2023-11-03 09:57:02 it could happen that you need create. 2023-11-03 09:57:21 In fig forth I think instead of CREATE you needed another word for DOES> ? 2023-11-03 09:57:28 Was it I've seen that 2023-11-03 09:57:56 and NAME, or some such 2023-11-03 09:58:01 DOES> is controversial because it actually adds some fixed overhead to every CREATE in most forths 2023-11-03 09:58:13 ( name followed by comma ) 2023-11-03 10:00:13 Oh, it doesn't in mine. 2023-11-03 10:00:26 The extra space is only added in words that actually use does> 2023-11-03 10:00:37 But I don't say create ... does>... 2023-11-03 10:00:47 I have builds> ... does> ... 2023-11-03 10:00:53 so I can discriminate pretty easily. 2023-11-03 10:01:05 Yes but you've got more overhead than most forths per definition anyway having to link to a separate data space 2023-11-03 10:01:22 yes, but that's really unrelated overhead. 2023-11-03 10:01:43 You just mean because I point to things that would normally be "just right there." 2023-11-03 10:01:48 yeha 2023-11-03 10:02:45 Oh allot uses here! 2023-11-03 10:03:11 allot changes here. 2023-11-03 10:03:22 Yes, it uses it to know where the next available RAM is. 2023-11-03 10:03:26 Then it nudges it forward. 2023-11-03 10:03:30 Aha 2023-11-03 10:03:34 Usually there is a variable DP. 2023-11-03 10:03:39 : HERE DP @ ; 2023-11-03 10:03:49 So HERE is really just a convenience word. 2023-11-03 10:03:57 DP is the really important variable. 2023-11-03 10:04:24 i have to have two of all of those, because I have separate RAM regions for headers and bodies. 2023-11-03 10:04:30 So I have dp.b and dp.h 2023-11-03 10:05:01 olle, one reason to separate headers is if you plan to try to build images for some embedded gadget. 2023-11-03 10:05:19 like eForths DP and NP (names pointer) 2023-11-03 10:05:20 You may not be planning to actually run Forth on your gadget, so you don't want to burn headers onto it. 2023-11-03 10:05:31 yes. 2023-11-03 10:05:44 If your bodies are by themselves in a region, then that becomes your burn image. 2023-11-03 10:06:04 or you can compress the headers down 2023-11-03 10:06:17 Yeah, you could peel them out later. 2023-11-03 10:06:24 Lots of ways to slice the onions. 2023-11-03 10:09:54 In my case I just wanted definitions to be able to flow into one another. 2023-11-03 10:10:24 I wanted to think of my stuff as that "wall of code" with entry points here and there. 2023-11-03 10:13:27 I also use this trick, specially with FCPU-16 of mine where I do not have (JMP) as a primitive 2023-11-03 10:14:09 : (JMP) R> @ >R ; 2023-11-03 10:15:09 which means I can have EXECUTE just target the last >R in that definition and I get it for semi-free 2023-11-03 10:19:36 Zarutian_iPad: I like your return stack tricks. 2023-11-03 10:20:22 `IF is compile-only`? o0 2023-11-03 10:20:23 Why? 2023-11-03 10:23:52 : IF ' (BRZ) HERE 0 , ; COMPILE-ONLY : THEN HERE SWAP ! ; COMPILE-ONLY : ELSE ' (JMP) 0 , SWAP HERE SWAP ! ; COMPILE-ONLY 2023-11-03 10:24:41 because IF ELSE THEN use the datastack at 'compile time' 2023-11-03 10:25:50 and they are IMMEDIATE words too 2023-11-03 10:26:39 s/' (BRZ)/' (BRZ) ,/ 2023-11-03 10:27:08 s/' (JMP)/' (JMP) ,/ 2023-11-03 10:27:43 forgot to actually get those into the defintion being compiled 2023-11-03 10:28:20 : , HERE ! DP+ ; 2023-11-03 10:29:24 Hey instead of writing a compiler, I can just define Forth words that write PHP code perhaps... 2023-11-03 10:29:30 Programmatically program PHP? 2023-11-03 10:29:36 s/compiler/transpiler 2023-11-03 10:30:54 Maybe someone already suggested that and I was too stupid 2023-11-03 10:36:08 olle: Yes, IF is compile only. 2023-11-03 10:36:22 It's creating a jump structure inside a compiled definition. 2023-11-03 10:36:33 You don't have a definition being compiled when you're interpreting. 2023-11-03 10:36:40 You just have a string you're working through. 2023-11-03 10:36:55 KipIngram: Thanks 2023-11-03 10:37:08 I have a seen a system that "interprets" lines by compiling the whole line in a temporary place and then running that compiled result. 2023-11-03 10:37:18 In that system you could use IF THEN "interpreted." 2023-11-03 10:37:20 olle: You were too stupid, I've said it twice to you now 2023-11-03 10:37:31 wat 2023-11-03 10:37:32 Lies 2023-11-03 10:37:54 He(a)rsay! 2023-11-03 10:37:57 eval() boy 2023-11-03 10:38:32 Is this the programming-by-incitement methodology? 2023-11-03 10:38:42 Eventually he'll annoy me enough into writing this forth for him lol 2023-11-03 10:38:59 >< 2023-11-03 10:39:07 olle: Also, as I mentioned to you earlier, IF communicates with THEN via a value on the stack. When you're interpreting, the code you put between IF and THEN might cover that up with something and THEN wouldn't find it. 2023-11-03 10:39:33 eval() is sheisse, but writing to source-code files could work. 2023-11-03 10:39:49 THEN treats that as an address and stores something there, so if you've changed the stack there's no telling what would happen. 2023-11-03 10:40:03 Hm k 2023-11-03 10:40:17 It is possible to play games with >IN that could let you fake up something that would interpret. 2023-11-03 10:40:19 olle: eval() on code you transpile isn't a bigger security issue than transpiling arbitrary code in first place 2023-11-03 10:40:41 You could write a word #if that checked a flag on the stack and then optionally pushed >IN forward just past #then 2023-11-03 10:41:12 but that requires nesting tracking and such 2023-11-03 10:41:14 >IN is just your current index into the text input buffer. 2023-11-03 10:41:19 Nothing stops you from changing it. 2023-11-03 10:41:29 Wanna hang your system? Run >IN OFF 2023-11-03 10:41:35 veltas: I mean it obviously won't scale. 2023-11-03 10:41:40 That will restart you at the beginning of the line. 2023-11-03 10:41:44 Over and over. 2023-11-03 10:41:49 olle: Not sure what's obvious about that? 2023-11-03 10:42:04 Invoke PHP compiler to get better runtime performance? Heresy! 2023-11-03 10:42:22 Scale as in LOC 2023-11-03 10:42:48 Not sure what you mean still I'm afraid 2023-11-03 10:43:11 I'd recommend eval for each colon word potentially, does that make sense? 2023-11-03 10:44:12 veltas: But how would one eval() know about defs from another eval()? 2023-11-03 10:44:54 Give them global names maybe 2023-11-03 10:44:58 Or put them in a linked list or something 2023-11-03 10:45:20 and do a word lookup like regular forth, depends how integrated this wants to be 2023-11-03 10:45:46 I'd recommend giving them global PHP identifiers if that's possible through eval() 2023-11-03 10:46:25 Might have a scheme for converting forthy names to PHP identifiers, or just limit names to PHP identifiers 2023-11-03 10:46:49 I was thinking of just using gforth to programmatically create PHP source code and write that to file, not make my own Forth. In that case. 2023-11-03 10:47:28 You can do that too, that's much easier 2023-11-03 10:48:01 Have you got a sort of example of what sort of translation you want? I might be able to help prototype 2023-11-03 10:48:04 Like `: startphp ." veltas: Latest mini-project was a program to parse google results, https://github.com/olleharstedt/query/blob/main/testfork.php 2023-11-03 10:49:34 Using a pipeline class 2023-11-03 10:49:36 ." is what you want, gforth lets you redirect I/O 2023-11-03 10:49:44 Ah nice :) 2023-11-03 10:49:53 I think maybe (TYPE) is DEFER'd 2023-11-03 10:50:04 You'll have to look at your gforth 2023-11-03 10:50:29 Yep 2023-11-03 10:50:41 Could potentially just run gforth from shell and pipe it with shell redirection too 2023-11-03 10:51:00 Only issue with writing to file instead of an intermediate data structure is getting rid of checks, like doing `startphp` twice or whatever. 2023-11-03 10:51:03 veltas: True 2023-11-03 10:51:07 i.e. `gforth -e 'include myfile.4th' -e bye` 2023-11-03 10:52:43 Yea :) 2023-11-03 10:52:50 It's all coming together. 2023-11-03 11:14:52 I guess Forth could be a metalanguage for any (scripting) language like that. Hm. 2023-11-03 11:18:07 Yup 2023-11-03 11:18:45 Good for generating HTML articles I think 2023-11-03 11:19:27 Yea! 2023-11-03 13:25:48 Hey, did anyone work out the three indistinguishable dice puzzle? 2023-11-03 13:26:16 Or, puzzles, rather - the easy one was extracting a one-die distribution from it and the harder one was to extract a two dice distribution from it. 2023-11-03 13:26:34 Not just the sum on that last one - you need to be able to identify two distince single-die values. 2023-11-03 13:26:59 Hint on the last one - don't put restrictions I didn't state on yourself. 2023-11-03 13:27:16 you just need a procedure that is practically usable in a gaming situation. 2023-11-03 18:37:13 Nice - Europe has just passed a new law. "Any natural or legal person that places on the market products incorporating portable batteries shall ensure that those batteries are readily removable and replaceable by the end-user at any time during the lifetime of the product." 2023-11-03 18:37:23 Kudos to Europe. 2023-11-03 18:38:29 I've seen a number of items that highlight how much more sensitive Europe is to consumer issues than America. Now the question will be whether or not it's worth it to the phone companies to make their phones two different ways so they can keep selling us the sealed up ones here in the US. 2023-11-03 18:40:01 I just wrapped up for the week. Got all of my test stands screaming along at full capacity; sometime during the weekend I'll cycle them to a second set of jobs, so I'll have a whole pile of new results come next week. I like it when they're busy. :-) 2023-11-03 19:52:24 Wow - that was an excellent jog. 2023-11-03 19:52:38 Longer and faster. 2023-11-03 19:53:49 harder better faster stronger 2023-11-03 20:48:16 Heh heh. Coming into the summer a few months ago, I was in pathetic shape. I'd done almost no regular exercise for... well, years. I finally decided I had to do something about it, and all I could really do at first was walk, especially with the heat we had here this summer. 2023-11-03 20:48:53 But the last month or so I've started to really feel some oomph come back into it. Been a hard row to hoe, but I think I'm over the hump now. 2023-11-03 20:49:04 Been doing some weight lifting several times a week too. 2023-11-03 21:12:27 i take a shower a couple of times a week. that's enough exercise for me 2023-11-03 21:40:27 :-) 2023-11-03 21:40:41 I'm getting old enough that I figure I better give it some attention. 2023-11-03 22:28:12 I mean, if I had any sort of significnt medical issue, fit vs. not fit might make all the difference. 2023-11-03 22:28:30 Not even mentioning the ones that being fit can help PREVENT, like heart issues. 2023-11-03 22:29:25 Anyway, before today I called what I'd been doing "jogging" at best, but I started to feel like it was qualifying as "running" some of the time today. At least when I wasn't going uphill. 2023-11-03 22:29:25 or reaching those hard to reach shoes 2023-11-03 22:29:33 :-) 2023-11-03 22:30:13 A bit stomach hasn't really ever been one of my issues. I was overweight at times, but I seemed to tuck it away "all over" instead of around my middle. 2023-11-03 22:30:33 I certainly don't have that problem right now - if anything I'm lighter than I'd prefer.