00:00:00 --- log: started forth/20.04.02 00:06:17 --- quit: proteus-guy (Ping timeout: 240 seconds) 00:09:20 --- join: proteus-guy joined #forth 00:25:09 ""A Forth System without an assembly vocabulary is only slightly better than no forth at all. "" 00:29:39 --- quit: siraben (Quit: killed) 00:29:41 --- quit: jimt[m] (Quit: killed) 00:46:41 S-Jack, what's the source for that quote? 00:47:33 --- quit: WickedShell (Remote host closed the connection) 00:54:48 it's a good quote in my opinion 00:56:27 --- join: jsoft joined #forth 00:56:55 --- join: siraben joined #forth 01:08:55 --- join: jimt[m] joined #forth 01:10:30 yes, I agree for targets, for PCs though I don't really care anymore 01:14:48 yeah, nor would I 01:22:12 --- quit: cp- (Quit: Disappeared in a puff of smoke) 01:22:23 rdrop-exit: I lost the reference. I have to Google it myself... 01:22:54 ok thanks, I'll try my google-fu 01:23:37 --- join: cp- joined #forth 01:24:14 --- quit: cp- (Client Quit) 01:24:15 Please inform us (me) of whatever You find interesting. 01:24:27 ok :) 01:24:28 --- quit: Keshl (Read error: Connection reset by peer) 01:25:02 --- join: Keshl joined #forth 01:25:09 --- join: cp- joined #forth 01:26:17 --- join: xek joined #forth 01:41:30 --- quit: tabemann (Ping timeout: 252 seconds) 01:41:41 --- join: tabemann joined #forth 01:47:09 --- nick: aaaaaaaa -> webchat9 01:54:02 --- quit: webchat9 (Read error: Connection reset by peer) 02:01:34 --- nick: veltas_ -> veltas 02:11:11 --- join: webchat9 joined #forth 02:36:37 --- join: dave0 joined #forth 03:19:08 --- quit: jsoft (Ping timeout: 240 seconds) 03:23:56 is there any "apropos" word that can be used to search for the dictionary for regexp patterns? 03:24:45 --- quit: dave0 (Read error: Connection reset by peer) 03:25:54 --- quit: nonlinear (Quit: Ping timeout (120 seconds)) 03:26:21 --- join: nonlinear joined #forth 03:27:50 --- join: dave0 joined #forth 03:27:59 webchat9, I'd check the docs of your specific Forth, utility words vary widely between systems 03:28:56 yeah, I am asking generally, if anyone has heard of some forth implementation that has such an utility; I wanna take a look to see how it's implemented 03:36:00 When you say search the dictionary, are you searching for word names? 03:37:16 or are you searching the binary for strings? 03:37:27 or are you searching through source? 03:37:48 --- join: dddddd joined #forth 03:39:23 --- join: iyzsong joined #forth 03:41:07 searching for word names 03:41:19 in the dictionary/vocabulary 03:42:30 Look in your Forth for variants of FIND or WORDS that take a regular expression or similar pattern 03:43:20 I've never encountered one myself, but they might exist in some Forths 03:44:39 ok 03:46:18 WORDS looks interesting 04:30:02 --- quit: proteusguy (Ping timeout: 250 seconds) 04:30:05 --- quit: proteus-guy (Ping timeout: 256 seconds) 04:30:58 --- quit: rdrop-exit (Ping timeout: 260 seconds) 04:41:33 --- join: rdrop-exit joined #forth 04:42:51 --- join: proteus-guy joined #forth 04:42:51 --- join: proteusguy joined #forth 04:42:52 --- mode: ChanServ set +v proteusguy 05:05:49 --- nick: jedb_ -> jedb 05:07:34 GForth has a GNU Emacs mode. You could take a look at it (documentation and source). 05:08:44 thanks 05:27:57 --- join: mark4 joined #forth 05:45:57 --- quit: iyzsong (Ping timeout: 240 seconds) 05:56:36 --- quit: mtsd (Quit: Leaving) 06:00:47 --- quit: dave0 (Quit: dave's not here) 06:06:26 --- quit: cartwright (Ping timeout: 240 seconds) 06:08:28 does anyone use net2o ? https://wiki.forth-ev.de/doku.php/infos:forthchatnet2o 06:22:10 --- join: cartwright joined #forth 06:40:00 --- quit: rdrop-exit (Ping timeout: 256 seconds) 06:50:38 --- join: rdrop-exit joined #forth 06:53:39 back 07:10:53 --- quit: mark4 (Remote host closed the connection) 07:12:19 I have an annoying problem 07:12:57 now that I've got reading bytes over serial working, writing bytes out is causing bytes to be lost when sending lots of data 07:20:16 tpbsd: I'm going off to work in a sec, but I'm just letting you know that from executing WORDS I've noticed issues with outputting large amounts of data at once with zeptoforth 07:20:21 but gotta go 07:25:26 --- quit: tabemann (Ping timeout: 256 seconds) 08:21:25 --- join: jsoft joined #forth 08:40:48 --- quit: kori (Ping timeout: 240 seconds) 08:51:49 --- quit: jsoft (Ping timeout: 256 seconds) 09:15:07 --- quit: Zarutian_HTC| (Ping timeout: 256 seconds) 09:20:34 --- quit: rdrop-exit (Quit: Lost terminal) 09:28:14 --- join: john_cephalopoda joined #forth 09:28:20 Morning 09:29:05 sure is, it's 0330 here :) 09:32:55 It's 18:33 here. 09:34:30 But it's morning in the UGT timezone. https://www.urbandictionary.com/define.php?term=ugt 09:35:48 ahh I didnt know that 09:37:14 I generally like to know what tz people are in and anyway if it's not morning, why say it ? why not just say 'greetings' ? 09:38:10 my usual saying is 'greeting forthlings' 09:51:45 --- join: Zarutian_HTC joined #forth 10:09:14 --- quit: reepca (Read error: Connection reset by peer) 10:09:34 --- join: reepca joined #forth 11:50:32 --- quit: webchat9 (Ping timeout: 256 seconds) 13:15:56 --- join: WickedShell joined #forth 13:52:33 Hm, thinking about what to program. 14:00:52 --- quit: john_cephalopoda (Read error: Connection reset by peer) 14:00:57 --- join: TheCephalopod joined #forth 14:05:51 --- quit: xek (Ping timeout: 265 seconds) 14:07:47 --- quit: gravicappa (Ping timeout: 265 seconds) 14:19:44 Huh, https://users.ece.cmu.edu/~koopman/stack_computers/stack_computers_book.pdf 14:19:50 --- nick: TheCephalopod -> john_cephalopoda 14:30:53 john_cephalopoda: bresenham graphix primitives? 14:32:26 Oof, those are really annoying to implement. I've tried my hand on those several times. 14:33:13 using that book/paper as guide? 14:33:48 No, just random online descriptions of the algorithm. 14:35:52 * Zarutian_HTC found the link http://members.chello.at/~easyfilter/bresenham.html 14:36:32 Yeah, I think that's one of the ones I used. 14:37:19 which reminds me 14:37:36 Hm, or actually not. The one I looked at split the line thing into half a dozen different ones. 14:37:52 I.e. every direction was handled separately. Really complex and clunky. 14:38:01 you know how VALUEs are often implemented 14:39:54 I actually never used the VALUE word, looks a lot like CONST. 14:41:02 How is it implemented? 14:43:10 VARIABLE TO_STATE FALSE TO_STATE : VALUE create 0 , does> TO_STATE @ IF SWAP ! FALSE TO_STATE ! ELSE @ THEN ; : TO TRUE TO_STATE ; \ for example 14:44:10 s/TO_STATE :/TO_STATE ! :/ 14:45:17 now do you know if this pattern has a name? 14:47:17 because a few moons ago I thought up and noted down something similar for ?pseudo-pixmaps? (and QuickDraw esque masks) 14:48:37 in place of TO I have four ?switch? words 14:49:21 I'm still trying to figure out what exactly the words do. 14:49:23 ( getWidth getHeight getPoint putPoint ) 14:51:01 the VALUE words were generally used for often read but less frequently written to variables 14:52:29 the words after does> run when ever a VALUE word is called 14:52:50 Ah, so it's practically a locked variable that can only be written to with the TO word? 14:53:30 when that code starts it has the address of the VALUE word on top of the stack 14:53:41 yebb 14:54:33 VALUE bar 42 TO bar \ for an example use 14:55:04 In what context would that be used? 14:55:25 I.e. what advantages does it bring over regular variables and '!'? 14:55:50 bar then puts 42 onto the stack when no TO was in front of it 14:57:51 less @ usage which could mean shorter words and take less space 14:58:26 I qm myself dubious about the usefullness of VALUE 14:58:40 s/qm/am/ 14:59:50 but the example impl above demonstrated more easily what I am trying to talk about 15:03:19 the idea is to have pixmap defineing words that can make words that act as graphix transforms, colour mapping and clipping masks 15:04:33 all those without taking huge memory each for an actual pixels buffer 15:05:23 --- join: Lambdajack joined #forth 15:09:47 --- quit: S-Jack (Ping timeout: 256 seconds) 15:30:22 --- quit: john_cephalopoda (Ping timeout: 260 seconds) 16:56:52 --- join: jsoft joined #forth 16:58:02 --- quit: MrMobius (Read error: Connection reset by peer) 17:00:51 --- join: dave0 joined #forth 17:32:41 --- join: tabemann joined #forth 18:33:16 tpbsd, 18:33:27 I decided to partially backpedal my interrupt IO 18:33:36 as for some reason it just wasn't working for TX 18:33:53 so for the time being it will only be for RX 18:48:40 --- nick: Lambdajack -> DKordic 18:50:17 aha 18:50:38 tabemann, i have noticed that error messages are cut off as well 18:51:20 I'm going to commit my code so at least it works 18:51:46 cool 18:51:55 Ill try the new commit when it's done 18:52:00 done 18:52:07 brb 18:54:26 --- join: boru` joined #forth 18:54:30 --- quit: boru (Disconnected by services) 18:54:32 --- nick: boru` -> boru 18:56:05 tabemann, end-compress-flash stack underflow 18:56:05 ok 18:56:05 compile-to-ram ok 18:56:05 ok 18:56:05 *** exit status: 0 *** 18:57:07 heh, my Forth powered STM32F103C8-DIAGNOSTICS.bin has been downloaded 211 times now 18:58:42 odd 18:58:57 I just recompiled everything, and reloaded everything, and no problem 18:59:05 same 18:59:14 except this problem at the end 18:59:34 Ill add hardware handshaking as soon as I can get a list of your error messages 18:59:56 there is no list of error messages :P 19:00:01 because then I use a parser to beep my terminal bell on errors 19:00:26 i upload so fast I cant read the screen 19:00:37 there is a point in the code where it sends nak 19:00:50 you could make it so it sends BEL as well 19:01:11 this is in the kernel assembly, btw 19:01:15 all forths really need a Bell on error 19:01:35 Id be utterly lost without mine 19:02:23 it only takes one error to screw up a complex app in unkowable ways 19:03:11 id recommend adding a macro that rings the bell and perhaps lights a LED on the board 19:03:15 on a error 19:03:42 that way you can add that macro to every error message 19:11:24 back 19:11:40 I added a bell to every exception and abort 19:12:02 I also think I fixed the problem you were getting with end-compress-flash 19:12:47 ready to try ? 19:13:33 ahh i see it is 19:13:36 brb 19:15:18 unfortunately I don't hear the BELs, even though the terminal I am using supposedly supports audio for them 19:17:22 tabemann, all ok 19:17:29 hmm 19:17:58 i do get a nice short pip, it's absolutely vital for me, but I do it by parsing the errors 19:18:18 Mecrisp-Stellaris has no way to handle error messages 19:18:58 i used to pactch the Mecrisp-Stellaris source but in the end it's way easier to do it withing screen as a sub program 19:19:34 the main thing for me is that error messages are essentially an open class 19:19:42 anyone can create an error message 19:19:58 any programmer ... 19:20:20 all an error message is is an xt passed into ?raise which displays a message when executed (if the exception is never caught, or is continually re-raised) 19:21:02 oh 19:21:15 sounds much simpler 19:21:33 I never liked the way ANS handles exceptions 19:21:58 --- join: iyzsong joined #forth 19:22:04 I do have to credit rdrop-exit for this idea 19:22:12 i dont care about ans 19:22:16 this is Forth 19:22:34 yeah, he is a Forth guu 19:22:37 guru 19:24:34 the genious of ?raise is that because it only raises if passed a non-zero value, one can pair it with try (ANS "catch") so that if try returns a non-zero value, you can do cleanup, then re-raise with ?raise, whereas if try returns zero (a non-exception), ?raise will do nothing 19:25:34 ill have to ponder that statement for a while 19:25:52 is try like an assert ? 19:27:09 nah 19:27:39 try is like a typical try-catch block 19:27:42 if you can, I recommend an 'assert' Word 19:27:55 it's just for hardware 19:28:44 that's what rdrop-exit calles "averts" 19:29:11 I'll call it "assert" though just because that's better-known 19:29:14 one problem cortex-m user run into that can take days to solve with unfamilar peripherals is verifying that a config has been written as intended 19:30:01 sometimes a single bit may refuse to be written as it's 'protected' by another bit or sequence 19:30:51 and sometimes the sequence required may not be in the doc youre reading 19:31:32 so it's very handy to be able to write them verify in a easy way with an Assert word 19:42:36 added ASSERT 19:42:58 oh wow thats fast 19:43:30 also ASSERT works both in interpretation mode and compilation mode even though it reads a token off the input 19:44:03 wait asecond 19:46:43 no problemo 19:47:05 back 19:47:07 fixed 19:47:29 cool 19:50:19 I still don't get why basic.fs by itself takes up a whopping 13K of flash 19:56:17 do you have a dissasembler to look for the reasons ? 19:58:03 I find disassembling the compiled forth code with gdb to be painful 19:58:39 and I don't know how to dump all of flash and disassemble it, if I even had a disassembler 20:01:44 my program to do that in in the latest 3 month old Mecrisp-Stellaris tarball 20:03:32 okay, I figured out how to do a dump 20:04:08 mecrisp-stellaris-2.5.3-orig/stm32f103-ra/ihex.fs 20:04:14 thats how I dod it 20:04:40 -d 20:05:44 it can handle flash up to 2GB 20:07:21 oops thats the ancient version! 20:07:31 ill email you the latest one 20:08:00 aha cutter turned out to actually be useful 20:08:13 radare2 is 20:08:22 I used st-flash to dump the flash then fed the binary into cutter 20:09:31 emailed to you 20:09:40 ah yes, thats the other way :) 20:10:06 the *much* faster way 20:13:30 I don't see how this code, with inlining and everything, is any much worse than my hand-coded assembly 20:14:28 --- quit: reepca (Remote host closed the connection) 20:14:42 --- join: reepca joined #forth 20:14:44 there is one answer but you wont like it ;-) 20:18:21 what is it? 20:18:57 oh cool i accidentally uploaded a *.sh file and had a ton of beeps from my bell 20:19:12 perhaps your assembly needs more refinement ? 20:20:07 take the usual Forth "min" ? 20:20:33 people on redit suggested the following for it: 20:23:04 what I mean is that basic.fs comes out at about the same size as the entire kernel 20:23:21 but the kernel does so much more than basic.fs 20:23:54 your Forth words are probably 2-3x the equivalent in assembly 20:23:56 but when I look at the asm for basic.fs it looks similar to my own hand-coded asm for the kernel 20:24:00 in terms of size 20:24:37 damn I cant read all the redit comments anymore 20:31:42 back 20:32:47 okay, this must be inefficient 20:32:52 here's the code for MIN: 20:33:33 wait, why won't Cutter let me copy? 20:33:59 yeh, it's the widget bs I guess 20:37:57 --- join: rdrop-exit joined #forth 20:38:03 0x0000827c push {lr} 20:38:03 0x0000827e str r6, [r7, -0x4]! 20:38:03 0x00008282 ldr r6, [r7, 4] 20:38:03 0x00008284 movs r0, r6 20:38:03 0x00008286 ldr r6, [r7], 4 20:38:04 0x0000828a subs r6, r6, r0 20:38:05 0x0000828c str r6, [r7, -0x4]! 20:38:07 0x00008290 subs r7, 4 20:38:09 0x00008292 str r6, [r7] 20:38:11 0x00008294 movs r6, 0 20:38:13 0x00008296 bl fcn.000013d2 20:38:15 0x0000829a movs r0, r6 20:38:16 0x0000829c ldr r6, [r7], 4 20:38:19 0x000082a0 ands r6, r0 20:38:21 0x000082a2 movs r0, r6 20:38:25 0x000082a4 ldr r6, [r7], 4 20:38:27 0x000082a8 adds r6, r6, r0 20:38:29 0x000082aa pop {pc} 20:38:31 hey rdrop-exit 20:38:33 ok, now compare it to this 20:38:51 see min 20:38:51 000016E4: CF01 ldmia r7 { r0 } 20:38:51 000016E6: 42B0 cmp r0 r6 20:38:51 000016E8: DC00 bgt 000016EC 20:38:51 000016EA: 0006 lsls r6 r0 #0 20:38:52 000016EC: 4770 bx lr 20:38:54 Bytes: 10 ok. 20:39:07 hi tabemann 20:39:43 hey Zen Forth Guru! 20:40:04 hi Forth Master Technician (tm)! 20:40:17 c[] 20:42:27 tabemann, thats a M3 Mecrisp-Stellaris 'min' 20:45:22 that horrific mess of code ressponds to just: : min ( n1 n2 -- n3 ) over - dup 0 < and + ; 20:46:07 0< is usually a word 20:46:28 : min2 ( n1 n2 -- n3 ) over - dup 0 < and + ; ok. 20:46:28 see min2 20:46:28 20000398: CF08 ldmia r7 { r3 } 20:46:28 2000039A: 1AF6 subs r6 r6 r3 20:46:28 2000039C: F847 20:46:29 2000039E: 3D04 subs r5 #4 20:46:30 (as opposed to 0 < ) 20:46:31 200003A0: 2E00 cmp r6 #0 20:46:33 200003A2: DA02 bge 200003AA 20:46:35 200003A4: 2300 movs r3 #0 20:46:37 200003A6: 43DB mvns r3 r3 20:46:39 200003A8: E000 b 200003AC 20:46:43 200003AA: 2300 movs r3 #0 20:46:45 200003AC: 401E ands r6 r3 20:46:47 200003AE: CF08 ldmia r7 { r3 } 20:46:49 200003B0: 199E adds r6 r3 r6 20:46:51 200003B2: 4770 bx lr 20:46:53 Bytes: 28 ok. 20:48:08 the branchless version is over - dup 0< and + 20:48:34 presumably inlined 20:49:21 so 28 to 36 bytes for the Forth compiled version and 10 for matthias hand written assy version 20:49:59 the point of the over - dup 0< and + version is to avoid branches 20:51:16 whether branchless code pays off depends on the platform 20:53:02 Chuck is a fan of branchless code 20:53:47 of course if you don't inline it, then there will still be the call 20:55:39 tabemann, so a 2.8 to 3.6 times smaller min with matthias hand asembled 'min' ... 20:57:36 his hand assembled code is not really comparable since it branches 20:57:48 the problem is I'm not seeing how to write branchless 0< type conditionals in thumb 20:58:21 wait 20:58:23 there is IT 20:58:51 0< is equivalent to an arithmetic right shift by one less than your cell width 20:59:23 (assuming 2's complement) 21:00:29 i.e. your filling the cell with the sign bit 21:00:56 if your sign bit is 0 then you get 0 21:01:07 if your sign bit is 1 then you get -1 21:03:31 on a 32-bit system it's equivalent to 31 ARSHIFT 21:04:33 (don't remember what ANS calls their arithmetic right shift, in my Forths I name it ARSHIFT) 21:07:09 any similar tricks for 0> 21:17:38 back 21:19:29 okay, I think I've got them figured out 21:19:54 for 0> sign bit has to be 0 while the overall value isn't 0 21:21:35 the only ones I've got left are 0= and 0<> 21:22:19 whereas now I have branchless, inlinable words for 0>, 0<, 0>=, and 0<= 21:23:21 0 = 21:23:26 0 <> 21:24:53 of course one can often do better on specific cpus using the flags 21:26:11 so aside from relying on cpu flags, there isn't a good way to do those 21:26:15 i use the carry bit and subtract-with-carry to get the forth flag (amd64 but hopefully also on arm?) 21:27:27 tabemann: on amd64 it's sbb rax,rax maybe arm has something similar? subc r0,r0,r0 ? 21:29:23 tabemann: 0= is sub rax,1 ; sbb rax,rax 0<> is add rax,-1 ; sbb rax,rax 21:29:49 thank you! 21:30:31 carry flag is so handy 21:31:30 here's some super old x86 code 21:32:02 0= ax 1 # cmp ax ax sbb 21:32:32 0<> ... ax neg ax ax sbb 21:32:54 aha that's a nice 0<> 21:34:12 I haven't touched x86 assembly in decades, had to dig through some of my ancient code 21:35:48 i think forth will make a great boot loader 21:35:56 becaue it's so small 21:36:06 0> ... 21:36:27 cx cx sub 21:36:28 ax pop 21:36:28 ax 0 # cmp 21:36:28 cl setg 21:36:28 cx neg 21:36:40 cx push 21:37:04 for amd64 0> is sub rax,1 ; sub rax,0x7fffffffffffffff ; sbb rax,rax 21:37:27 and 0< is add rax,0x8000000000000000 ; sbb rax,rax 21:37:33 my last example seems to not use stack caching, very old 21:38:07 0< 0> 0= 0<> all uses the carry flag and is tight 21:38:53 typical 21:41:13 the take away is that comparison primitives are always branchless on any cpu 21:47:26 --- join: gravicappa joined #forth 21:47:50 you could always do like Ting and start off with a very small set of core primitives and optimize the rest once your system is fully functional and tested 21:48:46 heck even = can start out as xor 0= 21:50:03 IIRC an eForth port starts out with around 30 primitives 21:52:39 makes it super quick to port it to a new platform, of course it runs slow as molasses initially 21:53:14 i'm trying that :-) 21:53:23 cool :) 21:53:35 :-) 21:53:45 back 21:54:15 some words are just so nice in assembly that i add it that way 21:55:05 now I've got 0=, 0<>, 0<, 0>, 0<=, and 0>= implemented :D 21:55:35 did you test them :-) 21:55:43 yes I did 21:55:49 even when you write it in assembly it's always good to have the high level equivalent in a comment or other block/file 21:56:37 I wish Thumb had predication 21:56:50 well... IT might count as predication 21:57:09 (IT being a weird instruction whose name stands for if-then 21:57:32 okay, I need to hit the sack 21:57:36 g'night guys 21:57:49 byes tabemann 21:57:55 good night 21:58:22 lunch is served, catch you all later 21:58:27 --- quit: rdrop-exit (Quit: Lost terminal) 21:59:52 oops he left too quick 22:21:10 --- join: MrMobius joined #forth 22:24:59 --- quit: dddddd (Ping timeout: 256 seconds) 22:48:37 i think forth will make a great boot loader 22:49:05 dave0, you know Forth has been used as a bootloader for decades with FreeBSD ? 22:49:27 dave0, sadly, the next version of FreeBSD will have LUA instead 23:02:18 --- quit: ecraven (Quit: bye) 23:02:39 --- join: ecraven joined #forth 23:06:13 --- quit: WickedShell (Remote host closed the connection) 23:12:27 --- join: rdrop-exit joined #forth 23:21:41 --- quit: jsoft (Ping timeout: 265 seconds) 23:26:46 --- join: mtsd joined #forth 23:59:59 --- log: ended forth/20.04.02