00:00:00 --- log: started forth/05.12.22 00:18:36 --- join: rsync_ (n=monkey@CPE000c41aac435-CM00111ae4f4cc.cpe.net.cable.rogers.com) joined #forth 00:18:45 --- quit: rsync_ (Client Quit) 00:19:33 --- join: rsync_ (n=monkey@CPE000c41aac435-CM00111ae4f4cc.cpe.net.cable.rogers.com) joined #forth 00:19:34 --- quit: rsync_ (Client Quit) 01:56:34 --- quit: nballen () 03:07:23 --- join: Cheery (i=Henri@a81-197-18-99.elisa-laajakaista.fi) joined #forth 05:24:10 --- join: PoppaVic (n=pete@0-1pool74-126.nas24.chicago4.il.us.da.qwest.net) joined #forth 05:26:40 --- join: rehges (n=segher@blueice3n1.de.ibm.com) joined #forth 06:55:24 http://martinfowler.com/bliki/DuckInterface.html 07:16:02 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 07:27:52 --- quit: Cheery (Read error: 104 (Connection reset by peer)) 07:32:13 --- join: Cheery (i=Henri@a81-197-18-99.elisa-laajakaista.fi) joined #forth 07:52:21 --- quit: snowrichard ("Leaving") 08:12:54 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 08:14:47 --- quit: swalters (Read error: 104 (Connection reset by peer)) 08:26:11 --- join: sproingie (n=chuck@64-121-2-59.c3-0.sfrn-ubr8.sfrn.ca.cable.rcn.com) joined #forth 08:28:20 --- quit: PoppaVic ("Pulls the pin...") 08:29:28 --- quit: Cheery (Read error: 104 (Connection reset by peer)) 08:33:35 --- join: Cheery (n=Henri@a81-197-18-99.elisa-laajakaista.fi) joined #forth 08:36:16 --- quit: Cheery (Read error: 104 (Connection reset by peer)) 08:36:21 --- join: swalters (n=swalters@6532183hfc82.tampabay.res.rr.com) joined #forth 08:38:41 --- quit: snowrichard ("Leaving") 08:41:39 --- join: Cheery (n=Henri@a81-197-18-99.elisa-laajakaista.fi) joined #forth 09:01:41 --- join: humulus_ (n=humulus@xover.htu.tuwien.ac.at) joined #forth 09:02:53 --- join: PoppaVic (n=pete@0-1pool73-209.nas24.chicago4.il.us.da.qwest.net) joined #forth 09:07:53 --- quit: Cheery (Read error: 104 (Connection reset by peer)) 09:10:49 --- join: Cheery (n=Henri@a81-197-18-99.elisa-laajakaista.fi) joined #forth 09:12:42 --- quit: Cheery (Read error: 104 (Connection reset by peer)) 09:13:40 --- quit: humulus (Read error: 110 (Connection timed out)) 09:33:47 --- join: _james (i=jcp@adara.cs.pdx.edu) joined #forth 10:09:22 --- quit: PoppaVic ("Pulls the pin...") 10:14:26 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 10:32:29 --- join: knapjack (n=fragment@mirkwood.nas.com) joined #forth 10:33:25 Hey, I'm a Forth newbie and I'm trying to implement exp on Gforth. Can I flood my code for critique? 10:34:33 --- join: virl (i=core@chello062178085149.1.12.vie.surfer.at) joined #forth 10:34:43 * knapjack waits for a few, hoping silence implies consent... 10:35:17 : exp ( n1 n2 -- n1^n2 for quite a few n2 > 0 ) 10:35:17 swap dup rot 10:35:17 dup 0= if 10:35:17 2drop 1 0 10:35:17 then 10:35:18 dup 1 > if 10:35:20 1 do 10:35:22 over * 10:35:24 loop 10:35:26 swap 10:35:28 then 10:35:30 drop ; 10:35:53 Is there an easier way to do that? 10:37:13 I suppose that should read "... n2 >= 0 )" 11:08:20 --- quit: snowrichard ("Leaving") 11:08:42 : exp over swap for over * next drop ; 11:09:07 Nice 11:09:33 oops 11:09:39 : exp over swap 2 -for over * next drop ; 11:09:45 : exp over swap 2 - for over * next nip ; 11:09:48 :) 11:10:00 gforth "for" anyway executes the loop x+1 times 11:10:17 oh, you can make it work with exp zero... 11:10:26 : exp 1 swap 2 - for over * next nip ; 11:10:50 drrr 11:10:57 maybe I should test before typing in here 11:11:48 Either way, I like your solution for all n2 > 2 11:11:55 >= 2 11:11:55 : exp 1 swap 0 do over * loop nip ; 11:12:19 that should work for n2 >= 0 11:12:40 Ah n2=0 still gives me grief. 11:12:42 ok >= 1 11:12:45 :) 11:12:58 if you have a loop that handles looping 0 times 11:13:08 then it will give correct results for n2=0 11:13:20 in my forth this is called ?FOR 11:13:42 What I love about forth is that it always makes me feel like an idiot. :) 11:14:04 forth always has a lesson for me 11:14:21 Yeah, that's a gentler way of putting it. 11:14:47 --- join: Astrobe (n=fred@85.69.106.223) joined #forth 11:15:24 wait... "swap dup rot" is the same as "over swap" right? 11:15:39 not sure 11:16:03 both do ( x y -- x x y ) I think 11:16:42 They are the same, but they both do y x x 11:17:35 no, x x y 11:17:38 just tested in gforth 11:18:03 so my prefered definition would be: 11:18:16 2 10 over swap . . . 10 2 2 ok 11:18:19 : exp 1 swap ?for over * ?next nip ; 11:18:20 ? 11:18:36 yeah 2 2 10 11:18:39 use .s 11:18:45 . prints TOS first 11:18:56 Ah, OK. 11:19:12 1 2 3 . . . yields: 3 2 1 11:19:18 filo 11:19:53 gotcha 11:20:52 ok, so even if you don't have a loop that handles a zero count, you can eliminate the other case (n2=1) in your example by replacing "swap dup rot" with "1 swap" and looping one more (0 do) 11:21:20 knapjack: printing "reverses" things 11:22:26 Yeah, I knew that, but I just reversed it mentally, too, so the last item in my list was the "first" item on the stack. :) 11:22:39 and of course only bothe handling either of those cases (n2=0 and n2=1) if you intend to actually pass those values ever 11:22:57 knapjack: I find it less confusing to just use .s 11:23:00 Yep, I'm looking at this more as a learning experience. 11:23:10 I can see your point 11:23:26 or better yet, use a forth that shows you the stack automatically as part of the prompt 11:23:32 I've been trying to hold the stack in my brain, and .s makes it pretty easy. 11:23:57 there's probably a way to get gforth to show the stack automagically 11:23:58 what are you trying to do? 11:24:20 .s fits in with the way I used to program (it's been a long time), where you'd try some stuff, then see if it did what you expected.... 11:24:30 Astrobe: Not much, really. Just learn forth. 11:24:38 Astrobe: No real project I'm working on. 11:24:53 taht's a beginning... :) 11:25:12 Though, I did read about the eXtremeGameStation, and I thought it would be fun with forth on it. Kinda like resurrecting the Jupiter Ace. 11:25:47 http://www.xgamestation.com/about_gamestation.php 11:25:54 Maybe it's just the XGameStation.... 11:26:51 I read about colorForth a year or two ago, scrounged up a copy of Starting Forth, and I've been reading it off and on since. 11:27:10 cool 11:28:07 So, now's the first time in a while I've started actually trying things out. Installed Gforth on my laptop and occasionally try out some ideas. 11:29:24 What's nice coming from the colorForth ideaspace is that Chuck really pared it down to the bare essentials, so though I knew I could load the right dictionary to just get exp for gforth, I also knew that I *should* be able to implement it given what's there. 11:29:45 So I gave it a whirl. 11:30:18 Having gforth to display the stack auto would be a useful learning exercice 11:30:19 I learn so much by just coding in forth 11:30:41 so do/did I 11:31:02 Do either of you do development? F-Code, etc? 11:33:14 knapjack, I advice you to choose a project to do; 11:33:16 it gives you kind of guidelines to explore Forth 11:33:20 I implemented my dialect, and did several dvl utility 11:33:55 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-190-254.pools.arcor-ip.net) joined #forth 11:35:10 I've been thinking about picking up a Zire 22 and Quartus and building some app that way. 11:35:10 I wrote an IDE 11:35:43 herkforth 11:35:52 I also screw around with other OSes quite a bit, so I've thought about an interpreter for Oberon or something like that. 11:36:08 it's for ppc linux though. but it does work on other architectures running linux with the help of qemu 11:36:18 I'm in the precess of rewriting it in a portable way 11:36:37 my new system (mist) should run on just about anything. I've tested it on ppc linux and windoze 11:36:41 Cool. 11:37:31 there's still a bug in my bootstrapping code 11:37:44 so I haven't started on the editor yet 11:38:20 but it's pretty cool 11:38:28 Hey, I see you referencing Raskin. Have you tried Bluebottle? 11:38:46 it's fun starting over because I can do all the things I thought of after getting the previous one going 11:38:56 what's bluebottle? 11:39:16 http://www.bluebottle.ethz.ch/downloads/crazy/AosCD.zip 11:39:28 More generic info at http://www.bluebottle.ethz.ch/ 11:40:07 It's a newer generation of Wirth's Oberon System. The new UI implements a metric ton of stuff from The Humane Interface. 11:40:23 The ISO is bootable live, and I recommend reading the tutorial. 11:41:33 wow 11:41:51 will try under qemu 11:41:51 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 11:41:52 --- nick: snoopy_1711 -> Snoopy42 11:45:42 crappy website 11:47:24 Yeah, heh. 11:48:08 I've found it works well under QEMU, but zooming the desktop can be painful under QEMU. 11:51:47 --- quit: rehges () 11:53:59 sounds fairly impressive. I'm suprised I've never heard of it 11:54:08 So, merging yours and mine, I come up with: 11:54:10 : exp dup 0= if 2drop 1 else 1 swap 0 do over * cr loop nip then ; 11:54:27 bah, don't use else 11:54:38 :) 11:54:40 : exp dup 0= if 2drop 1 exit then 11:54:48 hehe 11:54:51 just a personal thing 11:54:59 I'll work on that. 11:55:02 herkforth bugs out on "then ;" 11:55:25 you can use else, but if you don't it encourages more factoring, and thinking different, hence learning 11:55:44 for similar reasons I strongly reccomend never using rot or -rot or pick 11:55:48 Just out of curiosity, is then less efficient? 11:56:42 my version should be a bit faster because the first case doesn't have to branch to the end and then exit. it just exits 12:14:42 well bluebottle is interesting 12:14:50 too slow under qemu though 12:17:05 --- join: Astrobe2 (n=fred@85.69.106.223) joined #forth 12:17:40 sorry, wireless issues. 12:18:33 hmmm.... 12:22:43 Yeah, I recommend burning & booting. 12:23:10 Gotta run, but catch you guys later. Thanks again for the help (and insight)! 12:23:36 you're welcome 12:24:18 --- quit: knapjack ("Leaving") 12:25:21 JasonWoof, are you still there? 12:26:55 --- quit: Astrobe (Read error: 110 (Connection timed out)) 12:27:19 --- nick: Astrobe2 -> Astrobe 12:40:12 still here 12:41:18 good. 12:42:13 my wifi cnx is not very good, it seems. 13:05:11 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 13:17:59 --- quit: snowrichard ("Leaving") 13:45:01 --- join: nballen (n=nballen@adsl-69-111-248-132.dsl.renocs.pacbell.net) joined #forth 13:51:58 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 13:56:34 --- quit: snowrichard (Client Quit) 14:00:23 --- quit: swalters (Read error: 104 (Connection reset by peer)) 14:02:44 I don't see anything about bluebottle that makes me think of THI 14:05:52 --- join: TheBlueWizard (i=TheBlueW@ts001d0025.wdc-dc.xod.concentric.net) joined #forth 14:07:27 --- join: WillieScott (i=WillieSc@dialup-4.242.108.106.Dial1.Seattle1.Level3.net) joined #forth 14:10:39 Though, I did read about the eXtremeGameStation, and I thought it 14:10:40 +would be fun with forth on it. Kinda like resurrecting the Jupiter Ace. 14:10:47 why not just get a macintosh? 14:12:02 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 14:13:18 --- join: aum (n=aum@60-234-156-82.bitstream.orcon.net.nz) joined #forth 14:13:25 hi 14:13:33 hiya snowrichard 14:14:15 --- part: WillieScott left #forth 14:14:24 taking a break from housecleaning. trying to get ready for my niece and her husband to visit over holiday. 14:14:46 they are staying with her mom. 14:20:05 --- join: swalters (n=swalters@6532183hfc82.tampabay.res.rr.com) joined #forth 14:36:19 hi everyone 14:44:21 another room down ... 3 to go 14:45:43 22 december and I'm sweating 15:00:18 --- quit: Astrobe ("Leaving") 15:01:04 --- join: madgarden (n=madgarde@London-HSE-ppp3545637.sympatico.ca) joined #forth 15:06:30 --- quit: virl (Remote closed the connection) 15:16:37 --- part: TheBlueWizard left #forth 15:21:16 why do pick and roll drop the tos? 15:23:19 --- quit: snowrichard ("Leaving") 15:23:51 they consume the TOS by design 15:24:59 * crc doesn't know exactly why, except that he can't think of too many cases where you'd want to leave the TOS before the call to pick or roll on the stack 15:26:03 speed or something? 15:26:11 could it just be switching pointers? 15:26:22 (I don't know what's going on inside forth) 15:26:26 what it does with the original TOS is implementation dependent 15:26:46 hm 15:27:02 with pick, the forths I use mostly replace the original with a copy of the requested element 15:28:53 the ANS standard doesn't specify why the words are supposed to replace the original TOS, just that they must do so 15:30:50 hm... have you ever seen cl's hyperspec? ;) 15:30:56 yes 15:31:04 ANSI ppl are deranged 15:31:39 why do you say that? 15:35:38 because because it took me a long time to be able to navigate the hyperspec without a lot of effort 15:35:46 its not tractable to such a lowly mortal 15:35:48 :) 15:37:01 heh 15:37:09 it's not a book :) 15:37:16 * crc knows of a text version of it 15:44:07 hypertext can be good, but a nice sequental spec. is very handy 15:47:43 I just like it when I can stare at paper pages and not a computer monitor 15:48:32 hey, what do you think would be a good supplement (besides forth) for learning about stack based and concatenate languages? 15:52:51 hmm 15:52:59 * crc knows of Joy and Factor 15:53:31 Factor is a neat language drawing elements from forth and lisp 15:54:02 ah cool 15:54:03 http://en.wikipedia.org/wiki/Factor_programming_language 15:54:10 yup 17:02:56 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 17:14:34 --- join: Hobart (i=jb@jb.org) joined #forth 17:15:34 --- quit: aum () 17:20:27 --- quit: snowrichard ("Leaving") 17:22:40 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 17:32:59 --- quit: snowrichard (Read error: 104 (Connection reset by peer)) 17:43:07 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 17:48:06 --- quit: snowrichard (Client Quit) 18:19:03 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 18:22:14 --- quit: snowrichard (Client Quit) 18:36:12 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 18:40:47 --- quit: snowrichard (Client Quit) 18:45:35 --- part: Hobart left #forth 19:45:35 --- quit: swalters (Connection reset by peer) 19:58:31 --- join: swalters (n=swalters@6532183hfc82.tampabay.res.rr.com) joined #forth 20:17:44 --- quit: Quartus () 20:56:02 --- join: snowrichard (n=richard@adsl-69-155-177-154.dsl.lgvwtx.swbell.net) joined #forth 21:04:53 --- join: rsync_ (n=monkey@CPE000c41aac435-CM00111ae4f4cc.cpe.net.cable.rogers.com) joined #forth 21:10:13 --- quit: snowrichard ("Leaving") 21:30:35 --- quit: rsync_ () 22:19:19 --- quit: sproingie (Remote closed the connection) 22:31:31 --- join: rsync_ (n=monkey@CPE000c41aac435-CM00111ae4f4cc.cpe.net.cable.rogers.com) joined #forth 23:00:14 --- join: rsync__ (n=monkey@CPE000c41aac435-CM00111ae4f4cc.cpe.net.cable.rogers.com) joined #forth 23:11:11 --- quit: rsync_ (Read error: 110 (Connection timed out)) 23:30:00 --- quit: JasonWoof ("off to bed") 23:46:51 --- quit: rsync__ () 23:59:59 --- log: ended forth/05.12.22