00:00:00 --- log: started forth/19.02.26 01:05:43 --- join: yrm (~yrm@host155.shizentai.jp) joined #forth 01:07:32 --- quit: yrm (Client Quit) 01:13:58 Morning #Forth 01:17:51 --- join: dave0 (~dave0@193.060.dsl.syd.iprimus.net.au) joined #forth 01:18:38 re 01:28:27 --- join: mechanip1ter (~alan@188.166.100.122) joined #forth 01:30:28 --- quit: mechaniputer (Ping timeout: 245 seconds) 01:31:16 --- quit: presiden (Ping timeout: 245 seconds) 01:35:30 --- quit: ttmrichter (Ping timeout: 245 seconds) 01:35:31 --- quit: proteusguy (Ping timeout: 245 seconds) 01:35:39 --- join: ttmrichter (~ttmrichte@185.103.242.216) joined #forth 01:35:52 --- join: proteusguy (~proteusgu@mx-ll-180.183.98-133.dynamic.3bb.co.th) joined #forth 01:35:53 --- mode: ChanServ set +v proteusguy 01:59:57 --- join: presiden (fwiw@unaffiliated/matematikaadit) joined #forth 02:03:44 --- quit: ashirase (Ping timeout: 245 seconds) 02:07:00 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:18:40 --- quit: proteusguy (Remote host closed the connection) 02:28:45 --- quit: dave0 (Quit: dave's not here) 02:37:11 --- join: proteusguy (~proteusgu@cm-58-10-208-131.revip7.asianet.co.th) joined #forth 02:37:11 --- mode: ChanServ set +v proteusguy 03:07:23 Just searched up Forth on Hacker News and came across https://news.ycombinator.com/item?id=19146767 03:09:24 It's a web server written in Forth! https://github.com/urlysses/1991/blob/1991/1991.fs 03:13:38 uh huge wods 03:14:17 i wonder how much it would take to write an ip stack or usb stack 03:14:40 <`preside1> do it 03:14:55 yea, i'm already wondering 03:15:32 the application would be running on fpga and avoiding an external mcu 03:16:51 Yeah they could have cleaned up the code somewhat 03:34:09 <`preside1> debugging is fun 03:49:19 --- join: rdrop-exit (~markwilli@112.201.168.172) joined #forth 04:04:52 `presid1: It actually is kind of fun to debug in Forth. 04:05:15 I enjoy the process of figuring out where to put a debug print, etc. 04:05:20 To home in on the problem. 04:06:20 debug print? 04:06:23 no breakpoints? 04:06:31 i tried breakpoints with my forth 04:06:37 not so easy 04:08:39 I usually don't - I've just gotten accustomed over the years to doing it this way. 04:09:14 Well, I do that sometimes. Essentially at least. After all, QUIT is a breakpoint. 04:09:38 Once in a while I put a QUIT in whereever and then inspect the stack when it stops. 04:09:59 Often the error segfaults the program, so the issue becomes just finding how far I get. 04:10:03 QUIT works well for that. 04:10:08 yea i wrote some code for gdb to print the stack 04:10:18 It either segfaults or it doesn't - if it doesn't, move the QUIT forward. 04:10:31 --- nick: `preside1 -> `presiden 04:10:33 yea that seems like a poor way of developing 04:10:38 i think more unit tests are necessary 04:10:52 Works for me. 04:11:21 I envision a nice development environment for this thing at some point. 04:11:29 Single stepping, etc. 04:11:53 Printouts on the screen of the stack, the flow of execution through the program, the call stack, etc. 04:12:03 We'll see how it pans out. 04:12:33 The whole thing is coming along well, but it's only just now becoming a "fully capable system." 04:12:42 Up to now it's been mostly a toy. 04:12:55 <`presiden> "The most effective debugging tool is still careful thought, coupled with judiciously placed print statements." 04:13:05 ^ yes. 04:13:26 I get a long way just LOOKING at the code and mentally simulating it. 04:13:42 If your definitions are short that's not so hard to do. 04:17:35 `presiden: absolutely not 04:18:33 Well, guys, I assume this is something that varies from person to person, don't you? The "best" tool is the one that works best FOR YOU. 04:18:53 therefore the claim is incorrect 04:19:12 * corecode sits on a bench in the sun 04:19:20 i think i should code some forth 04:19:22 but what 04:21:31 <`presiden> that's a quote btw 04:21:55 Yes - I could tell. 04:23:44 Printf debugging has helped me a lot in the past - but it has its limits. 04:25:21 I once had a very weird bug in a qt application. Printf debugging pointed at a passage in my code that seemed unproblematic. 04:27:01 Started a debugger and found out, that during that passage, an other thread is usually switched to, which then crashed. 04:28:28 That code wasn't written by me and I would have never found it without going through it step by step. 04:30:26 --- join: rprimus_ (~micro@a9.lence.net) joined #forth 04:30:46 --- quit: ashirase (Ping timeout: 246 seconds) 04:30:46 --- quit: the_cuckoo (Ping timeout: 246 seconds) 04:30:46 --- quit: rprimus (Ping timeout: 246 seconds) 04:30:48 --- join: ashirase_ (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 04:30:52 --- quit: Zarutian (Ping timeout: 255 seconds) 04:30:52 --- quit: nighty- (Ping timeout: 255 seconds) 04:30:52 --- quit: KipIngram (Ping timeout: 255 seconds) 04:30:53 --- nick: rprimus_ -> Guest34409 04:31:14 --- join: the_cuckoo (~charlie@d51A50AE9.access.telenet.be) joined #forth 04:31:32 --- join: nighty- (~nighty@b157153.ppp.asahi-net.or.jp) joined #forth 04:32:01 --- join: KipIngram (~kipingram@185.149.90.58) joined #forth 04:32:02 --- join: Zarutian (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 04:32:25 --- nick: KipIngram -> Guest59440 04:33:39 --- nick: Guest59440 -> KipIngram 04:33:49 --- mode: ChanServ set +v KipIngram 04:49:39 * ttmrichter pings. 04:57:00 * john_cephalopoda pongs 05:00:48 --- nick: ttmrichter -> test 05:01:23 --- nick: test -> ttmrichter 05:01:34 --- nick: ttmrichter -> ttmrichter____ 05:01:59 --- nick: ttmrichter____ -> ttmrichter 05:02:15 Just added a stack print word. My multiple entry point support makes it pretty smooth: 05:02:35 : s. depth : (s.) sp@ over cells + @ . 1- ?dup 0=; me ; 05:02:48 s. prints the whole stack; (s.) prints the top items. 05:03:23 what does the second : do? 05:03:38 or (s.) 05:03:57 : is immediate in my system, and just does what it always does. 05:04:09 That second one adds (s.) to the dictionary. 05:04:24 I have my headers separated from my definitions, so it doesn't "get in the way." 05:04:40 i don't understand 05:04:40 My word "me" compiles a jump to the most recently defined name, which in this case is (s.) 05:04:57 what does 0=; do? 05:04:59 : adds a name to the dictionary, as an executable word. 05:05:11 If the top of stack is 0, it returns. It's a conditional return. 05:05:27 but it keeps compiling 05:05:34 ? 05:05:39 Oh, yes. 05:05:44 It doesn't change state. 05:06:01 0=; has nothing to do with ; - it's a separate primitive. 05:06:31 You can't stop compiling there - something has to come after 0=; in case you don't return. 05:06:45 oh now i get it 05:07:07 because your headers are elsewhere, you can execute from s. into (s.) 05:07:15 Instead of "me" I could have just said (s.) and let tail optimization turn that call into a jump. 05:07:26 But "me" can be used inside a word - not just at the end. 05:07:34 Right. 05:07:45 sort of an assembler mindset 05:07:50 That was the main reason I put them elsewhere - to support this capability. 05:08:10 Right - it's like the names are just labels. 05:08:15 ok 05:08:26 My definitions region is really just one long string of compiled words; the headers "point into it." 05:08:44 ok 05:09:17 this is not readable to me 05:09:31 i guess code of this style made me avoid haskell and forth 05:10:11 I used to use separated headers in my old DOS Forth. 05:10:20 Well, there are those personal differences again - I guess it figures it's readable to me, since I crafted it. I've been finding the general style very easy to use and keep up with. 05:11:16 In my actual source I wouldn't use a ; at the end of that, either. It compiles a (;) that never gets reached. All we really need is to exit compilation mode, and I can do that with [ 05:11:30 So I'd put a [ after the me. 05:12:13 A cell saved is a cell earned... 05:14:07 I use similar words, 0; ?; RECUR 05:15:42 RECUR lays down a jump to MYSELF 05:15:51 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 05:16:01 Yes, I've just been *loving* the conditional returns. I have a whole family of them for efficiency, though one will get you pretty much anything you need. 05:16:19 They've very much changed how I code - I almost never use IF ... THEN anymore. 05:16:29 Ah, yes - your RECUR is my ME 05:16:37 I have conditional ME's too. 05:16:41 Right 05:16:44 0=ME etc. 05:17:19 Again, a family, for efficiency. 05:17:28 This is generally a pretty primitive-heavy Forth. 05:17:43 that's how it looks :) 05:18:02 Oh, it is. Typing in all those families of primitives was sort of wearisome. 05:18:02 I'm a firm believer in multiple exit points, no sense sticking around when the job is done 05:18:13 Yes. 05:18:31 I have ;, for that - it compiles (;) (and does tail optimization), but doesn't exit compile mode. 05:18:48 I also have ;; and ;;, which do a two-level return. 05:19:06 And conditional variants on ;;. 05:19:16 why are those primitives 05:19:20 Oh, actually I'm not sure right off hand if I actually have ;;, 05:19:21 and not normal words 05:19:30 Me too, different names but same ideas 05:19:49 Well, ; and ;; are normal words, but they compile runtimes that are primitives. 05:20:19 But the answer to your question in general is "for high performance." 05:20:50 There are a lot of places I could have done some of them as Forth definitions, but I chose to do it as a primitive because I didn't want to incur the run-time overhead of the definition approach. 05:21:01 "Minimizing primitive count" just was not a design priority for me. 05:21:18 Obviously that's an idea that could be taken too far - I just made judgments. 05:21:25 I use THEN; a lot too 05:21:49 Ah. 05:21:59 I would do ... IF ... ;, THEN ... 05:22:13 Mine is IF ... THEN; 05:22:14 This is to return at the end of the if clause, right? 05:22:19 yes 05:22:26 I suspect we wind up with almost the same compiled code. 05:22:32 Since THEN doesn't really compile anything. 05:22:40 Most likely 05:23:09 Here's an example: 05:23:13 1 05:23:13 2 : interpreter ( -- ? ) 05:23:14 3 interpretation lookup if 05:23:14 4 >code execute 05:23:14 5 then; number ; compiled 05:24:07 : INTERPRET ?DPAGE FIND IF DEF ELSE NUMBER THEN ?STACKS ME [[ 05:24:07 Another is: 05:24:12 6 05:24:12 7 : compiler ( -- ? ) 05:24:13 8 compilation lookup 0= if number & literal then; 05:24:13 9 dup immediate? if >code execute then; 05:24:13 a >code compile, ; compiled 05:24:16 That's a comment from my assembly source. 05:24:29 Don't know why I decided to capitalize those comments, but I did. 05:25:11 ?DPAGE allocates a new heap page and shifts my compilation to that page if I'm getting too close to the end of the one I'm in. 05:25:24 That might happen mid-definition, in which case it compiles a jump to the new page. 05:26:48 I found it necessary to track some state information in order to do tail optimization correctly - did you encounter that? 05:26:48 I don't have "heap pages" 05:27:02 I really shouldn't call it a heap. 05:27:07 It's so plain vanilla and simple. 05:27:17 No garbage collection, fixed-size pages only. 05:27:51 But I'm planning to support multiple processes, and processes could be created and then killed in any order. 05:28:00 So I needed some way to manage the memory that's freed when one dies. 05:28:11 Once I had that mechanism, I started finding tons of places to use it. 05:29:04 I don't allocate or free 05:29:16 I tried to avoid getting into a situation where I did a ton of stuff "the simplest way" and then found myself facing great difficulty adding some feature later. 05:29:24 I thought about it all for a long time before I started coding. 05:29:39 So that memory management was in from the start, because I knew that eventually I was going to need it. 05:29:57 I don't need it 05:30:11 To answer your earlier question 05:30:13 Then you shouldn't have it. :-) 05:30:20 1 05:30:20 2 call| Holds the address just beyond the most recently 05:30:20 3 compiled call. 05:30:50 That's the variable my tail-optimization uses 05:30:55 Yes, that looks like it'd do it. 05:31:22 Would this work right on yours: 05:32:11 : ... ... if ... then ; 05:32:23 Or do you have to use your then; for that? 05:33:05 Actually I don't think mine would tail optimize that. 05:33:15 The presence of THEN would cancel it. 05:33:20 I'd need to do this: 05:33:36 : ... IF ... ;, THEN ; 05:33:39 wouldn't that be a jmp instead of a call? 05:34:01 Yes, generally. There are just some corner situations where you can get into trouble if you're not careful. 05:34:23 If you blindly optimize that, you wind up without anything for the IF to jump to. 05:34:26 does your then insert any code? 05:34:31 No. 05:34:34 ok 05:34:55 It just backpatches the conditional jump target compiled by if. 05:34:58 I would code that as : foo 0; ... ; 05:35:12 Oh, me too. 05:35:17 With my own names, of course. 05:35:28 That's exactly what I meant when I said I rarely use if ... then these days. 05:36:23 The tail optimizer is just part of EXIT 05:36:26 rdrop-exit: I just have a flag that I set when I need to tail optimize if the next thing that comes is ; 05:36:33 : exit ( -- ) curtail; & ret ; directive 05:36:41 I set it whenever I compile a defined word. 05:36:45 Certain things clear it. 05:37:07 I don't have a flag, just the CALL| variable 05:37:23 Right, I had to think about it for a minute, but you could use that to produce the same information. 05:37:33 rdrop-exit: and resolving a then clears the variable? 05:37:50 No need to clear it 05:38:05 ah, because your ret stays 05:38:06 okay 05:38:10 yea that makes sense 05:38:35 0 shadow Tail Call Conversion 05:38:35 1 05:38:35 2 call| Holds the address just beyond the most recently 05:38:35 3 compiled call. 05:38:35 4 05:38:37 5 call, Compile a call to code address and update |call||. 05:38:38 my ISA can meld the ret into any instruction that doesn't access the rstack 05:38:40 6 05:38:40 I got most of this stuff quickly right this time, because I learned all these lessons the hard way on the previous Forth I wrote. :-) 05:38:42 7 curtail; Convert a tail call to a jump then exit the caller, if 05:38:45 8 there is no tail call to convert just return to caller. 05:38:47 9 05:38:50 a exit Compile an exit from a subroutine, either via a |ret| 05:38:52 b bytecode or a tail call conversion. 05:38:55 c 05:39:06 That's the shadow screen for the tail optimizer 05:39:30 This is the source: 05:39:50 0 source Tail Call Conversion 05:39:51 1 05:39:51 2 variable call| 05:39:51 3 05:39:51 4 : call, ( ca -- ) & call32 32, here call| ! ; 05:39:53 5 05:39:55 6 : curtail; ( -- ) 05:39:56 I do all of this work in the ;, definition - then the ; definition just runs ;, and exits compile mode. 05:39:58 7 call| @ here <> ?; encoded jmpi32 here 5 - b! bail; ; 05:40:01 8 05:40:03 9 : exit ( -- ) curtail; & ret ; directive 05:40:06 a 05:41:25 The above code if from my bytecoded host Forth 05:41:28 rdrop-exit: It seems that we have very similar systems, actually. Just slightly different names, some slightly different methods, but the same general end point. 05:41:46 And I probably made more primitives than you did. :-) 05:42:21 The bytecoded VM can handle up to 256 opcodes 05:42:47 I don't have such a thing in mine. PoppaVic is big into bytecodes, though. 05:43:06 He's trying to support tiny little microcontroller targets, so he REALLY cares about RAM. 05:43:27 He's thinking "tethered development system." 05:44:12 My bytecoded VM is only used on the host side (i.e. PCs) of a tethered development system 05:44:29 Oh, you and he should talk. 05:44:40 We've chatted here 05:50:28 I used a bytecoded VM on the host side for the portability, speed is not an issue for an IDE. 05:53:23 It only runs two tasks, a terminal for the developper, and a serial link to the target. 05:55:11 It's a special purpose Forth, which is how I prefer my Forths to be. 05:58:11 With it I can host cross-compilers and cross-assemblers for any targets I want to work with. 05:59:06 I'm a big believer in the tethered approach to Forth development. 05:59:18 I guess I have a "nuance" of a bytecode interpreter in my formatted output code. 05:59:25 It essentially "executes" the format string. 05:59:56 And it maintains a "stack" of one-byte information in a single cell of the real data stack. 06:01:47 Here's an overview of the VM: 06:02:03 Task #0 : Task #1 06:02:03 : VM Memories: 06:02:03 +----+ : +----+ RS Return Stack 06:02:03 rp->| RS | ..... ts .... | RS |<-rp DS Data Stack 06:02:03 tp->| | : +-----+ : | |<-tp RAM Processor RAM 06:02:05 +----+ : | | : +----+ 06:02:08 : | | : VM Registers: 06:02:10 ip-:->| RAM |<-:-ip ts Task Select 06:02:13 : | | : ip Instruction Pointer 06:02:15 +----+ : | | : +----+ rp Return Stack Pointer 06:02:18 sp->| DS | : +-----+ : | DS |<-sp tp Try List Head Pointer 06:02:20 | | ............. | | sp Data Stack Pointer 06:02:23 +----+ : +----+ 06:02:25 : 06:04:14 It's basically a simple bytecoded virtual processor 06:07:19 The stacks are circular 06:35:55 Gotta walk the dogs, catch you all tomorrow. Keep on Forthin' 06:36:09 --- quit: rdrop-exit (Quit: Lost terminal) 06:50:03 <`presiden> nice diagram 07:23:06 the art of ascii art 07:33:17 --- quit: tabemann (Ping timeout: 264 seconds) 08:09:25 :-) 08:09:38 * KipIngram lives for ASCII porn... 08:10:09 --- quit: nighty- (Quit: Disappears in a puff of smoke) 08:10:28 --- join: nighty- (~nighty@b157153.ppp.asahi-net.or.jp) joined #forth 08:19:13 --- nick: mechanip1ter -> mechaniputer 08:19:30 --- quit: mechaniputer (Changing host) 08:19:30 --- join: mechaniputer (~alan@fsf/member/mechaniputer) joined #forth 08:19:53 --- quit: jedb (Ping timeout: 250 seconds) 08:20:12 --- join: jedb (~jedb@199.66.90.113) joined #forth 08:47:13 --- quit: nighty- (Quit: Disappears in a puff of smoke) 09:02:52 --- join: DKordic (~user@109-93-213-112.dynamic.isp.telekom.rs) joined #forth 09:04:12 there should be a bot that you can define words on and execute them 09:15:07 corecode: sound like a challange. Ya up for it? 09:15:15 s/sound/sounds/ 09:24:15 Might I suggest doing it as a halibot module? Just hook it up to an interpreter and make sure to add message rate limiting and an evaluation timeout. https://github.com/Halibot/halibot 09:24:42 (A friend of mine maintains that so I'm biased) 09:25:24 but 09:25:25 but 09:25:28 that's not in forth 09:25:42 Haha well if you'd rather... 09:26:01 isn't that the channel for people who'd rather? 09:26:13 I guess it is! 09:27:17 The module itself could be in Forth though. 09:27:31 Python is duct tape. 09:27:36 meh! 09:27:42 go deep 09:27:55 write a tcp/ip stack using raw sockets! 09:28:21 actually i have no idea how i'd do that 09:31:41 corecode: just start with tcp sockets ( https://www.tutorialspoint.com/unix_sockets/socket_core_functions.htm ) and work from there. 09:31:57 i know how the sockets work 09:32:06 i just don't know how i'd implement it in forth 09:32:24 fancy memory management etc 10:26:22 I work with a piece of software called OpenSIPS 10:26:41 it reads SIP packets and applies transforms to the header - it's all plaintext 10:27:17 they have this awful neutered-C-like configuration language and Forth would just be so appropriate. SAD! 10:27:35 maybe not "awful" but not nice 10:31:26 hehe 10:32:24 oh there is no gforth socket interface? 10:32:26 oh my 10:32:45 I can compile C modules for it 10:32:54 So I'm not without a paddle 10:33:16 i thought the irc bot could use the server connection as input stream 10:33:29 oh lol 10:33:38 there is a socket module for gforth 10:33:53 /usr/local/share/gforth/0.7.3/socket.fs 10:33:55 something like that 10:34:15 unix/socket.fs 10:34:29 but the command responses are numeric 11:05:50 corecode: https://tools.suckless.org/ii/ ? IMHO "corecode.fs" would be a good name for the bot :) . 11:06:01 --- quit: gravicappa (Ping timeout: 244 seconds) 11:07:59 --- join: gravicappa (~gravicapp@h37-122-126-13.dyn.bashtel.ru) joined #forth 11:18:25 --- quit: gravicappa (Ping timeout: 250 seconds) 11:21:52 --- quit: dddddd (Ping timeout: 255 seconds) 11:22:21 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 12:24:54 --- join: jedb_ (~jedb@199.66.90.113) joined #forth 12:27:30 --- quit: jedb (Ping timeout: 258 seconds) 12:28:28 ii is troublesome 12:28:29 be aware that client quits go in the server/out file, so if someone leaves the channel you cannot know unless you look at channel/out and server/out, making the division useless 12:34:02 I do not think forth is a good language for text handling though, which is what you will be dealing with mostly 12:34:14 depends on what you're doing 12:34:43 constructing a header isn't at all a ballache 12:34:59 Absolutely no language is good for "text handling" if yer posta' program in it. 12:34:59 hows your regex engine? 12:35:14 folks still speak of COBOL 12:35:21 PoppaVic: not willingly 12:35:35 who's doing a regex engine 12:35:47 you need a regex engine if you're writing an irc bot 12:36:11 depends on the commands. 12:36:13 * PoppaVic chuckles 12:37:16 you will need to check to see if the user is authenticated and you will need to grep every single line of input 12:39:45 : !? dup c@ [char] ! = if drop parse-token then 1+ rdrop recurse ; 12:42:21 ok, now sanitize the input 12:43:43 or will the bot do nothing but fetch from a db and paste the output? 12:49:08 * WilhelmVonWeiner shrugs 13:01:59 I was looking at the sam command language and I think it would translate very well to a forth vocabulary 13:02:41 I've a samd21 and samd51 and think the biggest issue is puzzling out the 'device' setup/use 13:03:12 which would then be suitable for sanitizing input 13:03:47 neither of my samd's know wtf sanitized or input are 13:04:41 PoppaVic: It means that when you're dealing with an irc bot in this case, and you want the user to give commands to the bot, you will have to evaluate the input and make sure there arent any infinite loops or worse. 13:05:15 I think he was being facetious 13:05:33 we've had bots here in the past. I used to run one written in retro, and there was `sifbot` (http://sametwice.com/sifbot and http://sametwice.com/sif) 13:05:58 I've never heard of sif 13:06:01 sounds awesome 13:06:41 --- quit: pierpal (Remote host closed the connection) 13:07:05 I lost my "awe" when "awesome" became noise. 13:08:14 You can't bloody stand C based Forths can ya 13:10:30 KipIngram: nice to see the nested word definitions like that (your : s. thing above) - i use that approach quite a bit 13:10:36 I suspect I 'C' more than the usual.. Albeit, I need new bifocals - if not trifocals. 13:10:44 it might be doable with this, thank crc 13:12:44 PoppaVic: You mean the ARM MCU? 13:13:11 the_cuckoo: Sometimes it works out quite nicely. :-) 13:13:42 My first shot at it was two short definitions instead, and that worked fine for the s. word. I was originally intending that (s.) wouldn't show in the dictionary. 13:14:15 Then I realized it's potential utility as well, and saw that the way I'd written the two definitions it didn't work quite right - it left the stack parameter on the stack. 13:14:32 Instead of ?dup 0=; I had .0=; and s. finished off with a drop. 13:14:57 So in this case I think the multiple entry points was definitely the way to go. 13:15:16 IIRC, sifbot used tcpclient (https://cr.yp.to/ucspi-tcp.html) to handle the connection to the irc server 13:15:32 DKordic: yes, they are the newest in my arsenal. I want to tinker those as soon as this code works on the AVR's 13:20:09 KipIngram: always found it a bit strange that forth doesn't support it - it's pretty unambiguous i think - either way, glad it's not just me :) 13:31:02 Oh, I think it's entirely clear. 13:31:31 I think that it's probably that Forth started out without separation of headers, and that is more "efficient," since you don't have to store a pointer from the header to the definition. 13:31:58 And with those headers in the way supporting this sort of syntax would be a kludge (you'd have to jump around the intervening header). 13:32:14 It becomes "natural" when you move your headers to their own home and accept that pointer. 13:32:56 I really, really hate the infix headers 13:33:37 I'm that little imp-bastard in red-suit and pitchfork on kips shoulder 13:37:34 for myself, i use them to group stuff together, but then when i definie words, i also define them within a 'vocab' - hence, i have vocabs for arithmetic, maths, io and so on - in the language, i have a : vocab [ : ... ; ]* ; and all the inner words are grouped in a vocab of ... iyswim 13:39:00 the dump from 'words' being kinda unpenetrable - i have help which provides a list : ... - nice to have a grouping i think 13:39:46 also, the outer word gives a neat reset if you rewrite one of the inner words 13:40:06 yeah, words-by voc, and columnized - are nicer. 13:40:58 for sure 13:43:56 was also thinking about more help for each word - i've docmented all of my in the projects README.md in one line table entries - hence you can get a 1 liner from the file by searching on ^| `word` - shows input expected, result and provides a comment 13:44:28 seems like a trivial thing to use at runtime if available 13:46:21 given that i can obtain all the words belonging to a vocab, i could also get all the README info and recreate the table using nice ascii art :) 13:47:15 I think the best system was f-83, due to a field in the header that lead to source which had a shadow-screen 13:47:57 not come across that term before 13:48:34 block oriented: odd screens were "shadows" for documentation of the EVEN source screens 13:48:57 0/1, 2/3..... 13:51:22 i get the idea i think :) - cool 13:51:42 a 1 liner in a readme is ... constrained... but it's better than nothing 13:52:15 and easier than trying to sanely render markdown in a terminal 14:52:35 --- join: dave0 (~dave0@193.060.dsl.syd.iprimus.net.au) joined #forth 14:53:53 hi 15:39:24 --- join: tbemann (~androirc@2600:380:647a:e5b8:a6d7:c653:eb96:b3ce) joined #forth 15:42:04 every time I change something major in hashforth it starts crashing again 15:54:37 stop doing that 15:55:00 heh 16:19:55 --- join: yrm (~yrm@122.1.74.155) joined #forth 16:20:59 Ok, I'm sure I have it somewhere, either bookmark or pdf. But I can't find it. 16:21:09 That old book by Moore - we discussed it in here a few months ago. 16:21:12 Anyone have a link? 16:25:51 --- nick: jedb_ -> jedb 16:30:40 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 16:32:45 tbemann What did you change this time? 16:34:24 --- quit: MrMobius (Ping timeout: 268 seconds) 16:34:24 --- nick: [1]MrMobius -> MrMobius 16:35:04 I found it - here's the link: http://forth.org/POL.pdf 16:35:15 That's actually a much better formatted document than what I had before. 16:35:59 ah 16:36:06 POL, I recall 16:58:08 --- quit: john_cephalopoda (Ping timeout: 258 seconds) 16:59:44 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 17:00:51 --- quit: dddddd (Remote host closed the connection) 17:06:20 --- quit: dave0 (Quit: dave's not here) 17:29:11 --- join: rdrop-exit (~markwilli@112.201.168.172) joined #forth 17:37:23 --- join: tabemann (~travisb@rrcs-98-100-171-35.central.biz.rr.com) joined #forth 17:40:08 Good morning Forthwrights c[_] 17:42:34 hey rdrop-exit 17:42:44 Hi tabemann 17:46:16 * tabemann needs to figure out why his latest changes now make hashforth crash 17:48:07 namely moving a number of members of the task structure into proper user variables 17:55:39 Are these changes above the protable VM you were writing? 17:55:46 * portable 17:59:06 they're not changes to the VM itself 17:59:17 they're changes to the userspace running on top of the VM 17:59:35 the VM itself works perfectly fine 17:59:52 as shown by that if I run a known-good image on the VM it runs just fine 18:00:39 If the VM is sandboxed it shouldn't crash regardless of what you do above it. 18:01:34 the VM exists in the parent addressing space 18:01:57 so it can crash if an address pointing to outer space is dereferenced 18:02:38 Ah ok, it's not sandboxed 18:03:22 this is intentional, because I want VM implementations for embedded systems to be able to directly frob hardware registers and like 18:06:13 ok 18:08:56 I imagine that all those services on POSIX-hosted systems would be replaced by Forth-native implementations which directly interact with hardware on smaller systems 18:09:29 which instead of operating within an OS-mapped addressing space would be operating on bare metal 18:10:15 I should get going though - will be back on later 18:10:41 Ok, see you later 18:11:01 <`presiden> morning o/ 18:11:21 Hi `presiden 18:12:53 --- quit: tbemann (Ping timeout: 264 seconds) 18:14:51 --- quit: tabemann (Ping timeout: 250 seconds) 18:23:14 bbiab 18:38:13 What's the word of the day, gents? 18:39:01 Maybe I should say ladies and gents - hard to know. 18:40:36 postpone? 18:41:17 That's a good one. 18:41:48 Heh. The folks around my office would call that "right shift." 18:41:57 As in right shift the lines on the Gantt chart. 18:58:23 Back with more c[_] :) 18:58:54 Hi KipIngram, yunfan 19:01:20 Postpone is probably the only word I adopted from ANS, although I renamed it & after a while. 19:08:20 rdrop-exit: hi 19:08:49 rdrop-exit: english is not my native lang, so i dont understand what postpone really do 19:08:59 also x86 assembly is too complex to me 19:09:08 for learning that from jones forth 19:09:42 hope there could be a learning purpose forth with tiny size and runs on a clean ISA like riscv 19:09:43 Hi rdrop-exit. 19:10:23 yunfan: POSTPONE is used inside : definitions - it has a different effect depending on whether the following word is immediate or not immediate. 19:10:34 If the word following POSTPONE is immediate, POSTPONE compiles that word. 19:10:51 If the word following POSTPONE is not immediate (i.e., would normally be compiled), POSTPONE executes it NOW. 19:11:06 It moves the word "one notch earlier" in both cases. 19:11:10 Whatever the postponed word would do at compile-time, it will now do when the word it is being postponed into is executed. 19:11:26 What KipIngram said. 19:11:27 Um, yes - that is accurate. 19:11:34 That's a much better way to say it, I think. 19:11:37 Your way, that is. 19:12:00 KipIngram: and the book moving forth, which's ISA were too old 19:12:11 maybe i could bought a attiny8 for that book 19:12:50 3 19:12:50 4 : & { -- }( -- ? ) 19:12:50 5 compilation defined 19:12:50 6 dup immediate? if >code compile, then; 19:12:50 7 >code & literal & compile, ; directive 19:12:52 8 19:13:30 Note the above definition of postpone is self-referencing, that's ok as it is meant to be meta-compiled 19:14:13 Directive just means immediate and compile-only 19:19:39 Here's the shadow: 19:19:49 0 shadow Outer Interpreter - Postpone 19:19:50 1 19:19:50 2 & Postpone the compile-time behavior of so that it occurs 19:19:50 3 instead when the word currently under construction is later 19:19:50 4 executed. 19:19:52 5 19:21:30 COMPILATION DEFINED will raise an exception if there is no definition that has COMPILATION behavior 19:23:58 --- join: tabemann (~travisb@2600:1700:7990:24e0:78df:6a9:450a:b439) joined #forth 19:29:25 Rereading the shadow doc I now realize I should have done a better job at phrasing the explanation. 19:33:08 Why do I not see postpone in that anywhere? 19:33:30 The 4, 5, 6 lines you posted. 19:33:35 How is it a definition of postpone? 19:33:56 Sorry, I mentioned earlier that I use the name "&" instead of "postpone" 19:34:07 Oh, sorry - missed that. 19:34:31 I haven't written postpone yet. 19:34:57 You know, I keep working on this or that part of it, but at some point I just need to mount a "rounding out" effort. 19:35:06 So much stuff that's not there would be easy at this point. 19:35:13 But I get distracted by the more challenging things. 19:35:21 The ones that involve some real thinking. 19:35:27 They're more fun. 19:36:32 I guess it made little sense to round out before I could even manage source on disk, but I've got that essentially within reach now. 19:37:01 Couple of rounds of editor implementation and I'm off to the races. 19:37:47 Round one of that: 19:37:58 Keeping things simple can involve plenty of real thinking and a ton of self-discipline :) 19:38:24 : line (block line --) 6 << swap block + 64 expect ; 19:38:39 Oh, I agree. 19:38:55 It's all too easy to 'envision' something that really isn't right, but then get obsessed with making it work. 19:39:31 Probably would be wise to fill that line with spaces first. 19:39:50 Otherwise you're plagued with hanging leftovers when you shorten a line. 19:40:36 I have a line input routine, though, that can be started with initial conditions (content, length, cursor position), so I may be able to do much better this time and have one-line editing engaged right from the start. 19:41:51 My impression of many "modern" programmers is that they are incapable of coming up with something that's simple through-and-through, only surface level simplicity. 19:41:55 Slight complication there, though - the easiest thing to do would be to say that the initial length was 64 chars (which would include a bunch of spaces at the end). And then the line would look FULL to the routine and it wouldn't let me enter anything. 19:42:14 I'd need to count the trailing spaces and reduce the content count by that much. 19:42:29 And then afterward I'd have to replace the null at the end with a space. 19:42:36 What are you trying to do? 19:42:37 But it shouldn't be too bad. 19:42:48 Sorry - I'm designing in public again. :-( 19:42:56 :)) 19:43:09 In the past the very first source entry method I implement has been to just expect 64 chars into a particular block / line slot. 19:43:36 But in this system, as part of the EXPECT / QUERY / command history infrastructure, I have the ability to pre-seed the editing process with initial content. 19:43:48 So that ought to let me do much better on editing a line - I should be able to start with what's there. 19:43:57 In my command history I have boundaries and counts well-tracked. 19:44:10 But in editing a block you don't - there are just 64 chars there, which you pre-fill with spaces. 19:44:16 So it will always look like a full line to me. 19:44:28 Unless I count the spaces at the end and "chop them off," so to speak. 19:44:47 Anyway, just the minor hoops I'll have to jump to make the input routines I have now do something more powerful than I've done in the past. 19:44:57 It's not a *perfect* fit, but it's close - I can get there. 19:45:05 "Editor #1" will be better this time than in the past. 19:45:21 :) 19:45:24 Because I already had to do a fair bit of that work to implement command history. 19:46:16 I use a circular history buffer as well 19:46:42 That was one of the major advances of this imp for me. 19:46:45 I've never had that before. 19:47:34 My EMIT, emits directly into it 19:48:46 A newline recycles the oldest row of history 19:49:21 Ah. Yes, I haven't worked on my OUTPUT buffers yet. 19:49:35 My KEY stows the history chars, and then they're outputted only to the screen. 19:49:53 But I do have plans for an output buffer too, so that when I change processes I can re-draw the new process's screen. 19:50:00 There are some thorny issues there, btw. 19:50:20 that's going to be optional - processes won't HAVE to have an output buffer. 19:50:37 If they don't, then their output will just appear following whatever output was there from before. 19:50:56 There will be a pointer that's null unless a content buffer is allocated and pointed to by that pointer. 19:51:13 I use terminal codes, all my high-level output goes into a "video control buffer" that gets flushed 19:51:16 Because that's a good bit of data. 19:51:30 Yes, I'm using ANSI codes too. 19:51:50 I spent some time studying the curses library source, to get my bearings. 19:51:54 At least at the high level. 19:52:11 Because I know it has good snappy performance. 19:52:30 The video control buffer contains the terminal control sequences to convert what's currently on the screen to what comes next. 19:52:50 A delta if you will. 19:52:57 Hmmm. You dont just repaint it? 19:53:08 OH. 19:53:16 You're referring to WITHIN a process's domain. 19:53:21 Yes, that makes sense. 19:53:48 No, there's only one display terminal 19:53:51 I haven't spent much time yet thinking about windows and so on - right now my plan extends only out to each process having a scrolling console. 19:54:19 And I don't plan to have more than one process's stuff being displayed at a time. 19:54:22 Think screen. 19:54:29 Each window is full, you can switch between them. 19:54:51 I realize much more sophiticated solutions are possible, but I don't currently use them, so... 19:55:43 So with that approach I just need to draw the screen on process switch-in, and after that I just scroll. 19:56:34 Nothing sophisticated, there no need to resend a screen full of data each time, just the control sequences necessary to change the previous display content to the new one. 19:56:54 --- join: gravicappa (~gravicapp@h37-122-126-13.dyn.bashtel.ru) joined #forth 19:56:55 What if you're switching from one process to another, and they have entirely different screens? 19:57:05 Maybe then the delta will just be big? 19:57:39 Oh, you may have told me this morning you weren't doing that. 19:57:43 Yes, and if there's hardly any difference it will be small. 19:58:35 Well, I have plenty of time to think about all that - I haven't worked on output at all yet, beyond EMIT and TYPE. 19:58:45 I didn't write TYPE as a loop over emit, for performance reasons. 19:58:54 There's an OS call that will do a whole line. 19:59:08 So my EMIT is a one-char TYPE. 19:59:36 that was the primary lesson I took from the curses study - output in STRINGS, not chars. 19:59:51 Design the data structures accordingly. 19:59:58 If you're doing full screen terminal updates, your emit will be writing to memory. 20:00:12 I'm not that fancy yet. 20:00:21 My TYPE is a write system call to stdout. 20:00:58 I don't know if I care about that - my real long-term goal is to be running on my own hardware, so that will be a problem to be solved when I have to replace that syscall with something of my own. 20:02:20 I do it the other way around, but it comes out the same. You need a low level emit and a buffered emit. 20:02:38 I'm touching the operating system with 1) read syscall, 2) write syscall, 3) open syscall, 4) close syscall, 5) seek syscall, plus "get" and "set" termios iocotls. 20:03:15 Me too, and exit() 20:03:20 Oh, yes - right. 20:03:22 Me too. 20:03:53 I don't think I use seek 20:04:06 How do you implement BLOCK? 20:04:32 And I'm curious - if those are all the syscalls you use, how do you know what memory to write to for... oh wait - maybe I know. 20:04:33 On the host blocks are in RAM 20:04:43 when you say emit writes to memory, you mean memory that you manage. 20:04:47 You have a buffer. 20:04:54 And you use the write syscall to write it out. 20:05:43 I've been trying to avoid that because I might want to port this to some very small microcontroller environments, but yes - that would be a splendid way to do it on a desktop / notebook. 20:06:08 The typical way to do full screen terminal apps is to fill a buffer with terminal commands, and do one big write to the terminal flushing that buffer. 20:06:16 Oh yeah, you're doing a tethered thing. 20:06:28 Yes, I'm catching on. 20:06:35 That's a great approach when you have plenty of RAM. 20:06:59 How do you handle attribute changes? 20:07:25 I don't mean how do you DO them - how do you know WHEN to do them? 20:07:41 Just integrated into your buffer? 20:08:08 That would mean your buffer wasn't directly addressable - do you have a table of pointers to the coordinate locations? 20:08:47 You have a screen cache that contains the character cell data and attributes that were on-screen after the last refresh. 20:09:09 You compare that to what you want on-screen after the next refresh. 20:09:41 And send just the terminal control sequences that will get you from one to the other. 20:09:48 Ok. It makes sense. This uses a good bit of RAM, doesn't it? 20:10:07 It's very clever - very clean. 20:10:13 2 bytes per character cell 20:10:26 80x24x2 in my case 20:10:28 Right, but out screens these days hold a lot of characters. 20:10:43 Ok. 20:10:58 I use lowest common denominator for portability, 80x24 20:11:37 I like it. I think I'm trying to be even more RAM frugal than that, with associated capability tradeoffs. 20:11:41 but yeah - very nice. 20:12:11 And you can hide it all behind EMIT. 20:12:12 :-) 20:12:16 I'm sure curses boils down to the same thing, with more sophistication of course. 20:12:49 Probably, but curses gives me a headache. 20:13:00 I better hit the sack - fun chat, rdrop-exit. 20:13:14 Likewise, nighty-night :) 20:15:21 Dogs need walking, catch you all later. Keep on Forthin' 20:15:54 --- quit: rdrop-exit (Quit: Lost terminal) 20:23:52 --- quit: proteusguy (Remote host closed the connection) 20:43:26 --- join: proteusguy (~proteusgu@mx-ll-180.183.98-133.dynamic.3bb.co.th) joined #forth 20:43:27 --- mode: ChanServ set +v proteusguy 21:08:40 --- quit: yrm (Ping timeout: 255 seconds) 21:11:47 --- join: yrm (~yrm@host155.shizentai.jp) joined #forth 21:18:50 --- quit: yrm (Ping timeout: 240 seconds) 21:21:39 --- join: yrm (~yrm@host155.shizentai.jp) joined #forth 21:28:33 --- quit: yrm (Ping timeout: 250 seconds) 21:29:45 --- join: yrm (~yrm@host155.shizentai.jp) joined #forth 21:35:49 --- quit: reepca (Ping timeout: 245 seconds) 21:44:09 --- quit: yrm (Ping timeout: 245 seconds) 21:44:36 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 21:46:07 --- join: yrm (~yrm@host155.shizentai.jp) joined #forth 21:47:56 --- quit: MrMobius (Ping timeout: 258 seconds) 21:47:56 --- nick: [1]MrMobius -> MrMobius 22:06:41 --- quit: yrm (Ping timeout: 250 seconds) 22:13:30 --- join: yrm (~yrm@host155.shizentai.jp) joined #forth 22:33:25 who is the author of the github repo forth right? 22:35:29 No. Who's on first. What's on second. I don't know's on third. 22:36:29 sorry i mean this https://github.com/niclash/forthright 22:36:42 i found his forth porting to esp8266 22:37:18 and by checking his profile, found he is located at malaysia, which is not too far away to china :D 22:37:37 That thumbnail doesn't look very Chinese though. :D 22:39:36 what ever, i dont care his race, its just not that easy to found a forth interested guys who happened also be interesting with esp8266 22:41:49 --- join: reepca (~user@208.89.170.37) joined #forth 22:42:40 I think mecrisp also supports the esp8266 22:43:14 if you're looking for more forthers interested in the esp you might look there 22:44:00 bluekelp: thanks, checking 22:45:43 specifically mecrisp-stellaris -- mecrisp is for the MSP processor but stellaris is the arm port and has been ported to several arm chips 22:46:12 i've been having a lot of fun with my stm32f0 board and playing with my first bare metal forth 22:46:15 also https://www.sifflez.org/lectures/ASE/C3.pdf this looks so cool 22:46:21 alas, not the samd's 22:46:49 bluekelp: but esp chip is not arm :[ 22:48:06 isn't it? I thought it was. hrm - let me check. I was pretty sure there was an esp8266 dir in the source for stellaris 22:49:03 you're right! erg. I can't remember where it was I saw that then - or maybe I made it up. 22:49:12 I am sorry about the confusion. I was wrong. 22:49:51 bluekelp: its okay, i'd ordered a pair of stm32f1 boards with builtin oled 22:50:08 might playing mecrisp on them this weekend when i receive the boards 22:57:28 yunfan: oops - I think I meant https://github.com/zeroflag/punyforth 22:57:41 *this* must be the one I saw which had esp8266 support :) 22:58:00 yunfan: i have a few of those - been a while since i've used them though 22:58:51 so there's three people with an interest in them and forth 22:59:18 bluekelp: i knew punyforth, actually the #2 issues were post by me 22:59:37 haha! oh well. it was worth a shot :) 22:59:39 bluekelp: but its repl support is not that good 22:59:50 that's why i am looking for others 22:59:59 good to know. I just ordered two of the esp8266s with oled and was going to try it out 23:00:29 the_cuckoo: three, wow, that's a huge community in forth domain :D 23:00:49 bluekelp: so the oled was ssd1306 ic controlled? 23:02:04 yunfan: :) 23:02:27 now i got this https://wiki.forth-ev.de/doku.php/projects:esp8266:start 23:02:42 it collected many of the forht runs on esp8266 23:02:49 thanks to the germany 23:04:29 there do seem to be a fair number of German forthers 23:05:05 yep, made me want to learn germany the language 23:06:08 also i found many forther use windows 23:06:21 mecrisp-stellaris is mostly commented in german (as are some of the assembly language variables/labels). i've forked it and want to "port" it to english for my own comprehension 23:06:26 because their flashing port usually is COMx 23:51:01 --- quit: yrm (Quit: yrm) 23:51:45 maybe they're using dos 23:58:03 dunno 23:59:59 --- log: ended forth/19.02.26