00:00:00 --- log: started forth/09.07.20 00:39:43 --- join: jewel_ (n=jewel@dsl-242-130-65.telkomadsl.co.za) joined #forth 00:43:46 --- join: GeDaMo (n=gedamo@212.225.107.61) joined #forth 01:55:07 --- quit: jauaor (hubbard.freenode.net irc.freenode.net) 01:55:07 --- quit: gogonkt (hubbard.freenode.net irc.freenode.net) 01:55:07 --- quit: TR2N (hubbard.freenode.net irc.freenode.net) 01:55:07 --- quit: schmx (hubbard.freenode.net irc.freenode.net) 01:55:07 --- quit: tarbo_ (hubbard.freenode.net irc.freenode.net) 01:55:57 --- join: jauaor (n=araujo@gentoo/developer/araujo) joined #forth 01:55:57 --- join: gogonkt (n=info@113.69.47.221) joined #forth 01:55:58 --- join: TR2N (i=email@89.180.144.5) joined #forth 01:55:58 --- join: schmx (n=marcus@sxemacs/devel/schme) joined #forth 01:56:26 --- join: tarbo (n=me@unaffiliated/tarbo) joined #forth 02:02:39 --- quit: GeDaMo ("Leaving.") 02:56:57 --- part: cataska left #forth 03:10:35 --- quit: crc (Client Quit) 05:05:06 --- quit: jewel_ (Read error: 113 (No route to host)) 05:35:12 --- quit: jauaor () 05:36:21 --- quit: proteusguy (Read error: 110 (Connection timed out)) 05:36:58 --- join: proteusguy (n=proteusg@61.7.144.97) joined #forth 05:45:10 --- join: jewel_ (n=jewel@dsl-242-130-65.telkomadsl.co.za) joined #forth 06:11:27 --- join: gogonkt_ (n=info@59.38.200.175) joined #forth 06:24:09 --- quit: gogonkt (Read error: 110 (Connection timed out)) 06:28:23 --- nick: gogonkt_ -> gogonkt 08:11:09 * madgarden is back (gone 08:33:57) 08:15:10 --- join: GeDaMo (n=gedamo@212.225.107.61) joined #forth 09:52:34 --- join: forther (n=forther@207.47.34.100.static.nextweb.net) joined #forth 09:52:57 --- quit: forther (Client Quit) 11:12:10 --- join: Deformati (n=joe@c-71-238-44-239.hsd1.mi.comcast.net) joined #forth 11:12:35 --- quit: Deformative (Client Quit) 11:13:53 --- nick: Deformati -> Deformative 11:34:44 --- join: I440r (n=mark4__@c-69-136-171-118.hsd1.in.comcast.net) joined #forth 12:06:04 --- join: jauaor (n=araujo@gentoo/developer/araujo) joined #forth 12:08:21 --- quit: Quartus` (Read error: 110 (Connection timed out)) 12:17:26 --- quit: gogonkt (Read error: 110 (Connection timed out)) 12:32:56 --- quit: mathrick (Read error: 110 (Connection timed out)) 12:39:40 --- quit: jauaor () 12:42:41 --- join: impomatic (n=John@nat65.mia.three.co.uk) joined #forth 12:42:48 Hi :-) 12:43:24 I've noticed a few Forths don't implement DO LOOP. Including eForth and Jones Forth. 12:43:47 Not sure what's so tricky? 12:50:08 --- join: mathrick (n=mathrick@wireless.its.sdu.dk) joined #forth 12:52:13 I like FOR NEXT myself 12:53:53 impomatic: I doubt they haven't been implemented due to it being difficult 12:54:02 Probably just preference 13:23:32 do loops are actually quite complex to implement 13:24:00 specially when u consider the complexity of having a word to do an early exit from said do loop and being able to count up or down 13:24:12 for loops are way easier :) 13:39:29 Is it necessary to count up or down? I thought that was only if +LOOP is used 13:46:21 -1 +loop 13:46:30 -2 +loop 13:46:33 5 +loop 13:46:38 theres alot to cater to :) 13:56:12 --- join: Deformati (n=joe@c-71-238-44-239.hsd1.mi.comcast.net) joined #forth 13:57:02 --- quit: Deformative (Read error: 104 (Connection reset by peer)) 14:00:22 l440r: it might not be so tricky to implement using WITHIN 14:00:49 the way isforth (and fpc and f83) implement it (and probably most other forths too) 14:00:56 is to fudge the indicies 14:01:23 erm let me dig out the sources lol. i forget which is fudged in which way 14:02:00 Thanks 14:02:04 Trying to decide which book to buy. Threaded Interpretive Languages by R. G. Loeliger or Computer Approximations by John F. Hart 14:02:27 ok. you add 0x80000000 to the start index. then push that value on the return stack. then you subtract the end inxed from taht value and push IT on the return stack too 14:03:06 on each itteration of the loop you add the count (positive or negative) to the top value and if the overflow flag becomes set you have completed the required number of itterations 14:03:06 --- join: Deformative (n=joe@c-71-238-44-239.hsd1.mi.comcast.net) joined #forth 14:03:23 to get the current loop index you fetch copies of both those values and add them together 14:03:31 which is how I, J and K work 14:03:51 Thanks. That makes sense. Probably makes I and J slightly longer 14:04:02 :-) 14:04:07 there is usually a third item pushed onto the return stack which is the address within the colon definition of the loop exit point 14:04:27 i.e. the address of the exection token immediately following the (loop) or (+loop) 14:04:31 --- quit: Deformati (Read error: 104 (Connection reset by peer)) 14:04:52 so that leave can just drop 2 items and perform a "exit" (pop top of return stack into IP) 14:05:04 i and j have to dig into the return stack 14:05:18 and they will not work if the outer loop "borrows" the return stack 14:05:40 : blah 100 0 do lots of stuff >r more stuff 5 0 do more stuff loop loop ; 14:05:46 --- quit: jewel_ (Read error: 113 (No route to host)) 14:05:46 Thanks, I'd been wondering how to implement exit from a loop. :-) 14:05:51 err i forgot to balance the >r with a r> after the first loop 14:05:59 after the INNEr loop i mean 14:06:15 when you compile a do loop it usually compiels TWO xt's 14:06:22 the xt for (do) and a dummy address 14:07:00 when you compile the LOOP you compile a (loop) and then PATCH the dummy xt after (do) with the here address 14:07:17 when (do) executes it fetches that address and pushess THAT onto the return stack first 14:07:39 its not overly complex but might not be easy to explain heh 14:07:43 Neat 14:08:03 Explanation was fine thanks :-) 14:08:31 As usual the solution is elegant. I thought I might have to do something ugly. 14:08:45 people far smarter than I figured all this out for me :) 14:08:49 i just stole it 14:08:51 fair and square 14:15:02 did you implement does> yet? 14:15:09 that one had me in knots for a long time hehe 14:15:18 --- join: forther (n=forther@207.47.34.100.static.nextweb.net) joined #forth 14:15:22 using it was easy. implementing it was errr wut? 14:16:25 --- quit: forther (Client Quit) 14:16:59 No, not implemented it yet. 14:17:21 I'm implementing in a bit of a weird way! 14:17:21 know how? 14:17:25 kk 14:17:57 well i think the one from f83 (and subsequently fpc and isforth) is nice 14:18:01 I have a vague idea. If I can't figure it, I'll compare a few implementations. 14:18:01 but kinda complex 14:18:12 well i can explain (maybe hehe) 14:18:20 :-) 14:18:38 ok. lets look at what variable my_variable actaually compiles in isforth 14:18:43 ill show it in assembler 14:18:45 I started implementing bottom up with a few primatives. 14:18:47 my_variable 14:18:59 call dovariable ; this is the words CFA 14:19:06 dd 0 ; this is the words body 14:19:09 Then I decide to implement top down beginning with the interpreter. 14:19:30 when you execute my_variable it executes said variables cfa. that CALL at its cfa leaves an address on the stack 14:19:37 i.e. the address of the body of the variable 14:20:03 yea order of implementation is not important :) 14:20:22 ok. im going to simplify somewhat on what f83 and fpc use 14:20:33 isforth has a word called ;uses 14:20:47 this word will patch the cfa of the most recently created word 14:21:16 i can define a constant as follows : constant variable ;uses doconstant ; 14:21:24 which is SORT of what happens 14:21:40 in the above definition if you do 0 constant blah it will create a VARIABLE called blah 14:21:51 That makes sense, and that's almost how I was thinking of it. 14:21:54 but the ;uses patches the "call dovariable" and will make it a "call doconstant" 14:22:01 ok 14:22:09 NOW lets look at ;code 14:22:16 which is what does> uses 14:23:16 ;code kind of works similar to ;uses in that it patches the most recently created words CFA 14:23:38 but in the case of ;code it patches the cfa to be a call to the address IMMEDIATELY FOLLOWING ;code 14:23:41 so if we have a word 14:23:43 dd foo 14:23:44 dd blah 14:23:48 dd create something here 14:23:50 dd ;code 14:24:01 do some assembler stuff here 14:24:15 Hmmm... didn't know about code. 14:24:26 when the ;code executes it patches the word that was created to execute the code at "do some assembler..." 14:24:39 That'll be handy if I need to mix asm / Forth in a word 14:24:39 ok. lets LOOK at a word that uses does> 14:24:51 : constant create , does> @ ; 14:25:09 does> is an immediate word. it compiles two things into the word containing it 14:25:13 it compiles a ;code 14:25:20 then it compiles a call to dodoes (in assembler) 14:25:29 so the above definition would actually look like this in memory 14:25:34 constant: 14:25:36 call nest 14:25:38 dd create 14:25:40 dd comman 14:25:45 dd ;code 14:25:49 call dodoes 14:25:54 dd fetch 14:25:56 dd exit 14:26:13 when constant is executed it creates a new constant, commas the value of the constant in 14:26:33 then ;code patches the "call dovariable" in the newly created word to call the code following itself 14:26:40 so the new word calls a call to dodoes 14:26:50 that leaves TWO return addresses on the stack for dodoes 14:27:11 the top one is the address of the code to interpret the new word with. (i.e. the new words run time semantics) 14:27:24 in this case the top return address points to the @ xt 14:27:38 Okay, I mostly got that 14:27:38 the second item on the stack is the return address that points to the body of the constant 14:27:51 0 constant blah will create the following 14:27:52 blah: 14:28:05 call address_following_;code_xt 14:28:09 dd 123 14:28:31 the call in the new constants xt jumps to the "call dodoes" that was compiled by does> 14:28:33 understand? 14:29:39 thats NOT the only way to implement it but its how i did it 14:29:45 again. i didnt "invent" it heh 14:30:18 * schmx saves all that in a file for later use (: 14:30:21 I think so. That's almost how I'd got it in my head, just I hadn't got beyond it working with ITC 14:30:26 I440r: That was a very good explanation. 14:30:52 Need to reboot, back shortly 14:31:00 --- quit: impomatic ("mov.i #1,1") 14:31:02 i think ITC is more complex and i KNOW its slower on x86 14:31:20 --- quit: GeDaMo ("Leaving.") 14:31:24 i only ever implement direct threading myself because its far easier for beginners to get to grips with 14:32:28 --- join: impomatic (n=John@nat65.mia.three.co.uk) joined #forth 14:33:05 btw. fpc and f83 both implemented ;code and (;code) and the ;uses (;uses) 14:33:16 the non () words were immediate and compiled the () words 14:33:27 i only implemented the () words and stripped off the parens 14:33:35 What's fpc? 14:34:03 an old dos forth compiler by tom zimmer which was based on F-83 by laxen and perry 14:34:18 tom zimmer subsequently wrote win324th and then abandoned forth 14:34:23 he no longer develops forth. 14:34:36 if i had started developing a forth for windows i would also have abandoned forth 14:34:47 :-) 14:34:56 i think he got a job coding c++ or something 14:35:05 guess he figured paying the bills was more important than " 14:35:10 "real" coding 14:35:14 :P 14:36:25 Hmmm... I plan to pay the bills with real coding ;-) Programming website with revenue from advertising. 14:36:39 webprogramming! 14:36:41 I'll only need 2.6 million visitors per month! :-) 14:36:42 begone evil! 14:37:06 I'd rather work selling fries at mcdonalds than do webcoding. 14:37:26 heh 14:37:50 I440r: I think I'll have great use of your explanation up there when I ever get my thumbs out of my arse far enough to start trying to combine isforth with arm (: 14:38:00 i would rather whore myself out to web development or msvc++ drag n drop object obfuscated crap and thus be able to keep my car 14:38:10 heh 14:38:14 No, no webcoding! Just writing about assembly, Forth and other cool stuff. 14:38:20 who needs cars when you have a bike, eh? 14:38:29 i LIKE my rx-8 tyvm 14:38:29 impomatic: oooh! 14:38:38 a blog millionaire in the making. 14:38:40 I like my.. bike. 14:38:41 My content management system is written in GWBasic. 14:39:05 never heard of no gwbasic :( 14:39:05 mine is written in php using sqlite 14:39:12 schmx: if I reach 2.6m visitors per month I'll be happy. 14:39:35 impomatic: I have no idea if that is very little or very many. (: 14:39:45 I've pondered making a website. 14:39:48 GWBasic came with some early versions of DOS. Mine is from my DOS 3.3 disk. 14:39:50 In 14:39:51 eh 14:40:13 then I realised that any website I made would make chuck moore's site look like a rembrandt. 14:40:26 i heared somewhere that gwbasic was written in forth 14:40:34 not sure if thats true tho 14:40:35 :-) 14:40:57 impomatic: I used some basic on a z80 back in my young days. 14:41:02 never touched it since. 14:41:10 man that was a crazy language. 14:43:16 Can see any Forthlike structures looking at GWBasic in a debugger. 14:43:59 I used to like writing z80 assembly 14:44:15 me too 14:44:33 Then I liked writing 68k assembly. Then x86 made me cry ;) 14:45:16 6502 all the way. then x86. then 68k then 8051 and anything else you can think of :P 14:46:02 I did a little bit of 6809, then 8086. Now I'm learning Atmel AVR 14:46:49 i have a butterfly 14:46:57 I was storing the Forth dictionary in a tree instead of a linked list. But I've switched back to a linked list. 14:47:40 do linked lists but have a bucket of lists where a word will be chained to one chain in said bucket based on a hash of the words name 14:47:47 vocabularies ftw 14:47:52 I think maintaining a tree structure would require writing to the flash memory too often. 14:48:10 erm actually a vocab would require that too 14:49:02 unless you kept ur vocs in ram :/ 14:49:09 I bid on a Butterfly on eBay, but didn't get it. At the moment I've only got an Arduino 14:49:20 but that would mean reconstructing the entire voc on the fly every time u ran 14:49:33 how much do the butterflies usually go for? 14:49:33 I440r: I have a live and kickin' sym-1 here. It's 6502 based. 14:49:42 Have you tried AMForth? 14:49:53 i have TWO kim's here 14:49:58 my god! 14:50:00 you win :) 14:50:00 they are z80 tho 14:50:13 i also have a xerox 820-1 motherboard 14:50:26 are they in use for anything? 14:50:34 probably not 14:50:38 heh. 14:51:28 http://www.old-computers.com/museum/computer.asp?c=487 14:51:28 well time to get to bed then. 14:51:34 thats a -II tho 14:51:35 g'night. 14:51:39 i have a -1 motherboard 14:51:49 * schmx looks 14:52:01 waddaslowsite 14:52:07 heh 14:52:11 I think AMForth uses the system stack for Forth's return stack and a register for the data stack. Also I'm sure it doesn't cache TOS in a register. :-( 14:52:24 I need to go too. 14:52:26 specs kinda remind me of my zx80 14:52:31 CP/M nice 14:52:31 ya 14:52:34 Night 14:52:45 I get nostalgic for my old zx. 14:52:48 night impomatic 14:52:50 lol 14:52:59 i miss my c64 AND my amiga 14:53:02 then I fire up an emulator.. but its not the same. 14:53:10 ya its not 14:53:33 I still have a few old home computers. 14:53:45 every now and then I browse ebay.de for amigas. I think that if I actually buy one it'll end up in a box unused. 14:53:59 41 of them to be precise. 14:54:03 shit. 14:54:11 you live in a junkyard, eh ? :) 14:54:28 * schmx goes off. 14:54:30 tata :) 14:54:32 No, they don't take up much space. 14:54:37 * impomatic waves 14:54:39 --- quit: impomatic ("mov.i #1,1") 15:21:09 --- join: Deformati (n=joe@c-71-238-44-239.hsd1.mi.comcast.net) joined #forth 15:31:14 darn, i'd've liked to talk to impomatic 15:31:22 anyone else using amforth? 15:32:41 i've just started playing with it & noticed that while FORGET isn't implemented, redefining a word doesn't overwrite prior definitions, so WORDS shows all the previous entries 15:38:39 no redefining words in forth is perfectly legal 15:38:45 even in the same vocab 15:38:45 hi I440r 15:38:51 : blah do stuff here ; 15:38:57 : blah do other stuff ehre blah ; 15:39:12 the second definition of blah is not an error and it can even refer to the first definition of blah :) 15:39:15 and hi slava heh 15:39:29 I440r: sure, but it's unusual for WORDS to show multiple copies of a name... 15:39:34 I440r: oh, referring to the prior definition sounds interestinfg 15:40:01 not unusual. words jsut traverses the list and displays names 15:40:09 it doesnt remember the names of every word its already displayed 15:40:16 Oh, never mind. You're right. 15:40:21 I440r: in the avr case, there's a limited amount of storage, so i wonder about eventual storage exhaustion 15:40:32 so, right now i'm prototyping & using it interactively 15:40:49 mainly to learn forth 15:41:15 i imagine it'll still take a lot of redefinitions to fill up 8kb 15:42:16 k8 of space is not "alot" even in forth standards but in forth at least its not "too little" heh 15:42:31 in a 16 bit forth 64k is enormous 15:44:14 --- quit: mathrick (Read error: 60 (Operation timed out)) 15:45:01 the core amforth system takes about 7k leaving 9k for user application 15:53:10 tathi: I'm working on a new technique to convert stack code to register code that I believe is at least a minor improvement over what the most optimizing forths do :) 15:55:32 cool 15:55:42 Have you blogged about it? 15:55:51 I will once its done 15:55:55 I gotta run, a cappella group practice 15:55:58 I'll catch you later 15:56:04 cappella? 15:56:06 later 15:56:19 aha 16:01:32 --- quit: Deformative (Connection reset by peer) 16:22:52 I440r: "a capella" :) 16:35:19 --- join: jauaor (n=araujo@gentoo/developer/araujo) joined #forth 16:41:06 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 16:52:46 --- join: crc (n=charlesc@c-68-80-139-0.hsd1.pa.comcast.net) joined #forth 17:37:53 slava: OK, so let's hear about that new stack to register technique. :) 17:39:21 once it works :) 17:39:38 hehe 17:40:16 Oh, so you just came in to pique my curiosity? :) 17:41:44 heh 17:42:58 See if I can figure it out before you tell me? :P 17:55:14 --- join: gogonkt (n=info@59.38.200.175) joined #forth 18:06:05 --- join: nighty__ (n=nighty@210.188.173.245) joined #forth 18:06:28 * jauaor got it working! 18:06:32 locals? 18:06:37 ? 18:06:57 you got locals working? or something else? 18:07:06 oh hah 18:07:07 yeah 18:07:11 that was the last thing I recall you saying you were working on. :) 18:07:15 one feature in my tiny language 18:07:16 :P 18:07:49 tathi: ooh, not yet, hah ... it has been a bit messy for it, i got working other feature 18:08:02 proper stack scope combination 18:08:08 ah 18:08:36 you can combine several stacks, and their scopes are combined too 18:08:40 properly combined 18:08:40 :D 18:09:19 * jauaor also thinks that after getting some proper local variables working he could post this small lang somewhere now 18:12:42 Though I am not really sure if i want local variables, considering the kind of i am languae i am designing here 18:13:14 i feel like i want more some kind of .. constants declaration 18:14:01 * jauaor goes and picks up his sister at univ, brb 19:46:35 * jauaor back 20:18:27 --- quit: crc (Client Quit) 20:26:15 jauaor: its easy to convert local variables to stack code (and vice versa) so there's no reason not to have them, unless you have code size constraints 20:26:55 --- join: tes1236 (i=cea9e224@gateway/web/freenode/x-12d3bde2d3bca6b9) joined #forth 20:27:00 --- part: tes1236 left #forth 21:11:38 --- join: sunwukong (n=vukung@ortros.den.rcast.u-tokyo.ac.jp) joined #forth 22:28:02 --- join: gnomon_ (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 22:31:13 --- quit: gnomon (Read error: 104 (Connection reset by peer)) 22:59:54 --- nick: gnomon_ -> gnomon 23:25:55 --- join: gnomon_ (n=gnomon@CPE001d60dffa5c-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 23:40:50 --- quit: gnomon (Read error: 110 (Connection timed out)) 23:59:59 --- log: ended forth/09.07.20