00:00:00 --- log: started forth/01.06.19 00:22:05 --- quit: I440r (Read error to I440r[purplecoder.com]: Connection reset by peer) 00:27:54 --- join: aaronl_ (aaronl@vitelus.com) joined #forth 00:29:32 --- quit: dired (Ping timeout for dired[vitelus.com]) 00:29:40 --- quit: aaronl (Ping timeout for aaronl[vitelus.com]) 00:33:17 --- join: dired (aaronl@vitelus.com) joined #forth 00:33:33 --- quit: aaronl_ (Read error to aaronl_[vitelus.com]: EOF from client) 00:35:20 --- join: aaronl (aaronl@vitelus.com) joined #forth 01:04:17 --- join: aaronl_ (aaronl@vitelus.com) joined #forth 01:05:07 --- quit: dired (Ping timeout for dired[vitelus.com]) 01:05:08 --- join: dired (aaronl@vitelus.com) joined #forth 01:05:42 --- quit: aaronl (Ping timeout for aaronl[vitelus.com]) 04:46:46 * aaronl_ is away: nighty nighty 06:10:47 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 06:10:57 hola 06:11:44 you know what pisses me off.. there's nothing on chuck moore's stuff on the web 06:15:45 i saw that brodie's forth books are no longer in print? 06:16:22 * klooie is looking for good learning material. 06:17:09 thinking forth is available on amazon.com but starting forth isn't so it's probably out of print.. 06:17:20 you could probably get starting forth at your library though 06:17:30 my public library has it 06:18:33 hmm, my experience with .nl public libraries is not very good. 06:19:24 you could also get "forth programmer's handbook" .. i dunno 06:19:42 go to your library online catalogue and check at least.. 06:19:44 that's how i checked 06:19:57 * klooie nods. 06:20:44 there's only 2 forth books on amazon.com! :( 06:20:47 any book on forth programming is better than none, but i always like to get those that are widely considered to be amoung the best. 06:21:54 i could get the "starting forth" from the library, tell them i lost it, and pay for it ;) 06:22:05 heh. 06:22:27 but that wouldn't be very nice for any other forth coders that want to read the book in my area 06:23:46 i want to meet other forth coders in my area.. that'd be cool :) 06:25:34 :) 06:26:18 i'm still reading introductory things, but i'm impressed. 06:26:34 what are you reading? 06:26:45 the BNF-like parser linked from forth.org in almost no code at all blew me away. 06:26:50 heh 06:26:53 yeah :) 06:27:19 well, i read part of the info that comes with gforth. 06:27:48 i did the arithmetic and dup swap rot etc. exercises. 06:28:12 it dives a bit too quickly into the looping constructs after that. 06:28:46 hmm.. 06:29:02 so if you know of a good tutorial, please tell me. :) 06:30:20 _Starting Forth_ doesn't cover ANS Forth. 06:30:47 so? :) 06:31:20 I have Starting Forth, Thinking Forth, Forth Programmer's Handbook, Forth Application Techniques, and a few others. 06:31:24 klooie: hm, what gforth stuff are you reading?? 06:31:44 trey: thinking forth has ANS stuff right? 06:31:58 klooie: url maybe? 06:32:17 Neither of Brodie's books cover ANS Forth. 06:32:19 the gnu info that comes with the gforth .tar.gz, futhin. 06:33:51 is the programmer's handbook fit for learning the language, Trey? 06:34:55 klooie: not really. I'd consider it more of a reference than a tutorial. 06:35:04 klooie: forth is kind of easy to learn, i coded a forth program without even looking at any intros. i had a list of primitives and help on each primitives.. 06:35:18 klooie: do you know what a MUD is? 06:35:35 yes, a list of primitives would be a big help. 06:35:48 there's no syntax to be stuck on. ;) 06:35:49 Forth, Inc.'s Application Techniques serves as a good tutorial. 06:35:51 dired, MUF 06:35:52 MUF is probably MUF - Multi-User Forth. It is an online programming language for TinyMUCK which is a MUD. It is a fairly cool way to start learning a Forth. 06:36:07 heh. 06:36:12 i started with MUF.. it was easy to use 06:36:21 and had good help 06:36:48 like you type "man primitives" for list and "man " for help on that primitive 06:37:11 that sounds very helpful. 06:37:33 klooie: check http://www.softsynth.com/pforth/pf_tut.htm and http://www.geocities.com/SiliconValley/Bay/2334/4thtutor.htm 06:38:44 you don't really need an intro.. just know how the stack works, and have a list of primitives and help on each... 06:38:50 * klooie nods. 06:40:37 trey: know where to get a list of primitives with basic help on each primitive/ 06:40:46 ? 06:41:05 That depends heavily on the system. 06:41:17 Most system these days follow the ANS standard for words. 06:41:33 that second tutorial link is very nice futhin. 06:41:51 You can either get a copy of the standard, or one of the tutorial books. 06:42:07 You can find the ANS Forth standard on-line. Google for it. 06:42:25 dired, dpANS? 06:42:25 trey: no idea 06:42:34 dired, ANS? 06:42:34 bugger all, i dunno, trey 06:42:43 www.google.com 06:43:13 i'm just talking a basic core list of primitives.. like 50 primitives 06:43:32 dired, ans 06:43:32 futhin: excuse me? 06:43:43 dired, dpANS is http://www.taygeta.com/forth/dpans.html 06:43:43 OK, Trey. 06:44:21 You can find the CORE word list in dpans.html 06:44:28 Or linked from there, anyways. 06:45:18 http://www.taygeta.com/forth/dpans6.htm <- The CORE word set. 06:46:50 trey: what are your opinions on the ANS standard? 06:48:05 It works great for its intended purpose. However, I don't believe all Forths must conform to it. 06:49:10 what is it's intended purpose? portability? hah! code reuse? hah! ;) 06:49:44 hmm. i don't really like dpans6.htm.. the MUF man was cooler :) 06:50:03 I think of it as roughly the equivalent to C's standard library. 06:50:46 trey: have you read the thoughtful programming on ultratech? 06:50:58 I don't recall, futhin. 06:53:40 starting forth is out of print right? 06:53:49 As far as I know, yes. 06:53:58 how'd you get yours? 06:54:09 From a friend. 06:54:20 heh 06:54:31 i can't compete with that :) 06:54:45 I got SF and TF from him, as well as a second copy of Threaded Interpreted Languages. 06:55:48 cool.. did he have multiple copies of SF/TF? or was he getting out of forth? 06:56:24 He had investigated Forth some years ago and never did anything with it. I got them when he cleaned out his bookshelf. 06:56:34 ah 07:02:37 sweet hookup 07:02:53 could you scan sf/tf and send to me? :) 07:03:05 heh 07:03:10 got a scanner? :) 07:03:33 Yes, I have a scanner. No, I won't scan it and send it to you. 07:03:49 how unsurprising. :) 07:04:12 boo hoo! 07:04:27 damn! :( 07:04:41 it's out of print.. it's perfectly legal to scan it :) 07:05:32 heh, copyright lasts as long as mickey mouse. 07:06:36 mike abrash put his graphics programming black book online. it's got lots of stuff on optimizing code, and coding in assembly etc. the "graphics" part of the title is misleading 07:07:24 that's a good book, i wrote a few demos when it was recent. 07:07:53 i downloaded the book, got up to chap 10 and stopped 07:08:03 read up to chap 10 07:13:38 ooh 07:13:43 i like the circular stack 07:15:20 forth 'then' is funny. 07:15:29 yeah 07:15:34 think of it like 07:15:39 if 07:15:42 then 07:15:52 * klooie nods. 07:16:06 hm 07:16:13 then as "afterwards", not as specifying a consequent. 07:16:19 --- join: muppie (kermit@202.58.130.77) joined #forth 07:16:24 i read something that told me how to think of the "if then" and it fixed my conceptual problems 07:16:29 i understand, but it's funny. 07:16:37 hey mup. 07:17:42 kloo I need your advice 07:18:15 aye, in private shall we? 07:18:22 advice on forth? 07:18:33 personal advice :) 07:18:38 i think muppie stalked me here. 07:18:47 yup :) 07:18:56 * muppie always stalks on klooie 07:19:05 bah.. if you need advice, you can get it at http://tuxedo.org/~esr/writings/sextips/ 07:19:11 heh. 07:19:23 that's the page "geek sex tips" 07:19:32 it's actually pretty good 07:19:47 heh thanks but I need a more 'friendly' advice 07:20:05 --- join: JALH (admin@heinlein.openprojects.net) joined #forth 07:20:09 nonononono! get your sex advice! 07:20:11 moo 07:20:15 moo jalh 07:20:18 you a forth coder? 07:20:27 hey jalh, anxious to learn another nice language? 07:20:35 hehe 07:20:37 what is forth ? 07:20:42 a nice & clean & tight language 07:20:46 something to do aith AI I suppose 07:20:49 forth is low fat computing. 07:20:52 naw 07:21:03 na 07:21:05 thats perl 07:21:08 * JALH runs like hell 07:21:09 it isn't just AI stuff.. it's just about everything else 07:21:13 perl is fat! 07:21:28 forth can pretty much do what C and Lisp do 07:21:56 jalh: learn forth first :) 07:22:21 I know C and perl ;) 07:22:33 C and perl both suck :) 07:22:50 depends how well you know them 07:22:52 i know asm, c++, and i'm starting forth.. 07:23:04 I made an ogg player at the weekend in perl which was 40 lines 07:23:11 (linking to libvorbisfile) 07:23:26 so.. :) 07:23:39 i wrote a c compiler just now by wrapping a shell script around gcc! 07:23:45 * klooie giggles. 07:24:06 perl and forth have different target audiences. 07:24:08 hehe 07:25:54 replace C with forth 07:27:17 --- nick: JALH -> venickserr 07:27:24 --- quit: venickserr (Killed (NickServ (GHOST command used by venickserr))) 07:27:27 --- join: JALH (admin@heinlein.openprojects.net) joined #forth 07:27:27 --- quit: JALH (Read error to JALH[heinlein.openprojects.net]: EOF from client) 07:29:30 heh 07:43:11 Forth compiles into binary ? 07:45:11 --- join: grurp (grurp@pc19959.batc.tec.ut.us) joined #forth 07:48:15 problem with forth is there's no windows tools around 08:04:28 muppie hu ? 08:04:46 explain that :) 08:04:56 never mind hehe 08:05:01 I am reading about forth now 08:05:20 i believe it's a interesting language 08:05:26 i'm learning it atm 08:05:51 : prn 0 do dup c@ emit 1+ loop drop ; 08:05:53 :D 08:11:06 --- quit: muppie () 09:06:18 --- quit: grurp (zelazny.openprojects.net farmer.openprojects.net) 09:06:18 --- quit: nopcode (zelazny.openprojects.net farmer.openprojects.net) 09:06:19 --- quit: Trey (zelazny.openprojects.net farmer.openprojects.net) 09:06:19 --- quit: nate37 (zelazny.openprojects.net farmer.openprojects.net) 09:07:16 --- quit: klooie (zelazny.openprojects.net sagan.openprojects.net) 09:07:16 --- quit: aaronl_ (zelazny.openprojects.net sagan.openprojects.net) 09:07:16 --- quit: dired (zelazny.openprojects.net sagan.openprojects.net) 09:13:20 --- quit: futhin () 09:13:39 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 09:27:54 --- join: Trey (Baxter@ns.TreySoft.com) joined #forth 09:27:54 --- join: nate37 (nate@cx83983-d.irvn1.occa.home.com) joined #forth 09:27:54 --- join: nopcode (yap@p3E9BFD65.dip.t-dialin.net) joined #forth 09:27:54 --- join: grurp (grurp@pc19959.batc.tec.ut.us) joined #forth 09:27:54 --- join: dired1 (aaronl@vitelus.com) joined #forth 09:27:54 --- join: aaronl_ (aaronl@vitelus.com) joined #forth 09:27:54 --- join: klooie (kloo@213-84-79-23.adsl.xs4all.nl) joined #forth 09:27:54 --- join: cleverdra (jfondren@1Cust157.tnt3.florence.sc.da.uu.net) joined #forth 09:27:54 --- mode: farmer.openprojects.net set mode: +ooo Trey nate37 nopcode 09:28:19 The code above uses a trick I learned recently. Even though typical C ignores the fact that argv is an array of pointers to parts of a single string, you can by looking at the next array get ... oops! I didn't account for the 0-byte above. 09:28:59 --- quit: grurp (varley.openprojects.net farmer.openprojects.net) 09:28:59 --- quit: nopcode (varley.openprojects.net farmer.openprojects.net) 09:29:00 --- quit: Trey (varley.openprojects.net farmer.openprojects.net) 09:29:00 --- quit: dired1 (varley.openprojects.net farmer.openprojects.net) 09:29:00 --- quit: aaronl_ (varley.openprojects.net farmer.openprojects.net) 09:29:00 --- quit: klooie (varley.openprojects.net farmer.openprojects.net) 09:29:00 --- quit: nate37 (varley.openprojects.net farmer.openprojects.net) 09:29:01 --- quit: cleverdra (varley.openprojects.net farmer.openprojects.net) 09:29:26 --- join: Trey (Baxter@ns.TreySoft.com) joined #forth 09:29:26 --- join: nate37 (nate@cx83983-d.irvn1.occa.home.com) joined #forth 09:29:26 --- join: nopcode (yap@p3E9BFD65.dip.t-dialin.net) joined #forth 09:29:26 --- join: grurp (grurp@pc19959.batc.tec.ut.us) joined #forth 09:29:26 --- join: dired1 (aaronl@vitelus.com) joined #forth 09:29:26 --- join: aaronl_ (aaronl@vitelus.com) joined #forth 09:29:26 --- join: klooie (kloo@213-84-79-23.adsl.xs4all.nl) joined #forth 09:29:26 --- join: cleverdra (jfondren@1Cust157.tnt3.florence.sc.da.uu.net) joined #forth 09:29:26 --- mode: farmer.openprojects.net set mode: +ooo Trey nate37 nopcode 09:29:41 hm ic 09:29:55 cleverdra i'm just trying to learn forth on the ficl platform 09:30:07 do you know how to enter float literals there ? 09:31:07 No, I don't know about ficl. 09:31:26 Typical float literal syntax is 100.0e0 -- try that 09:31:37 You might also have to prepend the numbers with '%'. maybe. 09:32:00 ok> 100.0e0 f. cr 09:32:00 100.000000 09:32:05 cool it works, thanks :) 09:33:00 100.0000 does NOT put a float on the stack. 09:33:10 sure not 09:33:12 Trey - I think that's ficl output 09:33:19 Ah, ok. 09:33:39 what do you guys think of having forth as a scripting language in games ? 09:33:46 * Trey likes the idea. 09:34:00 i want to extend quake in that direction 09:34:05 Forth is used as such in games already, nopcode. 09:34:19 cleverdra but not in mainstream games where i want to plug it in 09:34:30 quake3, age of empires, starcraft 09:34:35 all without scripting support for the user 09:34:50 nopcode: in TinyMUCK, forth is used as the online programming language.. 09:34:53 it's pretty cool 09:35:11 futhin hey, re :D 09:36:19 re :) 09:36:30 some split happened, everybody left except me and clog 09:36:38 is there a way to tell ficl to write down words that i author for dumping them to a source file later ? 09:36:53 why aren't you guys using varley.openprojects.net? grr :) 09:37:11 Why should we be, futhin? 09:37:39 nop - write down words how? Their source as you enter them? 09:37:59 cleverdra yep 09:38:07 cause varley is the best :) 09:38:23 cleverdra so i can do something like interactive engineering 09:38:30 how do you save all the stuff you type in the interpreter? 09:38:43 see there 09:38:50 it was zelazny's fault! :P 09:39:23 cleverdra i believe that forth would be the ideal language to develop cheats 09:39:34 nop - hack a frontend for ficl that logs all input to a file. gforth does that, and I use its logfile in the same way you suggested. I didn't know about it, so one day I look up and I've 10 megabytes of code I'd written and forgotten about -- some interesting =) 09:39:40 as you can interactively try out your stuff 09:39:56 Just write and develop your program, and when you're done extract it from the log. 09:40:11 hehe, well i'm planning to run it over a tcp connection 09:40:25 run the environment together with the game locally and have the forth console on my 2nd machine 09:40:32 there i could do the logging then 09:40:38 nopcode: check to see if ficl has words to save the dictionary. 09:40:57 trey i don't want to save the dictionary, there is no source there :) 09:41:09 Yeah. Many systems have basic ability to save the state of the system and restore it later -- some save the state as a new program. 09:41:19 Ficl can reconstruct the definition from the dictionary entry. 09:41:24 Try: see someword 09:41:35 nopcode - well, depending on your threading system the only thing the dictionary doesn't have is readable literals and comments. 09:42:05 what's some quick code to save everything that was typed to a file? 09:42:16 cleverdra well i'd want to have the stuff in the same way i entered it 09:42:22 (and, depending on your threading system, sometimes it has these =) -- there's an ANS Forth debugger that works by compiling the source of your programs into the dictionary. It's neat in a hackish sort of way) 09:42:47 hehe 09:43:10 cleverdra i have some questions about memory allocation 09:43:10 nop - yeah, a simple logger of input would do that 09:43:27 What kind of memory allocation? There are two kinds under most systems. 09:43:33 if i wanted to work with a linked list, wouldn't i be limited by only using the heap ? 09:43:46 if i wanted to allocate and remove elements anytime 09:44:05 no matter what is between the element and HERE 09:44:21 In a linked list, distance between the elements is irrelevent. 09:44:37 of course it is 09:44:48 but if i have the element and then shitload of other stuff on the heap 09:44:56 i cant remove it. 09:45:06 You *could* do calculations on the space left in 'here' at runtime to try and keep the lists in dictionary space, but you might as well allocate chunks at a time for it. 09:45:24 nopcode: you aren't supposed to have a shitload of stuff on the stack? :) 09:45:34 futhin - he means in memory, I think. 09:45:39 cleverdra the problem is that memory on the heap gets fragmented !" 09:45:55 So? 09:45:59 if i have cells "a b c" on the heap 09:46:07 i can only remove the last one 09:46:26 by doing sth like -1 cells allot 09:46:34 i am evil.. i am downloading the entire ultratechnology site onto my comp 09:46:36 nopcode - yeah, your dictionary won't suffer but it's difficult without critical assumptions to fix that. 09:46:44 nopcode - just use dynamic allocation, and put chunks at a time to your lists. 09:46:56 dynamic allocation ? 09:46:59 futhin - ooh, good idea. I lost most of their files recently. 09:47:27 cleverdra: you downloaded their files? 09:47:28 nopcode - yeah, 'allocate' and such to get a memory space outside of the dictionary space. 09:47:44 cleverdra dictionary space == heap space ? 09:47:47 futhin - most of the documents on dindex.html 09:48:34 nopcode - I'm not quite sure how the terminology maps here... 09:48:59 clevedra heap allocation would be ALLOT for me 09:49:11 nopcode - most Forth systems, ficl may be different, give themselves a chunk of memory from the system and put stacks and dictionary space at opposing ends of it. 09:49:14 cleverdra: want me to zip it all up and send you? 09:49:58 cleverdra ic 09:50:07 nopcode - OK, allot is just moving HERE upward in probably static space. ALLOCATE would give you memory space unattached to what you call heap space. 09:50:27 futhin - no thanks, I've a simple program that will safely get everything for me. 09:50:47 is it a forth program? :) 09:50:58 i used some freeware windoze program.. 09:51:02 cleverdra "4 cells allocate" puts an address and a 0 on the stack 09:51:09 cleverdra whats that zero good for ? 09:51:09 it took quite some time just to download 2 megs of pages 09:51:10 No, it's 'wget'. There is a windows port of it. 09:51:28 er.. 9 megs of pages 09:51:46 nopcode - that zero means that there were no errors. Idiom is to put a 'throw' after it. 4 CELLS ALLOCATE THROW 09:51:57 you sure you don't want the 6 meg zip file? :) 09:52:18 cleverdra ok. whats the word for freeing that block ? 09:52:30 heh 09:52:32 nop - FREE 09:52:39 k 09:52:44 great :D 09:52:59 but back to the heap... should it be used as the stack is used in c ? 09:53:05 for local variables of functions ? 09:53:14 the ultratech site is ugly as hell and a pain to navigate.. they should simplify it :) 09:53:34 so that every function that needs it allots a block and reverses that allocation on function terminaton ? 09:53:48 nopcode - please define HEAP. Do you mean the dictionary/stack space? 09:54:28 the space that here points to 09:54:30 futhin - really? I didn't notice. 09:54:52 here points at different things in different systems. 09:55:08 trey but i define the memory space that here points to as heap 09:55:12 no matter what the system (: 09:55:22 HERE != heap. 09:55:30 you are talking about the system stack in memory 09:55:31 trey i didnt claim that 09:55:34 HERE == growable data segment. 09:55:48 like the system stack that C uses.. 09:55:50 ? 09:56:03 ALLOCATE and FREE work like malloc() and free() in C. 09:56:14 trey sure i got that idea 09:57:27 Words like , and C, work with HERE. 09:58:00 --- quit: grurp (Bye all) 09:58:05 sure. still looks like a heap with a pointer to me 09:58:22 nopcode - give us an example word with local variables in it that you'd like to put in the the dictionary space 09:58:55 cleverdra uh, i can try 09:59:47 : foo here 0 256 0 do dup c, 1+ loop drop bar ; 10:00:31 that would fill an array with the set of ascii 8 bit characters 10:00:36 and pass that on to the function bar 10:01:14 : foo here 0 256 0 do dup c, 1+ loop drop bar -256 chars allot; 10:01:23 i forget to de-allocate it 10:01:31 Oh, so it ends at bar? 10:01:39 You forgot to allot it, too =) 10:01:47 nope didn't 10:01:48 c, 10:01:53 Oh, duh excuse me. 10:03:01 You realize that this word also... nevermind. 10:03:19 so i have this now 10:03:26 : bar . ; (just for testing) 10:03:28 and 10:03:29 : foo here 0 256 0 do dup c, 1+ loop drop bar -256 chars allot ; 10:04:07 so that functions use the heap for local storage that is only needed in this function or other functions later in the call chain 10:04:14 because that's exactly what c does 10:04:16 Yeah, there's no reason to move that to ALLOCATE. 10:04:23 no, not at all 10:04:41 but i'd want to know if that is the usual and proper way to use use c, / allot / whatever ? 10:06:02 In this exact instance something like this would probably be better: 10:06:03 Well, you can use them that way. 10:07:43 create tarray 256 allot : array< [ tarray 255 + tarray ] literal literal do dup c! 1+ loop bar ; 10:07:47 we need more forth code examples on the net.. to show how to use specific words, etc 10:07:56 err, 'i c!' 10:08:01 cleverdra i dont know half of the words you used there :D 10:08:20 create stores "here" in "tarray" right ? 10:08:34 nopcode - 'create tarray 256 allot' just makes a space for 256 characters. It's a static-length array in memory. 10:08:37 yeah, and literal always confuses me because i think it's talking about literal english! 10:08:44 nopcode - no, create builds a word named 'tarray' in the dictionary. 10:08:46 futhin... 10:09:00 cleverdra with the value of here ? 10:09:26 nopcode - yeah, TARRAY will return HERE at the time of its compilation 10:09:26 <-- he is a hyperactive lad 10:10:10 cleverdra ok thats what i mean 10:10:16 array< ? 10:10:43 '[ tarraty 255 + tarray ] literal literal' puts the ending address and the beginning address of TARRAY right in the definition of ARRAY< for speed, so that DO-LOOP will operate over the indexes of addresses. 'i' then is the current address in TARRAY. 10:10:55 --- join: edrx (edrx@200.240.18.58) joined #forth 10:11:02 'array<' is just the word I used. I don't it's a really good name. 10:11:26 create tarray 256 allot : array< [ tarray 255 + tarray ] literal literal do dup c! 1+ loop bar ; 10:11:28 hmm 10:11:31 lemme think 10:11:46 no, there's an 'i' before the c! 10:12:07 create tarray 256 allot : array< [ tarray 255 + tarray ] literal literal do dup i c! 1+ loop bar ; 10:12:10 Yeah 10:12:23 where does the "i" come from ?! 10:12:50 DO-LOOP keeps its count on top of the return stack -- um, usually. I returns the count. 10:13:42 nopcode: and J returns the limit 10:13:51 edrx ic 10:14:24 edrx - it does? I've never used it, but I thought that it was for nested DO-LOOPs 10:14:25 you could use tarray 255 + tarray do .... instead of this, right ? 10:14:57 cleverdra: leeme check the docs, I'm in doubt now... 10:15:01 nopcode - yes, but that'd be silly since TARRAY's location is static and defined and you'd be calculating it's location and length at runtime if you do that. 10:15:24 edrx - gforth I remember had 'k' for triply-nested DO-LOOPs 10:15:29 cleverdra so what do those [] brackets do ? 10:16:06 nopcode: they change from compilation mode to interpreted mode 10:16:32 nopcode - those change STATE. When you do '[ tarray 255 + tarray ]' you switch from compiling to interpreting, put two numbers on the stack, and switch back to compiling. 'literal literal' compiles those numbers into the word, so they'll be put on the stack at execution time 10:16:37 nopcode: tarray 255 + tarray is executed at that moment 10:17:18 nopcode - it's a form of compile-time optimization. You *know* that the numbers will be the same always, and you've enough information to compile them into the word, so why not compile them into the word? =) 10:17:40 ok literal takes cells from the stack and puts them as constants in the bytestream ? 10:17:57 Yes... 10:18:00 woa 10:18:09 i've never seen anything like that in another language 10:18:16 * nopcode starts to like forth 10:18:47 :) 10:19:06 * klooie is still playing with looping constructs. :) 10:19:08 If you read some of Chuck's stuff, you'll hear him talk about design-time, edit-time, compile-time, and run-time. 10:19:26 The point in optimization is to move operations from the latter to the former, as far as you can go =) 10:19:29 klooie: how so? all you need to know is BEGIN..WHILE..REPEAT and DO..LOOP 10:19:50 cleverdra hey, ok. there is interpretation state and compilation state. anything else ? 10:20:13 futhin - there's a bit more than that... you can build arbitary looping contructs in Forth with little trouble. 10:20:15 exactly so, futhin. 10:20:34 nopcode - anything else? I'm not sure what you're asking. 10:20:57 nopcode - oh! Don't be tempted to create that words that do different things depending on STATE. 10:21:00 nop: naw.. ICE = interpreted, compile, execute 10:21:07 J does not return the limit. I' returns the limit. 10:21:20 Thank you, Trey. I didn't know about I' 10:21:39 i see 10:21:50 (hmm. I' may only apply to certain systems) 10:22:24 Oh, it probably does. I'm still thinking right now of what use it could be. 10:23:03 am i doing something wrong or why doesnt "char . emit" work in a compiled loop ? 10:23:19 : badword STATE @ if ." Compiling" else ." Interpreting" then ; -- or maybe I've got those backwards. I've never used STATE in practice. 10:23:36 nopcode - what do you expect that code to do? 10:23:47 For non-nested loops, OVER will get you the limit. 10:24:10 cleverdra : foo 5 0 do char . emit loop cr ; 10:24:24 does not emit 5 dots but hangs my ficl :) 10:24:26 Hmmm. 10:24:31 nop - I'd repeat my question, and should, but I'll just guess that you want it to emit a '.' =) 10:24:40 yeah 10:24:41 nop - use [char] or [ char ] 10:24:55 i could use [ char . ] literal 10:24:56 right ? 10:25:04 nop - CHAR works at compile-time, see? It reads from the input stream 10:25:21 yes, that latter is what I meant. [char] is an abbreviation of it, say. 10:25:31 cleverdra it doesnt work in compile time without [] here 10:25:42 silly me (: 10:25:42 nopcode - sorry, I meant runtime. 10:25:54 ok but why does it hang my system at compiletime ? 10:26:04 no stuff to parse for it ? 10:26:08 nopcode - because CHAR works at runtime =) 10:26:15 hey ok (: 10:26:22 nopcode - let me break this down.. 10:27:11 so "literal" is a compiletime word as well that gets more or less "replaced" by the top cell from the current runtime stack ? 10:27:23 : foo char . emit ; "switch STATE to compiling and create a word in the dictionary named FOO. compile CHAR into the word. compile . into the word. compile EMIT into the word. switch STATE back to interpret and do some other word-ending stuff" 10:28:17 : foo [char] . emit ; "switch STATE to compiling and create a word in the dictionary named FOO. execute [CHAR] -- which compiles the ASCII code of '.' as a literal in the word. compile EMIT into the word. switch STATE back to interpret and do some other word-ending stuff" 10:28:35 oh wait 10:28:51 whats the difference between [char .] and [char] . ? 10:28:54 i used the first form 10:28:56 [char] is an immediate word, which means that it is always executed unless you do some parsing of the input stream to keep the outer-interpreter from working on it. 10:29:14 nopcode - well, [char .] is the the two words [char and .] 10:29:37 cleverdra char is a parsing word - right ? 10:29:42 nopcode - '[ char . ] literal' will do exactly the same thing as '[char] .' 10:29:59 [char] parses at compile time, CHAR parses at run time. 10:30:13 nopcode - yeah, when the first word 'foo' above is executed, it executes CHAR and CHAR tries to read from the input stream 10:30:35 nopcode - the second foo doesn't have [CHAR], it only has the literal number that [CHAR] compiled. 10:31:43 but why is '[ char . ] literal' the same as '[char] .' ? 10:32:06 nopcode - here. In Forth there is a class of words called 'immediate' words that the outer-interpreter executes even when STATE is set to compiling. "; [ [CHAR] if then" are five such words. There are more, including all control-flow words. 10:32:51 hm ok 10:33:19 nopcode - [CHAR] could be defined as ": [char] char literal ; immediate" 10:33:56 So when "[char] ." is come upon, CHAR sees "." in the input stream and puts its ASCII value on the stack, and LITERAL compiles that number into the dictionary. 10:34:34 uhm 10:34:57 is it uncorrect to just stay with [ char . ] literal ? 10:35:49 oh 10:35:51 hey wait 10:35:58 [char] is another _word_ ? 10:36:10 Yeah. What did you think it was? 10:36:15 damn :D 10:36:47 clevedra a bracketed "char" :) 10:37:05 You can stay with '[ char . ] literal' if you want, you'll just be typing more than you have to :/ Eventually, when your code has a bunch of these, you'll get the bright idea of factoring those constructs into a word -- it's called [CHAR] =) 10:37:17 (: 10:37:32 --- quit: edrx (Ping timeout for edrx[200.240.18.58]) 10:40:44 the difference between "[ n ] literal" and "n" (if n was a variable) would be that the first form always uses the value that n had at compiletime while the second form always uses the current value of n, right ? 10:42:40 The first form compiles a number into the dictionary and the second form executes a word 'N' at runtime. 10:42:59 cleverdra yeah ok 10:43:10 just wanted to make sure i got the idea halfway right 10:43:16 "[ BASE @ ] ." and "BASE @ ." are quite different, if that's what you're asking 10:43:28 what is "base" ? 10:43:58 the number base. If you print it, it's always "10", but it might be "10" in binary or "10" in hexadecimal or "10" in base-22 =) 10:44:30 ok> base . cr 10:44:30 22091044 10:44:31 : .bin base @ 2 base ! swap . base ! ; 10:44:40 nopcode - sorry, it's a variable. 10:44:49 oh ic 10:45:24 ahh i get the idea :D 10:45:32 Try that word I just defined. 10:46:08 it underflows :) 10:46:55 ah ok sorry 10:46:57 yeah works (: 10:47:13 Sorry, I don't commonly use stack comments. I guess I should here. 10:47:27 : .bin ( n -- ) base @ 2 base ! swap . base ! ; 10:47:31 yeah (: 10:47:54 "[ BASE @ ] ." and "BASE @ ." are quite different, if that's what you're asking 10:47:56 back to that 10:48:07 "[ base @ ] ." does what ? 10:48:17 it puts the base value on the runtime stack 10:48:33 There's no "runtime stack". There's only one stack. 10:48:47 the data stack, I mean. Nevermind. 10:48:49 but . gets the value later, when executing the function 10:48:49 so whats the idea there ? 10:49:01 no, '.' never gets the value 10:49:10 Because you never compile it into the word, see? 10:49:24 * cleverdra scrolls up. 10:49:25 hu ? 10:49:34 I'm sorry. I should've had LITERAL before '.' 10:49:54 yeah ok then 10:49:59 :D 10:50:03 The difference there is that, in the first, you'll always have whatever the base was when the word containing that was compiled. In the second, you'll get whatever BASE is when the word is executed. 10:50:04 i love this language 10:50:12 ok, understood 10:53:44 oh, just to be helpful: 10:54:20 : foo 10 0 do base @ i * . loop ; is BAD. Do you see why? 10:55:06 sorry i was phoning 10:55:08 lemme look 10:56:07 nope, it should work like that 10:56:14 producing 10, 20, 30 ... for decimal 10:56:40 yeah it does 10:56:40 whats bad about it ? :) 10:56:42 yeah, it works, but it's BAD. 10:57:01 why is that ? 10:57:10 OK. What's bad about it is that, even though BASE is the same throughout the execution of the word, it fetches the value of BASE 10 times =) 10:57:42 ohhh 10:57:53 hey :D 10:57:57 : foo base @ 10 0 do dup i * . loop drop ; is better. 10:58:18 hm ic 10:58:52 k i gotta watch a short report on tv 10:58:59 bbl 10:59:01 thx for all the help 11:00:07 --- quit: cleverdra (Leaving) 11:15:20 back (: 11:23:56 --- quit: nopcode (Leaving) 11:26:37 --- join: grurp (grurp@pc19959.batc.tec.ut.us) joined #forth 11:56:18 grurp! 11:56:36 klooie! 11:56:40 futhin! 11:56:57 futhin needs a life. 11:58:12 a life? i've got a life. let's see.. i stay inside my cave all day.. 11:58:23 it's a kickass life! 11:59:25 do you have a life?! 11:59:47 does forth have a syntax or not?! 12:00:04 Yes, I have a life. Forth doesn't have syntax. 12:00:09 i tried telling somebody forth has no syntax.. and he disagreed 12:00:36 what is syntax? 12:00:38 Well, it does have "words" separated by "white space". 12:01:19 After that, the immediate words impose what little "syntax" it has. 12:01:35 eh? 12:02:20 what immediate words 12:06:40 : ; [char] if then do loop 12:06:56 Words like those. 12:16:33 ya know i saw some code where the ; came in two places in the word.. it was weird.. can you explain that? 12:17:21 ColorForth allows that. 12:18:04 Just a sec... 12:18:53 so ; has a different meaning in color forth? 12:20:22 http://pringle.sphosting.com/flux2.html 12:21:55 --- join: cleverdra (jfondren@1Cust206.tnt3.florence.sc.da.uu.net) joined #forth 12:22:08 hola 12:22:46 buenos dias 12:26:55 colorforth seems pretty cool 12:27:08 tail-end recursion.. 12:27:43 tail-call optimizaiton, yeah. 12:28:18 You can do that in any Forth, really, by redefining ; and making the compiler a little smarter -- but Color Forth does it *well*, by design. 12:28:49 In Color Forth you also have cascading definitions, which are cool. 12:29:00 hm :) 12:29:25 If you want to play with Color Forth, check out Flux 12:29:28 dired, flux? 12:29:35 dired, what is flux? 12:31:52 futhin, look at pringle.sphosting.com 12:32:06 A new version was released recently =) 12:38:32 I haven't had a chance to do anything with it since he released it. 12:42:22 Neither have I, actually. Working with H3sm and eforthl. 12:42:49 Watch out, though -- his image goes to cylinder 14 or 15. 12:47:46 eforthl or eforth? 12:48:10 er 12:48:30 nm 12:49:15 eforthl 13:02:00 l=linux? 13:04:08 yes 13:27:15 --- quit: grurp (Read error to grurp[pc19959.batc.tec.ut.us]: EOF from client) 13:27:34 --- join: edrx (edrx@200.240.18.80) joined #forth 13:32:13 Does anyone know how .seq files came about, and what their significance is? 13:33:53 which system uses ".seq"s? 13:34:50 Not any system that I know of. Some people put their Forth source code in .seq files. 13:35:48 Lot of .seq files in ftp.taygeta.com/pub/Forth/FD 13:42:05 i want to see a wget in forth code... 13:44:07 futhin - I'll probably be writing one, soon, but it won't work outside of eForth+Linux 13:44:35 doesn't matter.. 13:44:58 Hah, then why don't you write one now? 13:45:05 heh 13:45:18 All you have to do is assume some basic networking words, document and mark them, and then write your code around them. 13:45:19 i don't know where to start.. i don't know how to interface with tcp/ip 13:45:41 i suppose i should take a look at win32for 13:45:53 futhin - see http://www.taygeta.com/forth.html 13:46:29 i took a look at swiftforth.. and there was some example code for sending email.. 13:46:55 and? 13:47:07 and i think i should be a little more familiar with forth first :) 13:47:34 cleverdra: how did you make eforth usable? The one I have only has direct kernel calls... 13:48:14 edrx - yeah, that's what I'm using. 13:48:40 well, Hohensee's cLIeNUX. I'm not sure how much he modified it. If at all, probably toward more syscalls. 13:52:18 edrx - what is your definitino of usable, there? 13:52:49 dired, fosm is at http://www.stejskal.de/web/computer/forth/_sources.html 13:53:07 dired, fosm is also a Forth Pattern Matcher, with some neat powers 13:53:15 dired, fosm is also a Forth Pattern Matcher, with some neat powers 13:53:17 dired1, fosm is also a Forth Pattern Matcher, with some neat powers 13:53:17 OK, cleverdra. 13:53:21 grr. 13:53:28 dired1, fosm is also at http://www.stejskal.de/web/computer/forth/_sources.html 13:53:28 okay, cleverdra. 13:56:17 cleverdra: hm... usable = that I understand well enough to extend conveniently? 13:57:07 * cleverdra shrugs. 13:57:40 Basic unix stuff is hard, right now. I'm working on it for cLIeNUX. 13:58:28 Well, not really hard. Getting arguments to the program is possible and you don't even (with some cleverness) have to walk the strings to get their lengths. 13:58:58 When I came in a few hours ago I wrote on-the-fly some words to do this, just for fun. I'll test the new version I came up with then later. 14:00:31 You can't easily use eForth as a "scripting" language. My solution for this is a 'forthfile' program that passes its arguments to eForth and then connects stdin to it, but I still need to do some hacking in eForth (to turn off 'OK' printing in such a case, for example). 14:01:46 A better solution to forthfile might be start-up code in eForth to automatically run some script -- which I could have do argument parsing, if I want that. Then forthfile would be just a copy of eforth that automatically loads some argument stuff. 14:02:57 for now, gforth is probably a better idea. The reason I'm not working with gforth is that it's much larger than eForth and so won't fit very nicely into the cLIeNUX core. 14:09:37 the "ok" thing is kinda annoying :) 14:10:04 Huh? Why? 14:10:57 i don't need it to appear everytime i hit enter.. 14:11:11 * cleverdra shrugs. 14:11:29 most languages have prompts. Forth has an acknowledgement. 14:11:58 i'm not really used to the interactive part, i've only coded that one MUF thing :) 14:16:16 The interactive part is the best =) 14:21:42 with muf/tinymuck you enter an editor, code the stuff out, compile, exit editor, run it. you could set the debug flag and then it would show what the stack looks like for each instruction.. pretty cool 14:22:45 Huhn. 14:30:46 here's an example of what the debug looks like.. 14:30:48 ebug> #165 44 ("hi", "dog", #51, 1, "lsprop;lsp", 4) PICK 14:30:48 Debug> #165 44 ("hi", "dog", #51, 1, "lsprop;lsp", "dog") STRINGCMP 14:30:48 Debug> #165 44 ("hi", "dog", #51, 1, 8) NOT 14:30:48 Debug> #165 45 ("hi", "dog", #51, 1, 0) AND 14:30:48 Debug> #165 45 ("hi", "dog", #51, 0) IF->line47 14:30:49 Debug> #165 47 ("hi", "dog", #51) JMP->line37 14:30:51 Debug> #165 37 ("hi", "dog", #51) 1 14:33:45 --- part: edrx left #forth 14:44:59 * aaronl_ is away: I'm busy 14:45:06 * aaronl_ is back (gone 00:00:03) 15:03:08 --- join: edrx (edrx@copacabana-ttyS16.inx.com.br) joined #forth 15:10:13 --- quit: edrx ([x]chat) 15:12:18 --- join: edrx (edrx@copacabana-ttyS16.inx.com.br) joined #forth 15:29:20 --- quit: cleverdra (Ping timeout for cleverdra[1Cust206.tnt3.florence.sc.da.uu.net]) 15:41:23 * Trey is away: life, etc. [17:41] 15:45:05 --- quit: edrx ([x]chat) 15:54:33 --- join: cleverdra (jfondren@1Cust20.tnt3.florence.sc.da.uu.net) joined #forth 16:00:52 --- quit: aaronl_ (The name's X. Bitch X.) 16:07:36 --- quit: futhin (bye) 16:13:53 --- join: aaronl (aaronl@vitelus.com) joined #forth 17:10:10 --- quit: cleverdra (Ping timeout for cleverdra[1Cust20.tnt3.florence.sc.da.uu.net]) 18:16:19 --- quit: klooie (Ping timeout for klooie[213-84-79-23.adsl.xs4all.nl]) 18:16:52 --- join: klooie (kloo@213-84-79-23.adsl.xs4all.nl) joined #forth 19:50:02 --- join: cleverdra (jfondren@1Cust49.tnt7.florence.sc.da.uu.net) joined #forth 19:59:43 Welcome back, cleverdra. 20:02:03 Thank you, Trey. 20:06:26 --- quit: klooie (Ping timeout for klooie[213-84-79-23.adsl.xs4all.nl]) 20:40:09 Someone ask a question on your mind. I'm waiting for someone. I'll try to answer. Won't that be fun? 20:52:39 cleverdra: describe Forth, but don't use any form of the verb 'be'. 21:01:05 --- join: edrx (edrx@copacabana-ttyS9.inx.com.br) joined #forth 21:02:57 Trey - is it OK if I use another language? 21:03:17 No, nevermind. 21:03:28 My answer to that is "Forth". 21:03:41 You used "is". 21:04:06 No, that's the wrapper of my answer, no the answer. My answer is just the word. That's my description. This is all meta-answer stuff. 21:04:39 The word "Forth" has no meaning in this context. 21:11:03 That's true, so I'm going to admit defeat. 21:11:17 Lame. 21:11:22 * cleverdra shrugs. 21:11:27 Do you have something non-tricky? 21:11:44 : Forth words blocks stacks ; 21:11:50 Duh. Excuse me. 21:12:48 Let me change the question a bit: Why do you like Forth? (you still can't use any form of 'be') 21:14:43 "I like Forth because of Forthian advantages" -- or does "because" count? 21:15:02 I'm not sure how to express my personal preferences in Forth. Let me see. 21:16:06 : why-like-forth? blocks stacks or words or deep extendability or reasontable + @ type ; 21:17:11 Does that work, Trey? 21:17:39 @ count type 21:18:33 I didn't intend for you to use the programming language Forth to write your reply, but I'll take it. 21:23:25 Maxtor recently released a 100GB disk drive for US$300. 21:24:12 --- part: edrx left #forth 21:24:15 In 1979, my dad paid $US15,000 for a 5MB drive the size of a dishwasher. 21:25:39 Yeah, isn't that nice? 21:26:04 I find it amazing. 21:26:47 $300 for 100GB disk, ~$300 for 1GHz CPU (less, probably), ~$300 for 1GB RAM. 21:32:39 * Trey prepares for bed. 21:32:43 * Trey is away: sleeping. [23:32] 22:18:53 --- join: I440r (mark4@purplecoder.com) joined #forth 22:19:01 hi clever! 22:19:06 aaronl 22:19:09 nate 22:19:12 trey 22:19:17 etc :) 22:20:08 hey 22:20:19 you missed dired 22:37:29 hello i440r, aaron =) 22:53:27 --- quit: cleverdra (Leaving) 23:41:43 --- join: klooie (kloo@213-84-79-23.adsl.xs4all.nl) joined #forth 23:41:53 * klooie wakes, rubs eyes. 23:59:59 --- log: ended forth/01.06.19