2024-07-15 11:40:04 Is there a reasonably portable method of determining the current number of cells on the stack? (And on the FP stack)? I've had a couple of bugs in my code where I've left extra crud on the stack, and I'd like to write tests to ensure that I'm not leaving extra stuff behind. 2024-07-15 11:44:05 DEPTH . 2024-07-15 11:48:25 Thank you. 2024-07-15 11:49:29 no worries 2024-07-15 12:48:59 darkling: I think the floating point equivalent will probably be system-specific. 2024-07-15 12:50:21 There's an FDEPTH in the standard 2024-07-15 13:04:42 Fair enough, and that's hte name I would have chosen too. I still doubt it's as "universal" as DEPTH. My guess would be that almost all systems including the ones that don't profess to be standard would have DEPTH - it's got "history" behind it. 2024-07-15 13:57:58 KipIngram: It's not universal because the standard doesn't specify whether it's the same stack as the parameter stack, or a separate stack 2024-07-15 13:58:08 Although every implementation I know of has a separate stack 2024-07-15 13:58:43 darkling: So unfortunately there's this inherent non-portability of the floating point stack 2024-07-15 14:41:23 Yeah, I've debated with myself about that same stack / separate stack question. 2024-07-15 14:41:56 We've talked a little about the vector floating point instructions - I figure the best way to use those resources would be to keep the data in place. 2024-07-15 14:42:34 Yeah I don't think you can do vector stuff on a stack effectively, agreed 2024-07-15 14:42:45 Unless you want a bit vector :P 2024-07-15 20:45:21 If I want to convert a number from the stack into a text string, I thought I could use <# #S #> to give me ( addr n ) on the stack, where addr is a pointer to n chars containing the converted string. 2024-07-15 20:46:02 That's my reading of the standard, at least. However, when I try it, I'm getting a single number on the stack, which appears to be the length of the string plus 19. 2024-07-15 20:46:11 What am I doing wrong here? 2024-07-15 20:47:07 https://dpaste.com/HW8Y7CJJZ 2024-07-15 20:48:47 The number on the stack should be a double cell value 2024-07-15 20:49:38 That doesn't seem to be the case here. 2024-07-15 20:49:46 I'm using pforth 2024-07-15 20:50:55 https://ideone.com/kNFRwX 2024-07-15 20:51:01 That's gforth 2024-07-15 20:51:24 Oh, sorry, I see -- the *input* should be a double cell. 2024-07-15 20:52:09 Yeah 2024-07-15 20:52:26 Yes, that's much happier. 2024-07-15 20:52:28 Thanks. 2024-07-15 20:52:32 :) 2024-07-15 21:02:41 My poland dude found the website 2024-07-15 21:02:51 https://forthsalon.appspot.com/ 2024-07-15 21:03:05 I definitely think we could make a better version of this 2024-07-15 21:03:22 crc -^ 2024-07-15 21:18:03 Ohhh, that's neat 2024-07-15 21:25:22 For real these are great for the My4th system 2024-07-15 21:25:27 Very fun stuff 2024-07-15 22:19:28 I realise that this is probably about as portable as a neutronium suitcase, even if it exists, but is there anything commonly used for concurrent programming? (Specifically, I want to run code in parallel on more than one core). 2024-07-15 22:31:00 I think people just run forth on each core lol. 2024-07-15 22:33:59 Fair. :) 2024-07-15 22:36:22 I don't really know what multi-core IPC looks like 2024-07-15 22:36:34 I imagine it's just...talking over memory, or even better, caches 2024-07-15 22:37:39 Plus concurrency control on the memory (mutexes, semaphores). 2024-07-15 22:39:44 Caches are worse, because if you have a separate cache for each core, you have to deal with cache invalidation on writes, and ensure that that's consistent with locking. 2024-07-15 22:41:24 True I was thinking like shared cache higher up 2024-07-15 22:41:31 Since machines have so many level of caches today 2024-07-15 23:08:34 I thought the processor hardware handled cache line invalidation. 2024-07-15 23:10:34 Mmm. Yes. Different value of "you", I guess. :)