00:00:00 --- log: started forth/18.12.26 00:21:34 --- join: smokeink (~smokeink@42-200-118-65.static.imsbiz.com) joined #forth 00:44:34 --- quit: pierpal (Quit: Poof) 00:44:59 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 00:50:45 --- quit: smokeink (Quit: peace) 02:03:12 --- quit: ashirase (Ping timeout: 250 seconds) 02:05:20 --- join: dys (~dys@tmo-120-171.customers.d1-online.com) joined #forth 02:14:33 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 04:08:27 Hello all 04:08:52 Learning to use Sam (Plan 9). It's more esoteric than Acme and not in a good way. 04:46:31 WilhelmVonWeiner: Is there any advantage to Sam over Acme? I use Acme for editing notes and sometimes also a uart forth prompt. Acme plumbing is great too. I often highlight part of a memory address to plumb it and filter a remap for related peripherals or associated registers. 04:55:33 It's been said that Acme is an *integrating* development environment rather than an integrated development environment. It's about the only ide I've seen that follows a unixy philosophy of composability. 04:55:33 I'd like to do a forthy retake of Acme I think it's the inkling of the composable forthy gui I've been searching for. 05:07:28 sam id more ed-like. 05:07:53 so the use of "structural regex" combined with ed and a proto-acme 05:08:34 I like using regex in it more than in Acme because acme means you have to write it and pass it to the Edit command, so a lot of mouse movement and checking your buffers and that 05:09:52 Sam does have the plumber, redirection etc just like acme too, so you can redirect/pipe a range to a program 05:10:33 Really I'd say it depends on if you want to use the mouse or keyboard more. Since with Sam, you can still editr directly into a buffer acme-window style, it's just sans the mouse chording. 05:12:57 later today I'm writing a CHIP-8 interpreter in Forth and Retro, I'm going to do so in Sam and determine whether I like they keyboard-focused or mouse-focused editor style more. Sam does not have commands like win/awd. 05:15:09 --- quit: libertas (Ping timeout: 272 seconds) 05:16:47 --- join: libertas (~libertas@a95-93-229-182.cpe.netcabo.pt) joined #forth 05:19:38 WilhelmVonWeiner: Well I've got this updated version of Sam installed https://github.com/deadpixi/sam 05:22:25 Oh, I'm using the version from plan9port. 05:28:04 With all those additions you may like vis (http://martanne.github.io/vis) 06:05:39 Hmm, x86 assembly is pretty horrible. 06:08:19 i've got some tight x86 code 06:08:47 and a fast 128 bit by 128 bit divide (25% faster than gcc) 06:09:58 it took a while to write, and then i found out i wouldn't need it anyway 06:10:07 I am trying to write a basic x86 assembler in gforth right now, so I can write a Forth in assembly and compile it with itself eventually. 06:10:20 cool 06:11:02 I am already able to compile a multiboot header and it boots in qemu. Now I only have to generate code that does something. 06:11:05 is it going to be reverse polish, like forth is? 06:11:32 Yes. 06:11:44 nice 06:12:00 It will look like "EAX 12 MOVI" once it's done. 06:12:41 i dig how it's automatically a macro assembler just cos it's forth 06:13:46 i like to rename the registers so it's more descriptive.. like TOS instead of EBX for top of stack register 06:15:11 and you could do make : NEXT LODSL EAX JMP ; 06:33:16 Oooh, I just found out why my program doesn't work as intended. 06:37:54 --- join: learning_ (~learning@47.149.80.42) joined #forth 06:39:13 Oh, wow. 06:39:16 Things happen. 07:12:35 https://www.reddit.com/r/Forth/comments/a9om1d/programming_a_problemorientedlanguage/ 07:13:00 Ok, only a little more work and the assembler will be done :D 07:14:33 --- join: Kumool (~Khwerz@adsl-64-237-235-60.prtc.net) joined #forth 07:16:25 --- quit: pierpal (Quit: Poof) 07:16:46 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 07:21:36 I would just have MOV EAX, 12 where MOV reads ahead in the current line 07:22:51 pointfree: reading the comments, it's interesting how people dismiss the basic principle out of hand 07:25:40 The comments read like defensiveness 07:26:48 Whenever Forth comes up, they always seem to. People who've never written it can have a lot of opinions on it 07:33:25 --- quit: pierpal (Quit: Poof) 07:33:41 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 07:49:40 pointfree; yeah, it is like they have invested in something that is crappy but do not want to admit it. 07:58:12 --- quit: learning_ (Remote host closed the connection) 07:59:16 --- quit: dave0 (Quit: dave's not here) 08:05:52 --- quit: pierpal (Quit: Poof) 08:06:12 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 08:08:58 --- join: alexshendi (~yaaic@46.183.103.8) joined #forth 08:15:07 Is there a way to name constants during execution? 08:16:09 Constantly I do `:NONAME 10 0 DO I CONSTANT LOOP ; EXECUTE V0 V1 V2...` but hand writing V0-F seems like it can be shortcut 08:19:34 --- quit: pierpal (Quit: Poof) 08:19:54 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 08:28:47 WilhelmVonWeiner: Hmm, how did you do nested IF-THEN without nesting but by using RDROP? 08:29:21 WilhelmVonWeiner: In assembly I have to check for a few dozen registers and nesting the statements is ugly. 08:30:32 INstead of your IF..THEN you have a word which RDROPs out of the the calling word 08:30:58 and you just RDROP as many words as you want to escape out of 08:33:17 https://bpaste.net/show/cbe5eae0ac08 08:34:26 This code is obviously incorrect. I'd like to leave the REGCHECK function when one of the IFs was executed. 08:34:31 : AL? DUP AL = IF DO_STUFF DROP RDROP THEN ; 08:34:31 ...etc... 08:34:31 : REGCHECK AL? AH? BL? BH? ; 08:35:17 So I have to define an AL? function? 08:35:33 Yeah, you need a new word to rdrop out of. 08:36:01 Else you're dropping the return from REGCHECK to it's calling word 08:40:12 Don't be afraid to write lots of words. It makes following control flow easier, it helps shortcuts long blocks of code, and helps you refactor later on 08:42:06 --- quit: pierpal (Quit: Poof) 08:42:25 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 08:43:49 --- quit: dys (Ping timeout: 240 seconds) 08:44:49 --- quit: alexshendi (Ping timeout: 246 seconds) 08:51:28 --- join: dys (~dys@tmo-100-214.customers.d1-online.com) joined #forth 08:54:29 --- quit: Kumool (Ping timeout: 240 seconds) 08:55:49 --- quit: dys (Ping timeout: 244 seconds) 09:10:58 Huh, my code actually ends up being quite pretty. 09:11:14 I have already got the MOVI commands done. 09:11:15 http://forth.org/forth_style.html 09:20:42 * Zarutian is thinking about doing desktop-y Forth by doing the RFB protocol (that VNC uses) over stdio 09:21:24 pipe back and forth with tk's wish 09:22:08 WilhelmVonWeiner: just you know, I am also an avid Tcl'er so, that isnt much of a challange 09:24:03 * Zarutian has even ported the list indexing procedures (lindex, llength & co) to forth just so he can start making a picol version ontop of Forth (picol being a subset of Tcl) 10:39:52 john_cephalopoda, your project with your x86 assembler in github anywhere? 10:45:56 proteusguy: Not yet, just trying to finish the basics. 10:51:19 I already implemented MOVI (Immediate to register) and MOVR (register to register). 11:00:45 https://bpaste.net/raw/1f11c80821da 11:01:03 Above the assembly in Forth, below the disassembly of the resulting file. 11:12:00 Nice, getting somewhere :D 11:13:36 --- join: Kumool (~Khwerz@adsl-64-237-235-60.prtc.net) joined #forth 11:16:41 john_cephalopoda: You can enter hex numbers in gforth prefixing them with 0x or the word HEX before your hex integers. 11:21:37 WilhelmVonWeiner: I am using the $ prefix for hex words. 12:58:47 Ok. 13:13:45 proteusguy: Here's some code: 13:13:59 https://thecutecuttlefish.org/tmp/asm_x86.fth 13:14:08 https://thecutecuttlefish.org/tmp/init.fth 13:14:48 You can then execute it with "qemu-system-x86_64 -kernel kernel" 13:41:24 --- join: learning_ (~learning@47.149.80.42) joined #forth 13:46:18 Hi learning_. 13:53:24 crc: that file access 'device' for nga, it handles fifos okay? ( mkfifo in bash ) 13:54:20 (so long one doesnt do seeks or tells ) 14:00:25 --- quit: learning_ (Remote host closed the connection) 14:01:03 john_cephalopoda: :NONAME 8 0 DO I CONSTANT LOOP ; EXECUTE EAX ECX EDX EBX etc etc etc 14:02:25 or since you do that a lot, make it a words SUCCESSIVE-CONSTANTS ( m n --) 14:02:50 remember, Forth exists to makeyour life easier 14:07:05 WilhelmVonWeiner: Hmm? 14:07:19 --- join: learning_ (~learning@47.149.80.42) joined #forth 14:07:23 I don't think that it would be really advantageous to add a loop for those few constants. 14:17:19 --- quit: Keshl (Ping timeout: 250 seconds) 14:34:02 You duplicate so much code, why? 14:54:01 Zarutian: it should work ok on fifos 15:06:35 --- quit: learning_ (Remote host closed the connection) 15:06:41 --- quit: Zarutian (Read error: Connection reset by peer) 15:07:05 --- join: Zarutian (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 15:07:05 --- quit: pierpal (Read error: Connection reset by peer) 15:07:15 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 15:08:27 --- join: learning_ (~learning@47.149.80.42) joined #forth 15:14:34 https://github.com/jmf/impexus <- proteusguy 15:16:08 hey guys 15:16:35 tabemann: Look at the link I just posted. It's an OS project in Forth. 15:20:22 the idea of making an OS in Forth is neat, but I don't think I'd be able to get all the device drives working for anything other than an embedded system (where everything's in the data sheet) or an emulator/virtualization layer 15:20:29 *drivers 15:32:35 I don't expect to support a lot of hardware with mine; I'd be pretty happy w/keyboard, display, serial, and a block storage device. 15:33:25 VGA text mode on x86 is trivial. 15:34:20 Of course writing device drivers will be super-hard, but most hardware isn't really that useful. 15:39:44 On x86, I have keyboard (from retro4) and text display (from fts/forth) working. 15:41:17 Adding hard disk support should be easy; I've done that before and can adapt much of the older code. I don't recall if I had done serial before. 15:42:38 --- quit: ashirase (Ping timeout: 250 seconds) 15:47:59 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 16:10:39 --- quit: learning_ (Remote host closed the connection) 16:21:32 --- quit: john_cephalopoda (Ping timeout: 252 seconds) 16:23:06 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:40:02 crc: Text display is ~2 lines of code :þ 16:40:29 More if you want scrolling, full cursor support, etc 16:40:53 Well, that's a tiny bit more work, but still relatively trivial. 16:43:09 Mine is 793 lines of assembly, including extensive comments 16:43:49 Well, first of all I got to get the Forth part of it all working. 16:43:56 http://forthworks.com/retro/s/interfaces/native/386.s 16:55:26 In my case, the Forth part is mostly done. I need to write some bridge code for the VM to be able to read/write raw memory and use the I/O ports, but that shouldn't take long. Then, adapting for 64-bit, and finally port to ARM... 16:57:56 I wrote the assembler itself in Forth. 16:58:18 But I've never written a Forth, so I'll have to see how to best do it. 16:59:58 I will have to define low-level Forth words somehow and then start evaluating stuff... 17:00:57 You should check out Chuck's book. 17:01:21 Which one? 17:01:59 And look at some small models (eforth, camelforth come to mind) 17:02:40 john_cephalopoda: I'm pretty sure he only has one. 17:04:30 I am reading through "Moving Forth" right now. 17:06:27 https://www.amazon.com/Programming-Problem-Oriented-Language-internals/dp/1983362565/ref=sr_1_1?ie=UTF8&qid=1545872756&sr=8-1&keywords=Problem+Oriented+Language 17:08:43 Or http://forth.org/POL.pdf for a free PDF of that 17:09:06 Oh, yeah. It's just I'm on amazon at the moment, lol. 17:20:22 Hmm, I've skipped halfway through it, nothing really interesting yet. 17:36:55 --- join: rdrop-exit (~markwilli@112.201.164.82) joined #forth 17:40:59 john_cephalopoda, thanx I'll check it out! 17:42:21 halfway through which? 17:43:14 Through problem-oriented programming 17:44:55 --- quit: proteusguy (Remote host closed the connection) 17:48:55 Hello Forthwrights :) 17:49:19 Hey rdrop-exit 17:49:35 Hi John 17:51:25 I'm recovering from the holiday festivities, though I'd check in while having my first cup. 17:52:31 I'm working on an OS written in Forth. 17:52:48 The OS part is coming along nicely, the Forth part, on the other hand... 17:54:40 A general purpose OS? 17:54:53 That's the plan, yes. 17:55:21 "Programming a Problem Oriented Language" isn't fiction, so you don't skim to the halfway point and guess what you can glean as interesting 17:55:31 it's a book on how to write a forth from the inventor of Forth 17:55:31 rdrop-exit: Here's the code I got so far: https://github.com/jmf/impexus 17:55:48 if there's nothing interesting in there you may be writing the wrong language 17:56:29 WilhelmVonWeiner: Most of the thing in that book were more confusing than helpful to me. In addition to that, I am not really interested that much in writing forth code but more in writing a forth. 17:58:03 The latter *is* what the book is about, which is why you avoid skimming technical nonfiction. 17:58:48 --- join: tbemann (ac0d3189@gateway/web/freenode/ip.172.13.49.137) joined #forth 17:59:21 I should reread it, it's been a while. 17:59:57 WilhelmVonWeiner: It doesn't even mention ITC and DCT. 18:00:34 I am interested in the very low-level details. I want to implement things. 18:01:36 It does detail the step-by-step implementation of a Forth in a language-agnostic way. 18:02:16 I'm not sure why it lacks the use of the word "threading" but it is discussed, as it's vital to the implementation. 18:03:12 The best description and comparison of threading approaches is in the book "Interpretation and Instruction Path Coprocessing". 18:03:36 Ooh, MIT press. 18:03:48 --- quit: tbemann (Quit: Page closed) 18:03:52 --- quit: Kumool (Quit: WeeChat 2.3) 18:04:17 IIRC POL is more like an proto Thinking Forth 18:04:29 $15 on Amazon.com... £65 on Amazon.co.uk 18:04:34 * a proto 18:04:42 Maybe I can find the ebook. 18:04:47 lol. 18:05:23 I have a hardcopy from when it came out (IAIPC) 18:05:50 rdrop-exit: "Moving Forth" also discussed threading pretty nicely. 18:05:59 I think I'll go with DCT for my Forth. 18:06:05 Hardcopies are nice. Real nice 18:06:39 True. Reading books on screen is just straining. I usually can't read more than a few pages. 18:07:23 For my Forths I usually go with either SRT/NCI or TTC 18:08:42 The opposite extremes of the threading spectrum are very similar to work with in many ways. 18:09:37 NCI threading? 18:09:42 The main difference is that with SRT/NCI you're dealing with a physical processor, while with TTC you're dealing with a virtual processor. 18:10:14 SRT/NCI: Subroutine Threading with Native Code Inlining 18:11:18 i.e. Subroutine threading plus the capability of selectively inlining native code 18:14:40 TTC for space and/or portability, SRT/NCI for speed. 18:16:34 bbiab 18:26:12 --- join: learning_ (~learning@47.149.80.42) joined #forth 18:29:39 back 18:33:55 back 18:35:16 * tabemann is frustrated with his software interrupt functionality 18:41:16 ? 19:05:08 --- quit: learning_ (Remote host closed the connection) 19:27:14 --- join: dave0 (~dave0@47.44-27-211.dynamic.dsl.syd.iprimus.net.au) joined #forth 19:29:56 hi 19:30:12 Hi dave0 19:30:29 hi rdrop-exit 19:43:49 --- quit: dddddd (Remote host closed the connection) 19:49:51 Gotta go, chat again later. Keep on Forthin' 19:49:57 --- quit: rdrop-exit (Quit: Lost terminal) 19:58:58 cya rd 19:59:06 cya rdrop-exit 19:59:19 hey again 19:59:25 hi tabemann 20:14:58 Yay! Finished QUIT and INTERPRET, now I need to bootstrap the rest of Forth from there :) 20:32:16 seems to me you might need: NUMBER, ',' (or 'c,'), '@' (or 'c@') and '!' (or 'c!' ;-) 20:42:06 back 21:52:01 finally - got proper cleanup of outstanding writes working without relying on spinwaits 22:18:08 --- quit: dave0 (Quit: dave's not here) 22:21:21 --- join: dys (~dys@tmo-097-27.customers.d1-online.com) joined #forth 23:07:55 --- quit: pierpal (Ping timeout: 245 seconds) 23:17:07 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 23:22:19 PoppaVic: Yep I have all of those 23:22:31 And the byte equivalents 23:28:37 --- quit: pierpal (Read error: Connection reset by peer) 23:28:53 --- join: pierpal (~pierpal@95.239.223.85) joined #forth 23:38:50 --- quit: dys (Ping timeout: 246 seconds) 23:40:32 Oof running out of space on RAM page 00, I need to figure out how to read flash pages in/out of RAM now 23:59:59 --- log: ended forth/18.12.26