00:00:00 --- log: started forth/03.04.19 00:00:02 --- log: started forth/03.04.19 00:00:02 why not? 00:00:29 Because the languages are quite different in what they can do naturally (well, OK, Lisp and Scheme aren't, but certainly K and Lisp/Scheme are quite different). 00:00:56 certainly. 00:01:39 True. 00:02:55 Hmmm...Something like that could be used to make a dedicated Grid computer. 00:04:51 Here we go. http://os.inf.tu-dresden.de/L4/LinuxOnL4/ 00:05:26 Just visited. 00:05:28 http://os.inf.tu-dresden.de/L4/ Is the main page. 00:05:34 They still have some pretty old kernels. 00:05:36 brb 00:05:49 ramnull: it is the first thing google offers when you demand L4 00:06:14 Ah. 00:06:27 I had it in my bookmarks. Heh. 00:07:38 Hmmm....ColorForth on L4. Like a Jackrabbit on Amphetamines. 00:10:49 why do you prefer a microkernel? 00:11:14 No particular reason, yet. Just something to experiment with for now. 00:23:34 * kc5tja likes exokernels. : 00:23:35 :) 00:25:52 Next step, graphing with OpenGL. 00:25:58 Heh. 00:29:14 bbl 00:29:18 --- quit: ramnull ("This isn't Happy Hour!") 00:31:00 --- join: Fractal (ibgdmlc@dont.try.configuring.openbsd.on.stronglsd.com) joined #forth 00:57:34 --- quit: bwb ("Later") 01:37:01 --- quit: tgunr (leguin.freenode.net irc.freenode.net) 01:37:01 --- quit: sifbot (leguin.freenode.net irc.freenode.net) 01:37:01 --- quit: Robert (leguin.freenode.net irc.freenode.net) 01:37:01 --- quit: flyfly (leguin.freenode.net irc.freenode.net) 01:37:01 --- quit: Klaw (leguin.freenode.net irc.freenode.net) 01:38:45 --- join: divgrad (~wer@81.25.34.62) joined #forth 01:39:26 --- join: sifbot (~sifforth@h0030657bb518.ne.client2.attbi.com) joined #forth 01:39:26 --- join: tgunr (~davec@vsat-148-63-143-139.c189.t7.mrt.starband.net) joined #forth 01:39:26 --- join: Robert (~snofs@h138n2fls31o965.telia.com) joined #forth 01:39:26 --- join: flyfly (~marekb@ip164.ktvprerov.cz) joined #forth 01:39:26 --- join: Klaw (chuck@ip68-4-77-247.oc.oc.cox.net) joined #forth 01:58:27 --- join: TreyB (~trey@cpe-66-87-192-27.tx.sprintbbd.net) joined #forth 02:04:01 --- quit: tgunr (leguin.freenode.net irc.freenode.net) 02:04:01 --- quit: sifbot (leguin.freenode.net irc.freenode.net) 02:04:01 --- quit: Klaw (leguin.freenode.net irc.freenode.net) 02:04:01 --- quit: flyfly (leguin.freenode.net irc.freenode.net) 02:04:01 --- quit: Robert (leguin.freenode.net irc.freenode.net) 02:06:42 --- join: sifbot (~sifforth@h0030657bb518.ne.client2.attbi.com) joined #forth 02:06:42 --- join: tgunr (~davec@vsat-148-63-143-139.c189.t7.mrt.starband.net) joined #forth 02:06:42 --- join: Robert (~snofs@h138n2fls31o965.telia.com) joined #forth 02:06:42 --- join: flyfly (~marekb@ip164.ktvprerov.cz) joined #forth 02:06:42 --- join: Klaw (chuck@ip68-4-77-247.oc.oc.cox.net) joined #forth 02:14:42 --- part: divgrad left #forth 02:20:43 --- quit: kc5tja ("[x]chat") 02:21:01 --- quit: tgunr (leguin.freenode.net irc.freenode.net) 02:21:01 --- quit: sifbot (leguin.freenode.net irc.freenode.net) 02:21:01 --- quit: Klaw (leguin.freenode.net irc.freenode.net) 02:21:01 --- quit: flyfly (leguin.freenode.net irc.freenode.net) 02:21:01 --- quit: Robert (leguin.freenode.net irc.freenode.net) 02:22:37 --- join: sifbot (~sifforth@h0030657bb518.ne.client2.attbi.com) joined #forth 02:22:37 --- join: tgunr (~davec@vsat-148-63-143-139.c189.t7.mrt.starband.net) joined #forth 02:22:37 --- join: Robert (~snofs@h138n2fls31o965.telia.com) joined #forth 02:22:37 --- join: flyfly (~marekb@ip164.ktvprerov.cz) joined #forth 02:22:37 --- join: Klaw (chuck@ip68-4-77-247.oc.oc.cox.net) joined #forth 02:25:32 --- quit: tgunr (leguin.freenode.net irc.freenode.net) 02:25:32 --- quit: sifbot (leguin.freenode.net irc.freenode.net) 02:26:07 --- join: tgunr (~davec@vsat-148-63-143-139.c189.t7.mrt.starband.net) joined #forth 02:26:07 --- join: sifbot (~sifforth@h0030657bb518.ne.client2.attbi.com) joined #forth 02:26:20 --- quit: Klaw (leguin.freenode.net irc.freenode.net) 02:26:20 --- quit: flyfly (leguin.freenode.net irc.freenode.net) 02:26:21 --- quit: Robert (leguin.freenode.net irc.freenode.net) 02:26:33 --- join: Robert (~snofs@h138n2fls31o965.telia.com) joined #forth 02:26:33 --- join: flyfly (~marekb@ip164.ktvprerov.cz) joined #forth 02:26:33 --- join: Klaw (chuck@ip68-4-77-247.oc.oc.cox.net) joined #forth 02:27:21 --- quit: sifbot (leguin.freenode.net irc.freenode.net) 02:27:21 --- quit: tgunr (leguin.freenode.net irc.freenode.net) 02:27:43 --- join: tgunr (~davec@vsat-148-63-143-139.c189.t7.mrt.starband.net) joined #forth 02:27:43 --- join: sifbot (~sifforth@h0030657bb518.ne.client2.attbi.com) joined #forth 04:18:05 --- join: mur (murr@baana-62-165-186-221.phnet.fi) joined #forth 04:31:06 --- quit: Fractal (Read error: 110 (Connection timed out)) 04:47:50 --- join: karingo (karingo@85.portland-15-20rs.or.dial-access.att.net) joined #forth 05:02:36 --- join: deluxe (~deluxe@pD950F032.dip.t-dialin.net) joined #forth 05:06:15 --- quit: mur ("MURR!") 05:08:47 --- join: mur (murr@baana-62-165-186-221.phnet.fi) joined #forth 05:12:23 --- quit: deluxe ("bb") 05:24:50 --- quit: karingo () 06:42:43 --- quit: flyfly ("using sirc version 2.211+KSIRC/1.2.4") 06:53:40 --- quit: TreyB (Read error: 113 (No route to host)) 06:54:02 --- join: ramnull (~nicad@12-241-145-39.client.attbi.com) joined #forth 06:54:12 Whats up? 06:57:55 --- quit: ramnull (Client Quit) 07:58:45 --- join: ramnull (~nicad@12-241-145-39.client.attbi.com) joined #forth 08:48:21 --- join: I440r (~I440r@1Cust254.tnt1.bloomington.in.da.uu.net) joined #forth 08:58:14 * ramnull yawns 09:00:10 how goes the coding ? 09:01:02 Pretty friggin good. 09:01:09 I keep rewriting things. 09:01:22 Like an obsessive compulsive gambler. 09:01:24 thats always good 09:01:30 heh 09:01:37 heres a trick i do all the time 09:01:54 * ramnull listens 09:01:58 write some code. spehd HOURS debugging it. when i get it working... 09:02:04 DELETE IT ALL and start over 09:02:09 second time is always better 09:02:31 never become too attached to the code you write heh 09:02:37 theres always a better way :/ 09:02:53 I figure really good code should have an aesthetic quality to it. That's kind of what I'm aiming for. 09:03:29 right 09:03:33 You know...like the Pyramids are aesthetic, the SR-71 Blackbird, etc... 09:03:35 it rarely does teh first time you code it 09:03:49 It'll get there. 09:04:24 Still trying to get a handle on deferred words and the compiler. But I'm starting to get it. 09:05:05 With creative use of next, I could write a complete app without a single loop. 09:05:05 ok, a defered word is like a variable that exeutes what it points to 09:05:08 defer foo 09:05:12 : (foo) ...... ; 09:05:18 Gotcha. 09:05:32 you can now say ' (foo) to get the execution address of (foo) 09:05:37 then you say ' is foo 09:05:49 to store teh execution address of (foo) in the defered word 09:05:54 ' (foo) is foo 09:06:04 when you run foo you will be executing (foo) 09:06:08 you can now do 09:06:17 : (foo2) ..... ; 09:06:20 ' (foo2) is foo 09:06:22 Ah, so it's a pointer to a code segment basically. 09:06:25 now foo will run (foo2) 09:06:34 its a pointer to any word you point it at 09:06:45 ' noop is foo 09:06:50 makes foo do nothing 09:06:53 * ramnull nods 09:07:08 btw do you know the difference between ' and ['] ? 09:07:28 --- join: Herkamire (~jason@h0030657bb518.ne.client2.attbi.com) joined #forth 09:07:47 ' is immediate while ['] compiles into a colon word? 09:07:58 yes 09:08:08 : foo ' blah .... ; 09:08:23 wont tick blah 09:08:29 : foo ['] blah ..... ; 09:08:39 Speaking of compile, how does one keep track of all the immediate versus compiled words already in the dictionary? 09:08:40 will store the xt of blah in the word foo as a literal 09:08:41 ' is NOT immediate 09:08:51 you learn what they are 09:08:54 no its not 09:09:04 i missed he said that heh 09:09:07 The dictionary can get pretty large. 09:09:16 : blah ' xyz abc ; 09:09:16 So I got it backwards. 09:09:33 the above definition is a parsing word you would invoke it as follows 09:09:39 blah doh 09:09:46 ramnull: yeah sorta. ['] is immediate 09:09:55 Ah. I was thinking of ,' 09:09:55 and the word blah will TICK doh and then run xyz abc 09:10:10 : ['] ' literal ; 09:10:15 immediate 09:10:22 Gotcha. 09:10:23 its com[plicated and im doing a bad job of explaining it heh 09:10:39 basically you would normally use ' outside a : def and ['] inside one 09:10:57 I see. 09:11:00 tho ' is often used inside : defs too 09:11:08 like the one above 09:11:22 Heh. Who needs loops? 09:11:38 eh ? 09:11:42 Gah. I've been looking at too much K. 09:11:55 you gotta have loops or recursion 09:12:00 erm no 09:12:04 NO recursion! 09:12:06 lol 09:12:11 recursion is evil 09:12:20 you're evil 09:12:24 and ? 09:12:28 your point is ??? :) 09:12:43 avoid recursion - its a gordian knot 09:13:01 heh :) 09:13:41 http://www.nsl.com/papers/papers.htm 09:13:57 * ramnull grins 09:14:45 Starting to get a knack for moving stuff around on the stack. 09:14:53 I440r: I wish I could convince you that if/then/exit/recurse is simple and flexible. (and can easily replace begin/while/until/again/repeat/exit) 09:15:04 What's postpone supposed to do? 09:15:37 ramnull: it postpones compilation of the next word until the word your currently defining is run. 09:15:53 Been avoiding pick and roll per the advice of other Forthers. 09:15:56 for example: : a postpone b ; immediate 09:16:18 when you execute a it will compile a call to b 09:16:28 ramnull: good :) 09:16:30 Ah. Seems a bit redundant. 09:16:37 ramnull: don't use rot iether 09:17:29 ramnull: yeah, you don't need postpone much, mostly for writing the forth (writing IF and such) 09:17:40 Hmmm...for stack practice, I've been considering reading text file onto the stack and then quicksorting it from the stack. 09:18:02 don't put the whole file on the stack 09:18:10 at once 09:18:23 do it in memory 09:18:59 How much should I allow on the stack at most? 09:19:25 you should avoid writing functions that take or leave more than 2 items on the stack 09:19:55 Gotcha. 09:20:37 if you start to use 3, then you should change how you're doing it. use variables or something 09:21:32 Alright, I've been seeing a bit of disagreement over local versus global on the newsgroup. Is it really that big a deal? 09:21:44 --- quit: mur ("MURR!") 09:21:57 As far as variables. 09:23:03 I440r: Still working on that Framebuffer stuff, but I got alot to learn before I can actually DO anything with it. Heh. 09:23:15 --- quit: I440r (Read error: 104 (Connection reset by peer)) 09:23:48 * ramnull is hacking up some Polynomial Functions right now. 09:24:55 Sorry. Did I say something stupid? 09:24:55 --- join: I440r (~I440r@1Cust254.tnt1.bloomington.in.da.uu.net) joined #forth 09:25:26 * ramnull just found I440r's comments on "postpone" in his source code. 09:27:11 --- quit: I440r (Read error: 54 (Connection reset by peer)) 09:27:28 ramnull: don't use local variables in forth 09:27:57 ramnull: whan are you doing with the framebuffer? which forth? 09:28:21 I was taught in my C days that memory accesses are expensive and should be avoided. This isnt such a problem with Forth? 09:28:34 I love forth! I just implemented CREATE and CONSTANT in 55 chars :) 09:29:02 ramnull: most of the stack is in memory 09:29:04 Herkamire: I envision a ColorForth type environment on steroids. 09:29:12 unless you have a good optomizer 09:29:44 ramnull: I'm making a forth invironment simular to what Chuck describes at colorforth.com 09:29:49 Been using IsForth 09:30:09 does isforth use the frame buffer? or are you trying to get it to? 09:30:19 But I'm thinking full on video acceleration. 09:30:44 Well, I've been coming in the back door using assembly. 09:30:57 ramnull: cool :) my forth will have vid accel eventually, not under linux though. 09:31:21 OpenGL extensions for code/data visualization. 09:31:33 heh :) 09:31:39 I don't know that I'll do that 09:31:45 I'm not much for glitz 09:31:55 And a Translucent editor window. 09:32:01 I'm mostly interested in 2D accelleration 09:32:27 ramnull: just to look cool? or does it have some purpose? 09:32:35 Glitz is good, as long as it's useful and not merely ornamentation on a pile of shit. 09:33:41 ramnull: Realtime visualization of the code/data and other relevant stuff on the fly as the Forth compiles it. 09:35:04 And of course the ability to use it in other apps. 09:36:16 Herkamire: Sound useful? 09:37:14 Once I get over this learning curve, I'll probably take IsForth and work in support for LinuxThreads. 09:38:19 Of course, I dont know, maybe IsForth already supports SMP indirectly. babble babble babble ............... 09:38:34 except that I never plan on having so much bloat that you would actually wait a noticable amount of time for the code to compile 09:39:35 You'll see what I mean. 09:39:36 I'm writing my own OS btw. 09:39:48 Microkernel? 09:40:15 there won't really be a kernel 09:40:29 or maybe it will just be a kernel. depends on how you look at it. 09:40:40 Ah. Sort of like Oberon? 09:40:50 I won't have any restricted access to divices or memory (at first anyway) 09:41:07 It'll just be an ELF that boots and access the devices 09:41:45 or I was thinking of making an ELF bootloder so I can use a simple format for my binary 09:42:14 (and I can make an bootloder that will setup the linux environment, so my OS can run under linux.) 09:42:39 Clever. 09:42:58 With L4/Linux, you can run it in it's own virtual machine. 09:43:14 --- join: I440r (~I440r@1Cust254.tnt1.bloomington.in.da.uu.net) joined #forth 09:43:17 That's a ways off though. I have to write my fabulous editor first. and I haven't even started that. I just wrote CREATE :) (mostly because I haven't needed it) 09:43:39 Heh. The journey of a thousand miles begins with a single step. 09:43:49 you commie you :) 09:44:18 Ooops. 09:44:19 I thought I'd need variables for the editor 09:45:23 Hmmm...wonder if anyone has ever built a Forth with a Queue and a Stack. 09:45:59 I gotta quit speculating. 09:47:24 ramnull: I'm sure people have used queues in forth 09:49:27 I gotta go code. Be back in a while. 09:49:38 bbl 09:49:45 --- part: ramnull left #forth 10:00:18 --- join: kc5tja (~kc5tja@ip68-8-206-137.sd.sd.cox.net) joined #forth 10:00:52 * kc5tja was doing some calculations this morning when I woke up. 10:00:58 About? 10:01:14 Someone had asked if my 65816-based computer was going to use bitplanes like the Amiga did for graphics. 10:01:15 I reported at that time, "Yes." 10:01:26 However, a shared-memory solution requires too much bandwidth. 10:01:47 To support 16 colors at 640x480, not even counting the CPU itself, requires a minimum of 20MB/s bus. 10:02:13 Therefore, I may have to adopt a more VGA-like solution, where bitplanes are "off-line" from the main CPU memory. 10:02:32 This way, I can make an arbitrarily wide bus, wholly independent of the CPU. 10:02:52 And I could even pump it at dot-clock frequencies, which the CPU can't handle. 10:04:18 Access to the frame buffer memory would be through data ports addressed by auto-incrementing address registers. 10:06:15 It's not the best solution, but it's a compromise that I think would work well. 10:09:23 --- join: thin (thin@bespin.org) joined #forth 10:09:31 re thin 10:09:34 heya :) 10:09:39 how's it gonig kc5tja 10:09:43 s/gonig/goin 10:10:00 I've always thought it would be cool to be able to send code to the graphics card for it to execute 10:10:03 blah two typos in a row 10:10:33 thin: Good. 10:10:58 Herkamire: That simply moves the problem from the mainline CPU to the graphics coprocessor. 10:11:07 It doesn't eliminate the basic problem of bandwidth. 10:11:44 --- quit: gilbertdeb (Remote closed the connection) 10:12:06 kc5tja: yeah, you still need seperate memory for the graphics. 10:12:24 I knew it couldn't last forever; the Amiga 4000 system is now going for $183. That's not far off from being just plain too expensive for me to purchase. 10:12:29 I just think it would be cool to have a proccessor that you could program with direct (fast) access to the graphics memory 10:12:33 --- join: gilbertdeb (~gilbert@fl-nked-ubr2-c3a-29.dad.adelphia.net) joined #forth 10:13:13 --- join: futhin (~thin@198.162.22.73) joined #forth 10:13:18 --- quit: thin (Client Quit) 10:13:44 I suppose. I can't see much use for it except to implement some rapid 2D stuff, but then you can always use a blitter for that. 10:13:58 It'd be slower than a blitter, but it'd perhaps save on transistors. 10:14:50 kc5tja: this idea is probably not apropriate for your project. I just think of what sort of processor my r128 card must have in it, and I wish I could play with it. 10:15:06 * kc5tja nods 10:15:22 My project is low-cost, low-power, decent to good performance. 10:15:44 kc5tja: how low is low? 10:16:13 The goal is to make a computer system that I can call my own, in its entirety, while keeping power consumption at or below 5A at 5V. 10:17:04 it'd be neat if the power consumption could be kept low enough to have one of those wind-up radio power supplies in there :) 10:17:17 but I doubt thats possible. 10:17:47 if so, you could rig-connect it to a wheel and place a hamster in it! 10:17:56 It would perhaps be possible if I didn't have video and audio requirements. Video and audio are major power hogs because they're always switching something. 10:18:11 Hamster doesn't produce enough power even to power a radio... :) 10:18:28 get Hamster and Hamstress then. 10:18:59 25W is my target maximum power consumption for my project. It's low enough to use convection cooling, and therefore absolutely no fans anywhere in the whole system. 10:19:42 how much do you suppose it would cost overall? 10:20:12 Too much. 10:20:41 I'm buying parts in quantities of 5 or less, so it's going to be rather "expensive." 10:21:29 I'm guessing (total speculation here) that the whole project will probably cost me around $300 to $400 to build, and that's not counting any case or PC board work (but it would include wire wrapping and perf-board work). 10:21:39 This calls for.... Harvey the Wonder Hamster 10:22:11 :) 10:22:17 The case I can do up with papier mache though. And I get enough junk mail that it won't cost me anything but electricity (for the blender to pulverize the paper) to make it with. 10:22:25 harvey the wonder hamster is still alive?? 10:22:25 kc5tja: you're making a desktop PC right? 10:22:45 Herkamire: Yes. A form-factor no bigger than an Amiga 1000 or Commodore 128-D. 10:23:00 form-factor? 10:23:01 ok 10:23:08 futhin: dimentions 10:23:27 dimensions 10:23:59 Form-factor basically sets dimensions, how the case looks to the user, etc. For example, though similar in size, the PCjr has a different form factor than the Amiga 1000. 10:24:04 Harvey, Harvey, Harvey the wonder hampster. He doesn't bite, and he doesn't squeal, he just run's around in his hampster wheel. Harvey, Harvey, Harvey the wonder Haaaaaamster. 10:24:09 (Because the Amiga 1000 has a keyboard garage, while the PCjr has nothing of the sort) 10:24:26 just make sure the paper mache doesn't catch on fire :) 10:24:41 With 25W of power, paper won't combust. 10:24:50 oh good :) 10:24:53 keyboard garage? like an apple II ? 10:25:09 No. Apple II is an all-inclusive monstrosity. 10:25:11 kc5tja: coool, a paper computer :D 10:25:25 like an atari? 10:25:38 The Amiga 1000's case is on stilts, which permits the user to slide the keyboard underneath the case when not in use. 10:25:57 That space underneath the case is called the keyboard garage. 10:27:13 * kc5tja was really considering modeling the computer after the Amiga 500/Atari ST case design, but that would have made things very difficult for me. 10:27:21 why? 10:27:52 First, you can't buy small, independent keyboards anymore. I remember when you could pick up TI-99/4A, Commodore 64, or Atari keyboards surplus all over the place. Not anymore. It's PC keyboard or nothing. 10:28:31 Second, getting the slope of the keyboard's top surface would be difficult to get right. It'd take a LOT of wood working to get it smooth enough to be comfortable. 10:29:04 So I figured I'd just go with a pizza-box style computer instead, but with a keyboard garage where I can park a normal-sized PC keyboard underneath when it's not in use. 10:29:44 i wrote some code to find the square root of a number, but it's a really crappy algorithm and only returns an integer. can somebody tell me what's wrong with it? 10:29:45 : sqrt 1 over 2/ 0 swap for 2dup / 2dup = if 2drop drop return then drop 1+ next ; 10:29:51 I wish I could get a USB port incorporated into the system; I'd use that heavily for most of my I/O devices. 10:30:25 Well, the fact that it uses only integer math has a lot to do with the fact that it returns only an integer... :D 10:30:35 no i want it to return an integer 10:30:41 i don't need anything else 10:30:48 but it's not running in pygmy 10:30:50 Oh, OK. :D Just making sure. :) 10:30:52 for whatever reason 10:31:18 it's going into my prime finding code and i don't need to be precise 10:31:27 Is "return" defined in Pygmy? 10:31:38 i defined it as : return pop drop ; 10:31:42 exit doesn't seem to work 10:32:09 For good reason; the state of the FOR loop is still on the return stack when you exit. Also, when RETURN is executed, I believe the stack is already rather empty 10:32:10 if i do something like : blah if exit then ; it returns "then ?" 10:32:23 Yes, EXIT is an immediate word. 10:32:26 how do i break out of the loop ? 10:32:36 (for whatever reason) 10:32:42 I don't know. 10:32:46 there's two EXIT the interpreter one is : exit pop drop ; 10:32:51 and there's a compiler EXIT too 10:33:08 This is another great reason why I generally don't use FOR or DO loops in Forth. They're a PITA, and have side-effects that are hard to control in a reasonable manner. 10:33:16 umm.. in other forths you can exit the do loop using exit 10:33:24 hmm 10:33:25 Nope. 10:33:38 The problem is so bad that ANSI defined a special word, UNLOOP, to specifically address this problem. 10:33:38 a begin repeat loop ? 10:33:56 i remember using RETURN or EXIT once in a loop with no problems 10:34:13 i just don't remember if it was a BEGIN REPEAT loop or a DO LOOP .. 10:35:20 BEGIN/REPEAT and BEGIN/WHILE are always safe to just exit from (as long as your data stack is as you expect). 10:35:41 DO/LOOP and FOR/NEXT place two data on the return stack: current index (where I gets its data from), and the loop limit. 10:35:59 You may need to change RETURN to read POP POP 2DROP POP DROP ; 10:36:16 Ooohh...scratch that too. 10:36:28 The first pop will return the return address for RETURN! 10:36:40 hmm 10:36:45 Try this: 10:36:51 : return pop drop pop pop 2drop ; 10:36:58 uhh 10:37:14 OK, never mind, they're the same. But try it anyway. It's equivalent to 3POP 3DROP -- that's the point. 10:37:35 One pop/drop combination removes the return address for RETURN, so it doesn't return to the word you are intending to return from. 10:37:45 THe other two attempts to "unloop" or dismantle the FOR/NEXT state. 10:41:23 pff, pygmy still crashes 10:41:23 heh 10:41:41 Repost the code again? 10:41:46 (for sqrt) 10:41:56 * kc5tja /clear'ed the window 10:43:20 : SQRT 1 OVER 2/ 0 SWAP FOR 2DUP / 2DUP = IF 2DROP DROP RETURN THEN DROP 1+ NEXT ; 10:44:04 boy, when my coding doesn't work, it makes me REALLY tired heh 10:44:16 * futhin is tired anyways bah 10:45:05 OK, I notice that when that IF condition is true, you have only two items on the stack. But you're dropping three. 10:46:34 Also, I'm unaware of how you're returning data to the caller. Upon exit, all data on the stack is being consumed. 10:47:21 heh 10:48:04 OK, I see what the 2DROP DROP is doing. That seems to work, but it still leaves no data on the data stack when you return. 10:48:20 The only answer I can think of is that RETURN isn't working well with the FOR/NEXT loop. 10:48:45 yeah i probably should code SQRT differently 10:48:58 it's not very good forth code 10:50:16 : return r>drop 2r> 2drop ; :) 10:50:34 i440r: pygmy calls its r> pop 10:50:39 i know 10:50:40 I440r: That's the code I posted above, only in Pygmy terms. 10:51:01 * kc5tja wonders if there'd be a market for kits if I were to go through with building my 65816-based PC... 10:51:05 i figured it was pygmy 10:56:26 --- join: mur (murr@baana-62-165-186-221.phnet.fi) joined #forth 11:01:31 --- quit: Herkamire ("It's a beautiful day. I'll be out if you need me.") 11:05:54 kc5tja: how is rational math done memory wise? 11:05:59 how is it stored 11:06:19 floating point uses 2 cells, one for the number and one for the power 11:06:25 Each number is expressed as a fraction. 11:06:37 You have one or two cells for the numerator, and one or two cells for denominator. 11:06:49 So at a minimum, you'd need two cells. 11:07:08 At a maximum, you'd need four. 11:07:40 (Well, it's not so much a maximum as it is a convention. I suppose if you really needed the precision, you could go up to however many cells you needed for each) 11:08:34 brb, watching "the mummy returns" again :) 11:09:02 nooo! 11:09:04 kc5tja: ok, sounds good. PC/Geos had it implemented in hardware? 11:09:12 Heavens no. 11:09:16 PC/Geos ran on 8086. 11:09:20 ok 11:09:45 But it screamed on an 80286, and was so fast as to be inconsequential on an 80386. 11:10:23 Imagine real-time, outline font text manipulations, including skewing, rotation, and other transformation effects, on an 80286. 11:11:00 ?? 11:11:05 because of rational math? 11:11:25 It used rational math for everything in the GUI and print subsystems. 11:11:43 In fact, the concept of "pixels" didn't exist in GEOS. 11:11:51 You addressed positions on the screen in units of points. 11:12:02 nice 11:12:07 print surface 11:12:07 The transformation matrix it maintained would do the conversion to screen coordinates for you. 11:12:14 True, 100% device independence. 11:12:25 * futhin drools 11:12:40 All courtesy of 16-bit rational math. :D 11:12:53 talking about good guis.. smallstar 11:13:16 * kc5tja was strongly considering the use of rationals in his THE Implementation, but floating point is so pervasive today that it would run faster to use it. 11:13:31 My favorite small GUI is GEM. 11:14:36 It can emulate almost any feature of MacOS you can think of, in a footprint of only a couple of kilobytes. 11:14:47 doesn't "floating point would run faster" depend on the architecture? 11:15:12 futhin: Yes and no. For x86 and PowerPC platforms, it certainly true that it'd run faster. 11:15:20 futhin: For *some* MIPS maybe even so. 11:15:25 hey! 11:15:46 futhin: But in general, MIPS, 6502/65816, and 680x0 series would probably benefit from the use of rational math. 11:16:03 *Impact graphics cards anyone? 11:16:13 gilbertdeb: ? 11:16:32 n/m 11:16:35 its too long winded :) 11:16:44 wasn't there a time when computers had no harddisks? 11:16:54 gilbertdeb: Yep. 11:17:01 Mostly 8-bits and the early 16-bits. 11:17:09 now that shouldn't be as hard to make should it? 11:17:22 I'm not understanding. Make what? 11:17:27 A computer without a harddrive? 11:17:33 a functional one too. 11:17:39 It's easy to make one with. IDE's circuitry is only a handful of TTL logic gates. :) 11:17:51 ah okay. 11:18:11 It's only when you get into DMA and whatnot that things start to become expensive. :) 11:18:16 But I have plans for that too. 11:18:17 kc5tja: can THE and/or the OS have the option to use rational or floating? 11:18:36 futhin: I was thinking of deriving a wordset for Forth that would enable me to use either. 11:18:36 kc5tja: for example, couldn't the rational or floating be a service module in the exokernel? 11:18:51 so that some computers would get rational and others would get floating 11:18:58 ok 11:19:36 futhin: Exokernels don't have that concept. If it doesn't have to do with enforcing permissions, it doesn't exist in the exokernel. Everything else lies in user space. 11:21:24 i meant in user space 11:21:32 mixed up the terminology :P 11:21:48 I would define words like G+ and G* or some such, meaning "generalized +" and whatnot. 11:22:02 gilbertdeb: you've never used VI 11:22:04 Then the definitions of G+ and G* would depend on which module I LOADed prior. 11:22:11 futhin: i use and love ed. 11:22:33 vi is even easier. 11:22:43 anyway, brb 11:22:45 shower time. 11:32:59 --- quit: mur (Read error: 110 (Connection timed out)) 11:49:50 --- join: bwb (~bwb@ip68-4-121-108.oc.oc.cox.net) joined #forth 11:52:56 bwb: what are you coding in forth these days? :) 11:56:01 not much :p 11:57:36 got any projects on the backburner? 11:58:13 bwb... By Water BASIC. 11:58:27 * Robert thinks of that old BASIC interpreter. 11:59:04 Hmm...a BASIC written in Forth, to be embeddable in C applications or extension to Python or Perl. Yeah... 12:06:51 no a rebol written in forth. 12:06:59 www.sassenrath.com 12:07:07 he was a 4thsmith :) 12:07:16 --- join: mur (jukka@baana-62-165-184-206.phnet.fi) joined #forth 12:07:29 Next Generation Systems Forth 12:07:37 Now I wonder what that means ^ 12:08:15 Rebol is written in C actually. 12:08:23 I know that. 12:08:31 wait, was bwb written in forth? 12:08:36 nope 12:09:39 oh great. well done! 12 paintings from iraqi museums have been caugth from reporters 12:09:57 no please. nothing about iraq. 12:10:08 it was about reporters, not iraw 12:10:14 I might burst a vessel :( 12:10:54 Carl is one of my heros, but here's another one... http://www.mical.org 12:11:46 =rj= is one fruitty nutcake. 12:12:15 Just the person who should be responsible for AmigaOS's intuition.library, graphics.library, and layers.library. :D 12:12:19 carl sassenrath ? 12:12:20 dummdidumm one nut fruitcake, hah >:P 12:12:39 I meant what I typed. 12:12:53 yes 12:15:43 kc5tja: these people. 12:15:55 where are they grown? 12:16:35 Most of them are grown in farm field just outside of Idaho, in a small patch world reknowned for growing outstanding hardware and software engineers. 12:16:42 ;) 12:16:52 Sorry, the sentence you wrote just lent itself to wild speculation. 12:17:12 I'm not sure where these people are or where they came from, except to say that they are all US citizens. 12:17:21 hehehe. 12:17:43 Bummer!! Dave Haynie took his site down. :( 12:18:14 Oh well. 12:18:59 hmmm. am I sensing a revival of homebrew computing or has it always been going on? 12:19:45 no, it's dying 12:19:56 or stable 12:20:13 maybe stable in a sine curve? up and down 12:21:01 I'd like to simulate a cdc-6600 sometime. 12:21:06 i just don't know where to start. 12:21:13 documentation is relatively sparse. 12:21:19 my skill level is thin :D 12:47:47 back 12:48:34 --- quit: tgunr (Read error: 104 (Connection reset by peer)) 12:50:30 --- join: tgunr (~davec@vsat-148-63-143-139.c189.t7.mrt.starband.net) joined #forth 13:09:35 Gotta go. D&D game about to start. 13:09:41 --- quit: kc5tja ("THX QSO ES 73 DE KC5TJA/6 CL ES QRT AR SK") 13:26:59 --- quit: tgunr (Read error: 104 (Connection reset by peer)) 13:37:36 --- join: tgunr (~davec@vsat-148-63-143-139.c189.t7.mrt.starband.net) joined #forth 13:39:53 --- join: Fractal (mxkzktej@dont.try.configuring.openbsd.on.stronglsd.com) joined #forth 13:41:31 --- quit: I440r () 13:55:57 --- quit: futhin ("bye") 14:07:41 --- quit: Fractal (Read error: 110 (Connection timed out)) 14:13:23 --- join: TheBlueWizard (TheBlueWiz@pc5ddn1d.ppp.fcc.net) joined #forth 14:18:04 hiya all 14:19:17 Hi TheBlueWizard :) 14:21:09 hiya Robert :) is everyone else asleep here? 14:27:03 I think so. 14:27:09 Nobody has been speaking for a few hours. 14:27:11 mmhmm.... 14:39:31 hey tbw :) 14:39:55 hei mur! 14:41:16 mur: mitä kuuluu? 14:41:37 hyvää 14:41:41 entä sinulle? 14:42:32 kiitos, hyvää :) 14:43:15 HAHAHAHAH 14:43:15 "Caution: Cheese is hot after heating." 14:45:22 sounds so redundantly obvious 14:45:47 he continued that it actually was not even hot.. 14:46:53 hmm...I guess I'm missing the context here 14:47:06 nm 14:47:36 * mur found some bread.. i think i'll make something to eat 14:48:20 i wonder if it's still eatable but anyhow 14:48:31 lol 15:39:47 * bwb awake 15:42:00 ah...another one is awake :) 15:42:55 i'm awake but absent a while 15:43:07 i was watching jackie chan film.amusing:) 15:43:38 which jackie chan film? 15:43:39 * onetom has just seen the ring. that 1 was well made >:) 15:43:46 Hi onetom! 15:43:47 the drunken master? 15:43:50 hi all 15:44:22 the drunken master was played on tv2 here in the afternoon :) 15:44:29 bwb i dont know. amusing one 15:44:31 channel tv2 15:44:39 some disk with some formula 15:44:49 some reactor exploded at least 15:44:55 ah, thats a more modern 1 i think 15:46:04 Robert: whats up? 15:46:11 * Robert yawns. 15:46:12 easters comin 15:46:13 Not too much. 15:46:15 Yeah 15:46:50 Robert is watching orthodox church mass from tv? :) 15:47:05 im processing the length data of ~4000 turrutus socialis :) 15:47:27 --- part: gilbertdeb left #forth 15:47:29 length of their head, neck, upper & lower wings 15:47:49 turrutus socialis? 15:48:01 mur: Huh? No 15:48:06 a midget like insect 15:48:10 sounds Latin 15:48:26 All insects are Latin, except the Swedish ones. 15:48:46 cicalae/cicadae 15:48:52 :) 15:49:30 Ah. 15:49:41 or perhaps some Greek thrown in as well 15:50:09 finnish insect namespace is very rich 15:50:21 linguistics say 15:51:48 really? interesting 15:52:34 Yeah. Finnish insects are ...interesting. :) 15:53:31 lol 16:02:40 --- join: semtex (~Speuler@mnch-d9ba4d26.pool.mediaWays.net) joined #forth 16:04:31 TheBlueWizard, i can pick you some of the better viivi ja wagner 's .. understood the comic of 11.4. already? 16:04:39 * TheBlueWizard stays away from semtex ;) 16:05:21 I haven't seen 11.4 yet...I decide to skip 15.4...too much work lol 16:06:02 as you desire 16:06:12 11.4 can be hard to read. 16:06:12 Hi Speuler 16:06:19 `morning all nevertheless 16:06:38 they may be a bit hard to understand since there are often word plays. and in some there are helsinki jargon too 16:06:47 http://www.helsinginsanomat.fi/tanaan/viivijawagner/viivijawagner.asp?paiva=7.4.2003 <- that woudl be next maybe :P 16:13:59 --- join: Fractal (bqfc@dont.try.configuring.openbsd.on.stronglsd.com) joined #forth 16:14:14 --- quit: Fractal (Remote closed the connection) 16:16:46 --- join: Fractal (afwviz@new.cure.for.SARS.found.to.be.strongLSD.com) joined #forth 16:19:23 hiya Fractal 16:19:30 Hey. What's new? 16:25:10 * Robert looks at Fractal's new, fancy hostname. HEH. 16:26:06 :) 16:26:14 Is there a sars problem in sweden? 16:26:29 One suspected case, not really what I'd call a problem. 16:26:42 How about... the US(?) ? 16:27:02 Canada 16:27:29 Not really a problem either, but we have it worse than the US since we, well, allow immigration... 16:28:02 10-20 deaths, 100 suspected cases... I think... 16:28:25 Heh. A guy from Canada told me about how the family of one of his friends are kept isolated. 16:28:38 Heh. Doesn't suprise me... 16:29:03 Lots of paranoia? 16:29:52 Ya, kind of... 16:30:09 Most people don't stay up worrying about it though. :) 16:30:31 Fractal: last I heard, there are more than 250 people dead so far from SARS, worldwide 16:31:33 Ah, well. Let's just hope this isn't what's going to terminate mankind... ;) 16:31:33 Ya, I don't doubt it... 16:32:01 I just wonder how the poor 90% of the world will handle this. 16:32:11 Might go not-so-well. 16:32:53 some expert said that it may be only the beginning of the epidemia 16:33:06 Experts say alot of things. 16:33:30 But sure, things can always get worse. A lot worse. 16:37:19 yup...I hope one would have some immunity after being infected (assuming he/she doesn't die in the first place) 16:37:28 if not, trouble! 16:37:52 and I understand SARS is related to colds, so if it mutates easily, then more trouble! 16:37:58 Trouble either way... 16:39:14 the optimists and happy people will survive because of better resistance :) 16:39:21 sleep well night time! 16:39:21 :) 16:39:36 sleeping too few will lower resistance to diseases :) 16:39:47 wash hands often, good hygiene helps with diseases 16:40:07 Thanks, I'll pass that on to Health Canada. :) 16:40:30 mur: hyvää yötä 16:42:49 Hyvää iltää, mur. 16:42:54 (sp?) 16:43:02 iltaa :P 16:43:07 * mur is not yet gonig sleep :) 16:43:20 :) 16:43:28 i meant that sleep well = sleep enough 16:43:58 Oh, right.. I'll go to bed soon. 16:44:06 Within, say, two hours. 16:44:08 :) 16:44:20 ah...I thought you were going to sleep :) I am now looking at 15.4 (pineapple strip) now 16:45:59 mur: Here's some nice comics for you! http://www.atarimagazines.com/whizkids/thumbs.php?issue=drugs 16:46:15 It's about old computers. 16:46:20 And drug smugglers! 16:46:34 20 or so pages of action, you just have to read it. 16:48:09 I never have heard of "Whiz Kids", but I'm sure it triggers a powerful surge of sweet memories for some 16:48:56 Atari advertising. :) 16:49:17 At least that's what it looks like. And they throw an anti-drug message into it to make teachers use it. 16:49:59 Robert, have you look at http://www.helsinginsanomat.fi/tanaan/viivijawagner/viivijawagner.asp?paiva=15.4.2003 tthen too :) 16:50:43 Is it in Swedish? 16:50:49 Robert, it was in slashdot i heard ( i dont read it myself) and it was pasted to me already :P 16:50:58 Robert, in finnish :) 16:51:02 :( 16:51:12 I don't like finnish, it's evik., 16:51:15 evilk 16:51:17 EVIL 16:51:24 * Robert can't type. :( 16:51:27 noooo it isnt' :) it's fun :) 16:51:39 Maybe, if you know it. 16:52:00 I can't read, I can't think, I can't write. Maybe it's time to go to bed, soon. 16:52:18 Robert: it is fun, if you have enthusiam for learning something DIFFERENT! ;) 16:52:25 hehe 16:52:52 I don't. Dutch is exotic enough for me. ;) 16:53:09 dutch is like southern dialect of norwegian 16:53:11 And I'm not even active on that front. 16:53:16 uh swedish 16:53:22 Yes, it's quite similar. 16:53:39 To German, too. 16:54:00 Probably most similar to German, and also a bit to English and Scandinavian languages. 16:55:03 Dutch isn't a Northern Germanic language....so it is certainly different. I know English is influenced to some degree by Dutch language 16:55:29 dutch is like english with swedish writing way and german grammar 16:55:55 dutch and swedish are near relative langauges :P 16:57:38 Dutch appears to be a sort of half way between English and German. Swedish just look more different 16:57:59 then again, I am not fluent in Dutch, German or Swedish 16:58:22 :) 16:58:26 Become! 16:58:32 hah 16:59:24 ha ha 17:01:05 Fuck, the whole system is lagged down by the dist-upgrade. 17:01:44 Robert has started to curse :( 17:02:03 calm down, Robert, stress lowers disease resistance. you cant afford that :) 17:02:25 I'm calm. 17:02:29 Very calm, actually. 17:02:38 Too tired to be anything but calm. 17:04:43 what dist-upgrade? 17:05:09 apt-get dist-upgrade 17:05:16 Updates the whole system. :) 17:09:05 hmm...to which? testing? unstable? radiactively unstable? :) 17:11:38 Testing. 17:12:02 Which usually is much more stable than the final release of.. certain other systems. 17:17:27 yup :) Debian is very good overall...provided you know how to fix some things in either testing or unstable from time to time (and have time to do so) 17:19:17 I've only had to fix one thing, a small gftp problem a few months ago. 17:19:23 And it just took a couple of minutes. 17:19:30 only one? sweet 17:19:48 So far. :) 17:19:59 :) 17:20:07 But I don't know, if people have more software installed... maybe there are more problems. 17:20:42 yes...especially if you can afford the bandwidth to push the envelope with the testing 17:21:10 I can.. 17:21:18 500 kbit up and down. :) 17:21:25 And I don't even pay it. 17:23:44 --- join: gilbertdeb (~gilbert@fl-nked-ubr2-c3a-29.dad.adelphia.net) joined #forth 17:24:08 terve gilbertdeb :) 17:24:25 terve mur 17:27:33 hiya gilbertdeb 17:27:43 hi tbw. 17:27:48 how's the going? 17:27:49 Hi gilbertdeb :) 17:28:00 Robert: lucky you....I have slow access, and I pay :( 17:28:09 hey robert. 17:28:15 I have parents to leech from. :D 17:28:21 gilbertdeb: doing OK...I am planning to make tacos tonight :))) 17:28:24 But I feel sorry for you 17:28:40 oh! smart of you to leech from your parents :) 17:28:45 And the other 5 billion people without a good internet connection. 17:28:47 Robert: parents to leech from are fantastic. 17:28:50 * TheBlueWizard nods 17:28:52 I am a practicing leecher. 17:29:01 The advantage of being a kid. ;) 17:29:05 bah. 17:29:13 the advantage of saying the job market is bad :) 17:29:40 :) 17:30:23 lol 17:30:39 if the job market were to suddenly improve, I'd be at a loss. 17:30:57 * TheBlueWizard is working, earning money, but is a notorious tightwad 17:31:17 gilbertdeb: how is that you'd be at a loss? 17:31:29 I'd then have to work part time!!! 17:33:57 ah...but you will build up a resume....or better yet, get a part time job now, build a resume...easier to get a new job when the economy picks up 17:35:02 the parttime jobs involve working the security beat, doing dishes, waitering ... 17:35:19 I guess I could fatten my resume somehow under those circumstances. 17:37:08 you can slant your resume to demonstrate your skills at managing things (not easy though)...i.e. demonstrating your understanding and execution of the tasks, whatever 17:37:20 be a bit imaginative with the resume 17:38:25 the silly thing is that when the economy is good enough, it is a redundant effort to pad ones resume. 17:39:53 in some way that's true 17:40:12 then again, it is market driven thing :-/ 17:40:33 TheBlueWizard, i'm going soon sleep but this is nice (short) little word play http://www.helsinginsanomat.fi/tanaan/viivijawagner/viivijawagner.asp?paiva=19.11.2002 17:41:33 I also am going to look at another comic strip (7.4) 17:41:43 you can go to sleep :) 17:42:47 http://www.helsinginsanomat.fi/tanaan/viivijawagner/viivijawagner.asp?paiva=6.11.2002 this is nice too 17:43:01 ok :) 17:46:38 Robert: I have closer to 2400 kbit and I don't pay :p 17:47:32 heh 17:50:04 bwb: Bah! :) 18:15:26 --- join: Speuler (~Speuler@mnch-d9ba4d26.pool.mediaWays.net) joined #forth 18:15:54 hiya Speuler (I guess no more semtex attached to your body ;) 18:16:23 i'm undercover 18:16:33 gn! 18:16:37 but don't underestimate my speuling capacities 18:16:58 anyone know when I440r is back? 18:17:46 no idea....I440r is having a hard time now 18:17:56 oh true 18:18:04 Speuler: lol 18:18:10 trick is to use an evident give-away 18:18:18 and sneak up behind him 18:19:41 and then get sandwiched between the "give-away" and a sneaker...clever....can't escape 18:20:36 most danger comes from the people you don't recognize as being dangerous 18:21:18 * TheBlueWizard nods, and points to Easter bunny as that dangerous one :) 18:21:43 --- quit: mur ("433,3 % of 1 hour done of the new day. processing sleep mode") 18:22:08 what's that in nanocenturies ? 18:27:15 bye all 18:27:26 'night TBW 18:27:36 bye Speuler 18:27:40 --- part: TheBlueWizard left #forth 18:29:50 --- join: monk23 (monk23@mstr195175-33294.dial-in.ttnet.net.tr) joined #forth 18:33:13 thelonius? 18:34:06 ? 18:34:31 * Speuler suspects mon23 is younger than 20 18:34:36 monk23 18:34:40 hi speuler. 18:34:44 hi gilbertdeb 18:34:51 no. i am older than 20 18:35:00 :O 18:35:00 hmm 18:35:08 not a jazz fan then 18:35:14 what does >r do? 18:35:22 tor 18:35:29 to the rstack 18:35:34 it puts stuff on there :D 18:35:36 removes an element from par stack, pushes it on return stack 18:35:47 return stack.. data stack? 18:35:50 return 18:36:06 stack == parameter/data stack. 18:36:09 oj 18:36:11 oh* 18:36:32 the parameter stack is the parameteres passed to a word? 18:36:35 return/ returnstack == return stack. 18:36:41 yes 18:36:43 oh 18:36:44 oh 18:36:47 its the same as the data stack 18:36:49 i get it now 18:36:53 yes, too 18:36:55 then whats he return stack 18:36:57 lol 18:36:57 re: stack == parameter/data stack. 18:37:06 when you say "stack", you mean "data stack" 18:37:06 the return stack is the second stack. 18:37:18 my tutorial didnt say about that 18:37:29 you say "parameter stack" or "data stack" to distinguish it from "return stack" 18:37:34 >r is a helping hand. 18:37:44 whats the return stack used for? 18:37:47 gilbertdeb: you read starting forth :) 18:37:50 i mean rstack is a helping hand according to my tutorial. 18:37:55 Speuler: yep :) 18:38:05 njd: you can hold variables with it. 18:38:12 oh 18:38:26 it also holds the value of 'i' in a loop. 18:38:31 so all my variables i make, are on the return stack? 18:38:37 and j and k as well. 18:38:44 njd: no, they are on the data stack. 18:38:45 njd: if you want to temporarily get top elements from stack out of the way, you can put them on return stack, and retrieve them later on 18:38:47 oh 18:38:52 oh 18:38:54 lol 18:38:57 im learning 18:38:57 >r r> 18:39:05 to r, rfrom 18:39:41 I don't know why its not called 'r to, and rfrom'. 18:40:18 --- join: TreyB (~trey@cpe-66-87-192-27.tx.sprintbbd.net) joined #forth 18:40:31 to verbose 18:40:41 lack of symmetry 18:40:44 to store a string variable i use, S" hello" varname ! - right? 18:40:55 ugh strings. 18:41:00 not quite 18:41:11 it MAY work 18:41:20 depends on where you keep your string 18:41:29 no, won't work 18:41:48 if it would work sometimes, you'd have to say varname 2! 18:42:09 cause s" leaves you addr and len 18:42:24 yea when i was going 'varname ?' it gave me 5 which im guessing is the len 18:42:35 only storing string len is not enough 18:42:47 but, watch out: 18:43:04 you're not storing the string, just a pointer to the string 18:43:22 if something happens to that string, the pointer will still point to the same location 18:43:28 hmm 18:43:35 may be a different string then 18:43:51 forth seems like a big maths language to me 18:43:57 njd: is that for learning variable and string handling, or because you need strings ? 18:44:16 learning vars and string handling 18:44:24 ok 18:44:39 otherwise i would have pointed you to a string handling library 18:44:52 i can figure out integers with variables 18:44:56 just having problems with strings :/ 18:45:06 njd: it is not terribly obvious. 18:45:07 you can move strings 18:45:22 such as, to a save location 18:46:14 the location, you get from using s" is save (for reading) when using s" in a definition 18:46:28 yeah 18:46:31 but not when you use it in interpreting mode 18:46:41 (not even guranteed to work then) 18:47:23 : mystring s" this is a pretty safe string" ; 18:47:26 mystring 18:47:44 nothing happened 18:47:49 those values you can store without risk in a variable 18:47:49 oh 18:48:10 the stack, didnt check that 18:48:14 data stack* 18:48:18 type 18:48:37 or, 2dup type 18:49:02 ok, what am i typing 18:49:25 mystring 2dup type type 18:50:00 it prints it twice 18:50:08 iz ferry zimple izn't it ? 18:50:35 so, type takes the top two numbers off the stack, the address and the len and prints ut> 18:50:37 it* 18:50:47 exactly 18:50:57 why does it need the len? 18:51:00 you're quick in taking things up 18:51:23 to know how many chars to type. string is not delimited by some extra characters 18:51:38 okay 18:51:45 so are you saying i should store my strings with words? 18:51:57 that's if i store strings 18:52:06 hehehe. sneaky things can be done. 18:52:07 how to deal with strings best depends on what you want to do wit them 18:52:08 like 1- :) 18:52:47 one would tend to NOT define strings as literals in high-level words 18:52:58 wait, pause 18:52:59 newbie here 18:53:02 what's a literal 18:53:03 lol 18:53:07 but for sake of example, that was a simple way to get you a string 18:53:13 ah 18:53:20 : foo 1234 ; 18:53:24 1234 is a literal 18:53:28 you can use, : blah ." blah" ; though ? 18:53:29 a number, in that case 18:53:32 thats simpler 18:53:45 : bar ." barf" ; 18:53:50 barf is a string literal 18:54:08 it is data, compiled into a high-level word 18:54:14 oh yep 18:54:14 gotcha 18:54:44 means "use that literally, as the data it is. don't try to execute it" 18:55:36 hmm 18:55:59 what does sp@ do? 18:56:18 returns address of stack pointer. 18:56:21 not recommended 18:56:36 why did the gods give it to us if not to use sp@ ;) 18:56:37 it's not needed? 18:56:50 spat 18:57:23 gilbertdeb: there are cpu architectures where "addr where stack pointer points to" doesn't make sense 18:57:48 for example, stack space not in data space 18:57:55 address won't help you 18:58:02 you couldn't @ it 18:58:16 depth would be sufficient for those 18:58:38 @ = fetch 18:58:47 retrieve... 18:58:48 get. 18:58:50 obtain. 18:59:07 its like ? right 18:59:09 @ . = ? 18:59:21 fetch and display 18:59:31 not recommended, because, if your program relies on being able to @ sp@, there's no way to get that working on some cpus 18:59:37 fetch, place on data stack and display topmost item. 18:59:44 actually, sp@ @ 19:00:43 : ? @ . ; 19:01:30 ah i was right 19:01:56 njd: have you seen/heard of bashforth ? 19:01:57 @ . = ? -> stack underflow :) 19:02:12 gilbertdeb yea i was at the page yesterday 19:02:18 cool. 19:02:29 neat huh? 19:02:34 is it yours? 19:02:35 i didnt try it 19:02:39 Speuler: 19:02:41 * Speuler is not here 19:02:41 it must be a bitch to make 19:02:52 it belongs to him. he brought it into being. 19:03:06 would you reccommend it more than gforth? 19:03:17 it is a great thing to play with. 19:03:30 whats the url ? 19:03:33 if you can read bash, you can read a whole forth. 19:03:42 from the ground up... 19:03:53 and its one big file, not 123423423 .c files. 19:04:03 yeah i saw its one file 19:04:04 forthfreak.net/bashforth 19:04:10 www 19:04:20 www.forthfreak.net/bashforth 19:05:54 its messing up 19:05:58 what is/ 19:06:00 ? 19:06:03 : foo ." hello" cr ; 19:06:03 word not found 19:06:03 ok 19:06:03 foo 19:06:03 word not found 19:06:04 ok 19:06:06 words 19:06:08 word not found 19:06:10 ok 19:06:12 do i have to use it differently or something 19:06:32 what bash version ? 19:06:37 : foo ." hello " cr ; should work. 19:06:37 2.05a 19:06:57 err 19:06:57 b 19:07:01 2.05b sorry 19:07:06 should be fine 19:07:13 does it matter it's os x? 19:07:16 2.03 doesn't work 19:07:21 2.04 and better does 19:08:00 hmm. i'd say bash2.05 is bash2.05 19:09:14 try to comment out the set -u on line 2 19:09:39 it works this way : 19:09:42 still says 'word not found' for whatever i type 19:09:47 : foo s" hello world " cr ; 19:09:50 foo type 19:10:00 word not found 19:10:24 could be that i slipped in a bug in recent version of course 19:10:48 it might not like os x for some reason ? 19:11:10 I am using .36 19:11:20 I refused to upgrade :D 19:11:49 v48a (the one from server) does : foo ." hello " cr ; nicely here ... 19:12:10 lol 19:12:14 * njd whimpers 19:12:21 alright, I'll upgrade :D 19:12:24 http://www.forthfreak.de/bashforth.versions/ 19:12:27 i will try .36 19:13:03 still saying word not found 19:13:04 lol 19:13:12 now that sucks 19:13:43 looks like an incompatibilty 19:13:57 no idea what 19:14:11 i assumed bash on different platforms to behave identically 19:14:35 isforth wouldnt compile either 19:14:39 so i have to use gforth 19:14:46 would get tough if you need to take care of platform issues with shell scripts 19:15:21 how long have you knowen forth 19:15:23 known* 19:15:26 but, fact is that bashforth uses some bash techniques where bash hasn't been tested very well against 19:15:37 noticed before 19:16:09 t'is a bit "bash to the max" 19:16:29 once you strain something, tendency to breal gets higher 19:16:39 break 19:17:21 i noticed with minor bash version differences 19:17:40 forthcgi looks fun 19:17:42 you make? 19:17:49 hm 19:18:03 not a good demo on that server. pictures missing 19:18:52 some things don't show w/o pictures 19:19:01 such as mouse-over 19:19:11 (javascript stuff) 19:19:49 code is also still a bit rough 19:19:54 could need some refinement 19:20:06 unfinished work 19:20:10 i wouldnt know where to start or how to make it if i was trying to make something like that 19:20:14 functional as far 19:20:45 last action was trying to get text from forms back to the cgi script 19:20:52 that doesn't work yet 19:20:57 hard 19:21:36 i wanna make something in forth, to learn how to use it 19:21:38 but i dunno what 19:21:51 have a look at stringstack. that's better written 19:22:10 also gives you an idea of one way to deal with strings 19:22:17 runs with gforth btw 19:23:02 \ left$ ( n -- ) leaves n left chars, or cuts off -n right chars 19:23:03 \ right$ ( n -- ) leaves n right chars, or cuts off -n left chars 19:23:03 \ mid$ 19:23:05 looks like basic 19:23:12 i more on the finished end than forthcgi 19:23:25 yeah. nicked from basic 19:23:42 but allows negative len or index 19:23:50 basic doesn't 19:24:04 i learn quickbasic at school in programming 19:24:07 it's a waste of time 19:24:38 er qbasic 19:24:39 left$ right$ are pretty intuitive 19:25:27 i've no problems stealing features of languages, even from those i dislike as a whole 19:26:42 pity my forth-written apl matrix operations are lost somewhere 19:27:02 long ago 19:27:16 what are they 19:27:17 apl matrix operations? 19:27:19 eeek! 19:27:21 even didn't have a pc then :) 19:28:25 matrix, basically a multi-dim array 19:28:34 a scalar of scalars 19:28:49 what did you do it on? 19:28:53 some bigiron? 19:28:53 fil them, rotate them , multiply them 19:29:00 on flex-09 machine 19:29:32 microprocessor 19:29:43 motorola 6809 19:30:24 image enhancements and filtering was a snap with those functions 19:30:43 one matrix, containing image, 19:30:56 secons matrix the convolution coefficients 19:31:03 ah I see. 19:31:10 so they were bitmaps? 19:31:27 nope. integers. but pixel colors where integers too 19:31:54 cells, to be more concise :) 19:32:09 16 bit 19:32:23 does emit print the value of an ascii number ? 19:32:30 or what that ascii numbers character is 19:32:33 nope 19:32:36 42 emit 19:33:13 yea..? lol 19:33:16 key dup . emit 19:33:58 it says 13 19:34:05 you pressed enter 19:34:09 try a char 19:34:21 where am i ment to be putting this char 19:34:32 key put it on stack 19:34:44 emit gets it from stack 19:35:20 so emit takes the top number and prints ascii character 19:35:52 and 'char .' is the opposite 19:35:54 it displays it ? 19:36:05 char * emit 19:36:09 char * . 19:36:27 char * 1+ emit 19:36:47 char A 32 + emit 19:36:48 am i right or am i wrong 19:37:05 does your observation confirm your statement ? 19:37:14 yes 19:37:23 so ? 19:37:28 i am ? 19:37:35 right 19:37:42 this is only my 2nd day playing with forth so i dont know for sure so thats why i ask 19:38:10 your thinking aids you more than my my telling 19:39:05 njd: how did you come across forth? 19:39:23 i440r, he told me to learn it for ages whenever i asked him to teach me c lol 19:39:31 he said it yesterday and i was on the site 19:39:34 and there was a tutorial 19:39:35 so i read it 19:39:40 which site?? 19:39:46 http://forth.tech.nu 19:39:59 actually, there's a pretty usable tutorial coming with gforth 19:40:08 pinfo gforth 19:40:12 or info gforth 19:40:16 aha! 19:40:21 pinfo is easier to use than info 19:40:25 Speuler: have you written a tutorial? 19:40:31 nope 19:40:43 what will it take? 19:40:52 for me to write one ? 19:40:58 yeah. 19:41:02 patience 19:41:06 coffee 19:41:07 lol 19:41:14 motivation 19:41:27 recognizing a need 19:41:33 youd make good ones 19:41:53 i was considering to start writing a book about 19:42:00 yes? 19:42:04 ..? 19:42:10 hehe 19:42:14 kept it for a time when i wouldn't know what else to do 19:42:26 is that likely? 19:42:37 could i get a free copy 19:42:49 couln't expect addison wesley to pay me an advance i guess 19:43:04 njd: there are 2 famous forth books and they are legendary for their lack of availability. 19:43:13 njd: once i'lll be finished, you're a forth master already 19:43:36 hehe 19:43:47 i still dont get how to do anything in forth except for maths stuff 19:43:51 :p 19:44:10 control of peripherals ? 19:44:12 I guess it would be nice to do forth alongside TAOCP 19:44:52 * njd reads gforth forth tutorial 19:45:13 njd: you can write forth's greatest killer app! 19:45:22 what 19:45:24 s 19:45:24 that 19:45:26 forth 19:45:40 aye 19:46:10 check out the chapter "crash course tutorial" :) 19:46:20 it gives you a crash course 19:46:27 i.e. a course how to crash forth :) 19:46:32 i dunno how to change chapters cept using space 19:46:55 using pinfo or info ? 19:47:07 oh 19:47:10 im at the crash course now 19:47:14 info 19:47:29 Now that you know how to produce crashes (and that there's not much 19:47:30 to them), let's learn how to produce meaningful programs. 19:47:32 lucky me 19:47:35 b is back 19:47:37 enter is enter 19:47:44 cursor up/down 19:47:54 bye all :) 19:47:59 --- part: monk23 left #forth 19:48:03 thelonius? 19:48:08 hmm. 19:48:45 n and p are next/previous chapter 19:49:13 t is top 19:49:58 sorry, not b but l is back 19:50:03 l as in last 19:50:31 wow 19:50:33 assignments 19:52:01 Given: How do you get: 19:52:01 1 2 3 3 2 1 19:52:02 wow i did it 19:52:10 1 2 3 swap rot 19:52:20 there's probably one word that does the same thing though 19:52:25 werri gud 19:52:47 mmmm 19:52:53 you can make one :) 19:53:08 there isn't 19:53:24 i made '1 2 3 2' by using '1 2 3 swap dup -rot' 19:53:31 is there a simplier way? 19:53:36 this is fun 19:53:37 lol 19:53:38 over 19:53:41 oh damn 19:53:51 damnit 19:53:59 whats the stack description? 19:54:07 .s 19:54:10 : foo ( -- ) ; 19:54:15 no for over 19:54:20 between ( ) is stack description 19:54:25 it is a comment 19:54:26 yeah i know what they are 19:54:36 ah 19:54:47 is over ( n1 n2 n3 -- n1 n2 n3 n2 ) ? 19:54:48 ( x1 x2 -- x1 x2 x1 ) 19:54:50 oh 19:54:56 yea 19:54:58 woopsies 19:55:04 there are diagreams clearly displaying these things. 19:55:30 aha. 19:55:33 its a frog 19:55:45 what is 19:55:51 for over. 19:56:07 how the hell do you get a frog 19:56:10 three leaves, 2 labeled a b, and a frog jumping from a to the third empty one. 19:56:15 "gilbertdeb: forget is a thief" :) 19:56:17 pg 47 19:56:32 yep. 19:56:40 I never forget forget 19:56:52 how do i loose the top member of the stack without using . ? 19:56:52 "gilbertdeb: / is a samurai" :) 19:57:00 drop? 19:57:03 drop 19:57:08 k cool 19:57:32 rot is a juggler 19:57:54 "gilbertdeb: execute is a hooded axe-man :) 19:57:55 and swap is a double headed dragon... 19:58:08 oh yes slash is sa samurai 19:58:13 s/sa/a/ 19:58:23 bwb do you have SF as well? 19:58:30 gilbertdeb: read it a few years ago 19:59:12 "gilbertdeb: create does> are salt shaker forms" :) 20:00:03 I don't see them. 20:00:13 ah. 20:00:15 silly me. 20:00:26 page 247 or so, where i marked the page with "heavy" 20:00:54 mine's on 291 20:00:59 why did you call it heavy? 20:01:09 was the first time i was reading about 20:01:30 had to get accustomed to that concept first 20:02:02 * Speuler learned forth with that book 20:02:12 hehe. 20:02:17 how many times did you have to read it? 20:02:49 until i found out how to get more knowledge about the system by using the system 20:03:14 25 20:03:18 not bad :) 20:03:20 no way :) 20:03:47 read it maybe twice or thrice. later again just for fun 20:04:30 wan't exactly stupid when i got into learning 'bout forth 20:05:03 about computers? 20:05:06 you know, once takes on new information easily when one is young :-) 20:05:12 one .. 20:06:02 the fundaments were probably layed by toying with programmable calculators 20:06:20 those need some ability of problem abstraction too 20:06:47 laid 20:07:35 did some electronics before 20:08:36 still remember when i went to the local electronics store, wanting to buy a transistor 20:08:45 guy asked me "pnp" or "npn" 20:08:53 i didn't know :) 20:09:01 you should have said both. 20:09:06 so he sold me a cheap one 20:09:12 was pnp i think 20:09:44 does negate make the top member of the data stack negative? 20:09:51 right 20:09:52 no 20:09:55 it negates it 20:10:02 .. 20:10:05 if it was negative, it makes it POSITIVE :) 20:10:11 oh 20:10:24 im ment to re-make the words and im up to negate. i don't know how to do it 20:10:37 : negate -1 * ; 20:10:49 is that all 20:11:03 dam 20:11:07 i spose its a maths thing 20:11:09 there's a more efficient implementation, which doesn't use * 20:11:36 hey 'see' is a cool word 20:11:40 but you need to know about twos complement representation of negative numbers in order to understand it 20:12:50 5 -1 * --> -5 20:12:59 -5 -1 * --> 5 20:13:07 not very math :) 20:15:06 do you use local variables? 20:15:09 njd an absolute value function isn't too hard. 20:15:18 local variables are elements on the stack. 20:15:25 yeah but do you use them 20:15:26 scratch that. 20:15:30 for what? 20:15:33 i dunno 20:15:34 anything 20:15:39 what for? 20:15:43 :) 20:15:48 I asked that didn't i? 20:15:50 yes. 20:15:57 : negate invert 1+ ; 20:15:57 there is a word for creating variables. 20:15:59 you confuse me 20:16:37 * Speuler harldly ever uses local vars 20:16:45 got the stack for 20:16:50 njd: variable 20:17:09 23 ! 20:17:23 ? 23 ok 20:17:42 njd: you got variables all right, but: a common beginners mistake is to use them too often 20:17:45 im just looking at the tutorial 20:18:35 njd: do you understand that some words consume elements on the stack? 20:19:29 yes 20:19:34 :) 20:25:20 the interpreter looks french. 20:28:47 --- join: CaffeineJunkie (~Speuler@mnch-d9ba468f.pool.mediaWays.net) joined #forth 20:29:25 re 20:29:33 * CaffeineJunkie alias Speuler 20:29:48 you never left. 20:29:52 what's the last thing i said ? 20:30:05 re 20:30:07 my alter egos will leave soon 20:30:07 [15:18:45] njd: you got variables all right, but: a common beginners mistake is to use them too often 20:30:09 njd: you got variables all right, but: a common beginners mistake is to use them too often 20:30:10 im just looking at the tutorial 20:30:18 bah. 20:30:24 programs properly written hardly use variables 20:30:24 beginner tend to use them because they use them in other languages too 20:30:24 but because of the full control on stack, rather than temporarily storing data in variables, try to keep data on stack 20:30:24 if logic flow and data flow relate well to each other, there's not much stack shuffling required 20:30:24 just try to avoid calculation of intermediate results which you are not going to use right away again 20:30:26 so there's no need to keep a result for long 20:30:28 that's, generally speaking. practical problems may require you to be creative with stack use 20:30:30 minimizing stack activity is almost always a good thing to try 20:30:51 yeah im used to php 20:30:55 which i use variables a bit 20:31:07 speuler its a little like re-organizing data for apl 20:31:19 because you can't leave results just floating on the stack 20:31:33 you need to put them somewhere 20:31:42 that's why you put them into variables 20:32:05 there's no need for that in forth 20:32:28 @ is a dog 20:32:34 you CAN leave them floating on the stack 20:32:39 it is actually encouraged 20:34:22 right 20:34:23 heh 20:34:52 --- quit: Speuler (Read error: 110 (Connection timed out)) 20:35:03 --- nick: CaffeineJunkie -> Speuler 20:35:54 is 'create' used to create arrays 20:36:16 nope 20:36:25 it can be used for creating arrays 20:36:39 is there a reference somewhere with definitions on what the words do 20:36:41 --- quit: semtex (Read error: 110 (Connection timed out)) 20:36:45 create is used to create a new header 20:36:54 --- join: semtex (~Speuler@mnch-d9ba468f.pool.mediaWays.net) joined #forth 20:36:54 DPANS94 20:36:58 whats a header lol 20:37:09 the name of a word 20:37:13 oh 20:37:20 like the : ; thing? 20:37:37 variable foo 20:37:44 foo will have a header 20:37:50 with name foo 20:38:01 variable has a header too 20:38:08 variable :) 20:38:21 ... 20:38:24 whats the point of it 20:38:26 briefly: a header allows a word to be found by name 20:38:40 instead of an address? 20:39:13 do you say ' : foo 32456, 35234 , 12323 , . ? 20:39:34 those numbers are addresses right? 20:39:37 if they are, no 20:39:43 unless youre wack 20:39:44 (ignoring that without headers : and ; couldn't be found neither ) 20:40:23 so what do you use it for? heh 20:40:23 a header contains the name of a word, and a pointer to its code 20:40:51 when interpreting, that list is searched for the word 20:41:08 actually, also when compiling 20:41:37 a header is the only place the name of a word is stored 20:41:59 so, variable foo creates a new header for foo 20:42:16 ok... 20:42:20 now `create' does? 20:42:25 executing foo results in searching the list of headers for foo 20:42:27 makes headers? 20:42:31 right 20:42:41 but i thought when you use variable foo 20:42:44 it makes the header 20:42:47 and gives it the behaviour of a variable 20:42:48 why do you need create 20:42:58 create makes them 20:43:01 but they arent used? 20:43:07 : variable create 0 , ; 20:43:35 hmm 20:43:38 create buffer 128 allot 20:43:54 create buffer 128 allot redefined buffer ok 20:43:56 ?? 20:43:58 riiiht 20:44:00 +g 20:44:00 true ... 20:44:06 create foo 128 allot 20:44:18 ok 20:44:22 that does? 20:44:28 whats the 128 and allot do 20:44:32 put 128 in foo? 20:44:34 created a header "foo" 20:44:46 which , when executed, returns an address 20:44:52 foo ? 200814306 ok 20:45:10 at that address, there are 128 bytes you have reserved 20:45:13 for foo 20:45:31 foo 128 char A fill 20:45:41 foo 20 type 20:45:54 its got 128 A's ? 20:46:17 those 128 bytes at foo have been filled with As, yes 20:46:30 foo 4000 type aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ok 20:46:34 i did 4000 20:46:39 instead of 20 20:46:47 was your buffer at foo big enough ? 20:46:48 njd you can talk to sifbot if you like 20:47:02 well i only did the create 128 20:47:05 gilbertdeb whats sifbot 20:47:20 sifbot: ." hello, njd " 20:47:21 gilbertdeb: 20:47:33 that's not a problem now. it would be a problem if you'd added another word after foo 20:47:49 sifbot: 3 2 + . 20:47:50 gilbertdeb: 5 20:47:51 because by filling it with 4000 As, you would have overwritten it 20:48:16 if i just type 'foo' 20:48:23 749504 20:48:26 it puts that in the stack 20:48:29 what is that 20:48:30 it gives you the address of foo on the stack 20:48:30 an address? 20:48:39 foo ? 1633771873 ok 20:48:41 what is that then 20:48:50 sifbot: 3 5 swap . 20:48:52 njd: 3 20:49:01 create xxx 10 allot create yyy 10 allot 20:49:08 xxx . yyy . here . 20:49:31 addresses? 20:49:35 sifbot: .s 20:49:37 njd: 20:49:45 sifbot: 3 5 swap .s 20:49:46 njd: 5 3 20:49:49 haha thats cool 20:50:18 sifbot: 10 variable showy ! 20:50:19 gilbertdeb: stack underflow 20:50:28 one at a time. 20:50:38 sifbot: variable showme 20:50:40 gilbertdeb: 20:51:00 sifbot: 10 showme ! 20:51:01 gilbertdeb: Word not found: showme 20:51:08 clever. 20:51:09 one line 20:51:11 do you have a memory? 20:51:20 Speuler if i dont use the 'allot' what does that mean? 20:51:38 you don't put it anywhere 20:51:38 sifbot: variable blah 10 blah ! blah ? 20:51:39 that you don't reserve any mem to foo 20:51:40 njd: Word not found: ? 20:51:53 so its not made? 20:52:01 Speuler: does sifbot lack allot then? 20:52:04 it is made, but has no space 20:52:08 is that why it remembers nothing? 20:52:10 sifbot: variable blah 10 blah ! blah . 20:52:12 njd: 670 20:52:16 what 20:52:20 whats 20:52:22 ack 20:52:23 sifbot: variable blah 10 blah ! blah .s 20:52:25 njd: 670 20:52:26 njd: here . 10 allot here . 20:52:35 sifbot: see variable 20:52:36 gilbertdeb: Word not found: see 20:53:04 gives here 10 bytes ? 20:53:23 after 10 allot, here is 10 bytes higher 20:53:54 is allot like short for allocate? 20:54:00 no 20:54:09 allocate is another word 20:54:23 allot is static allocation, allocate is dynamic allocation 20:54:32 this is harder than i thought 20:54:33 lol 20:54:41 forget about allocate for now 20:54:59 hehe. 20:55:02 im still stuck on create 20:55:05 drop it from your list of words. 20:55:18 1 character = 1 byte -- thats right isnt it? 20:55:52 1 chars . 20:56:03 that's the number of bytes for a char 20:56:24 (char may be 16 bits, for example) 20:57:03 usually, it is right. but don't hardcode it 20:57:20 do you use create much? 20:57:37 yes 20:57:45 so i need to learn it? 20:57:47 has some extra uses 20:57:54 is a very powerful word 20:58:08 too early for the extra uses :) 20:58:26 i dont even get the simple uses 20:58:45 well 20:58:52 it just creates a new name 20:59:01 maybe that's easier than "header" 20:59:09 no i get header 20:59:32 : uses create, variable uses it , 20:59:39 all words which create words use create 21:00:25 if create is used, the created word can be found by name 21:00:37 so i can use to create a variable of say 100 bytes? 21:00:53 if not, you still COULD use it, but not by referring to its name. it has none 21:01:01 --- quit: fridge ("http://lice.codehack.com") 21:01:16 yes, only you wouldn't call it "variable" 21:01:21 i call it a header? 21:01:58 nope. it is not the header. it creates a header, as part of the word 21:02:06 oh k 21:02:55 if you just create a word, it is just , a word :) 21:03:51 : mylongvariable create 8 allot ; 21:04:01 mylongvariable foo 21:04:15 now you've created a "mylongvariable" 21:04:36 create foo 8 allot 21:04:51 same thing 21:05:03 but how would you call it ? 21:05:20 umm 21:05:22 " a word with 8 bytes alloted to it" 21:05:39 very similar to a variable indeed 21:05:53 but, a variable has just one cell alloted to it 21:05:54 http://www.xs4all.nl/~thebeez/ForthPrimer/Forth_primer.html#tth_sEc5.6 21:06:07 not the number of bytes you specified yourself 21:06:14 foo 10 , 15 , 20 21:06:35 ... 20 , 21:06:46 oh 21:06:47 comma is a word too 21:06:56 not some syntactic glue 21:07:11 so if theres an address on the stack 21:07:16 and i type '10 , 20 ,' 21:07:22 no 21:07:23 oh 21:07:25 ok 21:07:28 :) 21:07:40 here 10 , @ . 21:07:53 i get 10 21:07:58 right 21:08:11 that's the 10 you've put into mem, using , 21:08:21 it is put at address "here" 21:08:37 here is the end of everything you have compiled 21:08:50 hm 21:08:50 or, the place where new things you compile will be put 21:09:04 below here is your system 21:09:10 above here is free memory 21:09:12 more or less 21:09:31 o_O 21:09:32 by using allot , or , you move that border 21:09:39 upwards 21:09:57 you say "this formerly free mem is now part of the system" 21:10:16 here . 21:10:22 10 , 21:10:22 here . 21:10:34 8 allot 21:10:37 here . 21:11:24 , (comma) just puts the number on top of stack into mem, and makes that address part of the system 21:11:48 does it put it in the first cell 21:11:48 (the address where the number from stack has been put) 21:11:51 or the first empty one 21:12:01 into the address at here 21:12:08 so itd b the first one? 21:12:17 : , here ! cell allot ; 21:12:43 better: : , here cell allot ! ; 21:13:14 what does cell do? 21:13:22 cell . 21:13:25 it is a constant 21:13:31 it says 4 21:13:36 sifbot: cell . 21:13:46 telling you how many bytes are used for one ... "integer" ... 21:14:14 on a 16-bit system, cell is 2 21:14:23 on a 32 bit-sys, cell is 4 21:14:38 (if address increments are done by byte) 21:14:52 hmm 21:15:06 and cells? 21:15:18 create myarray 10 cells allot 21:15:20 i see that there 21:15:30 helps making some differences between 16, 32 and 64 bit systems disappear, from point of view of source code) 21:16:00 123 here cell allot ! works on 16, 32, 64 bit systems 21:16:25 123 here 4 allot ! would only work on 32 bit system the way you intended it 21:16:46 so best to use cell 21:16:48 a stack element is one cell wide 21:17:18 that's common opinion, but not i440r's 21:17:18 he'll hate me for telling you about cell 21:17:33 but i think, cell is good 21:17:44 he thinks "it is easy to rewrite the code" 21:17:59 you make up your mind :) 21:18:22 lol 21:18:29 oh. cell is a standard word 21:19:49 whats a simple program i could make in forth to start off ? 21:19:50 when using cell in examples, it saves me from having to ask "do you have a 16 or 32 or 64 bit system ?" 21:20:18 a word like see is often written very early 21:20:50 it helps to understand how a high-level word (a colon definition) is constructed 21:21:08 next step is often, that people write their own forth :) 21:21:17 why would you write your own 21:21:23 to understand ? 21:21:29 to use it ? 21:21:38 to toy around with 21:21:40 hm 21:21:42 itb be too hard 21:21:47 for me anyway 21:22:11 if i present you this line in 4 weeks time, you'll laugh about it 21:22:52 a forth interpreter is simpler than it appears 21:23:36 i want to learn sockets 21:23:40 and make a forth irc bot 21:23:42 thatd be fun 21:24:07 that's actually a popular project too 21:24:25 i dont know where to start though 21:24:26 hehe 21:24:37 sifbot: s" i agree" type 21:24:52 bluddy bot 21:25:14 :) 21:25:31 sockets are non-trivial 21:25:51 well 21:25:59 is there documentation on it or what 21:26:19 i440r would be the right person to ask 21:27:15 sockets are either os-specific, or hardware-specific (if you implement the whole thing, rather than using os-provided functionality) 21:27:44 i'm more a kind of stand-alone forth person (no os between hardware and forth) 21:27:44 i saw there's a bot that comes with isforth 21:27:50 but i don't get it 21:28:23 create bot-nick ," [Forth]" 21:28:57 could that be 21:29:03 variable bot-nick S" [Forth]" 21:29:03 ? 21:29:03 with that, i can't fall back to os-features 21:29:06 bot-nick count type 21:29:22 first case was better 21:29:48 2nd makes a variable, then puts address and len of string on stack 21:30:03 how do i get the value of the create then? 21:30:13 type? 21:30:18 bot-nick type ? 21:30:20 there's no relationship between the variable and the string 21:30:38 you create bot-nick 21:30:45 by executing bot-nick 21:31:02 bot-nick count type 21:31:16 bot-nick gives you just the address 21:31:22 oh you need the len as well? 21:31:25 type wants address and length 21:31:41 type wants to know how many characters to output 21:32:33 ," foo" puts len of "foo" into first byte 21:32:51 count can get it from there 21:33:13 do this: 21:33:24 create foo ," abc" 21:33:29 foo 4 dump 21:33:51 hm 21:34:06 see the first number ? 21:34:14 03 21:34:26 yeh 21:34:30 whys that there 21:34:36 create bar ," abcdefgh" bar 9 dump 21:34:51 because ," has put it there 21:34:57 oh 21:35:06 its the length 21:35:09 now do: 21:35:12 foo .s 21:35:15 count .s 21:35:37 type 21:35:43 the address gets one added to it after you type count 21:35:49 right 21:35:49 so before its got one added to it 21:35:51 thats the length? 21:35:53 and it takes that 21:35:55 and adds one? 21:36:14 : count 1+ dup 1 - c@ ; 21:36:33 or 21:36:51 dd is the coolest thing about vi 21:37:04 : count dup 1+ swap c@ ; 21:37:38 whats c@ 21:37:45 something fetch? 21:37:52 character fetch 21:37:59 right 21:38:16 gets a byte or whatever (instead of 32-bits, in a 32-bit forth) 21:38:23 yes 21:38:36 there's also w@ in gforth 21:38:40 2 bytes 21:38:47 --- quit: sifbot (Connection timed out) 21:38:48 * bwb wanders back afk again after feeling a bit useful :p 21:39:11 hmm... did i do anything nasty to taht bot ? 21:40:19 dunno 21:40:50 i'll retry once it comes up again 21:40:57 is it yours 21:41:01 nope 21:41:23 should be herkamire's 21:50:32 how long you known forth? 21:50:46 'bout 25 years 21:51:05 jeeaz 21:51:27 i want to make something, but i dont know what 21:52:27 know brainfuck ? 21:53:11 interpreter for brainfuck programs is not difficult to do 21:53:32 brainfuck has only 6 instructions, plus 2 for input/output 21:53:40 ive looked at it 21:53:49 and there are plenty of brainfuck programs on the net 21:54:05 can be fun 21:54:20 what can i make with forth though 21:54:27 about anything 21:54:38 like, a brainfuck interpreter 21:54:48 i think thats a bit advance for me 21:54:53 or, a brainfuck to other language translator 21:55:04 actually... a brainfuck itnerpreter should be pretty easy in forth.. :) 21:55:13 well, adding two numbers wouldn't be much of a task :) 21:55:14 iirc about brainfuck 21:55:59 becomes ++p; 21:55:59 < becomes --p; 21:56:02 well those two arent hard 21:56:04 >* 21:57:03 written a compiler and executor (not an interpreter) in 15 lines, each line < 64 chars 21:57:16 you think i could do it? 21:57:32 i wouldn't see why not 21:57:44 the things you're missing you learn while doing 21:58:08 Instruction Description 21:58:08 > Increment the pointer 21:58:08 < Decrement the pointer 21:58:12 whats all this pointer stuff 21:58:15 here's a simple program: 21:58:44 [->+<]>[-<++>]< 21:58:50 god damn 21:58:54 this multiplies by two 21:59:01 mupltiplies WHAT by two? 21:59:02 lol 21:59:27 the program is complex because the language is primitive 21:59:28 oh 21:59:32 +- 21:59:35 i get that 21:59:39 makes the pointer one 21:59:40 then zero 21:59:41 lol 21:59:43 i think 22:00:22 you only got < > + - [ ] 22:00:30 and, for i/o . , 22:01:12 multiplies the number the pointer is pointing to by two 22:01:29 it assumes that the location of pointer+1 contains zero 22:01:43 if that's not the case, it would have to be set to zero first 22:01:45 is the pointer always 0 when you start? 22:01:51 program would then become: 22:02:10 >[-]<[->+<]>[-<++>]< 22:03:14 what such a forth-written interpreter would teach you is, in general, emulation of micropprocessors 22:03:39 now, here's one with only very few instructions 22:03:50 which are very simple, too 22:04:01 :| 22:04:01 lol 22:04:46 whats this pointer thing all about though 22:05:29 just a pointer to a location which can contain data. a byte, usually 22:05:38 so 22:05:41 > 22:05:43 makes it one 22:05:44 ? 22:05:46 no 22:05:52 sets pointer to the next location 22:05:59 "one up" 22:06:01 how many locations are there 22:06:16 default 30000, but you won't need that many 22:06:20 jesus 22:06:30 10 would be plenty :) 22:06:38 oh 22:06:40 so say i have 22:06:44 at least, for simple brainfuck programs 22:06:48 [.0] [0] [0] 22:06:52 and i went 22:06:53 the one i've given you needs 2 22:06:53 > 22:06:58 [0] [.0] [0] 22:07:02 it moves the poinbter 22:07:04 the . is the pointer 22:07:04 ? 22:07:09 right 22:07:11 and so 22:07:12 + 22:07:13 would make 22:07:16 [0] [.1] [0] 22:07:17 ? 22:07:21 increments contents by one 22:07:25 right 22:07:26 i GET IT 22:07:27 !! 22:07:27 :p 22:07:39 . 22:07:43 would print one? 22:08:01 no. . prints the char which ascii is in under pointer 22:08:21 it would emit char with ascii 1 22:08:22 oh 22:08:25 that's ctrl-A 22:09:23 like emit does :) 22:09:36 >[-]<[->+<]>[-<++>]< 22:09:40 lemme try that thing of yours 22:09:58 what does that do? 22:09:59 lol 22:10:23 >[-]< [->+<] > [-<++>] < 22:10:25 4 parts 22:10:30 eh. 5 22:10:33 haha 22:10:42 (spaces are ignored) 22:11:03 (actually, anything which is not <>+-[]., gets ignored) 22:11:11 mmk 22:11:11 first part: 22:11:38 > set pointer to next location 22:11:56 [ test whether location under pointer is 0 or not 0 22:12:10 if not 0, preceed with next instruction 22:12:25 if 0, continue behind next ] 22:12:37 so, if not 0, then 22:12:43 - decrement by one 22:12:50 until it is 0 22:12:57 ] jump to matching [ 22:13:15 right. a loop, decrementing location under pointer till it is 0 22:13:43 ok 22:13:45 < pointer one down (wher we got the number we want to multiply) 22:13:52 next part 22:13:59 you do it :) 22:14:05 ok 22:14:13 [->+<] 22:14:16 if not zero 22:14:19 assume , we got 2 under pointer 22:14:23 okay 22:14:42 that is, we have: 22:14:48 yea i need to see the cells 22:14:50 or somethimng 22:14:51 [.2] [0] 22:14:53 ok 22:14:54 ah 22:14:55 yes 22:14:56 ok 22:15:10 if not zero, take one off it 22:15:13 which make it one 22:15:18 move to the next cell 22:15:23 [1] [.0] 22:15:26 add 22:15:31 [1] [.1] 22:15:33 move back 22:15:41 hey does it end up [0] [2] ? 22:15:45 right 22:15:53 aha! 22:16:03 next part. here the *2 takes place 22:16:10 [-<++>] < 22:16:19 stop 22:16:22 ok 22:16:23 i stopped 22:16:24 forgot the > 22:16:28 yeah i saw that 22:16:34 [0] [.2] i think where we are 22:16:39 yes 22:16:48 ok 22:16:53 if not zero, which its not 22:17:33 take one off [0] [.1] move [.0] [1] add 2 [.2] [1] move back [2] [.1] 22:17:38 oh it make [4] [0] 22:17:46 oh i get what you mean by multiply now 22:17:49 i didnt get it at first 22:17:55 see ? 22:17:59 yeahg 22:18:03 its quite complicated 22:18:08 but easy to read 22:18:12 ai 22:18:22 try /2 :) 22:18:29 much more complicated ... 22:18:33 ok lemme try 22:18:39 what am i dividing by two 22:18:49 writing the brainfuck interpreter in forth is easier :) 22:19:15 ill try 2 / 2 ? 22:19:20 or is that not how it works 22:19:24 if you like 22:19:30 see you tomorrow :) 22:19:33 haha 22:19:56 i wouldnt know how to do the cells in forth 22:20:01 i reckon i could make the rest 22:20:10 sure you know 22:20:24 create brainfuckmem 30000 allot 22:21:29 what you use as pointer, you can either leave on the stack, or put into a variable. 22:21:35 stack is perfect, though 22:22:03 nasm -f bin -o bf bf.asm && chmod +x bf 22:22:04 woops 22:22:09 i would initialize brainfuckmem to zero, though 22:22:19 its not working 22:22:23 brainfuckmem 30000 0 fill 22:22:32 hm 22:22:36 i need an interpreter first 22:22:40 this nasm one aint working 22:23:14 i got a forth one, but that would take the challenge away 22:23:18 yeah 22:23:42 bash: ./bf: cannot execute binary file 22:24:25 elf versus a.out issue ? 22:24:33 do file bf 22:24:34 i dunno 22:24:34 lol 22:24:40 elf 22:24:50 should do 22:25:07 isnt asm code written for a specifier processor? 22:25:15 yes 22:25:19 yeah 22:25:29 remember this is a mac 22:25:31 ppc 22:25:32 not x86 22:25:42 rofl 22:25:47 ok 22:25:49 maybe it will work 22:25:50 sorry 22:26:00 but not for me 22:26:01 lol 22:30:05 argh 22:30:09 cant find interpreter! 22:30:35 there are plenty of c-written ones too 22:32:45 i compiled your program 22:32:48 >[-]<[->+<]>[-<++>]< 22:32:58 but nothing displays 22:33:04 sure. 22:33:05 no putput 22:33:09 oh yeah 22:33:12 it just leaves the result 22:34:01 ouput ... 22:34:04 damn 22:34:06 output 22:37:04 would i make words for [] etc 22:37:07 in forth? 22:37:48 i wouldn't 22:37:59 ah 22:38:04 misunderstood 22:38:22 you could 22:38:33 ill try 22:38:34 + 22:38:35 first hehe 22:38:49 1+ ? 22:38:51 thats all aye 22:39:02 [ ] are actually the most difficult ones 22:39:08 yea im leaving them 22:39:14 because of [ ... [ .... ] ... ] 22:39:42 so i did the create brainfuck 30000 allot 22:39:45 then filled it with zeros 22:40:10 and the user typed + 22:40:10 ok 22:40:15 where's your pointer ? 22:40:18 i dunno 22:40:24 on the first cell 22:40:32 so, where would + work upon ? 22:40:47 ok so the programs just run 22:40:51 ok, YOU know, but the program needsto know too 22:40:51 i need to get to the first cell 22:40:54 how do i do that 22:41:03 i mean put the value on the stack 22:41:22 yes 22:41:25 brainfuck 0 @ 22:41:25 ? 22:41:39 brainfuck 22:42:07 gives you the first address of those 30000 22:42:33 brainfuck @ 22:42:35 gives me the value aye 22:42:44 think again 22:42:56 .. 22:42:57 umm 22:43:12 you'd be better off using bytes rather than cells 22:43:25 lol ok 22:43:29 easier to handle for both of you :) 22:43:56 imagine the poor interpreter, trying to set a location to zero, containing 376234576 22:44:07 ok so bytes 22:44:12 .. 22:44:18 arent bytes and cells the same 22:44:18 lol 22:44:26 cell . 22:44:34 that many bytes in a cell 22:44:39 o yea 22:45:00 if cell would be char, 22:45:15 you couldn't calc 500 100 + 22:45:22 as a byte can be max 255 22:46:06 hm 22:46:15 stack element is one cell wide 22:47:00 stack elements of 1 byte would be a poor stack 22:47:06 i guess 22:47:29 guess you confused char and cell 22:47:47 so how do i update the pointer in forth 22:47:52 brainfuck @ 1+ 22:47:54 to add one? 22:48:02 where's your pointer ? on the stack ? 22:48:06 oh yeah 22:48:08 the pointer 22:48:12 let me make a pointer 22:48:20 ok 22:48:23 yea its on the stack :P 22:48:31 its 0 22:48:40 variable, or on stack, would both work. but on stack is probably easier 22:48:57 you only need to remember that it is there 22:49:02 when using it 22:49:08 for example, to update it 22:49:52 lemme help you to get the program into the interpreter 22:50:17 create program ," >[-] ...... " 22:50:41 ok 22:51:11 lets simplify the handling of "end of program" 22:51:20 the outpuit? 22:51:28 create program ," >[-] ...... " 0 , 22:51:49 when the interpreter runs on "0", it means "program end" 22:51:54 oh 22:51:57 yep ok 22:52:04 so we don't need to continously check whether there's still program left 22:52:58 thus, at program 1+ , there's the first instruction 22:53:12 (at program, there's the length of the program) 22:53:22 i get you 22:53:25 its to move the pointer 22:55:14 1+ 22:55:17 to move the pointer 22:55:31 that's about what > needs to do :) 22:56:02 ok 22:56:03 but say i had 22:56:19 >++>+<- 22:56:22 ( that is, the brainfuck instruction >, not the forth word >, of course) 22:56:43 > to 1+ 22:56:53 i dont know how to change the byte/cell thing though 22:57:04 change ? 22:57:07 update 22:57:11 increase 22:57:20 just 1+ is fine 22:57:27 no 22:57:29 but i mean 22:57:36 i dont know how to put it back 22:57:39 in position 22:57:43 ah 22:57:48 the variable thinking 22:57:51 yea 22:57:57 it stays one the stack 22:58:00 on 22:58:08 no need to put back 22:58:17 so id be constantly moving things back and forward? 22:58:30 it will stay on stack as long you keep it there 22:58:45 so after the + 22:58:47 and you probably want to keep it there 22:58:48 t'is the only place where your pointer os 22:58:53 is 22:58:58 no what i mean 22:59:04 the create brainfuck 30000 allot 22:59:12 arent i using that anymore? 22:59:13 ah 22:59:26 how to increment/decrement the contents 22:59:30 yeah 22:59:50 thats where im stuck 23:00:04 you could do several things 23:00:15 for example, consider to define c+! 23:00:42 which adds a number (such as 1 or -1) to the memory location which address is on stack 23:00:51 but you could also do it "by hand" 23:01:04 c@, c!, 23:01:07 i dont know how to do that 23:01:10 oh do i use them@ 23:01:13 *? 23:01:32 that's where you'll read about how to read and write bytes to mem 23:01:41 c@ reads a byte 23:01:45 c! writes a byte 23:01:53 do i go 23:02:04 i dont know 23:02:32 i tried 0 brainfuck swap c@ 23:02:34 0 = pointer 23:02:38 but that didnt work how i wanted it 23:02:38 lol 23:02:47 infact, it didnt work at all 23:03:00 right. you read from address 0 23:03:06 that's not a legal address 23:03:08 oh 23:03:21 it still doesnt work 23:03:26 your first brainfuck mem address is "brainfuck", not "0" 23:03:30 oh 23:03:31 haha 23:03:45 if you want to use "0" 23:03:50 well i just thought 23:03:55 c@ got the address of brainfuck 23:03:57 you'd make a word that adds "brainfuck" to the number 23:04:04 oh do i have to add them? 23:04:07 or, 23:04:11 and that gets the correct pointer cell;? 23:04:23 you'd learn about how to create a word which defines an array 23:04:31 i think i got it 23:04:34 (but don't do that now) 23:04:41 1 brainfuck + c@ 23:04:44 get pointer position one? 23:05:01 i could give you the definition, but i'm not sure whether it wouldn't just complicate things in terms of understanding 23:05:44 why not brainfuck 23:05:44 1+ 23:05:56 so your pointer shows to the next location ? 23:05:57 ?? 23:06:04 what 23:06:17 o 23:06:18 yea 23:06:19 oh 23:06:29 no youre right 23:06:34 1 brainfuck + same as brainfuck 1+ 23:06:38 i could just keep the memory address as the pointer 23:06:44 and just 1+ and 1- it? 23:06:49 RIGHT 23:06:51 lol 23:07:13 now 23:07:14 how does c! work? 23:07:25 the brainfuck program has no other ways to modify the pointer anyway 23:07:29 except up and down 23:07:51 c! ( c addr -- ) writes c to addr 23:08:22 10 c! brainfuck 23:08:22 ? 23:08:28 err 23:08:31 10 brainfuck c! 23:08:31 10 .s 23:08:32 i mean 23:08:39 ah 23:08:43 that would work 23:09:00 you store 10 into first location of brainfuck mem 23:09:06 i made : bf1+ dup 1+ ; 23:09:19 acvtually 23:09:20 it should be 23:09:25 : bf1+ 1+ dup ; 23:09:34 purpose ? 23:09:45 keep the pointer there 23:09:51 and a dup cause c@ uses it up 23:09:54 write a stack diagram for bf1+ 23:10:09 hmm 23:10:20 there is no c@ ... 23:10:28 what 23:10:36 why should bf1+ be followed by c@ ? 23:10:59 does that mean, bf1+ can only be followed by c@ ? 23:11:17 (because it puts the argument for c@ on stack) 23:11:24 hold on a sec 23:11:36 yea 23:11:37 if i go 23:11:41 'brainfuck 1+ c@' 23:11:46 brainfuck 1+ for pointer 23:11:48 then c@ gets value 23:11:51 i lost the pointer 23:11:57 right 23:11:59 so bf1+ is just to keep the pointer 23:12:02 so i dont lose it 23:12:25 why don't you dup pointer before c@ ? 23:12:34 thats what bf1+ does :P 23:12:37 at the place where you need the duplicate 23:12:46 actually 23:12:51 hm 23:13:07 what am i making again 23:13:08 + 23:13:09 bf1+ doesn't need the duplicate. 23:13:14 c@ needs it 23:13:15 ok 23:14:04 i think i need to give you another starting aid 23:14:07 > = bf1+ = : bf1+ 1+ ; 23:14:11 that's fine with oyu ? 23:14:15 ok 23:14:16 yea 23:14:57 you'll need to modify it, for your pointer 23:15:08 it is just to get you through the program ... 23:15:17 ok 23:16:22 : run brainfuck program 1+ begin count ?dup while instruction repeat drop ; 23:17:02 ?? 23:17:07 : instruction ( pointer programcounter instruction -- pointer programcounter ) ... ; 23:17:23 : run brainfuck program 1+ begin count ?dup while instruction repeat drop ; 23:17:49 run puts pointer on stack, and program counter (your program) 23:17:58 then runs it, until the final zero 23:18:02 do i type them in 23:18:12 to test it, i make a dummy instruction: 23:18:25 : instruction ( pointer programcounter instruction -- pointer programcounter ) emit ; 23:18:33 : run brainfuck program 1+ begin count ?dup while instruction repeat drop ; 23:18:50 : instruction ( pointer programcounter instruction -- pointer programcounter ) emit ; ok 23:18:51 : run brainfuck program 1+ begin count ?dup while instruction repeat drop ; ok 23:18:51 run >[-] ...... ok 23:18:57 is that right 23:19:17 it prints your program 23:19:20 that's right 23:19:42 run loops through the brainfuck program 23:19:54 but, instead of doing something on the < > + - 23:19:55 ok 23:19:57 it just emits them 23:20:20 that means, "instruction" needs the refinements 23:20:24 yeh 23:20:25 i get it 23:20:38 the stack diagram show what it receives, and leaves 23:20:43 top is the instruction 23:21:04 for > 23:21:07 there's the orogram counter which we don't really need there. it is actually in the way 23:21:33 : b> ( pointer -- pointer+1 ) 1+ ; 23:21:34 ?? 23:21:36 but the pointer is there too 23:21:45 let's add some debugging facility 23:21:52 lol ure like doing it all for me 23:22:02 nope 23:22:10 i leave you the task of filling it in 23:22:24 but i felt you were heading the wrong way 23:22:33 maybe, just another way 23:22:33 probably 23:22:55 you probably don't know about loops such as begin while repeat yet 23:23:00 oh sure, loops, but not the forth ones 23:23:13 i know do 23:23:14 difficult to use something you don't know about 23:23:15 i think 23:23:16 10 0 do 23:23:17 end 23:23:18 or something 23:23:22 itll do it to its 9 23:23:24 right 23:23:24 or something? 23:23:33 but now we just loop till end of program 23:23:38 yea 23:23:43 no do loop 23:23:48 can't use those 23:24:08 because [ and ] influence the number of times we need to execute a brainfuck instruction 23:24:20 we got loops in brainfuck too 23:24:21 yeah 23:24:35 thus, it is begin while repeat 23:24:52 loop until end condition reached 23:25:15 i add some debug code to instruction, and leave the rest to you. 23:25:29 ok 23:25:54 : instruction ( pointer programcounter instruction -- pointer programcounter ) 23:25:59 cr emit 23:26:11 ." pointer:" over . 23:26:27 ." program counter: " dup . 23:26:31 ; 23:26:40 : run brainfuck program 1+ begin count ?dup while instruction repeat drop ; 23:26:58 also, put the "real" brainfuck program at program 23:27:08 not the one i filled up with .... 23:27:25 k 23:27:53 it is good that we got programcounter in instruction ! 23:28:07 because [ and ] will need to modify it 23:28:29 < > modifes pointer 23:28:37 i redefined program 23:28:38 [ ] modifes program counter 23:28:40 but it still says the old one 23:29:05 + - modifiy the content of the location pointer points to 23:29:33 good luck :) 23:29:42 [18:29:40] i redefined program 23:29:45 [18:29:44] but it still says the old one 23:29:56 forgot to save ? forgot to load ? 23:30:14 i just redid the create 23:30:43 run and instruction still use the version compiled into them 23:31:07 oh yea 23:31:07 i got it now 23:31:11 you redefined program. you didn't replace it 23:31:33 previously compiled words don't care 23:31:45 do i just change instruction? 23:32:05 better, use an editor, write it in the editor, include the file from forth 23:32:24 im saving in a txt file all the stuff ill need later 23:32:30 right 23:32:43 you can load forth source from file 23:32:59 with more complex things than one-liners, that's preferrable 23:33:05 you may have to edit something 23:33:32 include filename does it 23:36:08 there is no "replace", except using "deferred words" (forget them now) or patching previous words (forget that alltogether) 23:37:14 and a program could search a word while running, but that's not good neither (much slower) 23:37:24 this is probably very wrong but: 23:37:26 for + 23:37:29 ive come up with this: 23:37:37 : v+ ( ?? -- ?? ) dup c@ 1+ swap dup rot swap c! ; 23:37:50 begin looks good 23:38:16 fromon swap, lots of improvements possible 23:38:27 lol 23:38:31 damn 23:38:46 well it works 23:38:53 but i assume you could repace a few words with one word? 23:39:11 but heading the right way 23:40:31 i need word definitions 23:40:34 err 23:40:34 stack 23:40:37 so i can find the right words 23:42:29 the swap is the cause for the stack complexity 23:42:29 consider the effects of "over" 23:42:31 two sources: 23:42:33 info gforth, or DPANS94 23:42:37 DPANS94 is the standards draft 23:42:39 every words described in detail there 23:42:41 including stack effects 23:43:47 wheres DPANS94 23:43:58 google knows 23:44:32 oh i got it 23:44:41 : v+ ( ?? -- ?? ) dup c@ 1+ swap tuck c! ; 23:44:42 ? 23:45:04 consider the effects of "over" 23:45:08 ok lol 23:45:28 but, quite an improvement :) 23:45:47 is it just the same? 23:45:58 oh 23:45:59 looks like it 23:46:01 i dont need the swap then aye 23:46:30 lets see if it works 23:46:57 oh goodie 23:46:58 :p 23:47:05 word index in gforth tutorial is usable 23:47:58 p+ ok 23:47:59 v+ ok 23:47:59 dup c@ . 1 ok 23:47:59 p- v+ dup c@ . 7 ok 23:47:59 sweet 23:48:00 :P 23:48:38 now im up to [ ] 23:48:46 or the . , 23:48:58 . , are easier 23:49:07 . = output? 23:49:11 [ ] needs some goos thinking 23:49:13 good 23:49:37 but that's what you're here for :) 23:49:58 : o dup c@ emit ; 23:51:31 [ ] are the reasons why i wrote a brainforth compiler, rather than an interpreter 23:51:54 err 23:51:56 for some reason 23:52:02 my value of pointer one 23:52:02 is now 6C 23:52:04 interpreter, such as the one you're building, interprets the instructions as they come 23:52:48 help 23:52:50 compiler runs through the source, and makes another representation of it. it could build into the program., for example. where the branch destinations are 23:53:09 so the program doesn't need to find that out while it runs 23:53:35 the compiler finds that out once 23:54:12 do you know the debugger in gforth ? 23:54:20 nope 23:54:27 im outta here my teas ready 23:54:30 ill play round later 23:54:32 dbg wordyouwanttodebug 23:54:35 thanks for all your help 23:54:40 np 23:54:48 my pleasure 23:54:58 got you going i hope 23:55:19 actually 23:55:20 before i go 23:56:17 my poitner value is 63 23:56:23 if i add 10 onto it 23:56:36 it becomes 6D 23:56:36 ?? 23:56:38 why not 73? 23:56:41 ah 23:56:49 you're in base hex 23:56:56 ff decimal . 23:57:15 123 hex . 23:57:20 decimal 23:57:34 how did i get in that 23:57:43 you tell me 23:57:53 by typing hex 23:57:57 or 16 base ! 23:58:04 dup c@ . 109 ok 23:58:09 thats not what i expected 23:58:12 but its better now! 23:58:14 ok im off now :p 23:58:15 laters 23:59:11 who's into redcode warbot writing, but using brainfuck ? 23:59:59 --- log: ended forth/03.04.19