00:00:00 --- log: started forth/18.09.04 01:08:47 --- join: ncv (~neceve@2a02:c7d:c5c9:a900:6eaf:6ef7:3b81:d5f6) joined #forth 01:08:47 --- quit: ncv (Changing host) 01:08:47 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 02:04:10 --- quit: ashirase (Ping timeout: 250 seconds) 02:06:58 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:29:48 --- quit: jedb (Ping timeout: 240 seconds) 02:33:49 --- join: jedb (~jedb@199.66.90.113) joined #forth 02:57:17 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 03:23:41 --- quit: X-Scale (Ping timeout: 272 seconds) 03:23:56 --- join: [X-Scale] (~ARM@83.223.243.102) joined #forth 03:24:18 --- nick: [X-Scale] -> X-Scale 04:01:35 --- quit: mtsd (Remote host closed the connection) 04:10:31 --- join: mtsd (~mtsd@77.110.61.100) joined #forth 04:44:44 --- join: cheater (~cheater@unaffiliated/cheater) joined #forth 05:27:05 --- quit: Zarutian (Read error: Connection reset by peer) 05:27:29 --- join: Zarutian (~zarutian@89.17.133.173) joined #forth 06:40:08 --- quit: pierpal (Quit: Poof) 06:40:41 --- join: pierpal (~pierpal@host60-229-dynamic.16-87-r.retail.telecomitalia.it) joined #forth 07:05:45 --- quit: mtsd (Quit: Leaving) 07:14:29 --- quit: pierpal (Quit: Poof) 07:14:47 --- join: pierpal (~pierpal@host60-229-dynamic.16-87-r.retail.telecomitalia.it) joined #forth 08:35:45 --- quit: dave9 (Quit: one love) 10:13:25 --- quit: ncv (Ping timeout: 240 seconds) 10:38:58 so I was doing SICP in Forth, and one of the questions in one of the first problems involved getting the two largest of three numbers 10:39:31 without any explicit conditionals I managed `: largest 2dup min -rot max -rot max ;`, think it can get smaller? 12:01:21 That looks pretty good. 12:02:03 I think you have to have at least three min or max calls, and it seems you must have SOME stack motion in between each one. 12:02:16 I think there's a pretty good chance that's optimal. 12:07:47 --- join: gravicappa (~gravicapp@ppp83-237-166-44.pppoe.mtu-net.ru) joined #forth 12:35:26 isn't -rot probably expensive? 12:44:45 --- quit: pierpal (Quit: Poof) 12:45:04 --- join: pierpal (~pierpal@host60-229-dynamic.16-87-r.retail.telecomitalia.it) joined #forth 13:10:19 Oh, I thought we were gauging on word count. 13:10:31 Yes, -rot and rot are somewhat more expensive than some of the others. 13:11:27 But you have to make three comparisons, and that's going to involve some stack motion. 13:26:22 WilhelmVonWeiner: : -rot ( a b c -- c a b ) SWAP >R SWAP R> ; \ no? and how is that expensive? 14:06:13 never really thought about it 14:14:08 : -rot code %rcx pop, %rbx 0 (%rsp) xchg, %rbx %rcx xchg, %rcx push, next, ; 14:19:09 --- quit: epony (Ping timeout: 245 seconds) 14:58:42 --- join: epony (~epony@unaffiliated/epony) joined #forth 15:00:59 --- quit: gravicappa (Ping timeout: 272 seconds) 15:40:18 -rot has to do two memory reads and two memory writes. 15:40:30 That's not horrible, but it's more than most primitives. 15:41:14 It's one of the ROLL family words. They just keep getting worse the deeper you go. 15:41:22 SWAP being the cheapest. 15:51:24 --- quit: nighty- (Quit: Disappears in a puff of smoke) 18:14:42 --- join: nighty- (~nighty@kyotolabs.asahinet.com) joined #forth 19:42:28 --- quit: pierpal (Quit: Poof) 19:42:44 --- join: pierpal (~pierpal@host60-229-dynamic.16-87-r.retail.telecomitalia.it) joined #forth 19:53:55 --- quit: dddddd (Remote host closed the connection) 20:29:47 --- join: dave9 (~dave@90.20.215.218.dyn.iprimus.net.au) joined #forth 20:29:57 hi 21:20:58 --- quit: dave9 (Quit: one love) 23:02:57 hi 23:48:27 --- join: dave9 (~dave@90.20.215.218.dyn.iprimus.net.au) joined #forth 23:48:34 re 23:59:59 --- log: ended forth/18.09.04