00:00:00 --- log: started forth/12.06.29 00:35:18 --- join: jillsmitt (~jillsmitt@176.222.164.229) joined #forth 00:35:26 --- mode: ChanServ set +v jillsmitt 01:10:01 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 01:10:01 --- mode: ChanServ set +v MayDaniel 02:21:11 --- join: rbarraud (~rbarraud@125-237-76-181.jetstream.xtra.co.nz) joined #forth 02:21:12 --- mode: ChanServ set +v rbarraud 02:31:08 --- quit: jyfl987 (Ping timeout: 250 seconds) 02:39:31 --- join: jyfl987 (~jyf@unaffiliated/yunfan) joined #forth 02:39:32 --- mode: ChanServ set +v jyfl987 02:44:27 --- quit: jyfl987 (Ping timeout: 246 seconds) 02:57:19 --- join: jyfl987 (~jyf@unaffiliated/yunfan) joined #forth 02:57:19 --- mode: ChanServ set +v jyfl987 03:00:23 --- quit: jyfl987 (Client Quit) 03:05:24 --- quit: rbarraud (Ping timeout: 265 seconds) 03:16:04 --- quit: DGASAU` (Remote host closed the connection) 03:39:48 --- join: DGASAU (~user@91.218.144.129) joined #forth 03:39:48 --- mode: ChanServ set +v DGASAU 05:47:41 --- join: fantazo (~fantazo@91.119.203.251) joined #forth 05:47:41 --- mode: ChanServ set +v fantazo 05:55:28 --- quit: jillsmitt (Ping timeout: 244 seconds) 06:07:35 --- join: jillsmitt (~jillsmitt@176.222.164.229) joined #forth 06:07:35 --- mode: ChanServ set +v jillsmitt 07:08:33 --- quit: MayDaniel (Read error: Connection reset by peer) 07:23:56 --- quit: DaDaDOSPrompt (Quit: Leaving) 08:06:51 --- join: Monevii (~Monevii@adsl-207-204-147-103.prtc.net) joined #forth 08:06:51 --- mode: ChanServ set +v Monevii 08:07:34 --- join: Kumul (~Kumul@adsl-207-204-147-103.prtc.net) joined #forth 08:07:34 --- mode: ChanServ set +v Kumul 08:47:36 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 08:47:36 --- mode: ChanServ set +v MayDaniel 08:57:51 --- join: remyhr (~remy@pob78-1-82-238-158-96.fbx.proxad.net) joined #forth 08:57:51 --- mode: ChanServ set +v remyhr 09:00:42 --- join: Onionnion (~ryan@adsl-68-254-170-249.dsl.milwwi.ameritech.net) joined #forth 09:00:43 --- mode: ChanServ set +v Onionnion 09:13:15 --- quit: Monevii (Ping timeout: 246 seconds) 09:15:09 --- quit: Kumul (Ping timeout: 252 seconds) 09:36:54 --- join: paldepind (~simon@0x55517461.adsl.cybercity.dk) joined #forth 09:36:54 --- mode: ChanServ set +v paldepind 09:37:31 What is the easiest way to read an integer from std. input? 09:43:20 I'm thinking something that would read a string, convert it to an integer and push it on the stack. 09:59:35 --- quit: ttmrichter (Quit: Leaving) 10:01:55 parse-word 0 0 2swap >number 2drop 10:03:35 --- quit: paldepind (Remote host closed the connection) 10:21:19 --- quit: fantazo (Remote host closed the connection) 10:28:29 --- join: paldepind (~simon@0x55517461.adsl.cybercity.dk) joined #forth 10:28:29 --- mode: ChanServ set +v paldepind 10:31:37 --- quit: paldepind (Remote host closed the connection) 10:35:45 --- join: paldepind (~simon@0x55517461.adsl.cybercity.dk) joined #forth 10:35:45 --- mode: ChanServ set +v paldepind 10:37:29 DGASAU: Is that really the simplest way? 10:38:01 do you want the simplest way, or the best way ;) 10:38:03 --- join: RodgerTheGreat (~rodger@71-13-215-128.dhcp.mrqt.mi.charter.com) joined #forth 10:38:03 --- mode: ChanServ set +v RodgerTheGreat 10:38:06 * kulp HAS NOTHING OF VALUE TO ADD 10:38:21 do you have anything of reference to add? 10:38:24 In this case, it is both. 10:38:57 I don't remember if "parse-word" got standardized, 10:39:06 but even then nothing stops you from using it. 10:40:52 kulp: The shortest! 10:41:34 It doesn't seem to work in gforth: rand.fs:3: Stack underflow parse-word 0 0 >>>2swap<<< >number 2drop r 10:41:56 I don't know how you got there. 10:42:06 2swap exists in gforth for sure. 10:42:24 it's not saying it doesn't exist, right 10:42:30 Ah, perhaps it is "parse-name" there. 10:42:39 Or "name". 10:42:42 * DGASAU shrugs. 10:42:49 You could have debugged it yourself. 10:43:22 but then I would be less entertained. 10:44:07 The ability of reading documentation is hard requirement in Forth. 10:46:32 parse-name doesn't work either. But there has to be a simpler solution. 6 words for reading a number and putting it on the stack? 10:46:58 Such a simple and common function should be build right in? 10:47:19 How do you do that in C? 10:47:37 scanf, if you're crazy 10:47:54 but it would be only one "word" :) 10:48:02 Oh, really? 10:48:14 Write complete self-contained example. 10:48:24 No. 10:48:37 Does that mean you can't? 10:48:42 Maybe. 10:52:38 --- quit: nighty^ (Ping timeout: 246 seconds) 10:56:14 --- join: nighty^ (~nighty@69-165-220-105.dsl.teksavvy.com) joined #forth 10:56:15 --- mode: ChanServ set +v nighty^ 10:56:30 --- join: entwislegrove (~Duncan_En@host81-159-168-94.range81-159.btcentralplus.com) joined #forth 10:56:30 --- mode: ChanServ set +v entwislegrove 10:57:41 --- quit: paldepind (Remote host closed the connection) 11:03:26 --- join: paldepind (~simon@0x55517461.adsl.cybercity.dk) joined #forth 11:03:26 --- mode: ChanServ set +v paldepind 11:19:22 --- join: fantazo (~fantazo@213.129.230.10) joined #forth 11:19:22 --- mode: ChanServ set +v fantazo 11:41:54 --- join: DaDaDOSPrompt (~DaDaDOSPr@63-231-108-178.clsp.qwest.net) joined #forth 11:41:55 --- mode: ChanServ set +v DaDaDOSPrompt 11:53:06 Well... I have vague memory that gforth has a whole family of number conversion words, 11:53:34 non-standard, of course, many obsoleted, and mostly undocumented. 12:11:24 DGASAU: Maybe they even have one like the one I'm describing? 12:25:44 --- quit: phirsch (Ping timeout: 246 seconds) 12:29:22 --- join: phirsch (~phirsch@xdsl-89-0-163-3.netcologne.de) joined #forth 12:29:23 --- mode: ChanServ set +v phirsch 12:50:12 --- join: Monevii (~Monevii@adsl-207-204-185-238.prtc.net) joined #forth 12:50:13 --- mode: ChanServ set +v Monevii 12:50:24 --- join: Kumul (~Kumul@adsl-207-204-185-238.prtc.net) joined #forth 12:50:26 --- mode: ChanServ set +v Kumul 12:59:06 hey there RodgerTheGreat 12:59:50 RodgerTheGreat: its a small forth world 13:00:06 you're hilarious 13:17:46 --- quit: fantazo (Ping timeout: 248 seconds) 13:24:32 --- join: rbarraud (~rbarraud@ip-58-28-153-132.static-xdsl.xnet.co.nz) joined #forth 13:24:32 --- mode: ChanServ set +v rbarraud 13:29:25 --- quit: paldepind (Quit: Ex-Chat) 13:32:30 --- quit: rbarraud (Read error: Connection reset by peer) 13:40:32 --- quit: MayDaniel (Read error: Connection reset by peer) 13:58:30 sry i was eating 13:58:38 --- quit: entwislegrove (Read error: Connection reset by peer) 13:58:40 i think #concatenative is more for factor no? which is why i didnt talk there 13:59:02 whats forth MT? 14:10:30 --- join: rbarraud (~rbarraud@ip-58-28-153-132.static-xdsl.xnet.co.nz) joined #forth 14:10:30 --- mode: ChanServ set +v rbarraud 14:14:25 --- quit: rbarraud (Read error: Connection reset by peer) 14:23:06 Which MT? 14:43:28 --- join: rbarraud (~rbarraud@ip-58-28-153-132.static-xdsl.xnet.co.nz) joined #forth 14:43:29 --- mode: ChanServ set +v rbarraud 14:50:22 --- quit: rbarraud (Read error: Connection reset by peer) 14:50:35 --- join: rbarraud (~rbarraud@ip-58-28-154-210.static-xdsl.xnet.co.nz) joined #forth 14:50:35 --- mode: ChanServ set +v rbarraud 14:55:08 only RodgerTheGreat knows 14:56:03 we were talking about Mersenne-Twisters 14:56:05 http://www.excamera.com/files/docforth/docforth/mersenne-falvo.fs.html#456 14:56:23 --- quit: Monevii (Excess Flood) 14:57:15 --- join: Monevii (~Monevii@adsl-207-204-185-238.prtc.net) joined #forth 14:57:15 --- mode: ChanServ set +v Monevii 15:00:45 Ah. 15:00:58 I don't remember if I implemented it or not. 15:02:07 Oh, my... 15:03:40 ? 15:04:24 kc5tja writes in that horrible style... 15:04:52 I've noticed a few places where it could be written more efficiently 15:05:05 Also, the code is non-reentrant. 15:05:15 and comparing this to the pseudocode on the wiki page I think there's a typo in "probability" 15:05:17 While it could easily be. 15:05:33 how would you change it? 15:06:36 First of all, all those constants have names. 15:06:59 Second, I think there's simpler RNG used for seeding. 15:07:36 Only it seems to be used in CTR mode (or how is it called properly?). 15:08:24 All those while loops should be killed and replaced with "do ... loop". 15:09:15 Anyway, code factoring is horrible. 15:09:27 yeah 15:09:35 I'm badly impressed. 15:09:45 Didn't expect it from kc5tja. 15:09:58 he computes addresses for cells of "states" in quite a few places 15:10:54 even a factor as simple as : state# cells states + ; would help 15:11:04 Not much. 15:11:42 DUP @ 30 RSHIFT SWAP @ XOR could be @ DUP 30 RSHIFT XOR 15:12:56 Hm. 15:13:11 I have the code from around 2004-2005, but I'm not sure if it works now. 15:20:48 --- quit: rbarraud (Read error: Connection reset by peer) 15:23:06 --- join: rbarraud (~rbarraud@ip-58-28-154-210.static-xdsl.xnet.co.nz) joined #forth 15:23:06 --- mode: ChanServ set +v rbarraud 15:51:20 wow. that *is* craptacular 16:00:10 DocPlatypus: not a fan of the factoring either? 16:00:47 RodgerTheGreat: no. I'm not a fan of the original unfactored code 16:00:52 the factoring is fine 16:01:14 I mean, I've overlooked some factoring before too 16:01:26 here's a pretty nasty looking C implementation: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c 16:04:42 --- quit: rbarraud (Read error: Connection reset by peer) 16:08:14 yeah 16:08:20 I'm aware Mersenne Twister has been done in C 16:18:05 Well... If that matters, I can explain what you can do to factor this RNG into more comprehensible thing. 16:19:55 go for it 16:20:16 * ASau shrugs. 16:20:25 First thing to notice is that what is called "tempering" 16:20:32 maps single numbers. 16:21:02 That alone brings twisted part of lshift-rshift-xor code 16:21:02 into separate definition. 16:21:21 Second, you see that the whole things works in periods on demand. 16:22:57 You can rework it so that it generates single number each time, 16:23:02 or leave it as is. 16:23:48 how about you take the original code, make those changes and pastebin it so we may be enlightened 16:24:11 "Original" like in C? 16:24:24 I meant the forth 16:24:42 No, that code should be dumped into trash can. 16:32:02 --- join: fantazo (~fantazo@91.119.203.251) joined #forth 16:32:02 --- mode: ChanServ set +v fantazo 17:18:31 alright, here's a partial attempt. http://hastebin.com/raw/goduwiwopo.fs 17:18:43 I made some simple optimizations, pulled out minor factors for indexing state cells and incrementing modulo the state array size, 17:18:52 rewrote the loops using DO...LOOP 17:19:06 factored the successor function for the seed RNG into its own word and pulled the actual array mutation into the surrounding loop 17:19:21 did similarly with the tempering function 17:19:38 and added some whitespace to clarify the structure of temper 17:19:49 y and alter are still a mess and terrible names 17:22:28 There's somewhat canonical definition of : th cells + ; 17:22:37 ah 17:25:54 seems like most of the time "swap cells + would b 17:25:56 argh 17:26:11 seems like most of the time "swap cells +" would be more convenient 17:26:31 because the array you're indexing into is more frequently constant than the index 17:27:21 Also, never mix arithmetic and bitwise operations. 17:27:29 Even when you understand consequences. 17:27:47 yeah, 0 index ! is more clear than index off 17:27:51 In particular, don't use 2/ instead of rshift. It bites. 17:28:06 mm. That was in the original. 17:28:12 That's bug. 17:31:46 is there a standard word which does a single rshift and ignores the sign like a >>>, or is "1 rshift" necessary? 17:33:29 don't see such a word in the gforth manual, but it does confirm as one would expect that 2/ is arithmetic, not logical 17:39:48 Good compilers optimize. 17:39:52 * ASau shrugs. 17:41:29 you know any good compilers? 17:44:04 If you don't know those, what are you doing? Selling fish? 17:45:31 RodgerTheGreat: by the way, if you refill buffer in one sweep, 17:45:49 then you better get rid of finite ring arithmetics. 20:07:02 --- join: rbarraud (~rbarraud@ip-58-28-154-210.static-xdsl.xnet.co.nz) joined #forth 20:07:02 --- mode: ChanServ set +v rbarraud 20:52:12 --- quit: rbarraud (Read error: Connection reset by peer) 20:52:41 --- join: rbarraud (~rbarraud@ip-58-28-153-132.static-xdsl.xnet.co.nz) joined #forth 20:52:41 --- mode: ChanServ set +v rbarraud 21:36:51 --- quit: DGASAU (Ping timeout: 244 seconds) 22:11:12 --- quit: Onionnion (Quit: Leaving) 22:13:04 --- quit: RodgerTheGreat (Quit: RodgerTheGreat) 22:31:40 --- quit: rbarraud (Read error: Connection reset by peer) 22:31:48 --- quit: jillsmitt (Ping timeout: 250 seconds) 22:31:54 --- quit: Monevii (Remote host closed the connection) 22:57:27 --- quit: Kumul (Quit: gone) 23:12:02 --- join: jillsmitt (~jillsmitt@176.222.164.229) joined #forth 23:12:03 --- mode: ChanServ set +v jillsmitt 23:44:12 hoooo boy 23:44:26 my WORDS implementation from a month ago, which i was never able to test before, works 23:44:33 because i finally figured out how to fix my linker \o/ 23:44:43 i don't know if i should credit the americano or the brandy, though. 23:49:05 but now i can get back to work on my text interpreter ! 23:57:38 --- join: ttmrichter (~ttmrichte@61.184.206.220) joined #forth 23:57:38 --- mode: ChanServ set +v ttmrichter 23:59:59 --- log: ended forth/12.06.29