00:00:00 --- log: started forth/18.02.18 01:44:31 --- quit: wa5qjh (Remote host closed the connection) 01:47:23 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 02:01:54 --- quit: wa5qjh (Remote host closed the connection) 02:03:47 Is anyone familiar with F18 ? I'm having a tough time trying to understand how this virtual machine works: https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ 02:04:08 why is it that each stack slot has its own code-page ? 02:38:37 i don't have time to read all this right now but it looks like it is because it uses the x64 general purpose registers for the stack, so instead of manipulating a stack pointer, it needs to emit different code depending on which register will be TOS then 02:41:49 thanks for the indication, I'll try to digest it all again, until I understand the whole mechanism 02:59:07 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 02:59:38 --- quit: wa5qjh (Remote host closed the connection) 03:09:27 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 03:47:46 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 03:55:27 --- join: proteusguy (~proteusgu@14.207.165.67) joined #forth 03:55:27 --- mode: ChanServ set +v proteusguy 03:57:11 koisoke: "it needs to emit different code depending on which register will be TOS", why ? 03:58:02 --- quit: proteus-guy (Ping timeout: 240 seconds) 03:58:27 "because it uses the x64 general purpose registers for the stack" so why does this imply that he must emit different code depending on which register is the TOS ? 03:59:00 it's explained before the first of the lisp implementation is shown 03:59:42 but remember that register operands are part of the instruction encoding 04:02:22 or do you not understand it because you don't know how the registers work on x64? 04:02:24 ok I know to which part you refer, I'll read it 20 times 'till I get what it says 04:03:14 I know how x32 works, x64 has those additional r8,...r15 04:03:15 The basic design of the VM is: 04:03:18 r8-r15: stack slots (32 bits); 04:03:25 yes 04:03:50 this is emitting code to use those as a stack, but the hardware doesn't have any special feature to use them as a stack 04:04:28 so the compiler keeps track of the stack depth and emits code to use the correct registers 04:05:02 ohhh I'm on the verge of undertanding now 04:05:26 I got it I think 04:05:31 thank you so much 04:05:38 i don't know why it seems to precalculate every variant for every primitive. i guess it runs faster that way, or maybe it was just easier to write 04:06:35 np 04:15:04 --- join: wa5qjh (~quassel@175.158.225.199) joined #forth 04:15:04 --- quit: wa5qjh (Changing host) 04:15:04 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 04:49:19 --- quit: wa5qjh (Remote host closed the connection) 04:52:23 How does his relative unconditional jmp work?? 05:06:51 ; 08395200: 486307 MOVSXD RAX, DWORD PTR [RDI] ; this puts the address of the word that would get executed by (NEXT), into RAX right ? 05:07:43 actually I'm now sure what the jmp and ret are supposed to do, in a forth code that is to be executed on his VM 05:08:32 I understand what (next) does, but I'm clueless what jmp,ret,call do and where they are to be used 05:10:28 oh, the above asm instruction puts into RAX the address of the word that IS BEING executed 05:12:19 nope 05:52:16 his unconditional relative jmp gives to *virtual-ip* the value *virtual-ip*+*virtual-ip*+4 or wtf 06:10:56 --- join: dys (~dys@tmo-098-181.customers.d1-online.com) joined #forth 07:28:52 --- join: Gromboli (~Gromboli@static-72-88-80-103.bflony.fios.verizon.net) joined #forth 07:43:49 --- join: Labu (~mik@mvice.pck.nerim.net) joined #forth 07:45:33 Hello all 07:45:49 Labu: hi 08:16:49 --- quit: smokeink (Quit: peace) 08:21:49 --- join: lijero (~lijero@unaffiliated/lijero) joined #forth 09:00:13 Hi jn 09:00:29 is there an debugger in gforth ? 09:02:03 i don't know 09:03:29 what is implementation you use jn ? 09:04:00 I found how I can do that 09:04:41 gforth sometimes, but i'm also developing my own forth implementation 09:05:31 ok great ! what is this implementation ? 09:06:28 it's a native-code forth for RISC-V, based on ANS Forth 09:07:02 and currently unreleased, because it can't even do 1 2 + . 09:08:31 ok it must not be easy 09:11:35 What is the RISC-V implementation you use ? Do you emulate it ? 09:12:34 spike 09:12:52 but the plan is to run my forth on the HiFive1 board 09:13:23 ok 09:13:38 great ! 09:16:16 Gr8 09:16:18 (!) 09:20:11 APic: what is Gr8 ? 09:20:22 Labu: StarCraftII 09:22:48 I have played only the first (a long time ago...) 09:23:26 * jn is watching a Starflight letsplay 09:25:27 Labu: /me too 09:25:33 jn: Sounds epic 09:26:12 APic: i found this game on the wikipedia page for forth, and then i looked into the binary and actually found a few pages of forth source code 09:26:17 Good 09:26:19 Go on 09:26:44 and yes, it's a good game (with 80s graphics, because it's from the 80s) 09:35:40 --- quit: ncv (Remote host closed the connection) 09:41:16 --- join: ncv (~neceve@2a02:c7d:c5c9:a900:1ec6:932f:1b02:d27e) joined #forth 09:41:16 --- quit: ncv (Changing host) 09:41:16 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 10:57:13 --- nick: Zarutian_PI2 -> Zarutian_PI 10:59:07 --- join: proteus-guy (~proteus-g@184.22.248.114) joined #forth 11:52:21 --- quit: ncv (Remote host closed the connection) 12:32:48 --- join: Mat4 (~Claude@ip5b409e5e.dynamic.kabel-deutschland.de) joined #forth 12:38:30 --- quit: Mat4 (Read error: Connection reset by peer) 12:50:46 --- join: Mat4 (~Claude@ip5b409e5e.dynamic.kabel-deutschland.de) joined #forth 12:56:13 hello 12:57:09 Hi 12:59:07 hi Mat4 13:00:38 does someone here know a working Forth for RISC V ? 13:02:37 I mean beside lbForth 13:02:39 Mat4: Maybe ask Sam Falvo? 13:04:47 https://sam-falvo.github.io/kestrel/ 13:04:54 thanks, ah I forgot he was working on a Forth for his Kestrel project 13:07:09 mine doesn't work yet, sorry :) 13:12:39 what kind of Forth you are working on ? 13:13:40 a native-code forth for RISC-V, written in assembly 13:13:46 and with documentation :) 13:14:10 (unreleased so far) 13:14:20 based on ANS'94 13:16:06 --- join: Mat5 (~Claude@ip5b409e5e.dynamic.kabel-deutschland.de) joined #forth 13:16:29 Mat4: h'lo. And there is now five you? ;-Þ 13:16:40 --- quit: Mat4 (Read error: Connection reset by peer) 13:17:51 --- quit: Mat5 (Client Quit) 13:18:25 --- join: Mat5 (~Claude@91.64.158.94) joined #forth 13:31:58 --- quit: Mat5 (Remote host closed the connection) 13:52:19 --- quit: proteus-guy (Ping timeout: 264 seconds) 13:52:43 --- join: proteus-guy (~proteus-g@2405:9800:bc10:1ca:e80f:92a4:b13b:f1f0) joined #forth 13:58:42 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 14:05:42 --- quit: Labu (Ping timeout: 248 seconds) 14:11:43 --- join: EvanCarroll (~ecarroll@rrcs-71-41-192-130.sw.biz.rr.com) joined #forth 14:14:10 --- quit: EvanCarroll (Quit: leaving) 14:14:24 --- join: EvanCarroll (~ecarroll@rrcs-71-41-192-130.sw.biz.rr.com) joined #forth 16:26:45 --- log: started forth/18.02.18 16:26:45 --- join: clog (~nef@bespin.org) joined #forth 16:26:45 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN | Forth Standards at http://forthworks.com/forth | www.greenarraychips.com | https://github.com/mark4th' 16:26:45 --- topic: set by crc!sid2647@gateway/web/irccloud.com/x-bvbpvizerlziiwww on [Wed Apr 19 13:11:34 2017] 16:26:45 --- names: list (clog wa5qjh proteus-guy Gromboli dys +proteusguy dddddd johnmark_ Darksecond Zarutian_PI dorothyw reepca`` karswell bedah djinni groovy2shoes jedb phadthai FatalNIX rodarmor rgrinberg ggherdov` @crc M-jimt pointfree1 bb010g a3f sigjuice ovf backer yunfan pointfree jeremyheiler xek cheater rpcope bavier` bluekelp dograt nerfur rprimus cess11 @koisoke ecraven dzho diginet2 malyn carc lugh fiddlerwoaroof zy]x[yz APic irsol izabera jn) 16:29:41 --- quit: wa5qjh (Ping timeout: 256 seconds) 16:45:57 --- join: lijero (~lijero@unaffiliated/lijero) joined #forth 16:46:50 --- join: nighty- (~nighty@kyotolabs.asahinet.com) joined #forth 18:53:44 --- log: started forth/18.02.18 18:53:44 --- join: clog (~nef@bespin.org) joined #forth 18:53:44 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN | Forth Standards at http://forthworks.com/forth | www.greenarraychips.com | https://github.com/mark4th' 18:53:44 --- topic: set by crc!sid2647@gateway/web/irccloud.com/x-bvbpvizerlziiwww on [Wed Apr 19 13:11:34 2017] 18:53:44 --- names: list (clog smokeink nighty- lijero proteus-guy Gromboli +proteusguy dddddd johnmark_ Darksecond Zarutian_PI dorothyw reepca`` karswell bedah djinni groovy2shoes jedb phadthai FatalNIX rodarmor rgrinberg ggherdov` @crc M-jimt pointfree1 bb010g a3f sigjuice ovf backer yunfan pointfree jeremyheiler xek cheater rpcope bavier` bluekelp dograt nerfur rprimus cess11 @koisoke ecraven dzho diginet2 malyn carc lugh fiddlerwoaroof jn izabera irsol APic zy]x[yz) 19:01:11 --- quit: clog (^C) 19:01:11 --- log: stopped forth/18.02.18 19:02:24 --- log: started forth/18.02.18 19:02:24 --- join: clog (~nef@bespin.org) joined #forth 19:02:24 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN | Forth Standards at http://forthworks.com/forth | www.greenarraychips.com | https://github.com/mark4th' 19:02:24 --- topic: set by crc!sid2647@gateway/web/irccloud.com/x-bvbpvizerlziiwww on [Wed Apr 19 13:11:34 2017] 19:02:24 --- names: list (clog smokeink nighty- lijero proteus-guy Gromboli +proteusguy dddddd johnmark_ Darksecond Zarutian_PI dorothyw reepca`` karswell bedah djinni groovy2shoes jedb phadthai FatalNIX rodarmor rgrinberg ggherdov` @crc M-jimt pointfree1 bb010g a3f sigjuice ovf backer yunfan pointfree jeremyheiler xek cheater rpcope bavier` bluekelp dograt nerfur rprimus cess11 @koisoke ecraven dzho diginet2 malyn carc lugh fiddlerwoaroof zy]x[yz APic irsol izabera jn) 20:32:28 --- join: EvanCarroll (~ecarroll@96-91-57-131-static.hfc.comcastbusiness.net) joined #forth 20:49:19 the book chapter on factor blocks is shit 20:50:55 then drag your file in the Forth window and drop it on the command line. Type ↵.) 20:51:03 is that a windows thing to paste the filename or contents? 20:51:26 It's not clear how to create or save a block 20:51:36 which book 20:53:14 https://www.forth.com/starting-forth/3-forth-editor-blocks-buffer/ 20:55:59 1 sec, I'll show you some notes, that might be of help (or not... :) ) 20:59:09 https://pastebin.com/M8mMaxf4 21:04:17 --- quit: dddddd (Remote host closed the connection) 21:04:34 assume I have no words in my file. 21:04:45 actually assume I have nothing whatsoever. 21:04:51 How do I write to a file. 21:04:59 I'm still not getting it 21:05:07 --- quit: Gromboli (Quit: Leaving) 21:05:12 Why am I running 0 LIST, 1 LOAD 21:05:14 or whatever 21:05:32 the only statement there that makes sense is `USE blocked.fb` because I can see that's creating a file. 21:05:39 the rest aren't doing anything, and shouldn't I don't have anything. 21:06:22 https://stackoverflow.com/q/48859721/124486 21:06:35 https://stackoverflow.com/q/48859741/124486 21:15:31 ok , I don't have much experience with blocks, those instructions were given to me by a friend. 21:15:40 blocked.fb is a file that already exists in the system (if you have gforth installed ) 21:16:58 so after use blocked.fb 0 list and 1 list and 2 list etc will display come content , from that blocked.fb file 21:19:19 0 list displays block 0 I think (I'm not sure about the terminology), which on my machine is a description , a readme: 0 \\ some comments on this simple editor 29aug95py blabla 21:20:15 1 list displays the content of block 1 , which contains the definitions of some words. If I want to load those definitions, then I'd do 1 load 21:21:54 On my machine the file is located at : /usr/share/gforth/0.7.3/blocked.fb 21:23:38 the words defined there are to be used when doing block editing, I guess 21:40:33 EvanCarroll: include is used to execute a text file , LOAD is used to execute a block . (in gforth on linux these blocks are sections in a file on the disk) 21:40:57 you can actually skip all this blocks thing, it's not that important, you can learn it later when you really need it 21:41:08 so how do I create those sections in the file and the words in the sections? Do all words have to be in a section? 21:41:59 it's not clear from the book what exactly creates the files, and sections -- do I have to do it in the editor. Or, are they created from the interactive section (or can they be) this is how R works. 21:44:41 --- quit: proteus-guy (Remote host closed the connection) 21:46:13 I also don't know how to edit blocks... Look, just use an editor to edit your forth code, and include it in the interactive session 21:46:41 if that's not interactive enough, you can use Emacs as it can integrate well with forth 21:46:47 hahahahah 21:46:48 =) 21:47:02 I'm just learning. I don't actually intend yet on doing anything useful with FORTH. 21:47:19 Emacs editor can have the forth interactive session in a split window, so you can execute code or parts of the code, as you type 21:47:26 Maybe these questions go unanswered for another decade, then they get answered on SO and then people have guidance =) 21:47:33 the book is pretty good 21:47:47 some areas it's trash. some stuff is just silly and overly verbose. But I'm pretty happy with it 21:47:50 the thing is, block editing it's system dependent, and also implementation dependent 21:47:51 I'll keep chugging along. 21:48:19 so the commands might differ when you use a different forth or a different operating system host or machine 21:48:43 this one is also nice : http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm 21:49:18 block editing commands for gforth: https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Blocks.html 21:49:50 and this one is the nicest: https://github.com/nornagon/jonesforth/blob/master/jonesforth.S 21:51:27 --- quit: lijero (Remote host closed the connection) 21:56:47 --- nick: dorothyw -> lisbeths 22:09:43 --- quit: EvanCarroll (Ping timeout: 264 seconds) 22:11:55 --- quit: groovy2shoes (Quit: moritura te salutat) 22:16:23 --- join: groovy2shoes (~groovy2sh@unaffiliated/groovebot) joined #forth 22:16:51 smokeink: it's doing a relative jump but that is a really inefficient way to do it 22:17:57 koisoke: :) where does it jump to ?? it jumps inside the (next) word to be executed + the current IP + 4 ?? 22:19:18 moment. let me reread this to be sure i understand it :P 22:23:36 i *think* it is doing a relative jump with a 32-bit displacement from rdi, then added to rsi to get the correct version of the primitive it is landing on. what i don't understand is the add rdi,4, since it seems like you could just do that to the jump displacements before storing them in memory 22:23:53 if there is some reason for doing that, i'm missing it 22:26:24 that would make it displacement from the location immediately following the offset. which is also how JMP instructions work on x86, but i don't think it is fetching from a place preceded by a jmp immed32 opcode 22:26:34 so eh, it's weird to me too 22:30:01 oh, it's .. 22:30:07 i think i almost get this 22:34:53 the NEXT there makes sense to me 22:37:59 actually the NEXT looks wrong to me because the mov eax,[rdi] isn't getting sign-extended 22:38:30 but probably you only see positive displacements there so it doesn't matter 22:38:33 so nm 22:39:25 oh right of course you would because they are relative to the start of the code pages 22:39:35 so NEXT is fine 22:39:45 sorry i'm thinking out loud 22:44:10 * smokeink reading 22:44:43 i'm not sure i understand the jmp word there. it looks like it would cause the NEXT of the word JMP'ed to to move forward two places 22:45:07 because it loads edi with the the correct value for where it is jmping, and adds 4 22:48:37 i don't see the code posted to verify that it even works 23:04:26 hmmmmmmmmmmmmm 23:05:10 I don't have a 64bit os available to test the code 23:05:14 https://github.com/mschuldt/rtx2000_simulator 23:05:39 somebody ported RTX chip simulator to linux 23:06:56 i will grab this but i don't have time to do anything with it now 23:06:58 thanks 23:07:50 i wish i had a space probe or something to need this 23:29:05 --- join: proteus-guy (~proteus-g@183.88.63.63) joined #forth 23:33:16 koisoke: a space probe? 23:35:55 https://en.wikipedia.org/wiki/RTX2010 23:46:26 --- quit: smokeink (Excess Flood) 23:46:49 --- join: smokeink (~smokeink@59-125-75-78.HINET-IP.hinet.net) joined #forth 23:59:59 --- log: ended forth/18.02.18