00:00:00 --- log: started forth/19.01.23 00:20:28 --- quit: gravicappa (Ping timeout: 246 seconds) 00:21:13 --- join: gravicappa (~gravicapp@h109-187-28-67.dyn.bashtel.ru) joined #forth 00:54:49 --- join: xek_ (~xek@apn-31-0-23-82.dynamic.gprs.plus.pl) joined #forth 01:46:44 --- join: smokeink (~smokeink@185.189.254.154) joined #forth 01:55:36 --- quit: smokeink (Remote host closed the connection) 02:05:03 --- quit: ashirase (Ping timeout: 272 seconds) 02:07:36 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:21:52 --- join: smokeink (~smokeink@118.131.144.142) joined #forth 02:51:47 --- quit: gravicappa (Ping timeout: 246 seconds) 03:09:17 Hola Forthwrights :) 03:14:47 good morning 03:22:22 Hi crc 03:25:51 I'm coming down with the flu, can't concentrate on anything. 03:27:35 good morning/evening forthers 03:28:53 hi 03:35:00 what's good 03:53:21 Working on man pages for the retro executables and refactoring my glossary tool. 03:54:28 Just relaxing today, nothing productive. 03:54:52 --- quit: smokeink (Remote host closed the connection) 03:58:38 nothing forthy yet, getting my esp LED matrix driver ready 04:11:24 --- join: gravicappa (~gravicapp@h109-187-28-67.dyn.bashtel.ru) joined #forth 04:31:32 --- quit: pierpal (Read error: Connection reset by peer) 04:32:28 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 04:33:10 --- quit: tabemann (Remote host closed the connection) 04:33:23 --- join: tabemann (~tabemann@2600:1700:7990:24e0:8d7a:3d82:9669:8573) joined #forth 04:41:42 --- join: smokeink (~smokeink@118.131.144.142) joined #forth 04:44:49 --- join: Zarutian (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 04:56:15 --- quit: proteusguy (Ping timeout: 245 seconds) 05:01:50 --- quit: smokeink (Remote host closed the connection) 05:02:11 --- join: smokeink (~smokeink@218.255.73.180) joined #forth 05:22:47 --- quit: rdrop-exit (Quit: Lost terminal) 05:58:30 --- join: proteusguy (~proteusgu@cm-58-10-154-54.revip7.asianet.co.th) joined #forth 05:58:30 --- mode: ChanServ set +v proteusguy 06:28:31 --- quit: smokeink (Remote host closed the connection) 06:28:54 --- join: smokeink (~smokeink@185.189.254.154) joined #forth 06:30:35 https://github.com/rufig/spf/blob/master/devel/~af/lib/c/define.f what does HEADER do in this code ? 06:31:00 question2 : what does "0 PARSE EVALUATE ," do ? 06:31:38 0 PARSE EVALUATE , <- does this parse the next number from the input stream and then store it inside the word #define's code ? 06:35:19 HEADER probably lays down a word header 06:45:35 yea without seeing these functions 06:45:49 words* 06:47:59 https://github.com/rufig/spf/blob/90cc85c92f002bc7dd93077de41b7d97aa5de79d/spf3-src/compiler/spf_defwords.f has HEADER, which lays down a new header 06:55:26 does HEADER get it's "name" parameter from the input stream ? 06:55:34 https://github.com/rufig/spf/blob/master/src/compiler/spf_parser.f has PARSE 06:55:55 PARSE takes a delimiter character and returns a string address & length 06:56:39 yes, HEADER takes the name from the input stream 06:57:00 got it, it uses NextWord (just tried it in the repl to see how it works) 06:59:21 --- nick: xek_ -> xek 07:02:58 everything is clear now 07:26:00 --- join: darithorn (~darithorn@75.174.238.174) joined #forth 07:30:49 --- join: MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 07:36:57 --- join: dave0 (~dave0@193.060.dsl.syd.iprimus.net.au) joined #forth 07:37:53 hi 07:38:11 hi dave0 07:38:35 hi Zarutian 08:15:11 I'm about halfway through my glossary tool updates. 08:17:29 what's the new glossary approach? 08:18:42 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 08:19:11 Still using the same data file, but cleaning up and refactoring the code. When I'm done, it'll be easier to maintain. 08:19:44 always a Good Thing™ 08:20:19 I'm also adding some new options (e.g., 'missing' to show words with no entries in the data file and more export formats) 08:21:03 The 'missing' bit is useful; it let me find and add four words I forgot previously 08:21:46 opcode:comma 08:22:04 One I think I saw in the source yesterday 08:22:44 Hmm, that's not in my source tree 08:22:53 comma:opcode maybe 08:23:00 it was in Rx.md 08:24:26 That's not exposed as a word 08:27:31 The words data file only includes words visible in the final dictionary, so none of the internal factors are in its 08:46:20 --- quit: nighty- (Remote host closed the connection) 08:48:13 --- quit: smokeink (Ping timeout: 244 seconds) 09:10:52 --- join: dys (~dys@tmo-103-124.customers.d1-online.com) joined #forth 10:51:29 --- quit: gravicappa (Ping timeout: 240 seconds) 11:50:24 --- quit: xek (Remote host closed the connection) 11:51:01 --- join: xek (~xek@apn-31-0-23-82.dynamic.gprs.plus.pl) joined #forth 12:56:58 --- quit: dys (Read error: Connection reset by peer) 12:59:49 --- quit: KipIngram (Ping timeout: 240 seconds) 13:00:06 --- join: KipIngram (~kipingram@185.149.90.58) joined #forth 13:00:30 --- nick: KipIngram -> Guest8377 13:18:24 --- nick: Guest8377 -> KipIngram 13:18:32 --- mode: ChanServ set +v KipIngram 13:31:29 All that's left is the server part of the glossary tool. I've added an HTML export and refactored most of the other parts. 13:35:27 --- quit: xek (Remote host closed the connection) 13:54:12 --- join: dys (~dys@tmo-103-124.customers.d1-online.com) joined #forth 14:01:34 --- join: smokeink (~smokeink@185.189.254.154) joined #forth 16:05:50 --- quit: proteusguy (Ping timeout: 244 seconds) 16:06:27 --- quit: tabemann (Ping timeout: 250 seconds) 16:30:28 --- join: tabemann (~tabemann@rrcs-98-100-171-35.central.biz.rr.com) joined #forth 16:41:57 --- join: rdrop-exit (~markwilli@112.201.166.158) joined #forth 17:05:05 hey 17:05:08 hey 17:05:23 hey 17:05:56 question: gforth can use $ to read hexnumbers from the input, spf uses 0x instead , is there an easy way to make gforth also understand the 0x syntax? or viceversa, to make spf understand $ 17:06:30 the normal forth prefix is $ 17:06:46 0x is heresy that is the product of trying to pander to C programmers 17:07:02 right, it does sound like heresy 17:07:32 radix prefix syntax is king 17:07:38 * tabemann remembers $ from 6502 assembly from back in his Apple //e days 17:07:38 so how to replace 0x with $ , is it difficult? 17:07:52 that's implementation dependent 17:07:56 is $ a normal word ? 17:08:06 in some forths $ is a normal mood 17:08:08 so that I can search for ": $" in the sourcecode? 17:08:11 in most it is a math prefix 17:08:16 *number prefix 17:08:41 you know this is all very dependent on the particular Forth 17:08:57 I cannot speak really for any Forth other than the ones I've coded 17:09:04 I understand yes 17:09:47 you might have to rewrite the math parsing routines, but it might not be able to patch them back onto the existing interpreter without metacompiling a whole new system 17:09:53 s/math/number 17:10:10 it all depends on how hard-coded things are 17:13:18 yes! fixed a stupid-ass bug 17:15:02 tabemann: but $ is an sigil infront of variables to derefernce them! 17:15:36 tabemann: so what do you think of 0o, 0q and 0b 17:16:22 if you're gonna use 0x, you should support 0o and 0b - never heard of 0q 17:16:34 Zarutian, lol 17:16:45 you know for 0o666 in unix file permissions, 0q01332 in quads and such 17:16:58 but I do support them 17:17:32 I've never used anywhere that used quad numbers 17:17:40 *seen anywhere 17:20:10 me neither but hey I was adding 0x, 0o and 0b support so I threw 0q in too just for giggles 17:21:21 the only use for them I can think of is direction encoding for 'needles' as used with GA144 arrays and such 17:31:26 It's simpler to have prefixes such as $ be their own words then to complicate the interpreter, i.e. 17:32:12 I figured I might as well make them part of the numeric parser function because otherwise I'd have to add complexity to save and restore numeric bases and like anyways 17:32:26 "$ f0f0" instead of "$f0f0" 17:32:53 I found the complexity increase of doing $f0f0 isn't much 17:33:14 rdrop-exit: immediates? 17:34:14 Yes 17:34:36 Every bit of added complexity counts 17:34:44 well, you could have them parse too, I suppose 17:35:20 I don't have a BASE variable 17:35:32 yer not missing much. 17:35:59 I find BASE to be a pain in the dick. Too many screens/code change base and leave it 17:36:18 It's unecessary state 17:37:17 I don't mind $A #10 %1010 - I just get tired of umpty spins on it. 17:37:54 brb 17:41:09 I only have decimal in my system. Other bases are left up to the user. 17:42:50 My interpreter uses decimal, I have a $ prefix word for hex, and % for binary. 17:43:52 that's clever 17:43:57 i like forth more and more :) 17:44:27 Cool 17:45:13 I can't do prefix words like that in mine. I can add single character prefixes, though I use $ for characters. 17:46:16 why can't you? 17:46:25 I've thought about adding a sample of extending the # prefix to support smalltalk style radix changes 17:47:03 Here's the source code for my $ prefix: 17:47:23 My system doesn't have a conventional parser. Each token is executed in isolation, with no way to wait for potential future tokens in an input stream. 17:47:37 : ($) ( -- u ) token 16 unsigned ; compiled 17:47:37 : $ ( -- u ) ($) ; interpreted 17:47:37 : $ { -- } ( -- u ) ($) & literal ; directive 17:47:40 but that's half the forth 17:48:23 I've not missed it in the last 2-3 years since I started down this path 17:48:36 ok 17:49:49 (my system is very much non-traditional though. It's closer to colorforth than conventional forths) 17:50:56 Can .\" be defined in terms of S\" ? 17:51:18 Gforth? no idea 17:52:26 sp-forth , I'm using this http://www.forth200x.org/escaped-strings.html but now I also need .\" 17:52:53 I don't use escaped strings, can't help you there 17:53:01 : .\" POSTPONE S\" TYPE ; IMMEDIATE \ tried this but fails 17:53:56 it doesn't work when inside a definition of another word, it just works inside the repl 17:54:42 bbiab 17:54:56 : .\" postpone s\" postpone type ; immediate \ works in definition but not repl 17:55:46 crc: thanks, it works now 17:56:22 no problem 17:57:49 --- quit: X-Scale (Ping timeout: 240 seconds) 18:00:30 crc: oh, I didn't read that part of the comment "but not in repl" :D 18:01:28 I'll see if I can fix that when I get home from this walk; hard to code on an ssh connection from my phone 18:01:42 I think there must be a way, to use a condition or something, so that it only postpones when it's inside the definition of a word 18:01:49 okay, I'll first try to fix it myself 18:04:48 --- quit: tabemann (Ping timeout: 240 seconds) 18:12:50 --- join: X-Scale (~ARM@46.50.0.93) joined #forth 18:17:30 back 18:26:21 : .\" STATE @ IF POSTPONE S\" POSTPONE TYPE EXIT THEN ['] S\" EXECUTE TYPE ; IMMEDIATE 18:27:05 This works in gforth 0.7.3 both in definitions or at the repl 18:32:10 ah, state-smart - the boogeyman of forth 18:33:37 I try to use them sparingly :) 18:35:22 --- nick: ynoom -> moony 18:35:41 I don't have STATE, it's just bad factoring. 18:42:41 I've thought about eliminating it, but it's not a high priority for me 18:47:45 I eliminated it 20 years ago. 18:56:10 crc: thanks! 18:57:53 what's bad about STATE ? 18:58:18 About 20 years ago there was a flurry of discussion on clf on how to deal cleanly with the issues surrounding cleanly with STATE, but the standard punted. 18:59:10 No one is supposed to test it or use it - they cry and scream and throw tantrums 19:00:04 then is there a way to redefine the above .\" without using STATE ? 19:00:35 smokeink: state smart words can lead to subtle, difficult to identify bugs 19:03:35 smokeink: It depends on the Forth 19:05:29 Basically state-smart words are a way to have a non-default combination of interpretation and compilation behaviors. 19:06:10 On my Forth, when I deal with those types of words by factoring the two behaviors into two definitions. 19:06:39 --- join: tabemann (~tabemann@172-13-49-137.lightspeed.milwwi.sbcglobal.net) joined #forth 19:06:51 In your case: 19:07:33 : .\" ... ; interpreted 19:07:45 : .\" ... ; directive 19:10:48 cmforth had separate dictionaries for interpret and compile time 19:11:05 The new standard uses a different approach, can't recall the details. 19:11:23 mpe's ndcs stuff? 19:11:43 I don't think they've settled it yet. 19:12:53 I looked into MPE's approach, didn't care for it. 19:13:29 I wrote a reddit post on the approach I use. Just a sec... 19:13:51 --- quit: dave0 (Quit: dave's not here) 19:14:08 https://www.reddit.com/r/Forth/comments/9izdtq/a_simple_approach_to_dual_words/ 19:16:10 I remember seeing that 19:17:29 I've since renamed COMPILE-ONLY to COMPILED, and INTERPRET-ONLY to INTERPRETED, but have made no changes to the fundamental approach. 19:18:25 ok, so to avoid STATE altogether the forth must have an alternative mechanism . Does GForth have any alternative mechanism ? I see it doesn't recognize the words "interpreted" and "directive" 19:19:12 I assume it does, although what the standard mechanism will be hasn't been settled yet. 19:20:12 I'll download the Gforth manual 19:21:30 https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Combined-words.html 19:22:01 There we go, thanks crc. 19:22:15 No problem 19:24:17 heh.. rdrop-exit that post is cute.. Mind you, your naming-procedures are a bit skewed.. I like it, though 19:25:10 Thanks PoppaVic 19:25:48 Thing is the idea of "normal".. The Compile/Interpret duality dates all the way back. 19:26:33 I tend to think we are looking at Macro vs ops - maybe vs the REPL/interp idea. 19:27:29 --- quit: darithorn (Ping timeout: 240 seconds) 19:30:48 There's also inlining, which the standard doesn't really address. 19:31:02 https://el-tramo.be/blog/waforth/ 19:31:13 I would think it's part of assembly, but that's me 19:32:33 I like to be able to specify wether a definition should be called or inlined. 19:32:51 oh, you mean extracting relative code to replonk elsewhere 19:33:09 yes 19:34:20 e.g. 19:34:22 : off ( a -- ) 0 \! ;inline 19:34:22 : on ( a -- ) -1 \! ;inline 19:34:25 yeah, to me that smacks mostly of a MACRO or fetching something from a db 19:35:22 : here ( -- a ) dp @ ;inline 19:35:53 etc... 19:38:52 It's basically laying down the code rather than laying down a call to the code. 19:41:38 bbiab 19:57:19 back 20:00:43 back 20:00:53 hey guys 20:01:06 Hi tabemann 20:01:17 wb 20:02:42 inlining would also require either relocating inline branches or forbidding branches in inlined code 20:04:00 mind you this is not necessary if you're inlining native code and it only uses relative branches 20:04:24 You only inline code that makes sense to inline, that's the programmer's responsibility to be sure that's what he wants. 20:05:34 e.g. return stack manipulations have a different effect in an inlined definition vs a called definition 20:06:48 If you have to set out to write an inlinable definition. 20:07:57 The mechanism for the actual inlining is trivial though. 20:08:21 why inline? what is the gain? 20:09:14 3 possible benefits: 20:10:09 1) some things are simpler to code for inlining (e.g. avoid a lot of postponing). 20:11:02 2) size: in a subroutine threaded Forth the code itself may be shorter than a call to the code 20:11:30 3) speed: avoiding call overhead 20:12:07 I am going to mull on 1) a bit but respond to 2) & 3) 20:12:55 2) are the callsites to words in subroutine threaded forths enormous in the ISAs you are targetting? 20:13:27 Depends on the ISA 20:13:50 BTW 2) also applies to token threaded Forths 20:14:45 3) call overheads indicate that direct static branching isnt cheap on the ISA which indicate that something went really wrong at the ISA design phase 20:16:39 It's a tool in the toolkit, you use it when it benefits you. I don't see the issue. 20:18:36 the issue is program memory bloating, which impacts often on i- and d-cache resedency which in turn turns something that might have been 15 cycle pipeline stall into 600 cycle dram fetch 20:20:35 Like I said, you use it when it benefits you. 20:21:42 (3) is why I do a small amount of selective inlining. Inlining the primitives corresponding to single instructions and a few other specific words saves a little space, but reduces the call/return overhead significantly. 20:25:28 Let's say you have a token-threaded forth, there's a CALL token, let's say 1 byte, followed by an inlined destination address, let's say 32-bits. In the ON example above -1 and \! are each single-byte tokens. 20:26:04 Why bother calling ON (5 bytes) when you could just inline it (2 bytes). 20:27:00 Faster and smaller. 20:28:52 Any tool requires judicious application, Forth programmers are thinkers. 20:30:41 --- join: darithorn (~darithorn@75.174.238.174) joined #forth 20:39:03 No one is advocating indiscriminate use. 20:44:47 Here's an example of case #1, where inlining simplifies the definition: 20:45:19 0 shadow Return Stack Miscellanea 20:45:19 1 20:45:19 2 supplant Push the cell at onto the return stack and store 20:45:19 3 in its place. 20:45:19 4 20:45:22 5 revert Pop a cell and store at address . 20:45:24 6 20:45:46 --- quit: rdrop-exit (Quit: Lost terminal) 20:46:46 --- join: rdrop-exit (~markwilli@112.201.166.158) joined #forth 20:47:33 0 shadow Return Stack Miscellanea 20:47:33 1 20:47:33 2 supplant Push the cell at onto the return stack and store 20:47:33 3 in its place. 20:47:34 4 20:47:36 5 revert Pop a cell and store at address . 20:47:39 6 20:47:54 0 source Return Stack Miscellanea 20:47:54 1 20:47:54 2 : supplant ( x' a -- )( r: -- x ) !@ push ;inline compiled 20:47:54 3 20:47:54 4 : revert ( a -- )( r: x -- ) pop \! ;inline compiled 20:47:57 5 20:50:44 The above code manipulates the return stack, much simpler to just inline, than to write a call-able version that has to take the call's return stack usage into account. 20:51:55 Note: the standard name for POP is R> and for PUSH is >R 20:52:14 !@ is a memory exchange op 20:55:57 IIRC some Forth's use the names BURY and EXHUME instead of SUPPLANT and REVERT 21:02:23 It's use is to temporarily change the value of a global variable (e.g. BASE) and later restore it. 21:03:14 e.g. 16 base supplant ... base revert ... 21:07:44 Base [ hex ... ] v:preserve 21:07:54 (In mine) 21:10:18 I don't remember ever encountering BURY/EXHUME or SUPPLANT/REVERT 21:15:49 I can't recall which Forth had BURY/EXHUME, I'll try to dig it up (no pun intended). 21:16:09 aw you should have intended that pun 21:16:15 ;-) 21:19:59 --- join: gravicappa (~gravicapp@h109-187-28-67.dyn.bashtel.ru) joined #forth 21:21:10 BURY/EXHUME is from Thinking Forth, they have the same purpose but work bifferently from SUPPLANT/REVERT 21:25:18 Thanks 21:26:49 My pleasure 21:28:06 I was lucky to find it, it first checked All About Forth and the HS/Forth manual, then something in the back of my head told me to check Brodie because of the colorful names. 21:29:23 * "I" not "it" 21:38:25 --- quit: dddddd (Remote host closed the connection) 21:39:54 --- quit: darithorn (Quit: Leaving) 22:11:17 --- quit: rdrop-exit (Quit: Lost terminal) 22:24:53 --- join: proteusguy (~proteusgu@mx-ll-14.207.171-27.dynamic.3bb.co.th) joined #forth 22:24:53 --- mode: ChanServ set +v proteusguy 22:37:51 --- quit: pierpal (Quit: Poof) 22:38:09 --- join: pierpal (~pierpal@host53-189-dynamic.17-79-r.retail.telecomitalia.it) joined #forth 22:59:10 --- quit: pierpal (Ping timeout: 244 seconds) 23:53:48 --- quit: dys (Ping timeout: 240 seconds) 23:59:59 --- log: ended forth/19.01.23