2021-12-18 00:05:38 forth project on hacker news: https://news.ycombinator.com/item?id=29593032 https://github.com/RickCarlino/fbbs2 2021-12-18 03:51:56 joe9: Because if the strings contain same content up to min(n1,n2), then on next access you will check next character which is out-of-bounds 2021-12-18 03:52:14 Offset min(n1,n2)-1 I should say 2021-12-18 03:53:02 And the point of compare is to decide which string comes first, not just whether they are the same string 2021-12-18 05:30:23 http://okturing.com/src/12824/body I am trying to figure out how restore-input here works? 2021-12-18 05:30:31 It seems to expect an n in the stack. 2021-12-18 05:30:43 to do the 5 <> 2021-12-18 05:30:58 but, I cannot figure out who is providing the n 2021-12-18 05:31:06 s/th/that/ 2021-12-18 05:31:32 the query when it calls ?restore-input, does not have anything on the stack. 2021-12-18 05:39:04 What is this from? Looks neat. 2021-12-18 05:56:37 joe9: restore-input is a standard forth word 2021-12-18 05:57:09 Its signature is ( x_n ... x_1 n - flag) 2021-12-18 05:58:48 There is also save-input which has sig ( - x_n ... x_1 n) 2021-12-18 06:16:27 Took me a while to figure out that's a paste website 2021-12-18 06:23:35 Oh, part of CORE EXT in ANS Forth 2021-12-18 06:23:57 I almost didn't pay much attention to them, but apparently they're useful in building the core word set. 2021-12-18 06:24:02 Good to know. 2021-12-18 06:25:02 They're something I don't know if I fully understand how to use, or what their implications are 2021-12-18 06:25:39 Like for example, if I'm parsing inside `include` am I going to be able to restore the line I'm on with it? 2021-12-18 06:26:01 I don't think I could restore the line I'm on at the REPL 2021-12-18 06:26:58 Maybe it's up to the implementation, and the point is just to let you nest contexts of parsing for i.e. `execute` so you can share stuff like `>in` 2021-12-18 06:29:36 neuro_sys_, joe9: They're paired with n>r and nr> by the way, which can send/retrieve a context laid out in that format to/from the return stack 2021-12-18 06:33:43 Sorry I mean `evaluate`, not `execute` 2021-12-18 07:57:20 Not too relevant, but I do remember reading INCLUDE should allow nesting up to 8 levels. 2021-12-18 07:58:01 I haven't implemented it yet, but it sounds like you need a stack to store the previous line buffer and file handle stuff. 2021-12-18 07:59:42 SAVE-INPUT description seem to imply the stack/recursive nature of it. 2021-12-18 08:00:20 Not sure why you prefixed with "Not too relevant", because what you said seems highly relevant 2021-12-18 08:00:31 Indeed :D 2021-12-18 08:00:50 Not too relevant, but: yes. 2021-12-18 08:00:56 Haha 2021-12-18 14:26:57 are there any other general-architecture compiled forths besides movforth? 2021-12-18 17:22:40 potatoalienof13, how do you mean? 2021-12-18 17:38:35 MrMobious: Forth implementations that compile to machine code, and are not restricted to only one architecture. 2021-12-18 18:44:43 I suppose there's nothing in the standard to print integers right justified with N digits like %2d in printf? 2021-12-18 18:50:31 Ah it's doable with <# # #> alright. 2021-12-18 19:26:47 https://github.com/neuro-sys/advent-of-code-2021/blob/main/4-1.fs.md