00:00:00 --- log: started forth/09.08.25 00:07:41 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 00:12:36 --- quit: w7tek (Read error: 110 (Connection timed out)) 00:19:30 --- quit: segher (Read error: 110 (Connection timed out)) 00:22:55 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 00:26:10 --- quit: w7tek_ (Success) 00:38:11 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 00:41:32 --- quit: w7tek (Connection timed out) 00:52:55 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 00:57:08 --- quit: w7tek_ (Connection timed out) 01:08:11 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 01:08:37 --- quit: f[x] (Read error: 110 (Connection timed out)) 01:11:51 --- quit: w7tek (Success) 01:15:05 --- quit: w7tek_ (Read error: 60 (Operation timed out)) 01:23:00 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 01:38:16 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 01:41:19 --- quit: w7tek (Read error: 110 (Connection timed out)) 01:41:29 --- join: mathrick (n=mathrick@90-224-55-34-no56.tbcn.telia.com) joined #forth 01:45:12 --- join: gogonkt_ (n=info@59.38.224.156) joined #forth 01:53:29 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 01:56:48 --- quit: gogonkt (Read error: 110 (Connection timed out)) 01:56:52 --- quit: w7tek_ (Read error: 110 (Connection timed out)) 02:01:37 * jauaor wonders if .$ is a proper symbol for referring to 'self' 02:02:58 --- quit: nighty__ (Client Quit) 02:08:46 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 02:09:37 --- quit: w7tek (Success) 02:09:38 --- nick: w7tek_ -> w7tek 02:18:01 --- quit: w7tek (Read error: 60 (Operation timed out)) 02:23:30 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 02:25:18 --- quit: gogonkt_ (Read error: 104 (Connection reset by peer)) 02:27:46 --- join: gogonkt (n=info@59.38.224.156) joined #forth 02:38:34 --- quit: w7tek (Read error: 104 (Connection reset by peer)) 02:38:45 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 02:48:40 --- quit: Quartus` (Read error: 110 (Connection timed out)) 02:53:52 --- quit: w7tek (Read error: 104 (Connection reset by peer)) 02:54:00 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 03:04:21 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 03:12:49 --- quit: w7tek (Read error: 110 (Connection timed out)) 03:19:35 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 03:22:59 --- quit: w7tek_ (Connection timed out) 03:30:58 --- join: GeDaMo (n=gedamo@212.225.115.96) joined #forth 03:34:17 --- quit: mathrick (Read error: 110 (Connection timed out)) 03:34:51 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 03:37:46 --- quit: w7tek (Read error: 110 (Connection timed out)) 03:50:05 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 03:53:38 --- quit: w7tek_ (Read error: 110 (Connection timed out)) 03:57:23 --- quit: w7tek (Read error: 60 (Operation timed out)) 04:05:20 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 04:20:06 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 04:23:52 --- quit: w7tek (Success) 04:29:16 --- join: f[x] (n=user@95.133.165.154) joined #forth 04:33:38 --- quit: GeDaMo ("Leaving.") 04:35:20 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 04:38:53 --- quit: w7tek_ (Read error: 110 (Connection timed out)) 04:42:24 --- join: skas (n=skas@ppp59-167-46-33.lns2.cbr1.internode.on.net) joined #forth 04:48:52 --- quit: skas (Client Quit) 04:50:11 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 04:50:34 --- quit: w7tek (Read error: 104 (Connection reset by peer)) 04:50:34 --- nick: w7tek_ -> w7tek 04:58:53 --- quit: w7tek (Read error: 60 (Operation timed out)) 05:04:42 --- join: DrunkTomato (n=DEDULO@ext-gw.wellcom.tomsk.ru) joined #forth 05:05:25 --- join: w7tek (n=w7tek@166.70.26.201) joined #forth 05:14:13 --- quit: w7tek (Read error: 145 (Connection timed out)) 05:20:09 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 05:35:19 --- quit: w7tek (Read error: 104 (Connection reset by peer)) 05:35:24 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 05:43:11 --- quit: f[x] (Read error: 110 (Connection timed out)) 05:50:10 --- join: w7tek_ (n=w7tek@knowlton.dsl.xmission.com) joined #forth 05:56:42 --- quit: w7tek (Read error: 110 (Connection timed out)) 06:05:25 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 06:09:09 --- quit: w7tek_ (Connection timed out) 06:20:27 --- quit: w7tek (Connection reset by peer) 06:20:40 --- join: w7tek (n=w7tek@knowlton.dsl.xmission.com) joined #forth 06:28:38 --- quit: w7tek (Read error: 60 (Operation timed out)) 07:36:07 --- join: kar8nga (n=kar8nga@129.27.148.233) joined #forth 07:46:20 --- join: GeDaMo (n=gedamo@212.225.115.96) joined #forth 07:53:31 --- quit: kar8nga (Remote closed the connection) 08:00:53 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 08:19:18 --- join: pgas (n=user@pdpc/supporter/active/pgas) joined #forth 09:16:04 --- quit: jauaor () 09:22:36 --- join: Quartus` (n=Quartus`@74.198.12.3) joined #forth 09:34:47 --- join: w7tek (n=w7tek@70.103.91.98) joined #forth 09:50:10 --- join: w7tek_ (n=w7tek@70.103.91.98) joined #forth 09:54:23 --- quit: w7tek (Read error: 113 (No route to host)) 09:56:51 --- join: f[x] (n=user@95.133.124.47) joined #forth 09:58:57 --- join: theatrustop (n=yann@208.176.190.222) joined #forth 10:04:40 --- join: w7tek (n=w7tek@70.103.91.98) joined #forth 10:08:07 --- quit: w7tek_ (No route to host) 10:12:35 --- quit: w7tek (Read error: 60 (Operation timed out)) 11:21:47 --- join: xjrn (n=jim@c-69-181-126-252.hsd1.ca.comcast.net) joined #forth 11:22:44 --- quit: xjrn (Client Quit) 12:04:47 --- join: Judofyr (n=Judofyr@c0492BF51.dhcp.bluecom.no) joined #forth 12:05:11 okay 12:05:16 anyone here? 12:05:17 good! 12:05:25 Nobody is here. Carry on! 12:05:29 --- join: segher (n=rehges@84-105-60-153.cable.quicknet.nl) joined #forth 12:05:31 :) 12:05:52 I am kinda used to the silly "anyone here?" questions in #ruby-lang which got like ~300 users 12:06:14 I guess nobody really "is" on IRC, though 12:06:16 anyway 12:06:24 I'm kinda a high-level guy 12:06:25 Ruby-ish 12:06:31 but wants to learn assembly 12:06:34 properly 12:06:51 or, go more into depth in how the computer *really* works 12:07:22 so I thought about the obvious little task: creating a little OS 12:07:26 at least in the end 12:07:30 as a goal 12:07:41 AND Forth looks pretty cool 12:08:38 so 12:09:09 I've read through the jonesforth tutorial 12:09:32 and the bootstrap-ability of Forth really amazed me! 12:10:19 (I'm not really sure what my question is) 12:10:33 hm… 12:11:51 I guess I'm looking for some tutorials/books/material that will tell about the way a computer boots and how it loads the OS. and what you'll have to do in order to create that OS. 12:12:16 http://wiki.osdev.org/Main_Page 12:12:42 and at the same time how to mix Forth together with this 12:13:02 There's an #osdev channel as well (although they tend to look down on people writing their own bootloaders) 12:13:10 And don't forget ##asm 12:13:44 GeDaMo: cool 12:14:15 I've heard x86 is kinda a weird/hard arch to target 12:14:44 Depends how much of it you want to use 12:14:44 would it be easier to built it on ARM or something else? 12:15:05 I guess it will mostly live in a VM 12:15:19 Remember that you can get away with writing a minimal set of Forth words in asm then write the rest in Forth 12:15:48 yeah, I think that's my goal… 12:16:06 or, one of them, at least 12:17:21 oh, and there's one thing that's puzzling me with jonesforth 12:17:30 it's this line: 12:17:35 HERE @ \ save location of the offset on the stack 12:18:06 isn't HERE an address? 12:18:20 and wouldn't then @ fetch the value stored at that address? 12:18:23 HERE is a word which returns an address, yes 12:19:04 There's something in the back of my mind which say that jonesforth's HERE is non-standard 12:19:09 But I might be wrong 12:19:56 jonesforth basically does "address_of_IF address_of_THEN -" to calculate the offset 12:20:17 but those addresses are fetched by "HERE @" 12:20:28 which doesn't make any sense in my head :/ 12:22:44 Right, in jonesforth, HERE is a variable which contains the pointer 12:23:00 In standard Forth, HERE is a word which returns the address 12:23:36 ah 12:23:40 makes sense 12:24:03 or, standard Forth makes sense 12:24:37 There's often a variable DP which contains the address so HERE would be define as : HERE DP @ ; 12:25:02 cool 12:32:07 GeDaMo: what arch would you recommend if I'm not interesting in taking over the world? 12:32:18 or what's the alternatives? 12:32:32 What you have / what you're comfortable with 12:32:58 well, now I'm not comfortable with anything… 12:33:40 Ok, so what have you got? :P 12:34:14 --- quit: mathrick (Read error: 110 (Connection timed out)) 12:35:21 I haven't actually written/compiled any Asm :P 12:35:33 No, I mean hardware wise 12:35:37 ah 12:35:41 Unless you only want to run it in a VM 12:36:03 right now I have nothing else than a MacBook :/ 12:36:28 x86 or PPC? 12:36:31 x86 12:36:35 (Not that I know much about PPC) 12:36:52 but I'm actually by running it in an emulator 12:36:57 I don't know much about the boot process on Macs either 12:37:02 even though it would cool to actually boot something 12:37:49 I'm actually fine* 12:39:57 You might write your Forth in a high-level language to start with 12:40:18 And worry about the low-level stuff later 12:40:50 that's probably a good idea 12:41:08 That way, you can figure out which primitives you need 12:54:17 --- join: impomatic (n=John@nat65.mia.three.co.uk) joined #forth 12:54:20 Hi :-) 12:55:01 --- quit: Judofyr (Read error: 104 (Connection reset by peer)) 12:55:30 Hi impomatic :) 12:55:44 GeDaMo: when you figured out what that code did I posted the other day, how did you do it? Analysing the code, checking the magic number or by testing sample data? 12:56:00 I can't remember :P 12:56:42 Aha, secret technique ;-) 12:56:42 I seem to remember running it on some data 12:57:36 The magic number meant nothing to me (I think that's always true of magic numbers) 12:58:57 I suspect some of the things you said were clues 12:59:18 :-) 13:03:30 --- join: Judofyr (n=Judofyr@c0492BF51.dhcp.bluecom.no) joined #forth 13:17:31 --- join: Judofyr_ (n=Judofyr@c0492BF51.dhcp.bluecom.no) joined #forth 13:29:00 --- quit: Judofyr (Read error: 110 (Connection timed out)) 13:37:45 --- quit: Judofyr_ (Read error: 110 (Connection timed out)) 13:38:38 --- quit: pgas ("/quit") 13:41:20 --- quit: f[x] (Read error: 60 (Operation timed out)) 13:43:42 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 14:04:54 --- join: Judofyr (n=Judofyr@c8497BF51.dhcp.bluecom.no) joined #forth 14:27:29 --- quit: DrunkTomato () 14:34:06 ok 14:34:14 thanks for the help :-) 14:34:50 No problem :) 14:36:19 --- quit: Judofyr (Remote closed the connection) 14:54:21 --- join: tgunr (n=tgunr@polymicro.net) joined #forth 15:24:03 --- quit: GeDaMo ("Leaving.") 15:26:49 --- join: xjrn (n=jim@c-69-181-126-252.hsd1.ca.comcast.net) joined #forth 15:30:38 --- quit: xjrn (Remote closed the connection) 16:27:06 Anyone want to argue that Forth isn't naturally illegible? http://tr.im/x6Vy 16:27:17 (on reddit) 16:30:15 you gotta admit, TUCK OVER AND -ROT 16:30:15 INVERT AND ROT / + 16:30:17 is pretty bad 16:41:00 --- join: OoS (n=John@nat67.mia.three.co.uk) joined #forth 16:42:16 Yes, my code looks pretty bad. 16:42:36 a good start would be a better choice of word name than C 16:42:42 I meant to defend Forth in general, no my unsightly code. 16:43:14 here's an untested version that's cleaner: 16:43:14 : (c) ( x a b -- x' ) >r 2dup >r >r and r> r> invert and + r> / ; 16:43:18 : c ( x -- x' ) 21845 2 (c) 13107 4 (c) 1799 16 (c) 15 256 (c) ; 16:43:33 (c) should probably use locals though, since it has more shuffling than actual work. 16:43:41 I forget forth locals syntax, its something like 16:43:55 That's on my list for the follow up. Word name that represents what it does. Comment docummenting the stack effect. Comment explaining what it does. Indentation. 16:43:59 : (c) { x a b } x b and x b invert and + a / ; 16:44:13 in factor I'd use combinators instead of shufflers 16:44:20 : (c) ( x a b -- x' ) [ [ bitand ] [ bitnot bitand ] 2bi + ] dip / ; 16:45:25 almost as bad APL 16:45:37 Hmmm... thanks. I ought to split it into two simpler words like you say. 16:45:46 how can you even compare APL and Forth? they're completely different 16:46:34 I'm referring to someone looking at the code for the first time, both are gibberish to the uniniated 16:51:27 Anyway, I'll be posting a follow up tomorrow to show how it ought to been written. 16:51:58 --- quit: impomatic (Read error: 110 (Connection timed out)) 16:52:03 But I was wondering if there's a really good example of well written Forth I can respond with on reddit. 16:52:12 --- nick: OoS -> impomatic 16:52:31 Just to show that Forth isn't naturally ugly, it's down to the programmer 16:52:49 : (c) tuck and dup>r xor swap / r> + ; 16:53:21 i wonder what this code is supposed to do? 16:55:28 ah, the thing it divides by is always a power of two 16:58:30 well factor ships with 200 thousand lines of libraries and they've been worked on by dozens of people. if that's not readable I don't know what is 16:59:32 this particular example code is quite inefficient, no matter how unreadable 16:59:36 just bad code 17:00:47 My code? It's actually twice as efficient as the obvious solution. 17:01:59 Executes 54 words. The obvious implementation executes 103. 17:03:36 counting the number of words executed is sort of menaingless 17:05:10 The alternative would be timing execution. 17:05:14 --- join: nighty__ (n=nighty@210.188.173.245) joined #forth 17:05:21 or looking at machine code 17:05:49 so what _is_ this code -- bitcount with a few bugs? 17:06:12 Bitcount with no bugs. 17:06:49 Unless I messed up while retyping it. Will double check now 17:07:27 8 goes to 0 17:08:10 maybe your 256 should be 16, and your 16 should be 8? 17:08:45 8 goes to 1 in PFE 17:09:58 : C >R 256 15 16 1799 4 13107 2 21845 R> 4 0 DO TUCK OVER AND -ROT INVERT AND ROT / + LOOP ; 17:11:06 the first step doe (8&15) + (8&~15)/256 17:11:13 so that's 8 17:11:24 oh damn, i reversed the steps 17:12:00 i blame it on your code, heh 17:12:25 you shouldn't do it with a loop 17:12:34 Yes, awful code. ;-) 17:12:47 slava: yeah 17:12:57 unless you do it the obvious way: 17:13:58 : bitcount ( x -- n ) 0 >r BEGIN dup WHILE r> 1+ >r dup dup negate and xor REPEAT r> ; 17:14:04 or whatever :-) 17:14:30 i'd do it with a lookup table for bytes 17:14:37 that's how factor's bitcount works 17:14:41 why? 17:14:54 if you care about speed, you a) don't use tables, and b) make it a primitive 17:14:55 because then it works for any precision integer 17:15:06 what's wrong with the table lookup approach? 17:15:14 it kills your cache 17:15:14 for a 32 bit integer, its four memory accesses and three adds 17:15:24 the table is 256 bytes 17:15:31 yes, that's big 17:16:22 : c 0 swap begin ?dup while 2 /mod >r + r> repeat ; 17:16:36 segher: not on a modern desktop pcu 17:16:42 sure it is 17:16:42 l1 caches are ~128k nowadays 17:16:46 nah 17:16:48 32kB 17:16:50 : c 0 swap begin ?dup while dup 1- and >r 1+ r> repeat ; 17:16:58 sse4 has a bitcount instruciton 17:17:02 two alternative algorithms. 17:17:17 the point though is that any single cache miss will cost as much as 300 or so insns 17:18:10 : c 0 i 16 0 do 2 /mod -rot + swap loop drop ; 17:18:10 impomatic: yeah, dup 1- and is good 17:18:26 Or the dumb algorithm. 17:18:45 : bitcount 0 >r BEGIN dup WHILE 1 split 17:18:48 whoops 17:19:03 : bitcount 0 >r BEGIN dup WHILE 1 #split r> + >r REPEAT drop r> ; 17:19:13 none of this works on 64-bit architectures 17:19:19 Sorry, I meant : c 0 swap 16 0 do 2 /mod -rot + swap loop drop ; 17:19:20 sure it does 17:19:31 other than the iterative solutions 17:19:42 heh, sure 17:20:41 The one on the blog and the one I just posted need adjusting for 64bit values. 17:21:56 for more than 16 bits, already 17:22:26 --- join: PoppaVic (n=PoppaVic@node62.205.100.208.1dial.com) joined #forth 17:38:52 --- quit: theatrustop (Read error: 60 (Operation timed out)) 17:52:27 --- join: jauaor (n=araujo@190.38.49.150) joined #forth 17:54:05 --- quit: impomatic (Read error: 110 (Connection timed out)) 17:56:05 hello 17:56:23 howdy 18:09:06 --- nick: tgunr -> tgunr_away 18:27:55 --- quit: maht (Read error: 110 (Connection timed out)) 18:45:24 --- part: PoppaVic left #forth 19:40:04 --- part: jauaor left #forth 23:27:15 --- quit: tgunr_away (Read error: 54 (Connection reset by peer)) 23:27:16 --- join: tgunr (n=tgunr@polymicro.net) joined #forth 23:49:16 --- join: f[x] (n=user@178-65-132-95.pool.ukrtel.net) joined #forth 23:59:35 --- join: kar8nga (n=kar8nga@j-85.vc-graz.ac.at) joined #forth 23:59:59 --- log: ended forth/09.08.25