00:00:00 --- log: started forth/01.10.05 01:50:15 --- quit: Fare (Ping timeout for Fare[samaris.tunes.org]) 02:24:55 --- quit: Speuler (Ping timeout for Speuler[c38038.upc-c.chello.nl]) 02:27:34 --- join: Speuler (l@c38038.upc-c.chello.nl) joined #forth 02:48:55 --- quit: Speuler (Ping timeout for Speuler[c38038.upc-c.chello.nl]) 02:53:56 --- join: Speuler (l@c38038.upc-c.chello.nl) joined #forth 03:47:16 --- join: Fare (Fare.LISPM@samaris.tunes.org) joined #forth 04:17:02 --- join: nevyn (nevyn@ocmax32-061.dialup.optusnet.com.au) joined #forth 04:17:13 hello anyone awake? 04:36:57 --- part: nevyn left #forth 05:30:36 yes, why ? 05:51:15 --- join: futhin (thin@h24-66-209-114.cg.shawcable.net) joined #forth 05:51:20 sup all 05:51:27 hi cqx 05:51:29 hi speuler 05:51:30 hi fare 05:56:26 hi futhin 05:56:30 how goes 05:56:31 ? 05:57:44 good 05:57:54 i'm gonna code a mud in forth :) 05:59:59 interesting. 06:00:05 training project ? 06:00:58 hmm.. it's for fun, but i fully intend on making it functional and putting it online for ppl to connect to 06:01:07 i'm doing it with a friend 06:01:17 the only problem is that i want to code it in forth and he wants to code it in perl 06:01:53 so we're both coding the backends for the mud in our respective languages.. hopefully we'll be able to decide which language is better in the long run after we've coded up the backends 06:05:15 you know what a mud is? 06:05:21 Multi-User Dimension 06:05:44 yep. do know. sorry, was wandering around ... 06:06:06 mudd related i suppose 06:06:12 eh? :) 06:06:19 but w/o dungeons and dragons ... 06:06:35 talker muds? 06:06:40 not hack'n'slash muds? 06:06:57 h+s = mudd , talk=mud i think 06:07:07 not really 06:07:31 it's more like h+s = dikumud talk = tinymuck or *MUSHs 06:08:24 mud is more h+s and MUSH,MUCK,etc are talker 06:08:45 i want to be able to have ppl code online on my mud, but i'm wondering how to implement that.. 06:09:00 i need to be able to run untrusted code safely 06:10:47 hello? 06:13:26 still/again there 06:13:55 you'd like to limit what people are allowed to do on your system 06:14:13 for example, create user words in a vocabulary which you can seal 06:14:46 (i.e. render everything else inaccessable) 06:16:26 i want to let some ppl code 06:16:44 builders for the mud, but their code isn't necessarily trustworthy.. 06:16:53 so i'll have to implement a second layer or something.. 06:18:01 would you like people to program forth, or something else ? 06:18:57 dunno 06:19:00 probably forth :) 06:19:40 then subsetting the language may be a good idea 06:19:52 subsetting? 06:19:58 it would be too powerful for anybody 06:21:06 how to subset? what does it do? 06:21:26 only offer selected words to the user, instead of whole vocabulary 06:21:36 dan kom ik zo langs 06:21:41 sorry, wrong channel ... 06:23:18 futhin: i have to leave now, have to pick up my car from inspection. 06:23:21 cul8er 06:31:57 gotta go to school, laterrs 06:31:59 --- quit: futhin (bye) 07:51:25 --- join: nevyn (nevyn@CPE-144-132-75-120.vic.bigpond.net.au) joined #forth 07:51:28 --- join: Speuler0 (k@d120073.upc-d.chello.nl) joined #forth 07:51:33 hi 07:51:34 g'day agn 07:51:47 what interpreter do people use? 07:52:07 english-french, japanese-russian, ... 07:52:11 heh 07:52:16 forth interpreter :) 07:52:24 many write their own 07:52:37 hrm 07:52:42 under linux, gforth seems to be quite popular 07:52:49 * nevyn is just fiddling with it as gforth 07:53:00 under windows, it is win32forth 07:53:14 different preferences under msdos 07:53:20 amiga, aforth 07:53:22 mainly playing with numbers and loops. 07:53:47 some c implementations of forth are popular too 07:53:53 I started by wanting to know what 07:54:06 atari: volksforth 07:54:19 (which became gforth) 07:54:23 0 f 0 do i idprom@ xor loop f mkp on a sparc did 07:54:50 and some use openboot/openfirmware 07:55:13 occasionally, a compiler can be found 07:55:24 such as 4thcmp (earlier: cforth) 07:55:29 so is it the usual thing that to have a loop I need to create a function? 07:55:33 or is it a gforth thing? 07:55:43 so if I want to do something like 07:55:52 10 0 do i . loop 07:55:54 usually you would write a word, but you can do loops without: 07:56:06 10 0 [do] [i] . [loop] 07:56:13 Speuler: gforth gives me an error that it's a compile only word? 07:56:24 do is, but [do] isn't 07:56:26 which confuses me.. it works in open firmware 07:56:30 :) 07:56:44 do and loop compile jumps. compiling a jump while interpreting makes no sense 07:57:11 with state smart words you can get around, but those aren't considered good practice 07:57:11 unless your just mucking around and fidling like I am? 07:57:30 i'm gone again. at a friends machine, about to leave again 07:57:33 thanks 07:57:35 bye 07:57:37 ttyl 07:57:44 --- part: Speuler0 left #forth 08:47:57 --- quit: nevyn (Read error to nevyn[CPE-144-132-75-120.vic.bigpond.net.au]: EOF from client) 09:24:25 --- join: redblue (star@ppp092.252-96-207.3riv.mt.videotron.ca) joined #forth 09:24:29 --- part: redblue left #forth 13:04:15 --- join: dima (ftech@62.76.51.144) joined #forth 13:04:24 hi, brothers 13:05:15 --- quit: dima () 14:00:25 --- join: qless (qless@clgr000977.hs.telusplanet.net) joined #forth 14:45:54 --- join: futhin (thin@h24-66-209-114.cg.shawcable.net) joined #forth 14:52:31 heyho futhin 14:58:26 --- join: MrReach (mrreach@209.181.43.190) joined #forth 14:58:37 heyho mrreach 14:58:46 hello 14:58:55 hi 14:58:56 hihi! 14:59:12 How your day? 14:59:23 good.. learned some japanese :) 14:59:38 heh, more power to you @:^> 14:59:39 checked out the bookstore's linux stacks 15:00:13 anything on administration? 15:00:29 the prob with books is that they become outdated rather quickly 15:00:38 yes actually, but was looking more for kernel stuff 15:00:45 indeed 15:00:57 the fundamentals are long-term, I spose, but the online docs are usually better 15:01:16 that's what i was thinking: too much effort turning these pages 15:01:21 compared to clicking a mouse 15:01:25 www.linuxdoc.org 15:01:30 HAHAHA! 15:01:38 :-) 15:01:52 I prefer printed material, but digital material more convenient 15:02:30 so given the choice would you prefer print, html, pdf, or ascii for the ANS? 15:02:48 ANS Forth??? 15:02:54 yeah 15:03:04 I have the HTML version, and OLNLY the HTML version 15:03:07 i prefer html 15:03:09 heh, also ... 15:03:53 my bookmarks point to Appendix F - Alphbetic List of Words 15:03:59 exactly 15:04:23 I sometimes use the TOC, but use that appendix far more often 15:05:24 they also had k&r's ANSI C, but it was $60 bucks 15:05:33 and i figured it would just make my bookshelf look more impressive 15:05:43 heh 15:05:53 at least it was K&R C 15:05:58 wasn't, rather 15:06:00 The White Book[tm[ 15:06:20 I've got Brodie's "Starting Forth" 15:06:35 me too. its due back on the 21st 15:06:40 heheh 15:07:01 i'm trying to wrap my brain around DOES> from a subroutine threaded point of view... 15:07:09 ack! 15:07:12 qless: you aren't canadian? 15:07:16 fun eh? 15:07:18 you must be a masochist 15:07:25 eh? eh? .ca eh? 15:07:31 HAHA! 15:07:44 i guess not.. my library has the brodie book but somebody else has taken it out 15:07:45 :-) 15:07:58 are you in .ab.ca futhin? 15:08:05 yes. 15:08:09 calgary 15:08:13 hehe. cowtown.ab.ca? 15:08:23 dunno about the cowtown part 15:08:28 qless: are you writing a JSR forth? 15:08:36 that's me, bud 15:08:40 yes mrreach 15:08:57 gonna do the inlining and peephole routines? 15:09:04 of course 15:09:13 I'd like to participate 15:09:24 how far along are you? 15:09:25 anybody want to tell me how i might go about executing untrusted code .. like make a secondary layer for untrusted code within a mud? :) 15:09:37 not at this time. it has to be self-hosting first, then i will get you involved if you're interested 15:09:59 what are you writing in initially? what platform? 15:10:15 futhin: well ... 15:10:27 it is in a combination of C and forth 15:10:46 futhin: restrict to single wordlist ... import common forth words as needed (with ALIAS maybe) 15:11:29 futhin: run in a seperate thread so that a stack underflow only crashes them, not the who system 15:11:37 import words like : ; ? 15:11:43 qless: which platform? 15:12:06 k6-2 (later athon) from POST 15:12:13 sure, and + - * / /MOD */MOD DUP DROP ROT OVER ... etc 15:12:34 qless: you mean as the OS itself? 15:13:23 yep 15:13:52 yuck ... I've been spoiled by the conveniences of a good lib 15:14:26 yuck? its a *challenge* 15:14:39 why not metacompile it in forth? 15:14:43 or maybe just insanity 15:14:44 gotta go, talk to you all later :) 15:14:46 --- quit: futhin (bye bye) 15:14:58 I wrote a metacompiled STC Forth for DOS once 15:15:14 there is no metacompiler yet, i'm still trying to figure out DOES> hehe 15:15:23 pitched it because I was disappointed with its performance 15:15:35 cool 15:15:37 I got an idea, wanna hear? 15:15:45 sure, go fer it 15:16:37 ok, in a STR forth, a CREATEd word starts with a call to doVar ... which pops the return adr to TOS and then returns up two levels instead of one ... right? 15:17:11 (your imple might be radically different) 15:17:32 i guess i'm at the point where i'm deciding how to implement the defining words 15:18:02 but is dovar a definition on its own, or is it the DOES> part of CREATE? 15:18:15 heh, it is both 15:18:24 ah, ok, i follow i think 15:18:46 ok so pretend that a created word looks like this ... 15:18:59 CALL doVar 15:19:17 [some data goes here later with , and stuff] 15:19:23 [end] 15:20:20 ok, then doVar simply pops the adr off the return stack (which will be a pointer to the data field) 15:20:31 got it 15:20:42 and then returns NOT to the created word, but to the word that called the created word 15:20:56 ok, now for DOES> 15:22:00 simply change the CALL doVar part to call code following the data area, then compile a call to doVar (I think, might need a doDoes) 15:22:15 so it would look like this ... 15:22:37 CALL [fwdadr] 15:22:48 [some data goes here later with , and stuff] 15:23:11 fwdadr: CALL doDoes 15:23:27 [code from part after DOES>] 15:23:32 [end] 15:24:14 so CALL [fwdaddr] is the code field, and the rest is data? 15:24:19 hmmm ... that idea is rather nearsighted 15:24:38 hmm why? 15:24:42 yes, basically 15:24:58 its either going to come clear to me within the next week 15:25:05 because the code that gets executed will actually be compiled earlier in the dictionary 15:25:06 or i'm going to go bowling and forget about it 15:25:18 no, I did this once ... it can be done 15:25:29 understood 15:25:56 and it's not that complicated, but it tends to warp the brain because it's so unusual 15:26:21 it is that 15:26:47 ok, lets use a sample defintion (of something like DEFER) ... 15:27:43 : DEFER ( -- -- ) CREATE ['] NOOP , DOES> @ EXECUTE ; 15:27:57 does that look right? 15:28:45 that's really neat 15:29:17 heh, hadn't gotten that far yet? 15:29:56 hell no. writing a disk driver and editor in C-simulated forth is where i'm at 15:30:19 but that is useful 15:30:41 ok, so what would DOES> do? first it would have to be immediate 15:30:49 naturally 15:31:08 it resets the code field of the CREATEd word to new code 15:31:24 and it wouldhave to change the behavior of the word previously CREATEd 15:31:30 right 15:31:54 or old code, as the case may be... 15:32:15 the @ EXECUTE part can be compiled as part of the current def, with a RET just in front of it 15:32:41 that way, DEFER stops executing at the DOES> part 15:32:48 follow? 15:32:56 i think so 15:33:05 what i' 15:33:22 ve seen so far is something like (;code) prefixing the runtime code 15:33:30 is that the same? 15:33:33 ok, when DEFER is executed, we want ONLY the part of DEFER before then DOES> to be called 15:33:40 yes 15:33:45 exactly 15:33:49 ok cool 15:34:01 it doesn't make sense for DEFER to do @ EXECUTE 15:34:07 right 15:34:46 ok, so then DOES> compiles a RET (or whatever your system needs for NEXT) 15:34:59 RET or JMP i would imagine 15:35:16 ok, then DOES> patches the CALL doVar in the word just CREATEd 15:35:48 such that it CALLs the current dictionary address (HERE) 15:35:56 wild! to become a CALL doDoes? 15:36:03 oops, maybe not 15:36:10 no, because now ... 15:36:22 we're gonna restart the colon compiler 15:36:45 to compile the "@ EXECUTE" at the current dictionary location 15:37:11 ah ok 15:37:20 the place where the CALL doVar in the CREATEd word has been patched to call 15:37:54 got it 15:37:55 so that when the CREATEd word is called, it ends up doing the @ EXECUTE 15:37:57 brb 15:38:12 ok 15:38:59 back 15:39:13 ok 15:39:27 i'm seeing how it skips forward i think now 15:39:30 in thinking about this ... there's one more part needed ... 15:39:55 when the CREATEd word calls the code snippet after DOES> 15:40:13 the address for the data area is going to still be on the return stack 15:40:34 but the part after DOES> needs it on data stack 15:41:15 so DOES> needs to compile a call to doDoes (or doVar?) first, before restarting the colon compiler 15:42:40 nope, can't be doVar ... because would be moving the 2nd address on return stack to TOS instead of the 1 address, as doVar does 15:44:44 I don't know how the hell you're gonna compile this in C, what a PITA 15:44:57 its been no problem so far 15:45:18 the c is just a framework, because i can't write classic forth until i bring the system up 15:46:36 but as anything, a few steps at a time seem to have done the trick so far 15:46:46 * MrReach nods. 15:47:02 incidently ... 15:47:14 great, thanks, i will be mulling this over until it comes clear 15:47:26 ? 15:47:46 when I'm writing a new system, EMIT is the very first word I define, then DO ... LOOP and TYPE ... so that I can debug the partially built system 15:48:14 yep, a keyboard driver, emit, key and key?, and type 15:48:32 otherwise, i really would be crazy 15:49:17 heh, some people try to write the entire system ... and then try to debug it 15:49:30 * MrReach looks around for I440r 15:51:23 ok, would you like to see how DEFER and the word that DEFER builds would look as raw assembly code? 15:51:34 you sound like your still a bit confused 15:52:02 oh don't worry, i am 15:52:36 Code DEFER 15:52:36 i am not a forth expert, i am a hardware junkie... but i know it will come clear 15:52:48 CALL CREATE 15:53:01 CALL lit 15:53:13 dw [address of NOOP] 15:53:39 CALL comma 15:53:57 hhhmmmm ... 15:54:10 JSR to code just beyond? 15:54:31 CALL (DOES) 15:54:38 RET 15:54:45 call doDoes 15:55:06 ooops, change that last to ... 15:55:22 adr: CALL doDoes 15:55:36 CALL fetch 15:55:41 CALL execute 15:55:49 RET 15:55:53 END-CODE 15:56:19 now, if we do ... DEFER EMIT ... we get 15:56:36 CODE EMIT 15:56:49 CALL adr 15:57:04 DW [address of NOOP] 15:57:11 RET 15:57:15 END-CODE 15:58:57 the RET in EMIT is spurious 15:59:08 the RET in EMIT is not needed 15:59:23 my EMIT writes to the frame buffer, not sure what NOOP has to do with it? 15:59:40 no, EMIT is a defered word 15:59:46 oh sure ok 15:59:51 understood 15:59:57 intitially, it would prob before vectored to (EMIT) 16:00:06 be vectored 16:00:11 yep, at this point its not necessary 16:00:50 it was trying to think of a word that's nearly always defered, and EMIT came to mind 16:01:21 oh i see 16:03:48 I was expecting you to ask why the "CALL (DOES)" was neccessary 16:04:31 actually i almost typed it, but i figured it was near or the same as (;CODE) 16:05:10 (DOES) is the part that actually patches the first CALL instruction of the word just CREATEd 16:05:25 so that it doesn't point to doVar anymore 16:05:30 right cool 16:06:07 the (;CODE) would be the RET then i guess 16:06:13 yep 16:06:59 the CALL doDoes in DEFER would be comiled by the immediate DOES> word 16:07:14 and all following would be compiled by the regular colon compiler 16:08:26 the compiler would probably inline and optimise the CALL doDoes part 16:08:54 even though you might have to write a special rule in the peephole optimiser to do so 16:11:21 optimization is a little green light on the opposite shore 16:11:24 :-) 16:11:36 heh 16:11:59 not even visible yet? have to have faith it's actually there? 16:12:45 no faith. but will steal what's necessary from gcc 16:15:36 oh! 16:15:47 your going to go with agressive optimisation? 16:16:01 GCC is NOT a peephole optimiser 16:16:44 hmmm 16:17:15 i thought i remembered reading about GCC doing peephole optimization, perhaps i'm wrong 16:19:21 that might be one of its methods, but it definately does the whole gamut of optimisations 16:19:55 register mapping/expiration, reordering for pipeline optimisation, etc 16:20:43 that is why the various compiler frontends use an intermediate assembly language 16:21:01 yep, i don't know if i wil have the patience or stamina to do all those optimizations, but they seem reasonable 16:22:48 actually, if you're gonna go with agressive, you've only really got one optimisation 16:23:05 and that's a tree of microperations and operands 16:23:26 once you have that, building the register allocation and instruction ordering is pretty easy 16:23:34 that's why it seemed easy at the beginning 16:23:57 building that tree is a real PITA 16:24:08 PITA = Pain In The Ass 16:24:17 the fun part is going to make it intelligent enough to optimize for k6-2 vs. p4 or what have you 16:24:23 yeah i hear that 16:24:27 peephole is easier, but not as effective 16:55:46 --- join: tasoth (tasoth@clgrtnt4-port-15.dial.telus.net) joined #forth 16:55:51 --- nick: tasoth -> futhin 16:55:52 sup sup 16:56:21 mrreach: i'm not on my comp right now.. and i'm trying to find the definition for ALIAS on the web.. 16:56:29 it isn't ANSI ?? 16:56:54 futhin: its not ANS 16:57:15 ah 16:57:21 what does it do/how does it work? 16:57:34 ALIAS? i have no idea 16:57:45 i found it on the web just now 16:57:53 creates new name for an existing word.. 16:58:07 oh nifty 16:58:17 hmm 16:58:19 is it nifty? 16:58:41 yes NIFTY ( a-addr n -- " yes indeedy" ) 16:58:43 why can i just do something like: : blah do ; 16:58:45 or something like that.. 16:58:51 heheh 16:58:57 why can't i 16:59:00 hmm 16:59:06 i have no idea 16:59:37 um, if i have a mud with ppl on it that want to run code, how do i put in a second layer that can run untrusted code safely? how would alias help? 17:00:22 i would think (although i'm no expert) that a sealed wordlist would be what you want 17:00:47 yeah.. 17:01:27 but for all the common words, do i have to recreate them for the sealed word lists (modified words)? 17:01:38 s/lists/list 17:02:12 i sure don't know, but it seems to me the 'common words' could cause the system to crash without too much effort 17:03:02 well if ppl want to code for the mud, they are going to have to use words like : ; and do loop and begin repeat etc.. 17:03:07 so how do i make it safe? 17:03:31 wrap it with duct tape and paint a sign that says "Do not touch" 17:03:38 how does the sealed wordlist help make the words used for coding help 17:04:08 well the only advantage to a sealed list would be exclude certain words 17:04:13 or is it better to ask: what words are going to be in the sealed wordlist that's going to be used for coding by the users?? 17:04:44 no idea, but you probably have some 17:05:09 like 'help' and 'eat' and 'drop' 17:05:52 um.. but i want to let other ppl code for the mud.. 17:06:09 so i need to be able to run the untrusted code safely without making it crash the mud... 17:06:25 a sealed wordlist doesn't seem to be the entire solution :( 17:06:34 probly not then 17:07:15 i kind of need to code a forth within forth or something weird like that :) 17:07:42 yeah understood, and i think its possible, i just don't know how 17:07:43 or somehow make a copy of the forth and run it in some separate thread.. 17:07:45 or something 17:07:54 so that i don't have to code EVERY word :/ 17:08:03 recode every word that is.. 17:10:04 hmmm 17:10:25 are you working on any forth coding these days? 17:10:47 i sure am, i'm trying to implement CREATE...DOES> in a subroutine threaded model 17:11:22 hmm 17:11:26 i don't know that stuff :) 17:11:38 mrreach had all sorts of things to say 17:11:46 and i might even get it done tomorrow 17:13:40 heh 17:13:53 i'm hoping to start coding and finish my mud backend this weekend :) 17:14:03 right on 17:14:09 i'm sorta thinking of pulling some kind of "marathon" ;) 17:14:18 excellent. what forth are you using? 17:15:08 prolly gforth 17:15:30 good choice i think 17:16:09 i'm impressed the way gforth is put together 17:16:09 it's got socket support according to mrreach :) 17:16:19 altho he says it has pretty weird code.. 17:16:44 another possibility is bigforth 17:17:10 does it have socket stuff? 17:17:29 i believe it can like to any .so so i would think so 17:17:33 hmm 17:17:36 ok 17:17:42 i'm gonna go eat, laters 17:17:44 --- quit: futhin (food) 17:31:20 --- quit: qless ([x]chat) 17:54:58 back, if it matters 19:09:34 hi gang 19:36:12 --- join: nevyn_ (nevyn@ocmax31-122.dialup.optusnet.com.au) joined #forth 19:36:44 hrm 19:37:49 --- quit: cqx (farmer.openprojects.net sagan.openprojects.net) 19:38:06 --- join: cqx (cqx@m206-182.dsl.tsoft.com) joined #forth 19:38:58 so is there such a thing as a minimal forth instruction set? 19:39:30 yes, you could call level 1 of "levels of forth" a minimal set 19:39:44 . ! url? 19:40:01 (justlemmelook4theurl) 19:40:16 nm 19:40:22 giyf 19:40:39 http://theforthsource.com/fp001.html 19:40:47 level0 i mean 19:41:25 there's no @ and ! yet 19:41:54 which i'd consider member of minimal set too 19:43:05 things like < u< 0= 0< etc you'd have to build too 19:43:51 where against DECIMAL, HEX, OCTAL i'd say shouldn't belong to that list 19:43:52 --- quit: nevyn_ (Ping timeout for nevyn_[ocmax31-122.dialup.optusnet.com.au]) 19:47:08 --- join: nevyn_ (nevyn@ocmax33-205.dialup.optusnet.com.au) joined #forth 19:47:40 how is .s different from dup . ? 19:48:08 dup . displays top element only. .s show whole stack 19:48:44 ah 19:48:57 try out 1 2 3 cr .s cr dup . and you'll see the diff 19:49:14 I forgot .s show whole stack 19:50:18 you're not so far from munich, right ? 19:51:18 me.. nowhere near it. 19:51:29 I live in .au 19:52:09 know that one of the original gforth authors was austrian too ? 19:52:26 .at ... you're .au 19:52:28 sorry 19:52:45 oz ! 19:52:52 yes 19:55:15 i dropped bit 0 from ascii u 20:09:12 --- join: Speuler0 (l@c38038.upc-c.chello.nl) joined #forth 20:11:00 --- nick: Speuler0 -> Speuler2m 21:07:25 --- part: Speuler2m left #forth 21:44:44 hihi 22:16:31 --- join: edrx (edrx@200.240.18.101) joined #forth 22:48:32 --- quit: edrx ([x]chat) 23:28:01 --- quit: nevyn_ (Ping timeout for nevyn_[ocmax33-205.dialup.optusnet.com.au]) 23:59:59 --- log: ended forth/01.10.05