01:44:42 --- log: started forth/09.11.19 01:44:42 --- quit: gogonkt_ (Read error: 110 (Connection timed out)) 01:51:53 --- join: foxes (i=flash@222.131.163.19) joined #forth 01:53:59 --- join: gogonkt (n=info@218.13.60.153) joined #forth 02:18:19 --- join: ygrek (i=user@gateway/gpg-tor/key-0x708D5A0C) joined #forth 02:27:02 --- part: TR2N` left #forth 02:48:41 --- join: GeDaMo (n=gedamo@212.225.98.255) joined #forth 03:31:30 --- quit: malyn ("Disconnecting from stoned server.") 03:31:48 --- join: malyn (n=malyn@unaffiliated/malyn) joined #forth 03:32:34 --- join: dinya_ (n=Denis@188.16.107.111) joined #forth 04:15:23 --- quit: GeDaMo ("Leaving.") 04:15:47 --- quit: ASau (Remote closed the connection) 04:16:28 --- join: ASau (n=user@host121-231-msk.microtest.ru) joined #forth 04:25:02 --- quit: proteusguy (Read error: 60 (Operation timed out)) 04:44:55 --- quit: mathrick (Remote closed the connection) 04:54:44 --- join: mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 05:20:29 So, in this FPGA-based Forth processor I'm working on colan definitions will compile as a series of 16-bit cells. Each cell can contain either the CFA of another word or three 5-bit primitive opcodes. I think three primitives will be enough to handle any "nested word" functionality needed, so I expect that CFA locations themselves will just contain three primitives. In other words, actual code and 05:20:30 not a pointer to code somewhere else in memory. That would make this a direct threaded or subroutine threaded system, right? Isn't that the nomenclature used when actual processor code resides at the CFA? 05:23:46 Yes. 05:23:59 It it is called direct threaded. 05:24:15 Well... 05:24:37 "Direct threaded" is when you write addresses into memory. 05:25:34 You must mean in a particular way - in an indirect threaded system a colan definition is a list of addresses written into memory too. It's what's *at* those addresses that's different. 05:26:18 I've had a lot of "well..." running through my mind too. The fact that there isn't a separate native processor running some non-Forth kind of code has made it a bit fuzzy for me. 05:26:52 --- quit: mathrick (Read error: 110 (Connection timed out)) 05:27:03 For example, if the word pointed to is another colan definition, then the "CFA" location might indeed contain primitives - the first three primitives of the contained word. 05:27:13 You write direct code, it isn't threaded code. 05:27:15 But it also might contain a pointer to yet another contained word. 05:28:25 Since this is a hardware implementation a pointer to a CFA contained within a colan definition is in some sense also code, not just a pointer. One bit in that 16-bit cell will cause the hardware to behave in a certain way, so it's an instruction just as surely as a five-bit primitive is. 05:28:52 It's just my processor's "call" instruction. 05:28:52 --- join: ben_m (n=ben@85-127-83-149.dynamic.xdsl-line.inode.at) joined #forth 05:29:08 Guten Abend, ben_m. 05:29:28 It's 14:30, that's hardly evening :) 05:29:40 Hi. 05:29:57 So in that sense this almost isn't an anything "interpreted" language. It's just machine code that's laid out a certain way. 05:30:11 ben_m: it is 4:30 and this is evening. :p 05:30:31 7:30 am here. 05:35:18 It seems more clear to me when I consider, say, variables. When the variable word executes, the hardware will push the return address and jump to the CFA of the variable. As soon as it fetches the contents of that address the instruction pointer will then point to the cell right after that, which is the address of the variable. So the CFA will just need two primitives: one that pushes the instruction 05:35:19 pointer onto the data stack and one that "returns" to the calling word. 05:35:39 That's definitely a subroutine threaded style flow, where a snip of code resides at the CFA. 05:38:14 I guess it's only confusing in the case of nested colan definitions, because the hardware itself processes those without need for a "snip of primitives" to tell it what to do. 05:39:08 So the code at the CFA (be it primitives or another nested call) can get right down to business, instead of helping process the threading. 05:50:45 * madgarden is back (gone 09:21:35) 05:51:26 --- join: mathrick (n=mathrick@wireless.its.sdu.dk) joined #forth 06:10:06 Hmmm. What this thing really looks like to me is a processor that has 33 possible instructions: 06:10:28 1) A 16-bit "call" instruction, where the first bit is the opcode and the remaining 15 bits are the address 06:10:52 2) Up to 32 "other instructions", each of which can be represented either as 06:11:14 a) a five-bit pattern with no parameters (if it's in the 2nd or 3rd slot of a cell), OR 06:11:34 b) a six-bit pattern with no parameters (if it's in the 1st slot of a cell) 06:11:54 The last five bits of the six bit pattern would of course match the five bit pattern from case (a). 06:13:22 Literals make it interesting. "Lit" will be one of the primitives, and the literal will live in the 16-bit cell following the one that contains the "lit" primitive. 06:14:00 But that lit primitive could be in any of the three slots, so in that case the parameter could be separated from its instruction by other (unrelated) instructions. 06:14:50 I guess if you compiled "1 2 3", and it happened to fall on cell boundaries the right way, you'd get this: 06:15:04 "lit" "lit" "lit" 06:15:06 1 06:15:08 2 06:15:10 3 06:22:31 Hey, this raises another issue. The same code ("1 2 3"), if aligned a different way, might result in this: 06:22:38 "op" "op" "lit" 06:22:40 1 06:22:46 "lit" "lit" "op" 06:22:48 2 06:22:50 3 06:23:14 So either the compiler or the programmer will have to stay aware of the alignment. 06:23:51 --- join: _mathrick (n=mathrick@wireless.its.sdu.dk) joined #forth 06:24:03 I guess the compiler just needs to remember that it needs to , a literal value into the stream at some point, and do so as soon as it's on a cell boundary, right? 06:24:25 I can't think offhand of any case that wouldn't cover, and it seems like it would be fairly simple to implement. 06:25:41 --- quit: foxes (Read error: 104 (Connection reset by peer)) 06:26:39 --- quit: mathrick (Read error: 104 (Connection reset by peer)) 06:48:18 You know, there's a real problem with the code I laid out above. I can't fetch the literals that fast. The general idea behind this thing is that while it's processing one cell it's fetching the next one. But three literal primitives packed into a cell requires the next *three* cells to be fetched for their execution. I'd have to slow down. 06:48:44 The alternatives are to have the compiler pad with nops: 06:48:51 "nop" "nop" "lit" 06:48:54 1 06:49:48 etc., or to drop support for literals altogether and require that they be defined as constants. The nop approach is probably faster and more compact overall. 06:56:32 --- join: DrunkTomato (n=DEDULO@ext-gw.wellcom.tomsk.ru) joined #forth 07:31:04 --- quit: _mathrick (Success) 07:31:13 --- join: qFox (n=C00K13S@5356B263.cable.casema.nl) joined #forth 07:37:36 --- join: GeDaMo (n=gedamo@212.225.98.255) joined #forth 07:40:19 --- join: PoppaVic (n=pops@99.150.139.232) joined #forth 07:44:49 --- join: segher (n=segher@84-105-60-153.cable.quicknet.nl) joined #forth 07:55:16 --- join: maht_ (n=maht__@85.189.31.174.proweb.managedbroadband.co.uk) joined #forth 08:04:59 --- quit: maht (Read error: 110 (Connection timed out)) 08:36:25 --- join: _mathrick (n=mathrick@users177.kollegienet.dk) joined #forth 08:51:06 --- nick: _mathrick -> mathrick 08:54:04 --- quit: ASau ("off") 09:08:13 --- join: tathi (n=josh@dsl-216-227-91-166.fairpoint.net) joined #forth 09:10:05 --- join: dinya (i=Denis@94.180.112.69) joined #forth 09:27:37 --- join: kar8nga (n=kar8nga@jol13-1-82-66-176-74.fbx.proxad.net) joined #forth 09:45:51 --- join: schmx (i=53e35f0f@sxemacs/devel/schme) joined #forth 10:21:17 --- quit: saper (No route to host) 10:45:51 --- join: ASau (n=user@83.69.227.32) joined #forth 10:55:48 --- join: saper (i=saper@wikipedia/saper) joined #forth 11:19:52 --- quit: DrunkTomato () 11:26:45 --- quit: ASau (Read error: 104 (Connection reset by peer)) 11:27:38 --- quit: dinya (Read error: 54 (Connection reset by peer)) 11:34:34 --- join: neceve (n=neceve@79.114.30.208) joined #forth 11:38:39 --- join: ASau (n=user@83.69.227.32) joined #forth 12:10:11 --- quit: schmx ("Page closed") 12:20:55 --- join: GoNoGo (n=GoNoGo@cro34-3-82-236-93-215.fbx.proxad.net) joined #forth 12:42:34 --- quit: GoNoGo (Client Quit) 12:50:42 --- quit: I440r ("Leaving") 12:57:19 --- quit: saper (farmer.freenode.net irc.freenode.net) 12:57:19 --- quit: maht_ (farmer.freenode.net irc.freenode.net) 12:57:19 --- quit: gnomon (farmer.freenode.net irc.freenode.net) 12:57:20 --- quit: kleinjt (farmer.freenode.net irc.freenode.net) 12:59:21 --- join: saper (i=saper@wikipedia/saper) joined #forth 12:59:21 --- join: maht_ (n=maht__@85.189.31.174.proweb.managedbroadband.co.uk) joined #forth 12:59:21 --- join: gnomon (n=gnomon@CPE0022158a8221-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 12:59:21 --- join: kleinjt (n=kleinjt@tarsonis.dhcp.rose-hulman.edu) joined #forth 12:59:23 --- quit: gnomon (Remote closed the connection) 12:59:26 --- join: gnomon (n=gnomon@CPE0022158a8221-CM000f9f776f96.cpe.net.cable.rogers.com) joined #forth 12:59:38 --- quit: kleinjt (Remote closed the connection) 12:59:41 --- join: kleinjt (n=kleinjt@tarsonis.dhcp.rose-hulman.edu) joined #forth 13:00:34 --- quit: saper (Remote closed the connection) 13:17:45 --- quit: maht_ (farmer.freenode.net irc.freenode.net) 13:21:54 --- join: maht_ (n=maht__@85.189.31.174.proweb.managedbroadband.co.uk) joined #forth 13:51:48 --- join: coliv (n=Coliveir@12.15.114.194) joined #forth 14:00:09 --- join: I440r (n=me@c-69-136-171-118.hsd1.in.comcast.net) joined #forth 14:01:05 --- quit: ygrek (Remote closed the connection) 14:05:11 --- quit: kar8nga (Remote closed the connection) 14:12:14 --- join: silver____ (n=silver@c-24-63-96-9.hsd1.ct.comcast.net) joined #forth 14:18:50 Anybody care to mention other stack-based languages? Forth, right. PostScript, Onyx, I expected to find more like this--?? Joy, Cat, and a couple others in this vein--?? 14:19:07 Factor, of course 14:19:28 Got that. Nice piece of work. 14:19:34 Thanks. 14:20:55 That's all I know of...IIRC Forth, PostScript and Joy are the only older ones; I think Onyx and Cat are sort of spin-offs from the group around Factor.... 14:22:08 POP 14:22:26 which was the first postfix programming language. 14:22:30 RPL. 14:23:04 tathi: you don't even know your roots :p 14:23:08 :) 14:23:15 ;) 14:24:09 hi, I know these days most people uses files instead of blocks. However, is there any ANS way to edit a memory block? I see documentation and it just shows how to list, load, and save blocks, not how to edit. 14:24:22 No. 14:24:54 POP, thanks, will have a peek. RPL, I ran across that one, and decided not to pursue it for one reason or another, I forget why. Got a link on POP? So generic, it's hard to search. Thanks! 14:25:07 http://poplog.org/ ? 14:25:32 http://www.cs.bham.ac.uk/research/projects/poplog/freepoplog.html 14:25:46 So, how did people edit it in the "old days"? 14:26:03 coliv: they had EDITOR 14:26:43 Basically, this was the first thing forth programmer had to write. 14:26:52 Even before string package. 14:27:30 interesting 14:27:40 thanks for the info 14:28:16 You can port FIG portable editor or "Starting Forth" one. 14:28:25 Or you can use the one from gforth. 14:30:07 Hmm, Poplog is more along the lines of logic programming. I love Prolog. 14:30:10 where is the "starting forth" one? in the book text? 14:30:40 coliv: yes. 14:31:12 Though I may misremember that part. 14:31:28 I'm a bit surprised that there isn't a wider array of stack-based languages. So easy to define and implement. 14:31:53 There're many problems in stack languages. 14:32:05 I see that it mentions the editor command, but I didn't find an implementation 14:32:52 Dr. Dobbs and assorted other places. 14:32:56 Yeah, but the fun is defining your way out of the craters. 14:33:13 Fig forth certainly had one, F-pc had a fine one - or f83, whichever imp it was 14:34:34 In the old days, we used an Emacs. Today, though, we use an Emacs. :) 14:35:20 In the old days we used TECO. :p 14:35:26 well, there days older than these... 14:35:41 I think FORTH is older than TECO 14:36:23 One of the first Emaxen was based on TECO. I may have used it on a DEC20. 14:41:06 Anybody familiar enough with Joy to show off with a one-liner for Fibonacci-tail, a better benchmark function than Fibonacci. : ft ( n s -- F_n+s ) dup 2 < if + else 1- tuck ft swap 1- ft then ; 14:42:39 that doesnt look like a very optimum version 14:42:52 : fib 0 1 rot 1+ 1 do tuck + loop nip ; 14:43:03 thats the version i wrote for isforth :) 14:45:00 I use the same encoding in many languages. (define (ft n s) (if (< n 2) (+ n s) (f (- n 1) (f (- n 2) s)))) 14:45:51 I440r: show-off ;-) 14:46:17 ASau: Oh, right, I forgot POP and RPL 14:46:32 actually that version is a bug fixed version. i had a silly bug in the previous version (the 1+ is the fix) 14:46:47 tathi: likely hundreds more that never get remembered. 14:48:28 Oh, for benchmarking recursion, not ultimate efficiency per se. Fibonacci-tail is a better indicator in general, having multiple (2) arguments, using both conditional clauses, and, most importantly, stressing non-tail and tail calls evenly. 14:48:53 --- quit: neceve ("KVIrc Insomnia 4.0.0, revision: , sources date: 20090520, built on: 2009/06/08 23:52:48 UTC http://www.kvirc.net/") 14:49:05 --- quit: qFox ("Time for cookies!") 14:49:38 riiight 14:49:46 I440r: why `1+ 1 do` instead of just `0 do`? 14:50:53 --- quit: ben_m ("bud spencer > chuck norris") 14:51:49 tathi: get the step-over/math-done early? 14:52:35 no, he doesn't use `I` -- the only time those numbers are used is as arguments to `do` AFAICS 14:53:08 hmm 14:53:13 ok 14:53:16 `1+ 1 do` and `0 do` should be equivalent except that the index is different 14:53:23 well, I rarely think "optimal" anyway 14:53:56 Oh, sure. It just struck me as odd. 14:54:23 yah 14:54:41 range maybe.. zero or 1 - don't much care. 14:56:27 I wonder how come that I440r doesn't have more optimal loops for this kind of tasks. 14:56:44 Heh 14:56:50 "do ... loop" is against orthodox forth. 14:57:03 humbug 14:57:15 what do you mean optimal 14:57:19 i jhav rep and for 14:57:34 plus all the begin/while/repeat stuff 14:57:51 I mean exactly that. 14:58:08 You claim that your "fib" is optimal. 14:58:25 But you use "do ... loop" instead of more optimal loop. 14:58:28 :p 14:58:29 i said it was MORe optimal 14:58:56 Still weird that you used unoptimal loop. 14:59:02 or rather. i said the one someone else posted wasnt exactly optimal 14:59:02 ASau: why is `do .. loop` "against orthodox forth"? 14:59:04 Hmm, I440r, it's off by one element. Most such functions are written this way, unfortunately. F_0 = 0. See de Moivre/Binet relation and R.Knott's Fibonacci site. The basic algorithm for such functions is f(n) = if n < 2 then n [[not 1]] else f(n - 1) + f(n - 2). 14:59:10 theres nothgin wrong with do loops 14:59:35 yea thats what was wrong with mine. the 1+ fixed the off by 1 15:00:10 its a non issue tho 15:00:13 tathi: didn't CM throw them out? 15:00:17 usually these things are done for benchmarking 15:00:29 which is already a lost cause so who cares if they come up with a wrong answer :) 15:00:31 ASau: Ah, I see. 15:01:03 I440r: you could just change the 1 to a 0 instead of adding the 1+ 15:01:15 cm didnt throw out do loops. he just greatly prefers for/next 15:01:25 colorforth doesn't have do loops 15:01:35 0 1 rot 1+ 1 do 15:01:52 if someone says 40 fib its their 40 that gest incremented 15:02:41 It is an issue, though. No-op vs drop 1, and that's just in-the-small. In the large, I have seen the two hopelessly intermingled, and the _result_ was the criterion. The ones using the correct definition would then be slower by a factor of Phi, 1.618... . 15:03:04 As for your iteration problem, perhaps you should start with F_-1 = 1 and F_0 = 0. 15:06:00 --- quit: coliv ("Leaving.") 15:06:35 Simple experiment shows that you can have only 46 numbers for 32-bit signed numbers. 15:06:52 Thus you can tabulate Fib. numbers. 15:06:54 :p 15:09:22 And this is really nice idea. 15:10:52 Eh, this relation extends into the complex, and it is outrageously fascinating! ..., F_-6=-8, F_-5=+5, F_-4=-3, F_-3=-1, F_-1=+1, F_0=0, F_+1=+1, F_+2=+1, F_+3=+2, F_+4=+3, F_+5=+5, F_+6=_8, ... 15:11:22 How do you extend it to _complex_?? 15:12:14 Do you mean Moivre expression? 15:13:00 Yeah, de Moivre. Actually Binet, but that poor slob is completely forgotten although he nailed it first. 15:14:57 The graphs of this relation are just plain sick, especially around the range [-2, +2]. I stared at it for hours. 15:19:40 Let's see, in my Scheme stuff... (define /sqrt5 (/ (sqrt 5))) (define phi (/ (+ (sqrt 5) 1) 2)) (define /phi (- hi-phi 1)) (define -/phi (- /phi)) (define (de-moivre n) (* /sqrt5 (- (expt phi n) (expt -/phi n)))) 15:21:52 My phi is Phi, 1.618..., my /phi is phi, .618... . Note that Phi = 1 + phi and Phi = 1 / phi. 15:23:01 create phi 5 >f fsqrt 1 >f f+ f2/ phi f, 15:23:08 phi f@ f. 1.61803398874989 ok 15:23:36 create phi 5 >f fsqrt 1 >f f+ f2/ f, 15:24:02 See www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/ and I'll stop detonating about Fibonacci, heh. i1440r, did using F_-1=+1 and F_0=0 work any better? 15:24:48 gee, thanks ;-) 15:27:43 Oh, well, we need ln phi rather. 15:27:47 create lnphi 5 >f fsqrt 1 >f f+ f2/ fln f, 15:27:53 create lnphi' 5 >f fsqrt 1 >f f- f2/ fln f, 15:27:59 : ffib ( f -- f' ) fdup lnphi f@ f* fexp fswap lnphi' f@ f* fexp f+ 5 >f fsqrt f/ ; 15:28:04 10 >f ffib f. 55.0072722464948 ok 15:30:09 --- quit: GeDaMo ("Leaving.") 15:32:34 Well... It is "ch" actually. 15:32:39 : ffib ( f -- f' ) lnphi f@ f* fcosh 5 >f fsqrt f/ 2 >f f* ; 15:32:51 10 >f ffib f. 55.0072722464948 ok 15:33:00 You planning on whacking the same math-flop all night? 15:33:31 silver____: :p 15:36:53 PoppaVic: you don't know math and envy us? 15:45:47 >:D I was just trying out a little something. F_0 and F_1 = n; F_1, F_2, and F_3 = n + 1. GForth does the following 3.21 times faster than straight Fibonacci. : f dup 4 > if 1- dup 1- f swap f + else dup 1 > if 1- then then ; 15:46:04 3.21 times faster for F_35, that is. 15:48:03 I wouldn't mind getting F_5 = n in with F_0 and F_1 = n, but I'm wondering how to efficiently differentiate 0 1 5 from 2 3 4. 15:48:20 The code is wrong. 15:48:54 The version I just typed in? 15:49:03 Yes. 15:49:47 Find some undefined word, e.g. "asdf" and type ": asdf asdf ;" 15:49:53 See what happens. 15:51:11 Oh, I didn't type "recursive" after ": f". Annoying! 15:53:03 No, it isn't. 15:54:07 Next step is to learn the word "recurse". 15:54:11 :p 15:55:17 As in, I'm accustomed to more convenient namespace control. I limp in Forth. 15:56:43 --- quit: Quartus (Read error: 60 (Operation timed out)) 15:57:40 ASau, know Scheme or CL? 15:58:26 --- quit: maht_ (farmer.freenode.net irc.freenode.net) 16:00:46 --- join: maht_ (n=maht__@85.189.31.174.proweb.managedbroadband.co.uk) joined #forth 16:00:49 I got recurse, thanks. I usually express things as systems of cross-recursive functions, never bothering with explicit loop constructs. 16:01:39 Of course, when tail calls aren't implemented, this is a biiig problem. 16:04:07 In ": f f ;", without "recursive", does the f in the body refer to the previous binding for f? 16:07:42 Oh. No. I see. 16:10:02 Lookit the time! Gotta fly. Have fun storming the castle! 16:10:22 --- quit: silver____ (Remote closed the connection) 17:24:01 --- quit: PoppaVic (Client Quit) 17:24:24 --- join: PoppaVic (n=pops@99.150.139.232) joined #forth 17:29:34 --- quit: ASau (Read error: 104 (Connection reset by peer)) 17:37:15 --- join: ASau (n=user@83.69.227.32) joined #forth 18:07:48 --- quit: tathi ("leaving") 19:06:19 --- quit: krainbolt ("Leaving") 20:03:21 --- quit: foxLaptop (Read error: 104 (Connection reset by peer)) 20:24:16 --- join: bogen (n=dwight@ppp-70-244-166-196.dsl.rcsntx.swbell.net) joined #forth 20:44:17 --- quit: dinya_ (Read error: 60 (Operation timed out)) 20:45:07 --- join: dinya_ (n=Denis@188.18.83.251) joined #forth 20:46:09 --- join: krainbolt (n=krainbol@adsl-065-013-148-105.sip.msy.bellsouth.net) joined #forth 20:46:41 --- quit: Snoopy_1611 (Read error: 110 (Connection timed out)) 20:50:45 * krainbolt waves. 20:50:57 lo 21:35:34 --- quit: PoppaVic (Client Quit) 21:56:54 --- quit: bogen ("Leaving.") 22:07:31 --- join: TR2N (i=email@89-180-152-217.net.novis.pt) joined #forth 22:08:37 --- quit: krainbolt ("Ex-Chat") 22:20:49 --- join: proteusguy (n=proteusg@zeppelin.proteus-tech.com) joined #forth 22:39:41 --- join: nighty^ (n=nighty@210.188.173.245) joined #forth 22:50:41 --- quit: ASau ("off") 22:56:07 --- join: ygrek (i=user@gateway/gpg-tor/key-0x708D5A0C) joined #forth 23:19:23 --- join: qFox (n=C00K13S@5356B263.cable.casema.nl) joined #forth 23:24:44 --- join: Snoopy_1611 (i=Snoopy_1@dslb-084-059-206-044.pools.arcor-ip.net) joined #forth 23:48:21 --- join: qFxo (n=C00K13S@5356B263.cable.casema.nl) joined #forth 23:59:59 --- log: ended forth/09.11.19