2022-12-07 07:46:08 Yes - define that. The block interface is pretty simple - there's not a lot to it. I think the main variation is how you handle the caching of information in block buffers. 2022-12-07 07:46:58 Usually you have "block-read' and "block-write" words that do something very precise - you give them a block number and a RAM address and they just read a block into that address or write a block out. 2022-12-07 07:47:07 Very little there you can change. 2022-12-07 07:47:29 But then you will have some set of block buffers that you use to hold your disk data, and exactly how you manage those is often subject to some variation. 2022-12-07 07:48:05 Not a lot, actually. The idea, though, is just to get something like good performance without you having to manage all of that space entirely on your own. 2022-12-07 07:48:49 When you run block, the system CHOOSES one of those buffers to put your data in, and if that buffer was previously dirty then its former content is written back out before it's reloaded. 2022-12-07 07:49:14 You don't usually know which buffer will be chosen - the system just leaves the address of one on the stack for you. 2022-12-07 07:49:38 Normally there would be some sort of least recently used algorithm in play there. 2022-12-07 07:53:29 But exactly how you make that choice is subject to some performance/flexibility tradeoffs. 2022-12-07 07:53:44 I use a hash algorithm to get from block # to buffer #. 2022-12-07 07:53:56 And I usually have a lot of block buffers, like 256 or something. 2022-12-07 07:57:43 BTW, I don't really think of that as a "file system"; for me a file system is a level up from there and associates a *sequence of blocks* with an entity we call a file. 2022-12-07 08:02:54 It's been said that Forth has the only truly portable 'filesystem', in reference to blocks 2022-12-07 08:03:35 I have to wonder if joe9 meant to ask about *applications* of blocks 2022-12-07 08:05:53 Yeah, that would make sense. 2022-12-07 08:06:46 People gripe about the block system, but the truth is EVERY operating system has that block oriented functionality somehow - because that's how the underlying disk drives work. Forth just allows you to see it in an up-front sort of way. 2022-12-07 08:07:22 Sure, you could hide it behind a file system interface, but I think its explicit presence is in keeping with Forth's philosophy of giving you full control. 2022-12-07 08:09:01 Really BLOCK already offers an abstraction since it manages buffer space for you. It's BLOCK-READ and BLOCK-WRITE that are fundamental. 2022-12-07 08:09:50 My BLOCK-WRITE doesn't itself check the dirty bit before writing - it just writes. The dirty bit is consulted in BLOCK. 2022-12-07 08:11:04 My implementation of BLOCK is a little unusual. It's a primitive, so that the entire "already present in a buffer" path is machine code. But if the block is not present in a buffer already then that primitive will transfer control to a Forth word to do the more complicated stuff. 2022-12-07 08:11:30 I wanted it to be as fast as possible in cases where the desired data was already in RAM. 2022-12-07 08:12:32 I use a really simple hash to go from block number to buffer number, and there are only two buffers eligible to hold any given block. 2022-12-07 08:12:49 I rely on having a large number of buffers to keep thrashing down. 2022-12-07 08:13:05 So if I wanted to write a word that would thrash it would be pretty easy for me to do it. 2022-12-07 08:13:27 Just repetitively load three blocks all of which went to the same buffer pair. 2022-12-07 08:14:53 The tradeoff there is that if more buffers can hold a block, it takes you longer on average to find your already resident data. 2022-12-07 08:59:04 KipIngram: Currently my plan for bot forth is that you can store in blocks, and share blocks between users 2022-12-07 08:59:25 And then if there's an FS it will be on top of that, rather than as an alternative etc 2022-12-07 09:00:02 Well your blocks will be read only 2022-12-07 09:00:23 People will get absolute block number ranges coded to the user 2022-12-07 09:14:59 Read only blocks? So, how will you update disk? 2022-12-07 09:23:10 KipIngram: I mean read only to other users 2022-12-07 13:33:34 "In Forth you can "assign" code to data with DOES>" 2022-12-07 13:33:35 True? 2022-12-07 13:34:01 'yea' 2022-12-07 13:35:27 mm 2022-12-07 13:47:38 "In Forth there is a harsh division between cell-sized types that fit on the stack and memory-based data structures" 2022-12-07 14:03:19 The Forth Lisp Python Continuum is a language made under the following incorrect assumption. 2022-12-07 14:03:22 Python is Lisp with syntactic sugar and Lisp is Forth with syntactic sugar. 2022-12-07 14:03:22 https://github.com/asrp/flpc/ 2022-12-07 14:05:56 when did python get macros? 2022-12-07 14:16:56 I have a more trivial question - when did it get a lexical scope? 2022-12-07 14:17:20 Well it does say "incorrect assumption" so 2022-12-07 14:18:04 fair enough 2022-12-07 14:18:11 forth is like an abused child 2022-12-07 14:18:23 everyone that looks at it must do something weird 2022-12-07 15:32:07 : drawer[] ( n -- addr ) \ return address of drawer n 2022-12-07 15:32:14 Is that idiomatic, using [] as address? 2022-12-07 15:34:02 there are no [] in ANS 2022-12-07 15:35:48 I know, I meant using [] in a word like that to annotate address 2022-12-07 15:39:10 https://rosettacode.org/wiki/100_prisoners#Forth 2022-12-07 15:53:02 wellif it is for an array it might 2022-12-07 15:54:09 It is yes 2022-12-07 15:54:24 So kinda mimic C tradition then 2022-12-07 15:55:05 or any Algol68 syntax inspired programing languages 2022-12-07 16:04:05 Yes sorry :D 2022-12-07 16:04:42 One could use asterisk too? : *drawer or drawer* 2022-12-07 16:04:48 But maybe that looks less like an array 2022-12-07 16:40:32 olle: yeah kind of I guess 2022-12-07 16:40:48 olle: I've never used any kind of syntactic notation to say that for example a thing is an array 2022-12-07 16:44:14 plural wording should be enough to annotate list or array imo 2022-12-07 16:46:00 olle: idiomatically you'd have a word that returns the address of your drawer for a given value on stack 2022-12-07 16:46:16 so it'd be something like 0 drawer @ 2022-12-07 16:46:34 and I'd read that - you might not - as "zeroeth drawer fetch" 2022-12-07 16:46:43 or whatever 2022-12-07 16:46:55 something along them lines, anyway 2022-12-07 16:46:55 check the link for full code listing 2022-12-07 16:47:04 I didn't write it :) 2022-12-07 16:47:36 I don't appear to be able to get it right now, I'm on my work laptop and it has strange interactions with my network at home 2022-12-07 16:47:44 Ah 2022-12-07 16:48:09 it may be sending web requests to the work proxy or it may be attempting to do them directly using IPv6 although it appears to not use the proxy for on-prem stuff 2022-12-07 16:48:45 the fact that the whole thing goes down an l2tp tunnel with some stuff breaking out locally over 4g and some over VDSL just adds to the excitement 2022-12-07 16:49:35 lol k 2022-12-07 16:50:22 olle: my partner and I both work from home, her stuff requires shitfast lowlatency two-screens-at-once-rdp insanity, mine just requires to never ever ever ever ever drop ever 2022-12-07 16:50:59 olle: it's actually safer for me to work on some of the networking gear I poke semi-effectualy at from home than it is from sitting on site right beside it 2022-12-07 16:51:24 interesting use case :) 2022-12-07 16:52:05 well a lot of it is a hangover from when I lived properly in the sticks and could get 2Mbps ADSL or 40Mbps 4G 2022-12-07 16:52:19 but 4G was CGNAT so lots of stuff was unhappy 2022-12-07 16:52:37 that's beyond my knowledge, thankfully 2022-12-07 16:52:49 heh 2022-12-07 17:31:41 Ehm, how is a value different than a variable? If it can be changed with TO 2022-12-07 17:41:28 variable puts an address on the stack 2022-12-07 17:41:31 value puts the value 2022-12-07 17:41:56 I'm confused 2022-12-07 17:44:57 Asking on SO, easier to elaborate there, and others will benefit from it 2022-12-07 17:45:49 a) pointer to moon b) moon 2022-12-07 17:47:17 ok 2022-12-07 17:47:25 if you define a word as 5 value A 2022-12-07 17:47:30 when you type A 2022-12-07 17:47:35 you get 5 put on the stack 2022-12-07 17:47:49 when you type variable A 2022-12-07 17:47:52 when you type A 2022-12-07 17:47:58 you get an address put on the stack 2022-12-07 17:48:07 to get the value inside, you use @ 2022-12-07 17:48:12 to write to it, you use ! 2022-12-07 17:49:06 https://stackoverflow.com/questions/74723640/how-is-a-forth-value-different-from-a-variable 2022-12-07 17:49:19 i just answered 2022-12-07 17:49:23 \o/ 2022-12-07 17:49:31 in the irc 2022-12-07 17:49:34 oh >< 2022-12-07 17:49:47 lemme copy paste 2022-12-07 17:49:51 value creates a word that puts a value on the stack 2022-12-07 17:49:51 I'll remove your name 2022-12-07 17:49:59 variable creates a word that puts an address on the stack 2022-12-07 17:54:42 thanks, will read again tomorrow, have to sleep 2022-12-07 17:54:43 \o 2022-12-07 18:06:43 He's left now but I've added an answer to the SO question 2022-12-07 18:07:39 thrig: Mars is quite close to the moon at the moment in the sky, and apparently is a full Mars 2022-12-07 18:08:16 been looking at it this evening 2022-12-07 18:08:27 you can see slight red tint 2022-12-07 18:08:30 Now: ☁️ 44°F Overcast Clouds 2022-12-07 18:19:47 About 30 where I am 2022-12-07 18:20:14 Or whatever "below freezing" is in F 2022-12-07 18:20:32 And clear skies 2022-12-07 18:21:27 I'm not far off, is -28*F 2022-12-07 18:21:35 Sorry.... 28*F 2022-12-07 18:21:49 -28*F is a different matter altogether lol 2022-12-07 18:23:11 the geolocation is defaulting to F for the app in question 2022-12-07 18:23:29 but the important point for moonview(TM) is the overcast 2022-12-07 18:23:55 Yeah 2022-12-07 18:24:14 The clear skies is very much related to why it's below freezing 2022-12-07 18:24:29 I guess western washington isn't a hotbed for astronomy for various reasons 2022-12-07 18:24:31 So nice skies but nasty cold weather for walking dogs 2022-12-07 18:25:32 I don't know F well but I remember 32*F is 0*C, and 212*F is 100*C 2022-12-07 18:25:56 And 0*F is roughly the temp seawater freezes over 2022-12-07 18:26:11 So you bloody well know if it's 0*F 2022-12-07 18:30:12 https://qph.cf2.quoracdn.net/main-qimg-6a2a70bca5195e8a7448c6e47a104fc3 2022-12-07 20:02:19 Fortunately I've never experienced 0 F. 2022-12-07 20:02:42 I think once in my life, when I was a kid, it got down to 4 F, but I hid inside. 2022-12-07 20:03:22 And that was quite far south in the US; it was an absolutely "freak" thing.