00:00:00 --- log: started forth/01.06.05 00:09:45 --- quit: futhin (Ping timeout for futhin[h24-67-113-99.cg.shawcable.net]) 00:14:16 --- join: edrx (edrx@copacabana-ttyS27.inx.com.br) joined #forth 00:15:17 --- quit: adu (Read error to adu[adsl-63-201-91-148.dsl.snfc21.pacbell.net]: EOF from client) 00:17:15 --- join: adu (andrew@adsl-63-201-91-148.dsl.snfc21.pacbell.net) joined #forth 00:35:30 --- quit: clog (Ping timeout) 00:35:30 --- log: stopped forth/01.06.05 00:35:49 --- log: started forth/01.06.05 00:35:49 --- join: clog (nef@bespin.org) joined #forth 00:35:49 --- topic: 'http://isforth.sourceforge.net -- http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/isforth/?cvsroot=isforth' 00:35:49 --- topic: set by ChanServ on [Sat Jun 02 11:57:30 2001] 00:35:49 --- names: list (clog adu edrx lar1 MrReach Trey aaronl) 00:35:57 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 00:57:34 anybody here? 00:58:35 somebody tell me what factoring means in forth? 00:59:20 yes 00:59:33 hey! 00:59:34 you write many small words 00:59:38 adu: hi! 00:59:47 ltnc 01:00:00 and your program becomes much cleaner 01:00:17 there was this sentence that doesn't make much sense to me 01:00:19 "Factoring also helps achieve the desired balance between memory use and speed for a given machine since memory and processing power are always finite. 01:00:25 hehe my pyvm never got finnished 01:02:57 does the sentence make any sense to anybody?? 01:02:58 futhin: seems like one of those sales blurb that are made to impress, not to say something concrete... 01:03:34 it doesn't make sense though 01:03:50 and the rest of the page does 01:04:11 so it's probably poor explaination rather than a sales blurb :) 01:04:33 factoring has nothing to do with memory use right :) 01:05:38 it saves memory when you can reuse the small words 01:06:09 it just makes things clarer when the small words are used only once 01:07:23 saves memory as in harddrive space or as in ram? :) 01:08:19 both 01:09:38 bah, memory use (harddrive wise) isn't really that important as compared to speed these days 01:11:36 --- quit: MrReach (Read error to MrReach[209.181.43.190]: Connection reset by peer) 01:12:36 --- join: MrReach (mrreach@209.181.43.190) joined #forth 01:12:50 futhin: nah, speed is not important these days, most things are fast enough. Programmer time is more important 01:12:55 * aaronl is away: Final exams 01:18:55 windows isn't fast enough 01:19:12 futhin: no one uses windows, forget about that 01:19:15 heh 01:21:51 --- quit: futhin (Read error to futhin[h24-67-113-99.cg.shawcable.net]: Connection reset by peer) 01:22:06 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 01:22:27 --- quit: MrReach (Read error to MrReach[209.181.43.190]: Connection reset by peer) 01:23:09 --- join: MrReach (mrreach@209.181.43.190) joined #forth 01:23:18 inefficiency fuels the planned obsolescence and forces people down the expensive upgrade path 01:23:27 there is no excuse for inefficient code 01:24:09 a pentium 75mhz with 8megs of ram should be an adequate system for almost everything (with the possible exception of some games) 01:24:26 well, if it was quick to write, and if you only wanted to run it once, or a few times... 01:25:28 true 01:26:05 forth code seems to be innately efficient code, as long as the coder doesn't fuck up too much :) 01:26:24 yes 01:26:38 I have to disconnect 01:26:40 bye 01:26:56 --- part: edrx left #forth 01:30:12 --- quit: adu (farmer.openprojects.net carter.openprojects.net) 01:30:59 --- join: adu (andrew@adsl-63-201-91-148.dsl.snfc21.pacbell.net) joined #forth 01:37:06 --- quit: futhin (Read error to futhin[h24-67-113-99.cg.shawcable.net]: Connection reset by peer) 02:26:39 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 02:39:04 night 02:39:06 --- quit: adu (Read error to adu[adsl-63-201-91-148.dsl.snfc21.pacbell.net]: EOF from client) 04:44:43 --- join: _MrReach_ (mrreach@209.181.43.190) joined #forth 04:44:52 --- quit: MrReach (Read error to MrReach[209.181.43.190]: Connection reset by peer) 04:47:58 --- quit: _MrReach_ () 06:50:42 --- quit: futhin (Ping timeout for futhin[h24-67-113-99.cg.shawcable.net]) 08:07:54 --- join: I440r (mark4@purplecoder.com) joined #forth 08:07:55 --- mode: ChanServ set mode: +o I440r 08:08:04 --- mode: I440r set mode: +o clog 08:08:07 --- mode: I440r set mode: +o lar1 08:08:10 --- mode: I440r set mode: +o Trey 08:08:13 --- mode: I440r set mode: +o aaronl 08:08:15 :P~ 08:08:26 ok.... i did my good deed for the day :) 08:16:32 Wheee! 08:18:43 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 08:18:49 huh 08:19:44 fux! damn computer crashed and i missed everything said while i was sleeping :( 08:20:09 You didn't miss anything. 08:20:17 well on the other chans too 08:20:20 like osdev? 08:20:26 or goos or tunes 08:20:43 You didn't miss anything in osdev, either. 08:20:45 i like to check to make sure if anything of interest was said 08:20:48 I can't help with the other ones. 08:20:52 heh, ok 08:21:21 is mr.reach gonna be back ? :) 08:23:04 trey: anything up? is the Forth with you? 08:25:20 I440r: how's the iforth project going? i'm not sure why you have a copy of the isforth kernel inside each compiled forth program?? 08:26:05 because when you write a forth program you dont realy write a forth program... 08:26:11 you write an extention to teh forth kernel 08:26:33 dunno about mrreach, he mite be back :) 08:26:35 i hope so 08:26:37 hrm. so forth is more of a interpreter? 08:26:37 him and bongo 08:26:49 bongo? is that the thing he's working on? 08:26:59 or a person? 08:27:06 no... bongo is another person i would like to see in here :) 08:27:12 ah :) 08:27:22 forth is more of an interpretor then? 08:27:23 yea,... wheres tcn :P 08:27:26 no 08:27:29 forth is a compiled language 08:27:37 you compile your sources into teh kernel basicaly 08:27:45 forth is both interpreted and compiled 08:27:47 then why the kernel? why not just compile forth straight into assembly? 08:28:04 thats called a native code compiler... 08:28:09 forth doesnt usually work that way... 08:28:21 im reserving judgement as to weather or not its a good thing 08:28:36 do other compilers do the same thing? like c compilers? do they just compile and extend the kernel? 08:28:44 one of the BIGGEST advantaqges to forth is that there is a 1:1 correlation between teh sources and the object produced 08:29:13 optimizingcompilers like native code forth compilers and c compilers destroy that correlation 08:29:14 brb 08:29:16 gotaa go do something 08:29:40 hrm 08:29:41 so you _could_ code a native code compiler. what's the advantage in having an extensible kernel? 08:31:18 futhin: Forth doesn't work like any language you've used. 08:31:41 hm, please explain it though :) 08:31:48 i'm pretty new to forth 08:32:20 Let's talk about the typical (historical) Forth first. 08:32:56 ok 08:33:39 A small program (historically called the outer interpreter) reads input and processes it. 08:34:18 The outer interpreter has two modes: interactive and compile. 08:34:52 * futhin nod 08:35:00 In interactive mode, the OI (outer interpreter) reads the input for the next space-delimited word. 08:35:41 Once it has parsed a word, it looks the word up in the dictionary (roughly the equivalent of a library for languages like C). 08:36:15 If it finds the word in the dictionary, it executes it immediately. 08:36:48 If it doesn't find the word, it attempt to conver the word to a number using the current number base. 08:37:04 attempts to convert 08:37:43 If the conversion succeedes, it pushes the number on the stack. If it fails, it prints an error message and clears the stack. 08:38:09 Pretty simple, eh? 08:38:20 yes 08:39:22 yup 08:39:30 .. 08:39:34 The word : (colon) puts the OI into compile mode. 08:40:26 It also reads a space-delimited word from the input (using some of the library routines, aka forth kernel), and creates a dictionary header for the new word. 08:41:11 Let's define a new word so you can follow along - : sum 1 2 + ; 08:41:28 ok 08:41:30 : grabs the word "sum" and creates a dictionary entry. 08:42:19 When in compile mode, the OI doesn't execute words immediately, it adds the code to execute those words to the definition. 08:42:32 yup 08:43:01 So the following "1" doesn't get pushed on the stack. Rather, code to push the value 1 on the stack gets added to the definition. 08:43:17 Same for the number 2. 08:43:40 Then the code for + gets appeneded to the definition. 08:44:10 A few lines ago, when I said the OI doesn't execute words immediately, I lied :-) 08:44:24 Some words have their "immediate" bit set. 08:44:50 The OI executes immediate words even when compiling. 08:45:08 eh? 08:45:22 so the stuff inside the word gets run while it's compiling it? 08:45:22 What did you miss? 08:45:25 No. 08:45:36 when it has the immediate set 08:45:41 Right! 08:46:25 ok, so if we have : sum 1 2 + ; as immediate, does that mean when it compiles it, the number 3 winds up on stack? 08:46:38 This ability to run code while compiling makes Forth different than most other languages. 08:46:49 No. 08:47:19 ": sum " starts a new word, entering compilation mode. 08:48:27 "1 2 " generates code to push these two values on the stack _when the word sum executes_. 08:49:02 "+ " generates code to add the top two values on the stack and push the result. 08:49:11 (now we get to the good part) 08:50:08 "; " executes immediately. It completes the definition of sum, and puts the OI back into interpreter mode. 08:51:09 When ; finishes, you can now type the word "sum" at the interactive prompt and have it executed. 08:51:20 yeah 08:51:57 The real power of Forth comes from the ability to create words which execute at compile time. 08:52:27 ok gotcha 08:53:12 does this have anything to do with why I440r is doing an extensible kernel thing? or what 08:54:12 like it seems that if the kernel is there, it's kind of an interpretor.. it's not true compiled code? 08:54:42 In Forth "kernel" == runtime library (mostly). 08:55:10 It just so happens that the typical forth runtime library includes a Forth compiler :-) 08:55:32 ah! 08:55:37 ok 08:55:57 so basically all the compiled words which are then called from the "code" 08:55:59 Different Forth environment "compile" to different formats. 08:56:24 uh 08:56:38 Yeah, but Forth doesn't make any distinction between the code you write and the "kernel". 08:56:47 what's the difference with native code compiler and what I440r is doing? 08:57:01 I don't know what I440r has planned, so I can't tell you. 08:58:27 what do you mean by "Different Forth environment "compile" to different formats." ?? 08:59:43 Before we talked about the outer interpreter. Now we'll talk about the inner interpreter (II). 09:00:04 heh, ok :) 09:00:29 You can think of Forth as a virtual machine, much like the Java VM or the UCSD P-system. 09:00:47 <-- forgot there was II temporarily :) 09:01:18 Logically, the VM has two stacks (return addresses and data). 09:01:51 yup 09:01:57 It also as a logical instruction pointer, as well as a couple of other less important registers. 09:02:26 The II implements the Forth VM. 09:03:48 huh 09:04:15 why is there a VM, can it be a non-VM? 09:04:29 Lots of implementation strategies exist, and which one works "best" depends a lot on the target environment. 09:04:47 VM (virtual machine, not virutal memory) 09:05:38 You can implement the II as a typical byte-code interpreter like Java or P-system, or you can implement the VM in native code. 09:05:56 yup, i know VM is virtual machine 09:06:00 ok 09:07:36 uh 09:07:57 For example, if you implement the VM in native code, the Forth IP uses the CPU's instruction pointer. 09:07:59 can't you just have it compile straight to assembly? what's with the VM/interpreter slant? 09:08:35 The VM provides the logical framework for generating the code. 09:10:38 Just like many compilers use a 3-address tuple for machine-independant code generation. 09:11:40 you said "byte-code interpreter like Java or P-system, or you can implement the VM in native code." what's the difference in implementing one and not the other? 09:13:46 It often comes down to a performance vs. footprint choice. Historically, interpreters generated smaller "code" than native code compilers. 09:14:14 With today's CPUs and optimization techniques, this has become less of an issue. 09:15:32 Other times, portability concerns win. You can usually fit the inner interpreter and machine language versions of the most important kernel words in 4K to 8K of object code. 09:16:16 You have a lot fewer lines of assembly to port in this case, and all of your forth code (in text format) "just works". 09:16:49 which is more portable? VM or interpreter? 09:17:26 I don't understand your question. VM == inner interpreter. 09:17:55 And what do you mean by "portable"? Across CPUs? Between OSes? 09:19:40 er 09:19:41 i meant 09:19:54 which is more portable? native code or interpreter? 09:20:37 IMHO, you have a lot more work to do when porting a native code generator. 09:21:35 Especially if you plan on doing much optimization. 09:21:47 ok, but for speed issues which is better? 09:24:53 That depends on how well you generate native code for the target CPU vs. how efficiently you code the interpreter. 09:25:17 You can spend a lot less time on an interpreter and get a very fast system. 09:26:24 i'm still not sure what the difference is between an interpreter and native code 09:27:06 * Trey digs up an appropriate URL... 09:28:50 http://www.zetetics.com/bj/papers/index.html 09:29:17 Look at the series of articles at the top of the page. 09:29:38 He goes into a lot more detail about the various techniques. 09:32:43 ok thanks 12:13:59 --- quit: I440r (My damn controlling terminal disappeared!) 14:37:32 --- topic: set to 'http://isforth.sourceforge.net -- http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/isforth/?cvsroot=isforth' by ChanServ 14:37:32 --- mode: ChanServ set mode: -o aaronl 14:37:32 --- mode: ChanServ set mode: -o Trey 14:37:32 --- mode: ChanServ set mode: -o lar1 14:37:32 --- mode: ChanServ set mode: -o clog 15:21:10 --- quit: futhin (nothing happening bah to irc :P) 16:03:51 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 16:04:43 is it possible to get forth to do multitasking within the lang? 16:30:50 --- join: edrx (edrx@copacabana-ttyS1.inx.com.br) joined #forth 16:41:28 --- quit: edrx ([x]chat) 17:17:08 --- quit: Trey (farmer.openprojects.net benford.openprojects.net) 17:17:09 --- quit: lar1 (farmer.openprojects.net benford.openprojects.net) 17:21:40 --- join: Trey (Baxter@ns.TreySoft.com) joined #forth 17:21:40 --- join: lar1 (lar1@adsl-63-203-73-199.dsl.snfc21.pacbell.net) joined #forth 18:08:58 * aaronl is away: dinner 18:23:10 --- quit: futhin (later) 18:34:43 --- join: edrx (edrx@200.240.18.85) joined #forth 18:35:51 --- quit: edrx ([x]chat) 18:45:07 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 18:57:39 --- quit: futhin (Read error to futhin[h24-67-113-99.cg.shawcable.net]: Connection reset by peer) 18:58:05 --- join: futhin (thin@h24-67-113-99.cg.shawcable.net) joined #forth 19:22:32 how many primitives does forth usually have? 19:22:36 the core primitives 19:26:15 --- join: cleverdra (jfondren@1Cust153.tnt6.florence.sc.da.uu.net) joined #forth 19:28:30 futhin: that depends a lot on the forth in question. 19:28:40 * cleverdra perks up. 19:28:44 huh? wha? 19:28:53 [21:22] how many primitives does forth usually have? 19:28:53 [21:22] the core primitives 19:29:44 oh. Yes, that's highly dependent on the Forth in question. If you mean ANS Forth, I don't remember. Look at the draft proposal, it's online. 19:36:14 curiously futhin, why do you want to know? 19:38:40 not for any important reasons :) 19:39:29 a friend of mine and i learned MUF (a forth-like lang) and suddenly he hates it and i'm trying to convince him that forth is good. its a huge bitch :( 19:40:23 mmm OK. What's MUF? What's bad about it? 19:41:08 MUF is exactly like forth for the most part. it's Mulit-User Forth, an online programming language on a MUD. you know what a MUD is don't you? 19:41:20 er 19:41:24 Yeah, I know what a MUD is. 19:41:25 Multi-User 19:41:32 i can send you some muf code as an example 19:41:51 That's kind of cool. I didn't know there was a forthy-coded MUD out there. 19:42:08 yeah, well it was implemented in C, but the online programming lang is forthy :) 19:42:11 it's pretty cool 19:43:03 interesting code. 19:43:22 yup 19:43:32 Well, why does he hate it? 19:43:56 well, it seems like he took a look at some poor code .. lemme send it to you :) 19:44:26 i dunno, he just hasn't gotten to the stage of factoring up code and stuff 19:44:51 we've only done like a handful of muf programming between us, but keeping track of the stack is kind of tricky 19:44:52 Yikes! cmd-@register is EVIL. 19:45:27 his problem is mostly with the stack, he thinks that it's too hard to read other people's code and to keep track of the stack 19:45:40 but i learned about factoring the code up.. 19:45:47 Send him to www.ultratechnology.com or something to read the Forth propaganda, where they talk about how factored things should be. 19:45:50 he's just being stubborn now or something 19:47:13 'pop' is like 'drop'? 19:49:13 yup 19:49:31 pop takes it off the stack and forgets it 19:50:01 How would knowing the number of 'core primitives' help you in this discussion? 19:50:08 In Forth. 20:12:40 it wouldn't 20:12:47 it's a stupid question :P 20:13:20 oh, mkay. 20:17:25 Anyone here program in Color Forth much? 20:17:30 j'curious. 20:19:46 I've not tried. 20:19:59 I couldn't get Enth to boot on the machine I tested it on. 20:20:36 Now that I've cleaned up my office a bit, I may try again. 20:21:34 Might be some mysterious conflict. Try another. I've gotten Enth to boot on random public display machines. 20:22:15 I tried an SMP box (dual P2-266), that might have caused some problems. 20:22:30 But it should have just ignored the second CPU. 20:22:50 --- quit: cleverdra (Leaving) 21:53:53 * aaronl is back (gone 22:36:33) 21:55:28 * Trey is away: sleeping [23:55] 22:02:46 --- join: adu (andrew@adsl-63-201-91-148.dsl.snfc21.pacbell.net) joined #forth 22:21:59 hi 22:58:38 --- join: cleverdra (jfondren@1Cust2.tnt4.florence.sc.da.uu.net) joined #forth 23:40:15 hey cleverdra 23:41:17 hey futhin 23:42:18 ah good 23:43:09 i was wondering if you wouldn't mind looking at that 165.m muf code and pointing out where i could improve it? 23:43:37 sure, keeping in mind that I've never touched muf code in my life. 23:44:00 it's close enough :P 23:47:06 mkay. Looking at it now. I think I did something moderately clever with CHECKARGS, btw =) 23:47:35 eh? :) 23:47:49 so you're gonna edit it up and then send it back or something? 23:48:04 i tried to factor it some more.. but i dunno what's the best way to go about doing that 23:56:13 OK. 23:56:16 want me to dcc it? 23:57:18 I'd've commented it better, but I don't know what exactly is going on. Also, I *think* CONTINUE in NEXT-REF may need to be handled specially or put in proper context -- which I did not do. These things are important when factoring =/ 23:57:58 Likewise with the rest of the code. I hope that you get the picture. 23:59:59 --- log: ended forth/01.06.05