00:00:00 --- log: started forth/02.03.08 03:10:53 --- join: rob_ert (~robert@h173n2fls33o898.telia.com) joined #forth 03:11:02 03:11:43 Hey :-) 03:15:09 how about the tower? 03:15:34 * rob_ert hides :P 03:15:44 I've been coding and reading too much 03:16:05 just like me, doont worry 03:17:50 :) 03:17:56 I've written my own forth compiler now. 03:18:03 With a few extentions 03:18:23 >-| 03:18:28 kidding? 03:18:28 :-D 03:18:33 Nope.. 03:19:00 show me! 03:19:10 uhm.. it sucks, but it works ;) 03:19:18 I'll start my other computer and upload it. 03:19:20 show me! show me 03:19:30 Calm down :P 03:19:49 It's not 100% done yet, you can't use the 3rd stack ;) 03:19:51 too much words too few uploads :) 03:20:04 wha? 3rd stack? 03:20:10 Bah, the computer I have it on isn't even up yet 03:20:14 Yah :P 03:20:41 Parameter stack, so parameters are kept until a function (word) ends 03:21:15 ??? 03:21:30 but what r the other stacks than? 03:22:30 the normal data and return stacks 03:22:54 the thing is, when you modify the data stack, the parameter stack is unchanged 03:26:09 sounds weired, but i ll c 03:26:57 bozos.sf.net/files/nourth.tar.gz 03:27:06 it _is_ weird 03:27:10 :) 03:27:20 But I don't think it's less useless than forth. 03:42:45 hm, so u r an active sf.net user :) 03:45:03 --- join: Stepan (~stepan@Charybdis.suse.de) joined #forth 03:45:08 moin 03:48:36 hi 03:48:40 Stepan 03:49:15 Hey onetom :) 03:49:23 how's life? going back and forth? 03:49:35 rob_ert: u have coded a really strange thing ;) 03:50:25 Stepan: eh, dont have time to make the research on preemtive multitasking forth :( 03:50:56 Stepan: dont u know by chance where can i get ddjcd? 03:52:02 there was an article about a preemptive eforth variant 03:52:24 in the 1996.03 issue of ddj magazine 03:53:18 but i only have the srces and can find the related article just nowhere 03:53:29 ddjcd? 03:53:38 what's ddj? 03:53:40 dr dobb's journal 03:53:47 i can ask here whether we have that.. 03:53:57 hm.. never heard of it.. is it forth specific? 03:53:59 wow, sounds great 03:54:03 nooo 03:54:13 its a general programming mag 03:54:46 u can find its archives in any simtel arch under hte ddjmag directory 03:54:55 but only up to 1994 03:56:24 what's the name of the mag? "Dr. Dobb's Magazine" or just "Dr Dobb's"? 03:57:02 Dr. Dobb's Journal i guess 03:58:23 onetom: Yeah, it's very strange ;-) 04:05:53 onetom: i sent out a mail to our internal list.. maybe someone will answer.. but i cant promise 04:12:30 Stepan: oh, thx a lot in advance 05:03:37 --- join: rob__ert (~robert@h173n2fls33o898.telia.com) joined #forth 05:04:34 --- quit: rob_ert (Killed (NickServ (Ghost: rob__ert!~robert@h173n2fls33o898.telia.com))) 05:04:39 --- nick: rob__ert -> rob_ert 05:11:56 --- join: rob__ert (~robert@h173n2fls33o898.telia.com) joined #forth 05:11:59 --- quit: rob__ert (Remote closed the connection) 05:36:53 oneton: i found one guy with a lot of dobbs magazines at home.. he'll check if he has it.. 05:52:09 ooh, u r wonderful, maaan :> 05:52:28 how large is that company u r working in? 05:52:35 s/in/for/ 05:53:58 meanwhile ive cheated the primitive preprocessor of gpasm 05:54:38 and i replaced it w m4. do u know m4? 05:54:40 define(`curFreg', 0)dnl 05:54:40 define(`Forg',`define(`curFreg',$1)')dnl 05:54:40 define(`Falloc',`define(`curFreg',eval(curFreg+$1))')dnl 05:54:40 define(`Fname',`define(`$1',curFreg)')dnl 05:54:40 define(`Freg',`Fname(`$1')Falloc($2)')dnl 05:55:06 gpasm, that's the free variant of microchip's picasm, right? 05:55:28 microchip's mpasm, yes 05:55:33 ah, sorry 05:55:55 rob_ert: so do u know m4? 05:56:24 Nope :9 05:56:52 and dont u even know what is it @ all? 06:00:11 No. 06:00:48 if not yet, than i have2 say: u definitely should ;) 06:01:13 What is it?. 06:01:15 its a language independent macro language 06:01:17 s/.// 06:01:54 it can be used as preprocessor for any language then? 06:02:00 u can use it to "extend" any lang w macroing capability 06:02:08 exactly 06:02:45 so u dont have to bother yrself implementin marco handling 4 yr brand new lang :) 06:03:22 :) 06:04:24 eg. ive written a 4th2asm native code compiler 06:04:42 re 06:04:44 entirely in bash,awk&m4 06:07:07 hmm, no, i was wrong i used m4 for my assembler. it handles the labels and the instruction pointer, afaik 06:08:13 now, i go 2 have a shower 06:10:21 --- join: Speuler (~l@a161161.upc-a.chello.nl) joined #forth 06:10:55 hoi 06:11:00 g'day 06:11:05 hi rob 06:11:07 _ert 06:11:12 :) 06:11:26 ]O= 06:11:34 (haegar) 06:12:06 isn't he cute ? 06:12:52 ]:O= ( this one better ? ) 06:13:32 (_:(|)~~ 06:13:42 judy ? 06:13:58 or bart's dad ? 06:14:20 Homer, yeah 06:23:11 i just finished reading "the book of going forth" this morning 06:24:21 it says: 06:24:35 "going forth is easy" 06:24:50 "going back requires (cont. on next wall) ... 06:25:10 ""An effort of will, because it is much harder. Thank you" 06:25:48 :-) 06:25:49 (page 358) 06:26:48 that"s just before two armies fight against each other, by building wood horses 08:02:08 --- quit: Stepan ("Do you think it is air you are breathing? Hmm?") 08:37:59 --- join: I440r (~mark4@1Cust5.tnt1.bloomington.in.da.uu.net) joined #forth 08:37:59 --- mode: ChanServ set +o I440r 08:38:10 watch this 08:38:20 argh segfaulted on this server grr 08:38:40 this sux! 08:38:46 it connects fine to ircu :P 08:39:36 argh 08:58:24 argh? is it like argv or argc? ;) 08:58:59 no its liek DOH! 09:07:36 come on, i know, just joking (@least tryin 2 joke :) 09:09:59 from :) 09:10:14 erm where did the "from" come from there heh 09:10:15 ugh 09:10:23 i KNOW i didnt type it :P) 09:14:24 --- quit: rob_ert (Read error: 110 (Connection timed out)) 09:14:35 --- join: rob_ert (~robert@h173n2fls33o898.telia.com) joined #forth 10:17:07 --- join: futhin (~thin@h24-64-175-123.cg.shawcable.net) joined #forth 10:17:19 boo! 10:17:28 * futhin runs and hides! 10:17:32 peek a boo! 10:19:14 * futhin conjures some forth code, and it dances across the meadow! 10:19:53 --- quit: Speuler (Remote closed the connection) 10:20:43 futhin is acting gay today :P 10:20:49 what u been smokin ? 10:20:50 heh 10:23:35 gay gay gay! 10:24:00 it's a gay day today, be gay, jolly, merry 10:24:03 blah blah blah 10:24:14 where's your irc bot dammit?! :P 10:25:12 trying to get it to connect here 10:25:20 i'm shifting blame onto your bot for the gayness of this channel! 10:25:42 having to rewrite the socket read code because this irc server is fucked in the head :P 10:26:21 i can telnet into this server because i am l33t 10:26:44 infact! i'm telneted right now! /ctcp futhin version ! 10:27:30 :) 10:27:32 yea 10:27:35 mirc :P 10:27:39 <-- leet!! 10:27:42 heh 10:28:00 no, i sent you an mirc response! it's fake! try again ;) 10:28:07 heheh 10:29:16 bs :P 10:29:19 im busy 10:29:23 want my bot connecting here 10:29:34 was connecting FINE on my ircu 10:29:45 but it was segfaulting here half way thru the login 10:30:22 --- quit: onetom (Read error: 110 (Connection timed out)) 10:30:25 bah, why does it segfault? 10:30:43 it should _never_ segfault! it should just give you a real error message :P 10:30:58 seems like you didn't put much error-checking/prevention code in it? 10:33:02 thats not the forth way dood :P 10:33:57 heh 10:34:01 lies! 10:34:10 abort" hey stupid idiot, this is gonna make me segfault" 10:34:20 ;) 10:34:31 code with an attitude! 10:35:30 hrm, brb 10:35:33 --- quit: futhin ("brb") 10:36:15 --- join: futhin (~thin@h24-64-175-123.cg.shawcable.net) joined #forth 10:37:09 ok wait 10:38:00 ok the bot connects 10:38:07 brb 10:38:14 ill try get it to join here 10:39:06 * futhin just typed /whois forthbot nope, no forthbot! damn! :P 10:39:54 he's gone 10:40:01 * futhin cries for Forth 10:40:13 he's back! 10:40:18 * futhin cheers! 10:40:25 time to start the forth orgy! 10:40:45 doh hehe hang on 10:40:53 he's gone again! 10:40:55 oh the excitement! 10:42:15 nope 10:42:20 they have fucked with the message format 10:42:23 its totally different 10:42:26 eh? 10:42:29 i cant even fucking tokenize the messages 10:42:36 irc messages ALEAYS follow the same format 10:42:43 mirc works fine on this server, why shouldn't your bot? 10:43:12 :source type target message body 10:43:29 if i try seperate the message out into its component parts i fucking segfault here 10:43:42 weird 10:44:08 well, i guess you have to find out what the message format is now? 10:44:28 there's a perl bot around here somewhere 10:44:33 maybe the guy knows the message format 10:44:57 um, speuler had a bot actually.. 10:46:17 --- quit: I440r ("Reality Strikes Again") 10:46:42 --- join: onetom (tom@adsl52070.vnet.hu) joined #forth 10:47:03 howdy onetom 10:47:20 me sleepy 10:48:20 but last night - that is this veryearlymorning - ive checked that preemptive eForth 10:49:03 an it look absolutely usable 4 me 10:49:34 heheh :) 10:49:39 though the corresponding article could help a lot more 10:49:57 yeah 10:50:05 but dont b so happy, i was right :P 10:50:07 you have to buy the article from them or somehthing 10:50:42 that eforth has a preemptive 4th kernel 10:50:52 what about the example THREAD code ? 10:51:02 that had nothing to do with the kernel i don't think ?? 10:51:19 thats just prepares the proper data struct 10:51:27 oh 10:51:32 what is interpreted by this kernel 10:51:50 but just take a look @ the kernel.asm 10:51:53 are you sure? "forth can do anything" :P 10:52:03 absolutely sure 10:52:19 you should be able to do multitasking without the kernel 10:52:20 ive written some 4ths already ;) 10:52:21 i'd think 10:52:55 everybody talks about how forth is a vm :P 10:52:57 the kernel is the code what runs through the threaded code, right? 10:53:33 eh? 10:53:42 you mean : THREAD ; ? 10:54:10 of course you can use the words the kernels provide 10:54:12 nooo :)) sure i dont mean it 10:54:14 to make a multitasking.. 10:55:04 the 4th kernel is the - usually - virtual processor that interprets threaded code 10:55:34 threaded code is the "binary" form of forth programs 10:55:46 a thread is a list of pointers 10:56:03 a list of pointers 2 words 10:56:25 and such a list makes up a word 10:56:34 all i was saying is that you don't need to be able to modify the kernel (or need its source code) if you wanted to make it multitasking. you can use all the words the kernel provides, and create a multitasking program on top of the kernel, and then run programs inside the multitasking program.. 10:56:38 this list defines the "meaning of a word" 10:57:16 i think.. 10:57:17 i absolutely understand what u r saying 10:57:46 and im just trying to teach u why its not absolutely right 10:57:48 what u state 10:58:19 so did u understand my pervious sentences? 10:58:53 if u let me tell u some more, u will understand what am i talkin about 10:59:13 go ahead, pls continue 10:59:21 k 10:59:47 & dont worry, im trin 2 b very concise 11:00:37 so, the 4th processor (=4th kernel=inner-interpreter) interprets these threads 11:00:52 for this task it needs some registers 11:01:09 and some memory 11:01:45 it has an instruction pointer (IP) 11:02:16 this points to an element of the currently executed chain 11:02:35 --- join: I440r (~mark4@1Cust5.tnt1.bloomington.in.da.uu.net) joined #forth 11:02:52 grr fucking thing :( 11:02:54 & it has two stack pointers 11:03:00 I440r: hi 11:03:24 1 for parameter stack & for return 11:03:43 (PSP, RSP) 11:03:59 i just call them sp and rp :) 11:04:01 and probably it has a working register (W) 11:04:26 thats all what a - usually - vitrual 4th processor have 11:04:28 ugh - the "w" register is a realy realy shitty idea 11:04:38 even if you have a "working" register you should CALL IT WHAT IT IS 11:04:43 not "w" 11:04:56 that just obfuscates the fuck out of the sources 11:05:22 I440r: ok, lets call them sp, rp instead (thats more conventional) 11:05:26 any time i try looking at someone elses sources in do a global search and replace on W and change it to what ever the fuck the actuall register is 11:05:56 i hate it when people obfuscate their code by trying to be "cool" 11:06:02 I440r: hey, man! stop cluttering up my "lesson" 11:06:06 heh 11:06:07 sorry :) 11:06:13 * I440r shuts up heh 11:06:21 its not a question of coolness 11:06:51 the idea for the W register is flawed imho 11:06:54 im just trying to give names 2 the things im gonna talk about 11:07:12 which register is usually used as the Working register? 11:07:18 just think of a geometry class 11:07:20 in an x86 its eax 11:07:36 i thought ax and bx were for the data stack? 11:07:38 when u draw a triangle u can name its corners 11:07:39 in 68k it can be ANY register at all 11:07:41 as A B C 11:07:53 but also P1 P2 P3 11:07:54 usually one of the D registers tho d0 thru d7 11:08:03 i choose to name i W 11:08:06 but a0 thru a6 would work nicely too 11:08:10 cant use a7 - thats sp :P 11:08:22 and plz, hold on 11:08:33 u dont know what im talkin bout now 11:08:50 "there is no spoon" in this example 11:09:08 * futhin runs and hides! scared of matrix quotes! 11:09:14 im defining a - usually - virtual forth processor 11:09:51 futhin: i havent said it 2 u :) 11:10:20 :) 11:10:25 I440r: so plz dont come up w various specific processors 11:10:33 :) 11:10:41 he asked - i answered hehe sorry :) 11:10:53 now, let me show what does the inner-interpreter do 11:10:57 shit, ive a phone call 11:11:18 k, me back 11:11:26 :) 11:12:20 instruction pointer (pointer to currently executed chain), stack pointer, return point, working register 11:13:15 ip @ @ @ 11:13:39 this retrieves the head of a thread (a word) 11:14:15 oh, i forgot to give examples of the memory areas this processor works on 11:14:41 certainly we have a dictionary and two stack areas too 11:15:02 variable dict dict-size allot 11:15:23 variable ps ps-size allot 11:15:30 variable rs rs-size allot 11:15:49 ps ps-size + sp0 ! 11:15:56 rs rs-size + rp0 ! 11:16:27 variable ip 11:16:47 variable w ( probably we need it, but we will c) 11:17:11 variable rp variable sp 11:17:33 entry-point ip ! 11:18:11 this is the init is roughly... 11:18:27 yeah 11:18:44 now let me show a dictionary entry (a definition of a word) 11:19:15 word-type , word1 , word2 , next , 11:20:02 (it was a long time ago when ive coded a 4th kernel... and i havent do it in 4th b4 :) 11:20:28 so a dict entry has a head 11:20:48 it's good practice! forth should only be coded in forth! none of that pansy-assed assembly! :D 11:21:39 thats it. u got the point 11:22:17 eh? you're finished? 11:22:24 so, this head describes who should the body part interpreted 11:22:29 ok, you aren't 11:22:58 no, im not finished until we put 2gether a very minimal 4th engine 11:23:26 but i hope it takes not more than 15mins 11:24:16 so, the header could tell that the definition (the body) of the word is 11:24:57 a thread of pointers oooor it is a list of primitive words 11:25:44 no docol, dovar, do-this, do-that... 11:26:05 (i think) its enough to have this 2 types 11:26:57 now lets see the main cycle of the inner-interpreter 11:27:01 : int 11:27:50 this will interpret a threaded code 11:28:15 so we assume ip points somewhere into a thread 11:28:30 ip @ ( look up where does it point 2 ) 11:28:48 @ ( get the address from the thread ) 11:29:12 @ ( retrive the header of the word pointed by it ) 11:29:34 dup head-threaded = if 11:30:49 ip cell + rp @ ! ( save return address onto the return stack ) 11:31:29 -1 cells rp +! ( update return stack pointer ) 11:31:37 rob_ert: r u also here? 11:32:06 yeah 11:32:30 is everything clear up to this point? 11:32:48 futhin: am i understandable? 11:33:01 sure, i've follwed everything up to "head-threaded" 11:33:17 dup ?is-this-head-threaded = if 11:33:23 is that what it's supposed to be? 11:34:27 aha, i think u understand it 11:36:05 (sec. some clean up... im coping the code snippets into a file to help meself) 11:36:21 heh :) 11:36:39 feel free to edit it up and paste the whole thing back into the channel (for the logs) 11:37:25 now we can step onto another thread located one level deeper 11:37:37 ok, i will do 11:38:18 ( -- head-pointer-of-the-new-word ) 11:38:30 ip ! 11:38:33 else 11:39:18 ( else we have 2 deal with a primitive word list ) 11:39:32 execute 11:39:37 then 11:40:10 oops... 11:40:16 cell + execute 11:40:38 because we were standing on the header yet 11:40:58 so we have to step 1 cell forward 11:41:30 now, lets define the word NEXT 11:42:11 this will gonna use up the pointer saved onto the return stack 11:42:17 : next 11:42:30 cell rp +! 11:42:37 rp @ 11:42:42 ip ! 11:42:43 ; 11:45:38 (arranging the code... preparing to paste it back) 11:46:42 --- join: Forth (~Forth@1Cust5.tnt1.bloomington.in.da.uu.net) joined #forth 11:46:53 :) 11:47:08 Hej Forth. 11:47:18 das me bot!!! 11:48:18 she doesnt understand privmsg's yet or ctcp's 11:48:21 thats next 11:48:27 no! first the coding! 11:48:34 : blah ." blah ; 11:48:37 : blah ." blah ; 11:48:39 heh 11:48:40 : blah ." blah" ; 11:48:42 blah 11:48:44 wtF?! :P 11:48:53 those would go to it via privmsgs 11:49:02 even messages to a channel are privmsgs 11:49:22 :nick!user@host PRIVMSG #channel :message body goes here 11:49:57 give us a realy example! 11:50:08 a reply to what 11:50:19 ctcps are privmsgs too 11:50:35 but the first character of a ctcp message body is always a \001 11:54:06 http://213.163.52.70/~tom/kernel.fs 11:54:22 its getting too long to paste back 11:54:43 but it will really function finally! 11:54:56 tell me if the link doesnt work 11:58:29 ah, i forgot about creating a dict pointer 11:58:43 at this point we dont definetly need one because 11:59:08 we dont have any compiler, but for manualy compilation 11:59:32 i create 1 to help building a sample dict 12:05:28 hmm, its a bit confusing 2 write a 4th in 4th :-/ 12:10:38 ahhhhaaa! 12:11:20 hmm, nooo bad idea. thinking... 12:12:23 :( i got confused 12:12:30 question for you 12:12:32 very easilly done heh 12:12:45 you do: 12:12:45 dup head-threaded = if 12:12:45 ip cell + rp @ ! ( save return address onto the return stack ) 12:12:45 -1 cells rp +! ( update return stack pointer ) 12:12:57 yes? 12:13:08 and then you do: 12:13:09 ( -- head-pointer-of-the-new-word ) 12:13:09 ip ! 12:13:09 else 12:13:09 ( else we have 2 deal with a primitive word list ) 12:13:09 execute 12:13:13 and some more code 12:13:16 didn't paste it all.. 12:13:27 how are the first bit and the second bit related? 12:13:37 dup head-threaded = if 12:13:45 and then: 12:13:46 ip ! 12:13:47 else 12:13:48 ??? 12:13:55 the r colocated 12:14:15 but check the url i gave u 12:14:25 i did.. 12:14:26 : THREAD-INTERPRETER ( -- ) 12:14:26 ( this will interpret a threaded code ) 12:14:26 ( so we assume ip points somewhere into a thread ) 12:14:26 ip @ ( look up where does it point 2 ) 12:14:26 @ ( get the address from the thread ) 12:14:26 @ ( retrive the header of the word pointed by it ) 12:14:28 dup threaded-word = if 12:14:30 ip cell + rp @ ! ( save return address onto the return stack ) 12:14:32 -1 cells rp +! ( update return stack pointer ) 12:14:34 ip ! 12:14:36 else 12:14:38 1 cell+ @ execute 12:14:40 then 12:14:42 ; 12:14:51 epic 12:14:52 nevermind 12:14:58 why? 12:15:03 whats wrong w it? 12:15:05 i versioned you 12:15:10 "epic, nevermind" 12:15:12 yeah i saw itr 12:15:33 thats why i asked: why? whats wrong w it? 12:15:34 the paste wasn't all at once 12:15:37 it slowed down 12:15:59 no, i pasted it in two .... 12:16:08 two sessions 12:16:33 to prevent meself from being kick out 12:16:41 because of flooding 12:19:21 ok, listen 12:19:53 its not clear what does a primitive word look like 12:20:07 you wouldn't get kicked out 12:20:09 not on this channel 12:20:14 if we have a native 4th processor 12:20:31 futhin: really? i didnt know it 12:20:46 there is no paste limit? 12:20:54 i'm pretty sure there's no paste limit 12:21:11 ("welcome to speed limit!" - u know the joke dont u.) 12:21:13 --- quit: futhin (Excess Flood) 12:21:19 --- join: futhin (thin@h24-64-175-123.cg.shawcable.net) joined #forth 12:21:21 lolllllllll 12:21:37 there's a paste limit.. but it's like 20 words 12:21:39 er. 20 lines 12:21:43 ah 12:22:04 ok, now we know it too 12:22:14 so 12:23:08 ive decided to create a "table" of primitives 12:24:29 for this i define the definition of a primitive word like this: 12:25:01 primitive-word ,, 4th-processor-opcode ,, 12:25:49 this way we have assigned dictionary addresses to the various 4th opcodes 12:26:46 and from now on, we can use the native instruction-set of out forth processor 12:26:55 s/out/our/ 12:27:18 in the body of threaded words 12:27:55 and now i feel, my example will reach the finish soon 12:28:31 as u could see under the specified url 12:29:00 ive defined some aux words to help meself in fill the dict up w data 12:29:50 these words need some variables 12:29:56 variable dp 12:29:56 dict dp ! 12:30:01 : ,, ( n -- ) 12:30:01 dp @ ! ( store data where dict pointer points 2 ) 12:30:01 cell dp +! ( advance dict pointer ) 12:30:01 ; 12:30:07 ( we also need help for naming specific dictionary locations ) 12:30:07 : :: ( "name" -- ) 12:30:07 create dp @ , 12:30:08 does> 12:30:10 @ 12:30:12 ; 12:30:20 AAAAAAAANNNND 12:30:50 now we r ready to define a basic instructionset for our brand new 4th processor 12:30:56 completly written in 4th 12:31:24 :: op1 primitive-word ,, ' (op1) ,, 12:31:29 :: op2 primitive-word ,, ' (op2) ,, 12:32:39 they will do nothing else but help us to trace the route of execution 12:32:40 : (op1) cr ." op1" ; 12:32:40 : (op2) cr ." op2" ; 12:33:57 ah, and we also need a word that "marks" - actually handles - the end of threads 12:34:31 :: ;; primitive-word ,, ' NEXT ,, 12:39:06 * onetom troubleshooting the net at home 12:45:04 hey, sybody, plz say sg! 12:45:44 i dont know whether our net connection is functioning or not 12:46:44 * futhin is afk for a bit, bbl 12:47:06 ok, so it worx... 12:49:14 just the nameservers deny answering.... 12:49:42 but every hungarian nameserver :( 1 by 1 12:50:05 i can ping them, but they dont answer to nslookup/host requests 13:02:49 we've gotten so side tracked 13:03:38 i weep for the world 13:03:41 waaa waa waa 13:03:43 <-- shutsup 13:03:47 ignore me 13:20:39 ok, i took a break 13:20:45 but now im back 13:21:02 check out the code ive put together 13:21:17 and lets create a main-loop 4 it finally 13:22:16 i feel its complete now, and we can start reconstructing it 13:22:26 to handle multitasking 13:26:03 ive just noticed ive deviated from the standard naming conventions of the 4th kernel 13:26:27 (memories started coming back) 13:27:03 the standard name of the inner-interpreter is NEXT 13:27:53 but then whats the name of the word that finishes a thread?... 13:28:27 semis? ... 13:28:51 cant remember what is the std name 4 it 13:29:01 anybody out there? 13:40:43 next isnt realy the inner interpreter 13:41:01 next is just the instruction fetch in the virtual machine example 13:41:11 i would call quit the inner interpreter 13:43:17 u sure? 13:43:57 ah, really... 13:44:08 it is called quit usually... 13:44:50 tho, i never understood why... 13:45:03 i always implemented forth kernels just for 13:45:20 showing people how easy is it 13:45:57 and always used nonstandard variable,word and function names 13:47:31 i think, i will name the main cycle MAIN instead of QUIT 13:47:49 until i understand why is it called quit 13:49:59 i never understood why they called it quit either heh 13:51:03 --- join: Etaoin (~david@ljk2-11.sat.net) joined #forth 13:51:19 hi eta 13:51:25 hello 13:51:33 i got my isforth bot to log in :) 13:51:37 cant do anything yet 13:51:38 heh 13:51:41 but there it is :P 13:51:47 does anyone have anything that's neat and short that I can look at? 13:52:14 via irc? 13:52:34 yes. its in here now - called Forth heh 13:52:46 oh 13:52:49 forth is isforth with an irc bot extention :) 13:52:51 Forth: hello 13:53:21 ill add the ability to write forth in here and have it interpret it in here 13:55:29 couldn't that be dangerous? 13:55:51 yes :) 13:56:08 so it'll be restricted, right? 13:56:09 it will have to be a trusted user - added to the bot. 13:56:11 yes 13:56:15 very restricted heh 13:56:15 don't worry, we're all experienced coders ;) 13:56:23 sure.... sure.... 13:57:09 Etaoin: http://213.163.52.70/~tom/kernel.fs 13:57:30 Etaoin: hi. thats the seed of a forth written in forth 13:57:46 uh? 13:58:32 native code comiler? 13:58:43 n 13:58:44 no 13:59:10 its just what i say: a 4th kernel written in 4th 13:59:57 it can (will b able 2) execute threaded code 14:00:08 ah 14:00:14 nothing for the 1st time 14:00:51 but its just enough 2 evolve it into a multitasking capable kernel 14:01:09 and so it also in pure 4th!!! 14:01:26 so it will b absolutely portably 14:01:28 I've never seen these :: ,, and ;; 14:02:16 oh, i named them this way to avoid redefinition 14:02:33 its an unimportant part of the kernel 14:02:40 its just a test 14:03:15 and those r helper words for putting an example dict content together 14:04:38 they can actually b considerd belonging 2 the "metacompilation level" 14:05:17 and its now yet complete certainly but it will b in some secs 14:12:38 ive cleaned the code up a bit 14:13:05 some more mins & it will b ready 2 test it 14:15:00 okay. 14:51:55 --- join: aum (~david@l76-154.world-net.co.nz) joined #forth 14:52:05 --- part: aum left #forth 14:53:20 hi aum! 14:53:30 forth is a bot i wrote for isforth :) 14:54:38 he's gone 14:57:24 hi aum 14:58:52 oopts so he is 15:31:57 nah, back again 15:32:36 everybody just phoned/icqed/irced 2 me 15:33:10 --- quit: Etaoin ("raise SystemExit") 15:33:16 kernel.fs now compiles fine, tho doesnt work yet 15:33:24 but its not far from it 15:33:42 ive cleaned the code up more, added some comments 16:26:41 --- join: Etaoin (~david@ljk2-11.sat.net) joined #forth 16:27:06 Helloo 16:27:30 hi 16:34:50 hello 16:35:31 its really not just a few sec to write a 4th kernel :) 16:35:39 okay 16:35:42 good deal 16:35:51 tho, im almost done now 16:36:10 slightly more than a few seconds, I guess 16:36:23 im only working on how to detect the end of the program 16:36:42 nooo, not that much 16:37:00 im just doing it about for an hour 16:38:04 & its quite easy writing it in 4th 16:40:03 basicly it also worx yet, anyway 16:40:25 great 16:42:00 if u download NOW 16:42:12 and say MAIN 16:42:45 it does sg and doesnt even drop u an error msg 16:43:07 & if u say some times more NEXT 16:43:30 it completes its job just fine 16:44:23 http://213.163.52.70/~tom/kernel.fs 16:45:16 rob_ert: its also could b useful for u to understand the internals of 4th 16:45:32 cool, I'll check it out 16:46:04 lol, you write like this in your programs too 16:46:53 looks like greece to me :) 16:47:00 erm... well i actually dont write like this in comments 16:47:18 I suppose those aren't comments, then 16:47:19 but this project has started on irc 16:47:59 and ive simply copied the code from irc 16:48:53 actually i consider this hack as a conversation 16:48:55 that doesn't make any sense to me 16:49:03 (or rather a monolog :) 16:49:34 writen in a platonian like style... 16:49:58 what makes no sense 2 u? 16:50:18 "this project has started on irc and ive simply copied the code from irc" 16:51:16 ah 16:51:52 ive started to "speak" in 4th here when 16:52:28 ive tried to explain to futhin that who does a 4th processor works 16:53:04 so 1st i wrote the main components of the kernel 16:53:26 on irc 16:53:38 embedded to our conversation 16:53:39 oh 16:55:04 than i started writing kernel.fs by coping the code snippets from the irc log 16:55:28 I see 16:56:21 rp @ rp0 > 16:56:33 this is the correct end condition 16:57:09 now, it worx, rockz and the like ;) 16:57:47 it's amazing that you can add object-orientedness to forth with 11 lines 16:57:49 i cant dare 2 state that its bugfree, but 16:57:56 12 lines 16:58:00 the sample code just runs fine in it 16:58:17 mini-oof? 16:58:20 yeah 16:58:33 :) yes, thats a lovely piece of code 16:58:48 and it does the job quite well 16:59:05 ive used it a bit once 16:59:29 when i was writing a 4th 2 asm compiler 17:00:00 onetom x86 asm ? 17:00:43 noooo :) 17:00:51 pic asm! 17:01:20 doh :) 17:01:56 u know, i simply overwrote the colon and the semicolon 17:02:17 and thats all! (roughly :) 17:02:48 :) 17:03:21 ive also ripped the text-interpreter out of gforth 17:03:49 and modified it to generate the proper code 17:04:05 for pushing the numbers onto the stack 17:04:40 and print calls on unknown words 17:05:39 this way u could have attached an asm library of basic 4th words to the 17:06:09 beginning of the code and they r automaticly called 17:08:32 --------------- 17:08:44 night good . 17:08:56 all: what object model do u prefer? 17:09:03 rob_ert: gnight 17:09:24 rob_ert: now theres a final working version of kernel.fs 17:09:36 OK, I'll check it tommorrow. 17:09:45 rob_ert: u can test it w "test run" 17:09:55 --- quit: rob_ert ("Peace. That's an order.") 17:16:21 --- quit: futhin ("bye") 17:18:04 can I do something like :noname [ :noname 1 + . ; ] ; ? 17:18:37 pardon? :) 17:18:39 heh 17:19:11 a function returning a function 17:20:12 : x 1 + . ; 17:20:17 nested functions hehe 17:20:24 a function within a function? 17:20:26 : y ['] x ; 17:20:44 what if I want them unnamed? 17:21:03 :noname x 1 + ; 17:21:13 constant y 17:21:48 coz noname-defining a word 17:22:02 results an execution-token on the stack 17:22:15 so there'd be a word-clash in that nestled example? 17:23:06 that example is absolutely wrong 17:23:31 but why? 17:23:40 u cannot start a word-definition b4 finishing a previous 1 17:23:53 uh huh. 17:24:03 how silly 17:24:35 why? 17:24:47 because it would make it easier if I could 17:25:17 hmmm... 17:25:32 u r not forth minded enough :P 17:26:18 you mean twisted 17:26:24 er untwisted rather 17:26:26 yeah :))) 17:26:31 but look: 17:26:41 I'm not untwisted enough 17:26:50 func1 (param, param, param) { 17:27:02 f1(); 17:27:06 f2(); 17:27:41 nested_func() { asd(); qwe(); } 17:27:45 f3(); 17:27:46 } 17:27:57 what does it do in c? 17:28:09 why compare to c? 17:28:16 why not? 17:28:41 im just trying to compare it 2 someting well known 17:28:54 2 ease the discussion 17:29:12 brb 17:29:44 well, I though :noname just created a word and returned the execution token. 17:32:13 you cant nest functions in c heh 17:32:20 no 17:32:43 I have lisp on the brain 17:32:44 functions dont nest in c 17:32:49 heh 17:33:08 (map (lambda (x) (print x)) myvector) 17:33:16 i wish if/switch etc statements didnt nest either :P 17:34:19 well im outa here 17:34:27 --- quit: Forth (Remote closed the connection) 17:34:31 :) 17:34:45 gota go write some more bot sht :) 17:34:55 okay 17:35:08 --- quit: I440r ("abort" moo!"") 17:44:13 back 17:45:11 (noname(x) print x) 17:45:31 (map (noname) yourvector) 17:45:56 got it to work 17:46:14 r these equvivalent? 17:46:22 wow, how? 17:46:26 then I pollute the namespace with "noname" 17:46:28 & what? :) 17:47:11 you have gforth? 17:47:31 amongst the others, yup :) 17:47:41 http://braznet.com/david/files/oovect.fs 17:47:45 but actively im using gforth 17:47:47 it uses mini-oof 17:47:57 and mastering noe 17:48:03 none of them :) 17:48:11 line 48 is where I had the problem 17:48:20 50 actually 17:52:37 ok, ive read it through 17:53:08 and whats your problem? 17:53:09 any glaring nono's? 17:54:28 nono? 17:54:45 a noun coming from "no no" 17:55:07 (something that I shouldn't be doing) 17:55:16 k, i think ive understand what u said 17:55:41 but i dont understand why r u saying that 17:55:49 it's not a real word, I think 17:56:10 nono is just ok 17:56:23 we also say it the same way in hungary 17:56:34 and also mean the same by that 17:56:52 neat 17:57:26 what are you doing now? 17:57:32 but why on earth did u ask "any glaring nono's?" 17:57:42 typing as u can c ;) 17:57:59 anyway, do actually nothing important 17:58:13 I'm asking if there was anything wrong with what I wrote 17:58:14 browsed the eForth resources on the net 17:58:39 wrong in the sense that it's unforthish 17:58:54 ugh, u mean u wrote oovect.fs? 17:59:10 yes. 17:59:18 :))) ohhhh god 17:59:29 what? 17:59:41 i thought uve found it as an example :))) 17:59:50 it was so clean & nice ;) 18:00:02 but uncommented 18:00:38 uncommented, but simple enough 2 b uncommented 18:01:21 now I've got to finish adding some vector operators 18:01:28 so, its just perfect 18:01:40 and then comptemplate matricies 18:02:01 comptemplate is probably spelled wrong 18:02:01 r u doing this as a practice? 18:02:19 and so I can use it later if I feel like it 18:02:29 see how fast I can get forth to raytrace 18:02:40 and still be pretty 18:02:42 hm, nice vision ;) 18:03:07 nah, u gave me a god idea! 18:03:20 oh? what's that? 18:03:37 1 can use a 4th written in 4th 2 profile algorithms 18:04:02 a profiler? 18:04:06 because 1 can easily modify the kernel - in 4th language - to 18:04:16 produce profiling info 18:05:09 eg. we can get an exact and "platform independent" measurement number 18:05:32 for your raytracing program for example 18:05:40 yay. 18:05:48 it's still not written, btw 18:05:56 not in forth anyway 18:06:01 that doesnt matter ;) 18:06:09 im the man of theories :))) 18:06:49 tho, as u could c, sometimes i also do some coding 18:07:29 because i can, tho i dont like 18:07:48 is it customary to allot memory and not put it back? 18:08:13 thinking is more funny than hunting silly bugs in the specific implementations 18:08:20 heh 18:08:34 in what environment? 18:08:42 eg. in gforth ? 18:08:51 any 18:09:00 it depends on 18:09:12 like, 5 allot blah blah and then never -5 allot 18:09:21 in java, yes, u dont have to care about releasing allocated mem 18:09:40 erm, dont mix allot and alloc 18:09:55 okay 18:09:56 allot is dp +! 18:10:25 it reserves mem on the top of the dict 18:10:52 "the dictionary" :) I still don't have a clear idea of what that is. 18:11:10 is alloc a word? 18:11:26 well, thats why u should understand that sample code ive written this night 18:11:51 type "see alloc" in gforth 18:11:55 and u will c 18:12:30 okay. thanks 18:12:53 anyway allocate is the base word 4 18:13:06 allocating arbitrary mem blocks 18:14:02 (but ive seen alloc defined somewhere... probably in some other forth than gforth...) 18:15:34 if I had a word that I wanted to detect whether two vectors have the same length, should it return an exception number or a flag? 18:16:14 exception number????????? 18:16:25 give me an example 18:16:43 s" Vector length mismatch!" exception constant vect-len-mismatch 18:17:54 : vect-len-match? ( o1 o2 -- wior ) 18:17:54 vect-len @ swap vect-len @ 18:17:54 = if 18:17:54 0 18:17:54 else 18:17:55 vect-len-mismatch 18:17:57 then 18:17:59 ; 18:18:46 ok, but how do u plan to use this word? 18:19:21 2dup vect-len-match? throw 18:19:22 u use exceptions only when an error occurs 18:19:43 aha... 18:20:25 well, its not easy 2 explain this situation 18:21:39 in this case vect-len-match? does nothing actually 18:21:59 what can go wrong 18:22:12 the lengths of the two vectors can not be the same 18:22:47 in which case some operators aren't defined 18:23:02 u generate exception when something unwanted, sg exceptional happens 18:23:25 what deviates from the normal flow of things 18:23:45 aahhhhaaa! 18:24:03 now im gettin closer 2 the problem :) 18:24:32 good 18:24:35 well, in this case, it will do 18:25:21 though its a lil bit weired... 18:25:50 I'm used to exceptions 18:25:56 but i cant tell it now whats wrong w it 18:25:58 I'm exceptional! 18:26:04 :)) 18:26:28 i never used exceptions but in delphi b4 18:26:46 tho, ive also tried to use it in gforth 18:27:00 it did strange things 4 me 18:27:03 try python. It's nice. 18:27:19 more than nice, thats just perfect ;) 18:27:36 except that it's not very fast 18:27:57 but i have 2 stick w 4th because its much more portable than a python 18:28:17 and much more ugly looking 18:28:31 tho, i have python on my palm IIIe :) 18:28:44 write a python interpreter in forth 18:28:45 but still better than asm 18:29:20 and lightyrs more portable than asm - but its obvious :)) 18:29:42 suuure :))) 18:30:32 there r nice parsing tools written in 4th exist 18:30:45 oh? 18:30:47 so i would b not that hard 18:30:55 do u know tile-forth? 18:31:00 no 18:31:17 thats an ancient for, i guess, but it has an 18:31:27 amazing documentation 18:31:42 and beautiful sourcecode 18:32:37 imean, it has a handcrafted library of tools 18:32:51 totally written in forth83 18:33:17 and its doc is that what is just perfect 18:34:01 -rw-rw-r-- 1 tom tom 149007 DEC 5 18:31 tile-forth-2.1.tar.gz 18:34:12 wanna get it? 18:34:45 nah 18:34:52 it has the nicest man pages ive ever cn 4 a 4th 18:35:04 nah, means no? 18:35:18 correct 18:35:35 ooookay 18:36:41 (but thats very small... ) 18:36:47 (and even...) 18:37:59 I'm busy coding me a vector classw 18:38:09 (has multitasking support. semaphores, channels, etc) 18:38:13 ok 18:39:58 no fsqrt ? 18:41:45 nm 18:41:57 it does seem to exist after all 19:02:16 what are you doing now? 19:05:18 onetom: pst 19:19:06 --- join: qless (~cerberus@clgr000977.hs.telusplanet.net) joined #forth 19:19:23 howdy folks 19:19:41 anybody awake? 19:21:28 yes 19:21:29 hello 19:21:43 heya etaoin 19:24:10 what's happening? 19:24:22 * qless is recovering from a disk failure disaster 19:25:19 * qless what fun, what fun :-| 19:25:27 I can imagine 19:26:55 how's your fun with forth? 19:27:10 it's easier to think using mini-oof 19:27:22 my mind is mostly intact atm 19:27:36 mini-oof? 19:27:54 mini object oriented forth 19:28:04 oh that does sound fun 19:28:29 12 lines of forth for a polymorphic, single inheritance object system 19:28:55 nifty. is this a publicly available system? 19:29:01 yes. 19:29:06 url? 19:29:06 it's distributed with gforth 19:29:13 oh ok 19:29:47 http://braznet.com/david/files/mini-oof.fs 19:30:05 ignore that part at the bottom. that's me trying to make it better. it's half done 19:31:32 http://braznet.com/david/files/oovect.fs 19:31:36 that's what I'm working on 19:32:29 nifty 19:41:26 well i have to shutdown before things overheat. cheerio 19:41:29 --- part: qless left #forth 19:58:51 well. forth is a rather interesting language 20:26:33 --- join: futhin (~thin@h24-64-175-123.cg.shawcable.net) joined #forth 20:28:00 hi 20:29:44 hello 20:29:51 anything happening? 20:31:04 ive fell asleep 20:31:09 bye bye 20:31:12 bye 20:31:21 I'm writing code 20:32:21 futhin: check the final kernel.fs! 20:33:35 futhin: u can test it w "test run" 20:34:41 heheh 20:34:42 url? 20:36:33 all the threading code proves is that you can code multitasking ontop of the kernel, without modifying the kernel, as long as you have CODE UNCODE 20:36:50 ugh, wtf, you shouldn't even need CODE UNCODE 20:37:06 i don't know what the heck we are arguing about 20:37:48 <-- is saying that you can implement multitasking ontop of the kernel, without modifying the kernel, doing it all in Forth code, no CODE UNCODE.. you haven't proven otherwise :) 20:37:56 or maybe you have to have CODE UNCODE 20:37:58 but still.. 20:38:10 that is perfectly acceptable with what I was saying before 20:38:30 or else the two definitions of "kernel" are not the same 20:40:05 kernel = the default forth they give you, including all the primitives and all the words that it comes with.. 20:40:28 anything you code, is "on top" of the kernel ;) 20:40:35 I agree with you 20:40:41 (i know, this is bad defining..) 20:40:43 I have a feeling that's not what onetom was saying 20:41:07 etaoin: the problem is that _anytime_ you code in forth, you are actually modifying the forth language. . 20:41:36 futhin: hooray 20:42:55 yeah, it's good, but it ends up with people having different definitions for some of the words.. such as forth kernel :P 20:46:36 forth is an interesting language 20:48:50 yup :) 20:49:28 it is such an amazing language 20:52:04 chuck moore is probably a genius, just for creating a language that is so simple and powerful, but more than that, is a very different way of thinking & approaching problems 20:56:07 although, in some ways, it is similar to lisp 20:56:45 yeah 20:56:47 he learned lisp and he was a hardcore assembly programmer. so forth was kind of the combination of both 20:56:58 but the fact that he is so focused on simplicity 20:57:15 i truely believe in the saying "it takes a genius to be simple" i think that is 100% true! 20:57:51 people are so prone to obfuscating things, and making things more complicated, and coming up with the more complex solution to a given problem 21:01:22 onetom 21:01:26 are you there? :) 21:03:30 I'm here 21:03:42 and it's the start of a new hour 21:04:34 i just wanted to talk a little bit about my forth mud, the database & the code & the objects in it.. 21:10:23 * futhin has been going thru the log and re-reading the conversation re: the forth kernel. i now understand what onetom meant by forth kernel 21:12:26 what did he mean? 21:13:33 um.. the first part of forth, before all the primitives & words are made. basically, the loop, dictionary, stack, etc.. 21:14:53 I now have a fatal bug in used-to-work code :( 21:19:17 forth code? 21:19:21 yes 21:19:27 want me to check it? 21:19:35 I dunno 21:19:47 it's an address error 21:20:15 it can't hurt to get it checked :P 21:20:51 might waste your time though 21:21:04 naw 21:21:14 i'd be happy to 21:21:19 http://braznet.com/david/files/oovect.fs 21:21:22 i really want to look at everybody's forth code :) 21:21:43 if i look at lots of forth code, i'll learn some more forth :) 21:22:41 ooh 21:22:49 your forth code looks very interesting :) 21:23:12 i haven't seen much forth code.. and i haven't seen forth coding that has tons of :noname in it :) 21:23:42 what is the purpose of the code ? 21:23:49 what is it supposed to do? 21:24:19 to make a general purpose vector class 21:25:30 what's a vector class.. ? 21:26:50 http://braznet.com/david/files/mini-oof.fs if you don't have it 21:27:18 are you familiar with object oriented programming? 21:27:57 yes, roughly. i know c++ & about classes & structs 21:28:24 okay. I'm making a vector object that will be able to do stuff 21:29:28 "vector object" and "vector class" doesn't mean anything to me.. just explain it briefly.. i probably understand the underlying concepts.. 21:29:52 <-- tends to forget OOP concepts.. like polymorphism, classes, etc :P 21:30:04 an object is a bundle of data and methods on that data 21:30:46 yeah 21:30:49 but the "vector" part.. 21:30:50 my bundle of data is an array of floats and my methods do vector stuff 21:31:05 a vector is a methematical thing 21:31:11 yeah 21:31:11 ok 21:31:16 uh 21:31:34 what, the vector class is so that you can do math on vectors ?? 21:31:42 yes 21:31:51 * futhin was thinking something totally different, like a spanking new concept 21:32:05 not something as simple as doing math :P 21:32:12 heh 21:32:22 so how will it work? 21:32:28 how it's written 21:32:39 how will you calculate some vector? 21:32:39 what would the code look like? 21:32:39 using the vector class 21:33:04 vector instantiate 3 over init 21:33:04 dup copy 21:33:04 vect-add-copy 21:33:04 dup print 21:33:39 that makes a vector and then copies it and then adds the two and then prints it 21:33:43 um, no, i mean, how are you going to input the numbers 21:33:48 no idea 21:33:50 for the vector.. 21:34:22 0.0e1 0 element@ f! 21:34:41 ( o -- ) 21:35:41 you've learned a lot of forth pretty quickly? 21:35:54 only the syntax 21:36:02 and thinking in stacks 21:36:12 I don't know a lot about the internals 21:36:37 yeah.. but your forth code seems a little more complex.. you might want to factor everything out.. make smaller words (so that it is easier to debug, etc) 21:37:14 I was doing that, but I missed something somewhere and now stuff doesn't work 21:37:33 chuck moore says that a word should only have one or two lines of code, any more, and you are just making it more complex.. 21:37:48 s/any more/any more than that 21:38:20 also, he says you shouldn't have to think about the stack in more than 2 or 3 depth :) 21:38:40 <-- my first code was a real exercise in stack thinking! 21:39:00 yeah, I don't think deeper than 2 or 3 21:39:30 yeah, some of the guidelines are: small words, don't pass more than 2 parameters to a word, etc.. 21:41:44 i'm not familiar with all of the forth words.. like "instantiate" or "f@" etc.. 21:41:58 you seem to be putting loop into the code without any IF ? :) 21:42:12 instantiate is in mini-oof 21:42:27 f@ deals with the floating point stack 21:42:43 eh? there's a 3rd stack ? 21:43:01 optional 21:43:29 it depends on the forth you have doesn't it? you are using gforth right ? 21:43:44 yes 21:44:43 your code can be considered slightly obfuscated, mainly because you have the "loop" all on its own :P 21:45:03 hm? 21:46:00 nevermind 21:46:11 i guess that's the power of forth 21:46:16 surely 21:48:15 onetom idle 5 secs ?? 21:48:23 onetom you there? 21:49:03 i guess his client prevents him from going idle too long, in case the server kicks him 21:49:42 probably 21:53:26 eh? 21:53:35 you are going to raytrace in forth? :D 21:53:47 I was thinking about it 21:54:08 fun fun.. any reasons why? 21:54:28 doing it for fun? or because of some strength that forth has ? 21:54:59 I've already done a simple one in two other languages, so I don't have to learn anything about how to design it 21:55:07 for fun 21:55:22 and to see how fast forth may be 22:00:08 yup 22:00:42 not sure how fast it is compared to C compiler since C compiler has better optimizing technology.. 22:01:01 a lot of forth coders on this chan have told me forth is faster 22:02:06 the comp.lang.forth FAQ gives this url http://www.complang.tuwien.ac.at/forth/performance.html 22:02:22 a benchmark comparing forth & C 22:02:52 actually 22:02:59 read section 3.5 of http://www.faqs.org/faqs/computer-lang/forth-faq/part1/ 22:05:22 However, there are many reports of cases where Forth programs beat 22:05:22 others in size and/or speed. My guess is that the added flexibility of 22:05:22 Forth helps programmers produce faster and/or smaller programs. 22:07:38 .. 22:07:38 .. 22:08:14 okay 22:08:18 i wonder if it would be important to use an optimizing forth in a forth os (if this forth os were to become really big, and used by many people) 22:10:56 lol.. 72 lines of code for bubble in forth, 1100 lines of C code for bubble 22:13:37 i440r dislikes optimizing forth because it ruins the 1:1 correlation between the code and object.. 22:14:26 forth should be fast enough in the long run.. for bigger programs, they should end up smaller and simpler, and therefore faster.. 22:21:27 "Dictionary overflow" 22:23:09 heh? your code? 22:23:16 no 22:23:23 something's screwy 22:23:57 it didn't do that before 22:24:01 did you try "see alloc" in gforth ?? 22:24:08 gforth doesn't have see does it? 22:24:18 yes, it does 22:24:28 eh?? 22:24:32 i'm in gforth right now 22:24:37 it just gives me backflow error.. 22:25:39 see see 22:25:39 : see 22:25:39 name find-name dup 0= 22:25:39 IF drop -13 throw 22:25:39 THEN 22:25:40 name-see ; ok 22:25:48 works here 22:25:54 0.5.0 22:26:01 hm, i have gforth 0.5.0 too 22:26:05 what the heck 22:26:14 do you change vocabulary or something? 22:26:29 no 22:28:24 there is no alloc 22:28:26 true? 22:29:04 weird 22:29:20 firght 22:29:22 right 22:29:26 that was his point 22:29:30 yup 22:29:31 heh 22:34:00 etaoin: i'm trying out oovect.fs in gforth 22:34:07 but it doesn't recognize the word copy 22:34:22 you have a line that says "dup copy" 22:34:27 near the bottom 22:36:11 now why wouldn't it? 22:36:34 because there's no such thing as COPY ?? 22:36:56 it should be made on line 80 22:41:33 well it doesn't appear to be assigning copy or something.. 22:42:33 which is interesting, because it should give the error earlier (because you have copy inside some of the other words) 22:42:46 like vect-add-copy 22:42:52 or maybe it doesn't matter.. 22:42:52 hmm 22:43:24 vect-add-copy 22:43:24 *the terminal*:1: Invalid memory address 22:43:24 vect-add-copy 22:43:24 ^^^^^^^^^^^^^ 22:43:24 Backtrace: 22:43:25 $DEE387C @ 22:43:27 $DEE4074 copy 22:43:27 I get "Invalid memory address" with @ and element@ on the top of the stack 22:43:31 yup 22:43:45 what did you change? :) 22:43:55 I dunno 22:44:16 @ is fetch right 22:44:23 yes 22:44:43 seriously though, do you remember modifying element@ or somesuch ? 22:44:56 yes 22:45:01 don't you keep old copies of your source around? ;) 22:45:13 no 22:45:32 I usually use languages that don't baffle me 22:45:37 heh 22:46:12 vect-first-element should be defined before element@ is.. ? 22:46:50 that would be silly 22:47:23 eh? i can't find vect-first-element? 22:47:48 it's magic in the class definition at the top 22:47:59 vect-first-element isn't defined ? 22:48:16 oh? var? 22:48:21 yes 22:49:04 give me an example of using init 22:49:30 just once right after the object is created 22:49:40 no, i mean, the parameters you pass to init 22:49:53 vector instantiate 3 over init 22:51:22 a b init > a b a b > a b a (vect-len) > a b a b (over) > a b ( floats allocate) > a b a (dup) > b a a (rot) > b a (vect-first-element) 22:51:56 i dunno if i got the stack right.. 22:52:27 jeez, what a mess, you might want to factor it up so that you can track the stack easier 22:52:34 heh :) 22:52:52 overrall i'm just as impressed with your code as onetom was 22:53:46 I wrote a bunch of it after he saw it 22:54:20 is vector a number? is instantiate a number? i just want to know how many stack items there are on the stack for init? 22:54:47 when? before the function is called there should be 2 22:55:07 there should be only 2 numbers on the stack for init? 22:55:33 yes, the second one being a pointer to some data 22:56:29 is "vector instantiate" going to leave any numbers on the stack? 22:56:45 a pointer right ? 22:56:52 yes 22:57:00 ok 22:57:47 stack looks like: p 3 > p 3 p (over) > p 3 p 3 p (2dup) etc 22:57:51 is that fine so far? 22:58:16 there's actually 3 numbers on the stack right before init is called 22:58:36 yes. one of them is there so I can use that pointer later 22:58:40 ok 22:59:24 ok, i'm just going to go thru the stack flow 23:00:07 p 3 p 3 ( vect-len !) > p 3 p 3 p (over) 23:00:11 what does floats do? 23:00:17 does it take 2 numbers off stack? 23:00:20 it's like cells 23:00:38 p 3 p (floats) ? 23:00:44 would that be right ? 23:01:00 floats takes off 2 stack items ? 23:01:09 no 23:01:14 only one 23:01:23 and puts one back on 23:01:38 allocate and throw don't affect the stack items right ? 23:01:52 floats converts it 23:01:52 yeah, they do 23:01:56 ok i remember 23:02:01 floats converts it 23:04:30 p 3 p 3 pf (floats) > p 3 p 3 ( allocate throw ) > p 3 p 3 p (dup ) > p 3 3 p p (rot) > p 3 3 p (vector-first element !) 23:04:33 does that look right? 23:06:43 I don't think so 23:06:50 I'm having trouble thinking. 23:06:54 it's late 23:07:10 allocate throw takes one number off stack right? 23:07:18 takes off the number that floats converted 23:07:26 right 23:07:30 throw just quits the whole program 23:07:31 ok 23:07:33 and puts an address on the stack 23:07:36 oh 23:07:39 ok 23:08:13 allocate ( u -- addr wior ) 23:08:20 throw ( wior -- ) 23:08:37 p 3 p 3 a > p 3 p 3 a a > p 3 p a 3 a > p 3 p a 3 (vector-first-element !) 23:13:07 I think I've found the problem 23:13:46 p 3 p 3 a 0 do loop 23:13:57 address 0 ?do loop 23:14:05 is that right ? 23:14:16 do you want the ?do loop to use the address number ? 23:14:19 probably not 23:14:24 given by allocate 23:16:17 you want it to be 3 0 ?do loop right ? 23:16:48 right 23:17:06 the loop will initialize the float array to 0 23:17:26 oops 23:17:29 nevermind 23:17:35 it is 3 0 ?do loop 23:17:50 but inside the loop, the addr is getting dupped 23:19:25 ahahahahahaha! 23:19:35 works 23:19:58 heh 23:20:06 <-- not helpful :P 23:20:13 eh? 23:20:20 what did you change/fix ? 23:20:25 not hurtful 23:20:58 I changed the ordering of the arguments to element@ back to the way they were before it got broke 23:21:20 seems that the object pointer must be on the top of the stack when calling a method 23:21:37 heh 23:22:22 now would be a good time for sleep 23:22:26 ok 23:22:29 good night then :) 23:22:34 good night 23:22:40 --- quit: Etaoin ("raise CreativityError, "can't find a good exit message"") 23:28:39 --- quit: futhin ("sleep") 23:59:59 --- log: ended forth/02.03.08