00:00:00 --- log: started forth/07.12.11 00:09:33 --- join: ecraven (i=nex@eutyche.swe.uni-linz.ac.at) joined #forth 00:34:58 --- quit: doublec () 00:55:40 --- join: ygrek_ (i=user@gateway/tor/x-7a5aa006c638edec) joined #forth 01:28:14 --- quit: Quartus__ (Read error: 110 (Connection timed out)) 04:16:02 --- quit: Fractal (Read error: 110 (Connection timed out)) 05:28:17 --- join: Crest (n=crest@p5B107655.dip.t-dialin.net) joined #forth 05:56:28 --- quit: ygrek_ (Remote closed the connection) 08:36:52 --- join: doublec (n=doublec@209.79.152.140) joined #forth 08:54:11 --- quit: ecraven ("bbl") 09:21:25 --- quit: TreyB (Read error: 110 (Connection timed out)) 09:34:43 --- join: TreyB (n=trey@cpe-66-87-192-27.tx.sprintbbd.net) joined #forth 09:45:08 what the hell? 09:45:25 Verizon won't relay mail for its customers except for email accounts Verizon hosts 09:45:53 --- join: alexshendi (n=alexshen@dslb-088-067-078-048.pools.arcor-ip.net) joined #forth 09:46:06 well, apparently 09:46:09 I haven't tested this 09:51:30 --- join: ygrek_ (i=user@gateway/tor/x-33e718e06ae3f430) joined #forth 10:17:59 --- join: neceve (n=ncv@unaffiliated/neceve) joined #forth 11:03:20 --- quit: doublec (Read error: 104 (Connection reset by peer)) 11:03:54 --- join: doublec (n=doublec@209.79.152.140) joined #forth 11:09:45 --- quit: doublec () 11:25:43 --- join: snoopy_1711 (i=snoopy_1@dslb-088-068-215-245.pools.arcor-ip.net) joined #forth 11:33:54 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 11:34:06 --- nick: snoopy_1711 -> Snoopy42 11:51:39 --- join: doublec (n=doublec@209.79.152.179) joined #forth 12:02:47 --- join: forther (n=forther@c-67-180-150-67.hsd1.ca.comcast.net) joined #forth 12:35:12 --- quit: Al2O3 (Remote closed the connection) 12:38:03 --- join: Al2O3 (n=Al2O3@c-75-70-5-69.hsd1.co.comcast.net) joined #forth 12:47:39 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 12:47:39 --- mode: ChanServ set +o tathi 13:50:02 --- quit: doublec (Read error: 104 (Connection reset by peer)) 13:50:42 --- join: doublec (n=doublec@209.79.152.179) joined #forth 14:14:52 --- join: edrx (n=Eduardo@201-27-202-34.dsl.telesp.net.br) joined #forth 14:36:47 --- join: arke (n=arke@p54A7CD2B.dip.t-dialin.net) joined #forth 14:36:47 --- mode: ChanServ set +o arke 15:09:37 --- join: crest_ (n=crest@p5B1052B0.dip.t-dialin.net) joined #forth 15:17:39 --- quit: Crest (Read error: 110 (Connection timed out)) 15:25:36 --- join: slava_ (n=slava@li13-154.members.linode.com) joined #forth 15:31:17 --- part: slava_ left #forth 15:31:34 --- join: slava_ (n=slava@li13-154.members.linode.com) joined #forth 15:33:26 --- quit: slava_ (Client Quit) 15:33:36 --- join: slava_ (n=slava@li13-154.members.linode.com) joined #forth 15:33:46 --- join: Quartus__ (n=Quartus_@209.167.5.1) joined #forth 15:34:00 --- quit: slava_ (Client Quit) 15:34:16 --- quit: slava () 15:34:19 --- join: slava (n=slava@li13-154.members.linode.com) joined #forth 15:34:26 --- quit: slava (Client Quit) 15:35:15 --- nick: timlarson___ -> timlarson 15:40:18 --- join: slava_ (n=slava@li13-154.members.linode.com) joined #forth 15:40:31 --- nick: slava_ -> slava 15:40:41 --- mode: ChanServ set +o slava 15:47:34 --- join: edrx` (n=Eduardo@189-18-251-57.dsl.telesp.net.br) joined #forth 15:47:40 --- quit: edrx` (Remote closed the connection) 15:48:43 Hey slava. 15:49:56 --- join: edrx` (n=Eduardo@189-18-251-57.dsl.telesp.net.br) joined #forth 15:54:26 --- quit: edrx (Read error: 110 (Connection timed out)) 16:04:04 --- quit: crc (Remote closed the connection) 16:24:40 --- join: crc (n=crc@70.16.151.239) joined #forth 16:28:29 --- quit: ygrek_ (Remote closed the connection) 16:47:08 --- part: edrx` left #forth 17:22:28 --- quit: tathi ("leaving") 17:33:52 --- join: doublec_ (n=doublec@209.79.152.179) joined #forth 17:33:52 --- quit: doublec (Read error: 104 (Connection reset by peer)) 18:07:47 hi Quartus__ 18:07:53 how goes? 18:08:30 yeah its useless because it only supports factoring integers < 2^32 18:08:36 oops sorry wrong window 18:08:48 still getting used to the new client 18:12:00 --- nick: doublec_ -> doublec 18:19:39 heh 18:20:48 slava: you making crypto keys? 18:21:06 no, just discussing the 'factor' unix tool :) 18:25:06 hello 18:26:40 Hello. 18:28:08 forth is a nice language 18:28:15 i discovered it some days ago 18:28:25 --- join: I440r (n=mark4@ip70-162-227-19.ph.ph.cox.net) joined #forth 18:28:38 I like it. 18:28:45 my mom's master thesis was a forth project 18:28:53 around 25years ago ;) 18:28:59 Neat. 18:29:13 she wrote some PCI stuff 18:29:50 --- join: tane`weq (n=blub@p5B15CEA1.dip.t-dialin.net) joined #forth 18:30:02 mh 18:30:24 found two piles of continuous paper in a locker ;) 18:30:26 with code on it 18:31:12 tane whats your name irl? lol 18:31:28 mh? 18:31:34 what do you mean 18:31:34 oooohhhhh 18:31:45 IRL = in real life 18:31:50 oh 18:31:50 why? 18:32:02 my real name is tane 18:32:02 ;) 18:32:06 because if you been coding forth for 25 years i probably know your name lol 18:32:24 not me 18:32:26 my mom 18:32:32 I440r: two seconds before you logged in he said he discovered forth some days ago 18:32:32 im just 19yo 18:32:37 oh lol 18:32:50 my mom wrote her master thesis in forth 25 years ago 18:32:58 cool! 18:33:20 well 18:33:29 my dad is master of information technologies as well 18:33:36 im coding since im 13yo 18:35:03 In what? 18:44:44 lolcode, of course 18:46:39 --- quit: tane (Read error: 110 (Connection timed out)) 18:47:48 LOL 18:48:28 this may prove that I'm a geek, beyond recovery, but I think that lolcode is one of the funnies things I've ever seen 18:51:47 JasonWoof: i think its enough that you use a drovak keyboard :) 18:51:53 you don't have to bring lolcode into this :) 18:52:07 next you'll start talking about dungeons and dragons and star trek 18:52:08 you think my keyboard layout is funny? 18:52:15 them r fightn words! ;) 18:52:37 oh, the irrivokably geeky thing. right 18:52:39 "huh, punk? y'all dissin' mah keyboard layout??! you'll look even funnier sayin dat wit' no teeth!" 18:52:50 yeah, it's geeky, but my fingers don't hurt :-P 18:53:02 lol 18:56:56 qwerty doesn't require your fingers to hurt 18:57:31 I used to get mild pain in my hands 18:57:40 you just needed to relearn how to type. 18:57:55 yeah, I realize that most benefits came from re-learning to type 18:58:01 Quartus___: i heard that argument in regards to COBOL 18:58:09 cobol makes your fingers hurt? 18:58:17 no, you just have to re-learn how to type. 18:58:24 and type 18:58:25 and type 18:59:36 is cobol very verbose? 18:59:45 It is. 19:00:44 add 4 to x giving ... 19:00:51 or whatever, ew 19:01:09 yoinks 19:01:47 to put it in perspective, here is factorial in cobol: http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/c0925405211.htm 19:01:58 you can make ruby code look real nice 19:04:09 good lord 19:04:24 that's horrendous 19:04:33 no, it's Enterprise 19:04:40 ooo, recursive cobol! 19:04:45 now that Is rare 19:04:45 that's the best sort 19:05:52 http://home.ccil.org/~cowan/cobol-horrors.html 19:06:01 sub factorial(x) { return x ? factorial(x-1) : 1 } 19:06:17 right? 19:06:34 JasonWoof: yeah 19:06:39 you're missing a multiply? 19:06:42 yeah 19:06:56 1 100 [a,b] product 19:07:16 (defun (f x) (if (zerop x) 1 (* x (f (1- x))))) 19:07:34 that's not tail recursive though 19:08:08 it shouldn't be recursive at all... unless your compiler can unravel it 19:08:20 easy enough to transform it 19:08:36 but I'm lazy/distracted 19:08:45 int factorial(int x) { int ret = 1; while(x--) ret *= x; return ret; } 19:08:53 some compilers can convert simple non-tail reursive forms into tail recursive forms using an accumulator 19:08:56 such as gcc 19:09:04 gcc does that now? 19:09:08 hmmmmm 19:09:08 yup 19:09:12 most impressive 19:09:32 its not that hard 19:09:37 easy enough to write a loop. it's only longer because it needs a variable 19:09:39 you look at the operation consuming the result of the recursive call 19:09:49 if its associative, you can transform it to use an accumulator 19:10:40 slava: easier to do in some languages than others... but yes it makes sense 19:10:59 well, if your language is really terrible, then its probably impossible to do certain types of analysis 19:11:06 for instance in ruby, Fixnum#* can be redefined at any time 19:11:06 most C programmers I know still do loops because they don't trust the compiler to even handle tail recursion right -.- 19:11:31 many C compilers don't 19:11:37 also even gcc has limitations 19:11:46 it doesn't support general tail recursion, only self-tail calls, IIRC. 19:11:52 actually, i'm wrong. 19:11:56 it supports full tail recursion 19:12:03 hmmm 19:12:20 do any forth implementations compile away tail recursion? 19:12:35 many do 19:12:42 its a trivial optimization 19:13:21 especially in a native-code Forth 19:13:36 with DTC it introduces a conditional on every subroutine call 19:14:21 --- join: arke_ (n=arke@p54A7CDBF.dip.t-dialin.net) joined #forth 19:15:35 : fact ( x -- y ) dup 0 = if drop 1 else dup 1- recurse * then ; or something? 19:15:45 or something 19:15:55 looks fine 19:17:02 can be done more efficiently without recursion 19:17:10 yup 19:17:23 I440r: when are you going to finish isforth? :) 19:17:26 anything you can do WITH recursion can be done better without 19:17:33 not true 19:17:34 slava erm... erm... 19:17:36 ok 19:17:43 so the ackerman funciton would be problematical lol 19:17:49 tail recursion is the same thing as iteration 19:18:02 : fact ( x -- y ) 1 swap 1+ 1 do i * loop ; 19:18:05 its not recursion 19:18:06 something like that 19:18:21 any iterative function can be written recursively and vice versa 19:18:25 I440r: recursion is easier on Some kinds of programmers; more math oriented 19:18:39 there can be issues with automatic-tail-call optomization 19:19:01 lucca true. and "most" math people are a bit crappy at coding lol... they THINK differently 19:19:09 in factor iteration is built with recursion 19:19:11 I440r: i make do. 19:19:17 because it means the language itself doesn't need any looping constructs 19:19:26 which is why isforth doesnt support automatic optimizations of any sort 19:20:05 the main problem with automatic tail-call optomization in forth is that some people manipulate the return stack 19:20:19 ie they expect the return address to be there 19:20:41 as it SHOULD be 19:21:00 that's why you don't expose the return stack to the programmer :0 19:21:17 so then you have to choose if you want to break return stack manipulation, or have a different exit/; word(s) that do tail-call optomization 19:21:20 I440r: I will politely disagree; every tool has its place. 19:22:02 slava "hide stuff from programmer so he doesnt shoot himself in his own foot" "compiler plays mommy" 19:22:07 JasonWoof, I'd need to see some pretty compelling code to see the need for eliminating tail-call optimizations. 19:22:23 I440r: actually, if you don't expose implementation details, the compiler is free to change them 19:22:23 "the unix operating system was not designed to prevent you from doing stupid things as taht would prevent you from doing clever things" 19:22:55 for example, if your library says 'the phone book records are laid out contiguously in memory starting at address 1234' 19:23:00 there is no user space, there is no system space. there is NO SPOON. there is just "forth" 19:23:01 then you're stuckw ith that representation for life 19:23:10 Quartus___: tail-call is rarely needed. I'm fine with having some special word/syntax for such cases 19:23:12 slava, and he is -- Forth-83 19:23:18 instead, you'd say 'to get the first record, call this word, to advance to the next record, call that word' 19:23:26 i wouldnt call isforth 83 standard 19:23:28 I440r: heh, as you like 19:23:52 isforth may vary from forth83, but that's your implementation model, and you have vociferously defended it as the only approach you consider worthwhile. 19:23:52 JasonWoof: it depends on your programming style 19:23:56 with certain data structures recursion is very useful 19:24:13 recursion is damn useful 19:24:56 but most recursion works just fine without tail-call optomization 19:25:13 in gforth I wrote a word TAIL-RECURSE 19:25:27 like RECURSE only it compiles a jump/branch not a call 19:25:51 but it's just sugar 19:25:54 well JasonWoof even in something like a binary tree traversal, the right-hand recursive call is a tail call 19:26:01 makes it so I can do: : foo ... tail-recurse ... 19:26:10 instead of: : foo begin ... again ... 19:26:56 I guess it's better, because I can have tail-recurse in my def more than once without juggling 19:26:57 JasonWoof, I cobbled one of those together for somebody too -- modified : to do a begin, store the address, and then whistle it back up if tail-recurse is requested 19:27:22 eech 19:27:26 worked fine 19:27:47 : tail-recurse postpone branch last-cfa tail-recurse put the BEGIN address back on the stack, did an AGAIN. 19:28:03 oh, : last-cfa lastxt 8 + ; 19:28:22 Sure. My approach was somewhat more portable. 19:28:23 JasonWoof: why should the programmer have to write such a word at all? 19:28:34 slava: because he's using gforth. 19:30:48 --- quit: arke (Read error: 110 (Connection timed out)) 19:32:18 --- quit: alexshendi ("Leaving") 19:35:17 --- part: doublec left #forth 19:36:52 --- quit: forther ("Leaving") 19:39:33 slava: gforth doesn't do everything, and what it does do is very poorely documented 19:39:45 fortunately, much of it can be fixed 19:40:14 I have a 6k file that makes gforth much better 19:41:09 6k? Largish. 19:41:34 such is the sad state of forth :) 19:41:58 No; there's colorForth, and LSE64, and SeaForth! 19:42:13 yeah, I like to use some words/concepts that were concieved during the last 20 years 19:42:31 and I consider some of the gforth stuff to be horribly broken 19:42:39 like FOR which loops the wrong number of times 19:42:40 JasonWoof, like shiznit, and blog? :) 19:43:41 : foo 2 for '# emit next ; foo ### ok 19:44:08 It counts to 0. 19:44:28 so? 19:44:34 No so. 19:44:50 x = 2; 19:45:18 while(x--) { ... } 19:45:24 that counts to zero, and executes ... twice 19:45:27 it's not that hard 19:45:37 I don't think easy/hard was the reason for the choice. 19:46:38 maybe there's a reason that made sense 40-50 years ago 19:46:41 but today it's madness 19:46:49 It's not all that mad. 19:46:55 it's pretty mad 19:46:58 it's a counted loop 19:47:03 but it executes x+1 times 19:48:07 --- join: mark4_ (n=mark4@ip70-162-227-19.ph.ph.cox.net) joined #forth 19:48:30 For/next is non-standard precisely because implementation varies. It's an optimized counting loop, and commonly (and historically) employs whatever nifty low-level instructions are available for the purpose. On some architectures, it makes sense to do the x+1 thing. 19:48:33 I can't even think of a reason why the gforth implementation would be faster or simpler or anything 19:48:57 I can't tell you, but I'd guess it's because the majority of implementations go that way. 19:49:17 I guess forth is a small world 19:49:44 If you want standard behaviour, use the standard counting loop, or do as you've done and roll your own specific one. 19:50:26 so gforth's FOR is broken because other forth implementations do it that way? 19:51:06 I'm making an assumption as to the reason why it is the way it is. I don't consider it broken, but I follow what you mean by that. 19:54:02 It may well be faster than the alternative. 19:54:16 I haven't dug into it. 19:54:40 If it is faster than the alternative, then it is adhering closely to the history of FOR/NEXT. 19:55:42 I'd be suprised if there was a modern architecture where it took more than 1 additional instruction to make it loop x times instead of x+1 times 19:56:04 that's one instruction before the loop starts, not each time through the loop 19:56:31 Probably so. 20:05:48 --- quit: I440r (Connection timed out) 20:07:08 --- quit: proteusguy (Read error: 110 (Connection timed out)) 20:07:18 I just looked up some notes; Retroforth has a for/next, counts downward from the limit to 1, and allows access to the counter with r. F-PC counts downward from the limit to 0, and allows access to the index with R@ (and not 'i' as the docs claim). Pygmy counts down from limit-1 to 0, and gives access to the index with I. SwiftForth, pForth, Win32Forth, don't have for/next at all. 20:08:05 --- join: proteusguy (n=proteusg@ppp-124.120.229.24.revip2.asianet.co.th) joined #forth 20:08:10 There may be other systems that count upward. 20:09:20 counting downward makes sense to me 20:09:45 F-PC was highly influential, and may have had some influence on the gforth implementation. 20:09:47 PPC (the assembly language that I know) has an instruction to decrement and branch if not zero 20:10:52 I think it decrements before the check though, so it'd be fastest to loop x times, not x+1 20:12:33 On some systems it may be fastest to do a register-based loop, or to stop after zero. Some systems use a short-displacement branch instruction for for/next. Some permit no access to the counter. 20:13:01 It's why consensus wasn't reached to standardize it, and why DO/LOOP was standardized instead. 20:15:00 I understaind why it wasn't standardized in the old days 20:15:23 afaik it's not standardized now 20:15:26 which I'm fine with 20:15:29 It's not. 20:15:34 I just think it's very strange that gforth does it the way it does 20:15:39 considering it's written in C 20:15:52 I haven't dug into it. Possibly it's optimal. 20:16:13 I'm sure Ertl could shed some light. 20:17:13 optimal for what? x86? 20:17:20 For the implementation. 21:35:22 --- quit: crest_ (Read error: 110 (Connection timed out)) 21:54:56 Quartus__, 21:54:57 ;) 21:56:28 had to take a little sleep 21:57:01 you asked me "in what" i just think you asked for the programming languages... it were a lot over the years, but only some to a deeper level 22:04:11 --- join: Crest (n=crest@p5B1058A8.dip.t-dialin.net) joined #forth 23:00:56 --- nick: arke_ -> arke 23:51:20 --- join: ecraven (i=nex@eutyche.swe.uni-linz.ac.at) joined #forth 23:59:59 --- log: ended forth/07.12.11