00:00:00 --- log: started forth/08.04.16 00:53:21 --- join: tane (n=tane@p57903B4F.dip.t-dialin.net) joined #forth 01:01:32 --- join: Maki (n=Maki@adsl-224-84.eunet.yu) joined #forth 01:04:39 --- quit: tane`weq (Read error: 110 (Connection timed out)) 01:45:23 --- quit: ecraven (Read error: 110 (Connection timed out)) 03:07:18 --- quit: Malfermi1aKodo (Read error: 104 (Connection reset by peer)) 03:11:43 --- quit: nighty^ ("Disappears in a puff of smoke") 03:12:39 --- join: MalfermitaKodo (n=kansu@xdsl-78-34-147-245.netcologne.de) joined #forth 03:29:06 --- quit: ramkrsna (Remote closed the connection) 03:35:41 --- join: ramkrsna (n=ramkrsna@unaffiliated/ramkrsna) joined #forth 03:43:04 --- join: ecraven (n=nex@140.78.42.119) joined #forth 05:23:55 --- join: nighty^ (n=nighty@p5025-adsau17honb13-acca.tokyo.ocn.ne.jp) joined #forth 06:31:26 --- quit: ramkrsna (Remote closed the connection) 07:10:02 --- quit: ecraven ("bbl") 08:22:32 --- join: tane`weq (n=tane@p579039DE.dip.t-dialin.net) joined #forth 08:32:55 --- quit: tane (Read error: 110 (Connection timed out)) 08:53:18 --- join: luinfana (n=tony@c-69-253-227-21.hsd1.nj.comcast.net) joined #forth 09:02:49 back with another quick question if anyone's lurking around... 09:03:50 hi 09:03:56 o hai 09:04:13 ugh 09:04:29 was wondering if someone could explain how this little function works 09:04:34 haha, gotta love lolspeek 09:04:35 what's your query? 09:04:42 it goes like this 09:04:52 : find.divisors 09:04:59 0 # divisors ! 09:05:20 dup 1 do dup i mod 0= if 1 # divisors +! i swap then loop drop; 09:05:37 I assume that's #divisors, not # divisors 09:05:41 so what that does is find the divisors of a given number, if #divisors is already declared as a variable of course 09:05:45 right, sorry 09:06:07 significant difference 09:06:12 so I understand what it does and all, just not quite how it works...what's the purpose of #divisors +! ? 09:06:30 +! increments. 09:06:58 okay, but why is it incrementing the divisors variable...? 09:07:12 so 1 #divisors +! adds 1 to #divisors 09:07:17 right 09:07:26 it's counting them. 09:07:36 but shouldn't #divisors just be holding the numbers it finds? 09:08:01 I guess I'm confused as to where the division actually happens...there's MOD but that should only return the remainder, not the result of division 09:08:14 it's a variable. It holds one number. 09:08:26 OK 09:08:50 MOD is the division operator here. If there's no remainder, it's a divisor. 09:09:01 --- join: JasonWoof (n=JasonWoo@unaffiliated/herkamire) joined #forth 09:09:01 --- mode: ChanServ set +o JasonWoof 09:09:21 the list of divisors winds up on the stack. The count is in #divisors. 09:09:36 understood...but how is it actually dividing, say 6, by 1, 2, 3, 4, 5...etc 09:09:47 with mod. 09:10:01 really? I didn't think mod worked that way 09:10:06 I thought it would have to be /mod 09:10:07 or something 09:10:13 how do you think it works? 09:10:44 given two numbers, divides them (quietly) and returns the remainder only 09:11:06 right. And that's what you want here. The remainder. 09:11:06 right? maybe I'm completely off 09:11:20 right, I definitely want it to check if the remainder is 0 or not 09:11:29 so... 09:11:41 maybe it'd help if I showed you the whole program...it's only a few lines 09:12:05 one sec 09:13:55 http://retroforth.com/paste/?id=522 09:14:25 it does a search through a given range of numbers, looking for "perfect numbers" 09:15:21 ok. 09:15:47 I need to do a line-by-line analysis of this. So the first function "integers" just increments the top of the stack on every loop, right? 09:16:12 and then find.divisors finds the divisors of the current number, and puts them on the stack 09:16:15 no. 09:16:18 oh ok 09:16:36 enlighten me 09:17:07 bench test integers at the prompt. See what it does. See what it leaves on the stack. Write a stack diagram for it. 09:18:17 yeah, I did that before...you can give it a number like 10, and it counts up to 10 (prints 1 2 3 4 5 6 7 9 10) and puts all of the numbers on the stack 09:18:29 haha I don't know how to count, forgot the 8 09:18:30 lol 09:18:50 --- join: forther (n=forther@c-67-180-150-67.hsd1.ca.comcast.net) joined #forth 09:18:51 ok. So how do you get from that, to saying it increments the top of the stack each time through? 09:19:34 ummmmm 09:19:40 not sure 09:19:45 hi 09:20:04 guess I was looking at my comments from earlier, and wasn't thinking about it 09:20:27 Analysis requires thought. 09:20:33 indeed, indeed. 09:20:51 hi forther 09:21:09 so now the stack has this string of consecutive numbers onit 09:22:22 with the highest one on the top... 09:22:34 where in that code is 'integers' used? 09:22:49 did you see the code I pasted? 09:22:58 http://retroforth.com/paste/?id=522 09:23:00 yes. Where is it used? 09:23:13 oh, at the top of the program 09:23:25 before find.divisors and all that 09:23:25 read my question. I see where it is defined. But where is it used? 09:23:37 ahhhh OK, gotcha 09:24:01 --- join: JasonWoo1 (n=JasonWoo@c-65-96-165-155.hsd1.ma.comcast.net) joined #forth 09:24:07 --- quit: JasonWoof (Read error: 104 (Connection reset by peer)) 09:24:08 it.......isn't? 09:24:42 correct 09:24:54 so...why would it be there in the first place if nothing calls it? 09:25:04 hell of a good question. 09:25:06 that's so weird, I didn't notice that before 09:25:09 haha 09:25:35 okay, so I'm going to delete that 09:25:45 and just worry about find.divisors 09:26:47 what does the <> signify? 09:26:57 down at #divisors @ 1 <> if 09:27:21 look it up in the Standard. 09:27:23 didn't find it in the Forth manuals I've been reading 09:27:46 :/ can you just tell me, or is it that complicated? 09:28:09 you need to have the references available, and know how to use them 09:28:38 yeah, you're probably right 09:28:46 http://quartus.net/dpans 09:29:14 thanks! 09:29:44 section F is an index. 09:30:52 ahhhhh not equal 09:30:58 OK 09:31:00 makes sense 09:33:28 then I think the only other thing I'm not getting is the next line, #divisors @ 2 - for + next...and I'm not seeing "for" in the Standard index 09:34:08 for/next are nonstandard. What Forth is this written for? 09:34:18 that's what I thought 09:34:20 gforth 09:34:43 then look at the gforth manual. 09:34:49 so I assume gforth includes those commands, right...they're in the words list 09:35:00 yep 09:35:30 where on earth did that code come from? 09:36:16 hah, a couple of different places...mostly written by crc 09:36:23 it could do with some factoring. 09:36:37 --- nick: JasonWoo1 -> JasonWoof 09:36:44 --- mode: ChanServ set +o JasonWoof 09:37:07 in 2nd grade? 09:37:47 I was under the impression that crc was a good programmer 09:38:02 really, it's that bad? 09:38:04 works for me 09:38:13 I just need to understand it like it's the back of my hand 09:38:21 maybe he was in a hurry. 09:38:28 he did mention that it could be done "more efficiently" 09:38:39 luinfana, is this homework or something? 09:39:29 it's not efficiency, it's the stack usage 09:39:41 no, it's a large project I'm doing on Forth in general. This is just one little part of it. 09:40:08 what's the project? 09:41:56 discuss the history, implementations, syntax of the language and give specific examples in code...perfect numbers seems to be a pretty standard thing 09:42:37 So homework. Ok. That code you're chewing on is badly factored, and does what it does in the clumsiest way. 09:43:09 ah, I still wouldn't call it homework... :) 09:43:21 it's for school, though. 09:43:24 hm, and you said crc was a good programmer? 09:43:28 for college ^_^ 09:43:50 and I'm probably not supposed to ask that sort of stuff here, I gather 09:45:02 look, I can't account for who wrote it and why, I can only tell you what's true about it. 09:45:15 FWIW, crc specifically indicated that his solution was not well-factored: Apr 13 21:28:52 for the record, a working (though not well-factored) solution to luinfana's problem is at http://retroforth.com/paste/?id=519 09:45:39 oh, of course...I mentioned he said it could be improved 09:45:56 woh, I guess there are some large perfect numbers, like 191561942608236107294793378084303638130997321548169216 09:46:11 yeah, the fifth one is already more than 33 million 09:46:22 this only needs to find the first four and I'm happy 09:47:35 was in crc's idea to keep all divisors on the stack? 09:47:57 so, unless someone wants to rehash the entire problem in better-working code (and I'm not asking you to), I think I'm sticking with this 09:48:25 no, I provided the find.divisors part...found it somewhere else 09:48:50 he changed it to have that #divisors +! part though 09:48:51 you're making a key error, trying to give an overview of forth by starting with a badly-written example of it. 09:49:08 mmm 09:49:11 that's not good 09:49:39 so what's the alternative to using the stack? 09:49:57 the find.divisors leaving an untold and possibly very large number of stack items behind is _very_ _bady_ 09:50:02 bad 09:50:17 you can't not use the stack 09:50:20 everything uses the stack 09:50:23 so a partial solution would be if it "cleaned up after itself?" 09:50:41 words should take 0 09:50:42 right, it leaves thousands of items on the stack 09:51:00 take 0-3 arguments and return 0-2 arguments 09:51:03 as a general rule 09:51:20 words should never need to be cleaned up after 09:51:35 I...don't know enough to understand what that 0-2 and 0-3 mean... 09:51:38 they should provide you with the number or effect you asked for 09:51:52 sure, that would definitely be best 09:52:03 it would make a lot more sense if it gave you the sum of the divisors, not a slew of stack items 09:52:27 : perfect? dup divisor-sum = ; 09:52:27 it does eventually sum the divisors...it has to to determine whether the number is perfect or not 09:53:20 so why collect them first? Sum them as you go. 09:53:39 true... 09:54:39 seriously though, if I'm being a pain or I'm not supposed to ask these kind of questions here, this'll do...I'll leave you in peace 09:54:50 --- join: ygrek (i=user@gateway/tor/x-0de99eeeb2285aa6) joined #forth 09:55:07 understood that this is a pretty terrible solution 09:55:28 variable v-divisor-sum 09:55:42 ok 09:56:16 and how to sum them up? 09:56:29 : divisor-sum ( x -- y ) 0 v-divisor-sum ! dup 1 do dup i mod 0 = if i v-divisor-sum +! then loop drop v-divisor-sum @ ; 09:56:53 something like that 09:57:03 oh wow, OK 09:57:05 thanks 09:57:08 np 09:57:13 hope it works, I didn't test it 09:57:19 yeah let me try 09:58:07 : print-perfects 2000 2 do i perfect? if i . then loop ; 09:58:51 Try this: http://retroforth.com/paste/?id=523 09:58:54 or better yet, do it without the variable 09:59:36 OK 09:59:39 will do 09:59:55 : divisor-sum ( x -- y ) 0 over 1 do over i mod 0 = if i + then loop nip ; 10:00:11 idiomatically, I might even say i mod 0= i and + but I don't expect you to follow that at this stage 10:00:13 If you don't have nip, it's just: : nip swap drop ; 10:00:40 Quartus`: nice :) 10:01:56 : divisor-sum ( x -- y ) 0 over 1 do over i mod 0= i and + loop nip ; 10:02:22 that's a confusing optomization 10:02:27 very nice 10:02:37 not to me. 10:02:39 I like it, but for intro material, stick to the one above with the "if" in it 10:04:10 I'm on gforth, so I've got nip 10:04:50 Quartus' pasebin solution works great 10:05:24 so work on understanding that one. 10:05:56 divisor-sum ( x -- y ) 0 over 1 do over i mod 0= i and + loop nip ; looks interesting 10:06:41 it's the same, but with an alternate idiom instead of if/then 10:07:22 luinfana: if you're interested in learning about the trick, it's cool, but for demo/intro purposes, stick to the one with the "if" (Quartus`'s paste looks great) 10:07:48 OK, yeah I like that solution 10:07:58 thanks alot, this is much more compact 10:08:09 it's better forth. 10:08:14 :) 10:08:15 Is it really a trick? I would call it one of the things that makes Forth unique. Kind of like your nth-execute: "trick" that I am so fond of. :) 10:08:55 sure, it's tricky 10:09:18 as for nth-execute... many languages have jump tables 10:10:39 I have always felt that "true" being defined as -1 was done on purpose, so that you could do things exactly like the "AND +" idiom in Quartus's solution. 10:11:01 sure 10:11:09 very cool 10:11:17 and so you don't need a "logical and" 10:11:54 right, the same one serves both needs 10:14:06 malyn: how'd you get nth-execute from me? from herkforth or fronds or did I describe it here? 10:15:58 I saw it here a while back. I didn't understand what was happening at first, but after doing the research (and testing things out) I understood both nth-execute: and quite a bit more about how the Forth VM operates. 10:16:42 how one particular sort does, anyway 10:17:03 Every now and then you drop interesting tidbits like that into #forth and I am always happy to stash them away in my notebook. :) 10:18:18 cool 10:20:23 Quartus`: why do you do "over 1" before the do loop? 10:23:23 look up DO, see what it requires 10:26:48 has something to do with how many times it loops, right? 10:26:58 look it up. 10:27:05 like the 2000 2 do at the bottom 10:27:12 yeah, I was just looking at it 10:28:39 bbiaw 10:31:41 Any preferences for naming of deferred words? 10:34:45 I would like to take this opportunity to cast one vote against the suffix "-I-am-a-deferred-word", on the grounds that it would be stupid. 10:35:06 madwork: "emit" 10:35:19 Yes, clearly you should replaces dashes with dots in that suffix. 10:35:37 gnomon: hehe :) 10:42:05 --- quit: JasonWoof ("Leaving.") 10:44:00 --- join: JasonWoof (n=JasonWoo@unaffiliated/herkamire) joined #forth 10:44:00 --- mode: ChanServ set +o JasonWoof 10:53:39 I think I've got Quartus` solution down, except for the over 1 ?do part...looked at the Standard definition as he suggested but I 10:53:46 I'm still not getting it 10:53:50 ... 10:55:21 I'm just too much of a Forth noob, I guess 10:56:53 luinfana, in which paste is ?do being used? 11:00:01 Also, could you explain your current understanding of what ?do actually does? If there's a misunderstanding there, that's the best place to start. 11:02:02 luinfana: in understanding confusing sequences of words, (especially for beginners) I recommend writing a stack comment after each word 11:02:21 (just copy/paste a copy of the code, replace all spaces with line breaks, and add the comments in) 11:07:41 yeah, funny you should say that, that's exactly what I'm doing right now 11:08:32 gnomon: current understanding of ?do? non-existent. I guess. I think I understand regular old do, though 11:09:36 Ah, if you're experimenting with it then you're 90% of the way there. Carry on. You'll have it in minutes. 11:10:04 :) well that sounds promising 11:17:23 oh...sorry, if you haven't figured it out already I'm referring to http://retroforth.com/paste/?id=523 11:26:08 Hm. 11:26:26 Am I missing something or does Forth not have structures? 11:37:42 Forth doesn't have structures in the same way that C doesn't have strings. 11:41:05 Hm. 11:41:41 alright...I still don't get it. If I type "0" in my Forth, followed by "over 1", I get a stack with three items: 0, some huge number (memory address?), and 1. Why is that? 11:42:05 my guess is this should NOT happen 11:42:11 luanfina, try putting 10 and 15 on the stack before executing over. 11:43:05 right right, I tried it with numbers on the stack and I see what it does, I just don't understand why using it the way the program dictates gives me a weird number 11:44:06 10 and 15 gives me 10 15 10 as it should 11:44:20 The way the program dictates..? The program expects there to be a number on the stack already, doesn't it? 11:44:39 it just slaps 0 onto it! 11:44:50 luinfana: read the documentation for OVER 11:44:57 There's some number N on the stack; divisor-sum starts by putting a 0 on the stack and then executing over to bring a copy of N back up to the top of the stack so that it can start working on it. 11:45:06 luinfana: it takes two operands. Weird things happen if you only give it one 11:45:17 some forths will crash in this case. I'm suprised gforth didn't 11:45:21 Weird things like nose demons. 11:45:37 ok...that sounds right 11:45:40 haha 11:45:48 nah, gforth is some pretty stable stuff 11:45:50 1 2 3 .s 11:45:52 1 2 3 OK 11:45:55 over .s 11:45:59 1 2 3 2 OK 11:46:05 yup 11:46:05 JasonWoof, the fact that gforth doesn't crash just means that it's not checking for stack underflow, no? It's just pulling from the memory region beyond the end of the stack. Could be anything there. 11:46:15 got it got it 11:46:28 gnomon: right, but iirc gforth generally does check for stack underflow 11:47:06 Ah, thus your puzzlement. Gotcha. 11:47:31 gnomon: I just popped open gforth, and typed "drop" which resulted in: *the terminal*:1: Stack underflow 11:47:54 right, generally looks like this: 11:47:57 Backtrace: 11:47:57 . 1714303587 11:47:57 *the terminal*:8: Stack underflow 11:50:31 ok, so gforth allows read-access to below the bottom of the stack 11:50:37 dup and over both work when the stack is empty 11:50:51 well... "work" in the sense that they put *something* on the stack 11:52:02 so when this program starts for the very first time, it's checking 2, right? And it incements that number all the way to 20,000. Each time, the number is put through divisor-sum, which loops that number of times (to get all the divisors) using mod to check for even division, adds up the divisors, compares the sum with the original number, does some boolean to separate perfect/nonperfect by those rules, and starts all over again 11:52:15 that's my interpretation 11:52:21 probably horribly wrong 11:53:50 pretty close 11:54:11 only off on one detail, the loops never reach the upper bound 11:54:20 ie the main loop goes from 2 to 19,999 11:54:37 ahhh 11:54:37 and the inner loop (in divisors-sum) doesn't check the number against itself 11:54:57 it can be an important detail 11:55:02 then...how is the number checked against itself? 11:55:10 the most common use of do/loop is to loop x times 11:55:32 example: 37 0 do ... loop 11:55:39 that will execute "..." 37 times 11:55:41 yup, got that down 11:56:01 "do" is usually preceded by "0" 11:56:27 but in this case we know 0 and 1 can't be perfect 11:56:27 so in my example above i is first 0, then 1 all the way up to 36, but is never 37 11:56:35 OK 11:56:38 right 11:56:54 but it's ?do in this case 11:57:05 which is slightly different? 11:57:23 ?do is like do, except it handles the weird case where you give it a range of zero length 11:57:29 eg: 1 1 ?do ... loop 11:57:33 that doesn't do anything 11:57:39 where as: 1 1 do ... loop 11:57:50 would loop for a very very long time 11:58:09 oh, that's all? Then why not make regular "do" handle that by default (I'm just thinking aloud, I'm sure there are lots of important reasons) 11:58:25 ok, yeah that pretty much answers that 11:58:34 just in case I guess. Quartus put it there, mine had "do" 11:58:45 ok 11:59:52 so where is the number actually compared to the sum of its divisors? In over i mod 0= if i + then? 12:00:10 no 12:00:17 in "perfect?" 12:00:19 didn't think so 12:00:27 so it's just the "dup" 12:00:37 whaaat? 12:00:47 divisors-sum ( n -- sum) 12:00:54 that means you pass a number, and you get back a sum 12:01:06 do you know what "dup" does? 12:01:25 divisor-sum is a predefined function? 12:02:02 no, it's half your source code 12:02:18 do I have the name wrong? am I going mad? 12:02:31 woah........ *luinfana is Confused* 12:02:46 no, it's my idiotic approach to Forth, not your explanations 12:03:07 tell me if you understand this: 12:03:17 : foo ( -- ) 1 2 + . ; 12:03:29 do all those symbols and words make sense to you? 12:03:35 if not which ones don't? 12:03:39 the function "foo" will add 1 and 2 when called 12:03:45 right? 12:03:52 right 12:04:02 do you understand the ( -- ) part too? 12:04:26 a comment, in the form of input -- output 12:04:32 cool 12:04:35 just making sure 12:04:36 ok 12:04:40 so from there... 12:05:09 in your source code you define 3 words correct (the version Quartus pasted) 12:05:23 divisor-sum, perfect?, and check 12:05:32 --- quit: ygrek (Remote closed the connection) 12:06:04 ahh, yes. good. I opened it up again, so we're on the same page now 12:06:09 ok great 12:06:28 --- join: ygrek (i=user@gateway/tor/x-d213e7a22cc2a85a) joined #forth 12:06:51 so "check" is responsible for kicking off the program with the loop range, and displaying perfect numbers. 12:06:55 so PERFECT? is passed a number, and returns true/false (true if the number passed is perfect, and false otherwise) 12:07:09 yes 12:07:12 sounds good 12:07:35 and divisor-sum... 12:07:48 PERFECT? makes a copy of the number (DUP) passes one copy to DIVISOR-SUM (which returns the sum of its divisors) 12:08:08 then PERFECT? checks of the copy of the original number matches the sum returned by DIVISOR-SUM 12:08:21 (with "=") 12:08:31 AHHHHH the EQUALS SIGN 12:08:33 follow that? 12:08:39 that was what I was missing 12:08:43 yes, perfectly clear now 12:08:51 wow 12:08:52 --- join: arke (n=arke@p57A76277.dip.t-dialin.net) joined #forth 12:08:52 --- mode: ChanServ set +o arke 12:09:47 ahh, that's what you were missing :) 12:10:06 ok cool, thanks so much...it didn't make any sense without that one piece of information 12:10:20 I was wondering... you'd gotten all the tricky parts 12:10:27 :) 12:10:30 * gnomon cheers a little bit for luinfana 12:10:43 * luinfana bows 12:10:44 you understand . too? (period) 12:11:07 I think so...pops off the top of the stack and displays it? 12:11:23 yeah. good. just checking :) 12:11:25 ok 12:12:52 I think you've got the whole thing pegged 12:13:37 yeah I think so too...and it only took me like 3 hours! Yay! 12:14:43 not bad for a new language 12:15:00 I did this in assembly last year...oddly enough I understood that much, much more 12:15:27 how did you learn it? 12:15:37 this just takes a far different approach 12:15:50 oh, an assembly class 12:16:08 * is a comp. sci. major 12:16:08 sounds like more than 3 hours :) 12:16:15 and how'd you learn forth? 12:16:21 brute. force. 12:16:23 :) 12:16:44 heh, I suspected that learning technique would account for the difference in ease of learning 12:16:53 definitely 12:17:09 forth is suprisingly simple 12:17:28 For some reason I have a hard time understanding forth memory management. 12:17:57 Deformati: what? it hardly manages memory at all 12:18:10 I also found it more difficult to find complete, well-commented Forth programs for reference (and maybe I just wasn't looking in the right places), but I started doing Forth with a really bad attitude toward the language...it's not so bad once you figure out its "quirkiness" I guess 12:18:42 hope you won't mind my calling it quirky 12:18:50 nope 12:18:55 it's different 12:19:04 Allot confuses me. 12:19:08 most of is here (if not all) find that to be a good thing 12:19:22 : allot here + >here ; 12:19:24 pretty simple 12:20:24 variable v-here : here v-here @ ; : >here v-here ! ; 12:21:24 : , here ! here 4 + >here ; 12:21:54 Deformati: If you're confused, you're probably trying to imagine something complex 12:21:58 There really isn't anything 12:22:07 Forth figures it runs in one block of memory 12:22:25 and that everything important (like itself, variables, code, etc) is in the first part 12:22:36 HERE points somewhere in the memory block, after all that stuff 12:22:48 Hm. 12:22:52 You mean there is no heap? 12:23:05 what do you mean "heap"? 12:23:10 it has many definitions 12:23:18 C's malloc 12:23:37 some do, some don't 12:23:48 that's nothing to do with ALLOT 12:23:57 Yeah, that clear some things up. 12:24:17 ALLOCATE is basically like malloc() 12:24:40 Oh. 12:24:48 Allot is just the current stack pointer? 12:24:55 no 12:25:02 no 12:25:13 ALLOT changes HERE 12:25:23 which points to the middle of the main memory block 12:25:50 HERE returns a memory pointer into the middle (somewhere) of the main memory block 12:26:07 the idea is that _below_ HERE is "used" and everything past there is up for grabs 12:26:23 the way you "grab" some, is to move HERE ahead (up) 12:26:43 you can do this with ALLOT, "," (comma), etc 12:27:50 Oh. 12:27:51 follow? 12:27:59 Somewhat. 12:28:09 ALLOT and HERE don't do anything else, besides what I just described 12:28:11 It will take a while to wrap my mind around it, but you cleared it up quite a bit. 12:28:52 Allot is like changing the stack register in asm? 12:29:04 no 12:29:10 ALLOT has _nothing_ to do with the stack 12:29:16 it moves HERE 12:29:23 HERE is not on the stack?. 12:29:27 NO 12:29:32 I thought the memory you were talking about was the stack. 12:29:38 no 12:29:43 the stack is not a memory block, it's a stack 12:29:43 Oh. 12:29:51 if you're lucky it's in hardware 12:30:01 Stack is memory. :P 12:30:10 it's not always RAM 12:30:16 True. 12:30:22 On x86 it is. 12:30:29 Well 12:30:31 Maybe not. 12:30:34 yeah, x86 is not a forth chip 12:30:36 --- quit: Baughn (Remote closed the connection) 12:30:43 or a stack processor, more to the point 12:30:44 --- join: Baughn (n=svein@084202038064.customer.alfanett.no) joined #forth 12:31:09 some forths will allow you to access the stack as memory, but many do not. it's generally not advisable, except for debugging 12:31:09 Alright. 12:31:19 Your explanation makes a lot more sense when you say memory != stack. 12:31:27 good 12:31:34 the stack is quite small for the most part 12:31:37 just holds a few numbers 12:32:01 unless you do some crazy recursive thing, the stack usually never gets more than say 12 items on it 12:32:33 By numbers, they can be pointers, right? 12:32:45 the big block of memory which is used for everything I can think of except the stacks, is quite big in comparison 12:33:02 right. forth doesn't distinguish 12:33:02 JasonWoof, and the really nice thing about Forth is that it makes understanding tail recursion and tail-call elimination quite easy. 12:33:19 it just does bits and bytes (and words) 12:33:55 If I've got a 32-bit forth (the common kind for desktops) then each stack item is 32 bits 12:34:21 forth doesn't care if you use that stack item as a memory address, integer, byte, text character, boolean, bit-field, etc 12:34:46 I was making a garbage collected statically typed forth-alike in my head. (Not for real) 12:34:52 But I cannot find a way to trace types well. 12:34:54 use it how you like. if you call @ it'll be a memory address, + and it'll be an integer, AND and it'll be a bitfield, etc 12:35:21 language isn't meant for that 12:35:34 Yeah I know. 12:35:37 you've either gotta expand the stack structure to track types, or do the "everything is an object" method 12:35:45 Deformati: have you seen factor? 12:35:51 Yes. 12:35:56 Factor is too high for me. 12:36:00 Too much dynamicness. 12:37:22 Strangely my first language was Lisp, and while most people end up loving lisp, I moved to liking C. 12:37:24 not sure there's a middle ground 12:37:38 why? 12:38:06 Not sure. 12:38:20 I guess I just find it more confertable for some reason. 12:38:29 lisp is intreguing to me, and seems to be very well designed under the hood. I've made several attempts to learn/use it, but I cannot for the life of me get over the perenthesis overdose 12:38:41 Deformati: you mean that you can read it? 12:38:51 I can read lisp. 12:39:02 can you teach me? ;) 12:39:10 the parens are actual god's gift to programming :) 12:39:12 Heh, I am a horrible reason. 12:39:19 Erm 12:39:24 s/reason/teacher 12:39:34 Sorry, my mutex is broken. 12:39:37 makes editting so much easier and more uniform 12:40:02 Fractal: I prefer spaces 12:40:10 Eh, no one thought my joke was funny. :( 12:40:26 i used to as well except editor support is much better for balanced chars 12:40:30 JasonWoof: Well, the key to lisp is to read from inside out. 12:40:32 Not left to right. 12:40:35 Or top down. 12:41:03 for example, in vi just type d% to "cut" an expression (any expression) and press p to paste it somewhere 12:41:39 yeah, I thought about what sort of display would help me see lisp structure easily 12:41:53 I really like reading left to right 12:41:54 deformati : good point - lisp is about structure, not syntax 12:42:30 It isn't that that made me dislike it. 12:43:37 I guess I just don't like a lot of things happening at runtime via the language itself, I prefer to be the one who decides what happens at runtime, not the language. 12:44:11 odd - that is one of lisp's best points imo - complete control over when stuff happens 12:44:17 Deformati: what sort of things happen at runtime that you don't want to have happen? 12:44:20 (forth is good too) 12:44:45 I also think that forth if anything gives more control than C 12:44:57 definitely more than C 12:45:13 perhaps runtime is pretty similar, but forth also gives control of compiletime 12:45:13 though implementing forth in lisp is trivial, not so the other way around 12:45:19 JasonWoof: Well, I prefer static typing which is also strange, I do not like to be able to alter the language so much. 12:45:28 that's because lisp is non-trivial 12:46:19 I dislike closures. 12:46:33 well lisp actually is strongly statically typed. the type of every object is T and that is known by the compiler/run-time at all times :) 12:46:50 hmmm... I don't know how I feel about static typing 12:46:57 on the one hand it sometimes helps me find bugs 12:47:14 on the other (with gcc) it's often quite annoying, and overly strict 12:47:34 It is more simple to me. 12:47:43 Other people think that dynamic is simpler. 12:48:12 s/more/ 12:48:26 Deformati: it depends on your angle 12:48:37 dynamic can be easier to use 12:48:47 I see static typing as just addition on the base pointer. 12:48:54 Which it is. 12:48:55 eg: for all objects in window { object.display() } 12:49:29 but it's much harder to understand, or track down the code that actually gets executed when you do that 12:50:15 so I can see it making sense that dynamic typing is harder to understand, 12:50:53 my two big kicks are these: 12:51:04 1) code should be easy to read, and should actually do what it looks like it does 12:51:23 2) references (calls, includes, etc) to code should be very easy to follow in the editor 12:54:26 I don't know how to describe why I prefer C style. 12:55:31 Deformati, if you don't mind, I'd like to hear you describe your reasons for disliking Factor in more detail. I think that you may be surprised by what it offers. 12:56:26 Uhm. 12:56:54 You needn't if you prefer not to, of course. 12:57:07 No, I am just trying to find the words. 12:57:12 I am horrible at explaining things. 12:57:48 i'll take a stab (disclaimer: never really tried it in depth). with factor you arn't close to the hardware like forth and you don't have lisp macros - wtf is the point? 12:57:57 I do not like lisp, python, or ruby either if that helps. 12:58:37 I would add erlang to that list, but erlang's concurrency makes up for a lot of the things I don't like. 12:58:57 --- join: tony_ (n=tony@c-69-253-227-21.hsd1.nj.comcast.net) joined #forth 12:58:59 Fractal, I contend that, in fact, you *are* very close to the hardware. That's the main point that makes Factor attractive. May I send you to a short article? 12:59:07 sure 12:59:41 http://www.phildawes.net/blog/2008/04/08/digging-into-factors-compiler/ 13:00:00 Ah, hell, for that matter just look at anything at http://planet.factorcode.org . The signal to noise ratio is amazing. 13:00:01 thx i will read 13:00:02 --- part: tony_ left #forth 13:00:38 but from what i've heard, factor is garbage collected, which precludes pointer arithmetic, correct? 13:01:08 slava, care to field that one? 13:01:41 I actually like garbage collection oddly enough. 13:01:56 Increadably inconsistent with the rest of my preferences. 13:06:38 Deformati: how do you feel about smalltalk? 13:07:07 I had a cool idea for garbage collection on a forth derivative. If all references were actually structures with the reference+an Id, dup could send an increment message to a gc process with the id, and anything that causes a drop would send decrement, then when the gc found that anything had a count of 0, it could free that memory. 13:07:12 JasonWoof: I haven't tried it yet. 13:08:04 Rather than searching the tree like most garbage collectors do. 13:08:50 errr... it isn't a tree, that's WHY you need GC.. it is a graph possibly containing cycles 13:08:51 Deformati, a student once came to Moon and said "I have an idea for a new garbage collector! We must keep a count of the references to each cons, and place it back on the free list when the count reaches zero!" Moon sat the student down and told him a story: "A student once came to Moon and said..." 13:09:22 Heh. 13:09:52 haha 13:09:57 that's g00d 13:10:01 Yeah, I didn't even notice that it was just reference counting.. 13:10:03 How stupid. 13:11:51 --- quit: luinfana (Read error: 110 (Connection timed out)) 13:12:19 'S' not stupid. It's a good idea. That's how a lot of the JavaScript and Perl garbage collectors work; it's just that ref-counting doesn't suffice on its own in the general case. 13:12:29 (also, the story was [badly] paraphrased from http://catb.org/esr/jargon/html/koans.html ) 13:13:42 and in fact, it was recently discovered that gc and reference counting are actually the same thing: http://sct.ethz.ch/teaching/ws2005/semspecver/papers/bacon.pdf 13:13:59 Oho? Now this I must read. 13:14:08 ya fascinating paper 13:14:16 (also, any file with 'bacon' in the name is A-OK in my books) 13:15:25 Aww. I already read that one. 13:15:35 Whoa, how did I overlook circular problems. 13:15:43 * Deformati hits head on desk. 13:17:01 I need to stop thinking something is a great idea at 2am, then at 4pm when I have brain functionality back still think it is a great idea without re-thinking about it first. 13:17:26 It *is* a great idea. It's simple, fast, easy to implement and cheap to use. 13:17:32 It's just not entirely complete. 13:17:42 Don't beat yourself up about it! 13:18:16 * JasonWoof heads off to the patent office... I must be the first to design a GC for asm ;) 13:18:40 Heh. 13:21:16 really, the great thing about forth and other stack based langs is simplicity of implementation 13:21:24 for serious programming you want Common Lisp 13:21:55 * TreyB loads the shotgun... 13:21:58 Nup. 13:21:59 ;) 13:22:27 I prefer D above everything else. 13:22:38 I treat it like garbage collected C. 13:22:48 With a few extra things. 13:23:16 Bells, whistles, an inflatable marching band and ticker-tape cannon..? 13:23:27 Heh. 13:23:31 Not really. 13:23:35 Better types. 13:26:10 Eh, other things too, it is hard to think of unless I was making the same thing in both languages. 13:26:18 I rarely use objects though. 13:27:09 You wander through life in a metaphysical haze..? 13:27:29 Heh. 13:31:55 I would like to have types in forth, but trying to find a way to make them fit, it seems that it is much better without. 13:34:48 ding! that's correct 13:35:14 Heh. :/ 13:35:16 So I just read about static typing 13:35:26 the point made was that it helps with debugging 13:35:40 Deformati: is that why you like it? 13:35:43 No. 13:35:46 forth is typed.. everything is of type "bunch of bits" 13:35:55 Fractal: Heh. 13:37:20 JasonWoof: Dynamic typing can not really be done without an interpreter or such, but that isn't the reason either, the only word I can find is that it is confertable. 13:37:42 Which doesn't make sense. 13:38:19 Deformati: static typing gives you a warm comfortable feeling that nothing fishy is going on? 13:38:51 I think the static typing errors are helpful for debugging C 13:39:01 Yeah, somewhat. 13:39:15 I just like types being a way of representing the data. 13:39:15 debugging my forth code, seems to go so much easier than C anyway though 13:39:25 Offsets on a pointer. 13:39:27 nothing wrong with static typing - as long as it is optional 13:39:56 Dynamic typing seems to not represent actual data. 13:39:59 And I do not like that. 13:40:04 mmm 13:40:07 that's coherent 13:40:37 Yay. :D 13:40:40 Deformati: I think you might have the wrong term there. Are you talking about "automatic type conversion"? 13:41:23 dynamic vs static type conversion is just a matter of when the types are checked, (runtime vs compiletime) 13:41:25 Deformati, dynamic typing is entirely possible in a compiled - even an extremely heavily optimized - language implementation. I invite you to investigate Gambit Scheme, Larceny, Ikarus and Stalin. 13:41:55 i invite you to ignore scheme and use lisp 13:42:06 xD 13:42:38 The same argument applies there, but your humour is noted ;) 13:42:43 :) 13:43:25 Well, the variable changes the type of data it represents. 13:43:45 variables don't have types. only variables have types 13:43:46 And thus the variable does not seem to represent data anymore, but rather uhm. 13:43:48 errrr 13:43:55 variables don't have types. only values have types 13:44:09 Yeah. 13:44:27 I like my variables to have types. 13:44:28 :D 13:45:00 There's value in that concept, but there is also value in more flexible variables. The nice thing is that they aren't mutually exclusive! Yay for optional type annotations! 13:45:22 exactly.. why not be able to choose? 13:46:08 Well, there are sound arguments in favour of strict, strong, static typing, too. 13:46:51 I like D typing, but for those who do not know D, pretend I said C. :D 13:47:16 The discipline can really help out when working with a large team of coders, for one; or when dealing with potentially untrusted modules; or to detect versioning conflicts in dynamically linked libraries; or to help with automated proof checkers... 13:47:29 ...also, static typing generates lots of research grants. 13:47:37 haha ya 13:47:50 I'm only half kidding. There's some value there. 13:48:09 when you're proving theorems about how awesome static typing is, it's pretty imp0rtant to have a static type system 13:48:12 It also gives us interesting things like StrongForth! 14:28:20 --- join: luinfana (n=luinfana@c-69-253-227-21.hsd1.nj.comcast.net) joined #forth 14:59:33 --- quit: nighty^ ("Disappears in a puff of smoke") 15:00:26 --- quit: ygrek (Remote closed the connection) 15:01:43 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 15:01:43 --- mode: ChanServ set +o tathi 15:05:47 --- quit: Maki ("Leaving") 15:18:01 hey, if anyone wants to see the finished product from earlier, it's here: http://pastebin.com/m3faa5942 15:29:21 --- quit: Quartus` (Read error: 104 (Connection reset by peer)) 15:29:31 --- join: tane (n=tane@p57903636.dip.t-dialin.net) joined #forth 15:40:04 --- quit: tane`weq (Read error: 110 (Connection timed out)) 15:48:55 --- quit: forther ("Leaving") 16:03:55 Is there a forth for the ti 83 calculator? 16:04:44 --- join: Malfermi1aKodo (n=kansu@xdsl-78-34-130-123.netcologne.de) joined #forth 16:04:55 Deformati: http://www.hcsw.org/ti83+/ 16:05:44 Neat! 16:06:21 crc: Is that the only, best, or first one you found? 16:07:17 i wrote that a long time ago :) 16:07:26 mostly works but it's not complete 16:07:36 Fractal: You wrote it forth? 16:07:44 well.. z80 asm and forth, yes 16:07:51 Neat. 16:08:05 Oh yes, I see in the readme! 16:08:06 :D 16:08:08 biggest problem is there's no way to store the threads to the flash mem 16:08:18 so you ave to re-enter your programs :( 16:08:27 D: 16:08:53 So I just send forth.8xp to the calculator? 16:09:04 ya.. it's not a flash app 16:09:13 honestly it has been a long time 16:09:33 and the only assembler it supports is an ancient sourceless asm linked to libc4 ;) 16:09:45 so recompiling it will be.. hm.. an adventure 16:09:59 sry gotta run.. let me knowif you get any use out of it 16:10:04 bbl 16:10:11 Alright, have fun. 16:16:23 --- quit: MalfermitaKodo (Read error: 110 (Connection timed out)) 16:19:45 crc: Do you know how to run the app? 16:19:51 * Deformati is an idiot. 16:41:43 --- join: snoopy_1611 (i=snoopy_1@dslb-088-068-203-027.pools.arcor-ip.net) joined #forth 16:49:28 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 16:49:37 --- nick: snoopy_1611 -> Snoopy42 16:52:48 Oh! 16:52:53 It was a group. 16:55:14 Was it, now? 16:55:55 It was. 16:59:12 Hm, i cannot find semicolon. 17:01:21 Found it 17:08:35 Fractal: The colon compiler causes crash and ram clear. 17:54:30 --- quit: luinfana (Read error: 111 (Connection refused)) 18:04:34 Deformati: it's the only one I found with a quick search 18:08:48 --- quit: tathi ("leaving") 18:10:49 --- join: nighty^ (n=nighty@210.188.173.246) joined #forth 18:32:38 --- join: MalfermitaKodo (n=kansu@xdsl-78-34-137-159.netcologne.de) joined #forth 18:34:18 --- join: tane`weq (n=tane@p57903D4B.dip.t-dialin.net) joined #forth 18:38:08 --- join: Quartus` (n=Quartus`@209.153.204.1) joined #forth 18:42:38 --- quit: Malfermi1aKodo (Read error: 110 (Connection timed out)) 18:46:35 Deformati : sry no warranty :) 18:48:22 the design was heavily influenced by these excellent papers: http://www.zetetics.com/bj/papers/ 18:48:43 which is to this day the best description of "how forth works" i've ever read 18:49:28 and in fact i cribbed the z80 division algorithm from camelforth 18:49:31 Fractal, how would you rank the Moving Forth articles against a careful reading of JonesForth? 18:49:43 gnomon - actually haven't had a chance to read that yet 18:49:49 heard good things tho 18:51:12 Add mine to the list. It's exemplary. 18:51:28 It's probably the best introduction to any programming language that I know of, bar none. 18:51:45 It produces a very naive Forth, but it *works*. 18:51:45 werd 18:51:59 --- quit: tane (Read error: 110 (Connection timed out)) 18:52:02 what thread model? 18:53:52 --- quit: proteusguy (Connection timed out) 18:54:02 It explains both, but it uses indirect threading. 18:54:19 nice.. i will read at some point.. 18:54:31 --- join: proteusguy (n=proteusg@61.7.144.97) joined #forth 18:57:09 gnomon: where is this introduction of which you speak? 18:57:39 aspect, http://www.annexia.org/forth 19:01:19 Fractal: Any idea why it doesn't work though? 19:01:57 ah, jonesforth. I've still got it on my to-read list, mostly due to the length's incompatibility with my current commitments. And the time lapse since I last did any assembler, let alone that wasn't at&t 19:02:22 not off the top of my head.. when does it crash? what is the exact word you are compiling? 19:03:12 : abc 1 2 ; abc 19:03:16 Crashes on abc 19:03:23 Then on reboot, ram cleared. 19:03:26 not sure where my TI is otherwise i'd try it again.. i think there is an emu avail too 19:04:01 aspect, the assembler in it is minimal, actually. Probably under two pages, and extremely well commented. 19:04:03 do other words like + and . work? 19:04:11 Fractal: Yes. 19:04:24 Just colon definitions do not. 19:04:26 aspect, the majority of both files is text; but the overwhelming majority of the implementation code is in Forth. 19:04:44 very strange.. you figure it out plz let me kno :) 19:04:57 gnomon: sounds great. I'll still have to devote some time to it, but it's higher on the list now :-) 19:05:36 Fractal: Heh, alright. 19:05:43 I will need to setup a compiler then, at some point. 19:05:58 The new southpark is awesome. 19:05:59 aspect, I started reading through it on my lunch hour a week or two ago. When I realized that I had spent way too long on it, I printed it out and read it on my commute home. Missed my stop twice: once on the way past, once again on the way back. I could literally could not put it down. 19:05:59 xD 19:06:05 "The internet is broken!"\ 19:06:10 I was on the edge of my seat! It was a non-stop roller-coaster thrill ride! 19:06:19 I laughed! I cried! IT WAS BETTER THAN CATS! 19:06:26 Ahem. 19:06:29 * gnomon gets a grip 19:06:51 sounds like printing it is the way to go 19:07:01 Yeah. Use a pen, too. 19:07:04 Or a highlighter. 19:07:11 this is the assembler: http://caesar.logiqx.com/php/tool.php?id=tasm 19:07:22 schlorp. 19:07:51 err actually maybe not.. the z80 version of tasm 19:07:58 Eh, I really hate the forth file management. 19:08:13 can't seem to find the official site 19:09:13 Fractal: I cannot mess with it till monday anyways. 19:09:17 I am going on a trip. 19:10:15 And you haven't got a small electronic device on which you can code while in transit? 19:10:19 I am shocked, sir; shocked! 19:10:51 I have such a device, but I prefer not to bring it. 19:11:08 I brought it last time I went, and it was a hassle. 19:11:37 Especially since there are 5 people in a pickup truck. 19:11:38 :D 19:11:44 Ah. 19:11:57 And a ratty hotel which I don't trust, thus I have to lugg it with me EVERYWHERE> 19:12:06 Which means back in the truck again. 19:12:25 So it is better if I don't. :) 19:12:26 if you really wanna improve a forth, this one has teh potential to be 3l337: http://www.hcsw.org/downloads/lightning-forth.c 19:12:58 Well, I want ti forth. :) 19:13:04 I can fool with it at school. 19:13:11 Without getting bitched at.. 19:13:38 uses this pacakge: http://www.gnu.org/software/lightning/ 19:14:13 I read about lightning once. 19:14:41 I think an llvm forth would be neat. 19:22:36 Forth seems like it would be really easy to compile, like C. 19:22:45 Why is it always interpreted? 19:22:57 Um. 19:23:02 It almost never is. 19:23:17 Well, run in a shell or whatever. 19:23:27 Why not just binaries like C? 19:24:55 I don't understand what you mean. 19:27:02 Generating elf binaries. 19:28:34 I mean, if it is easily done, call me an idiot or something. 19:28:38 I just never saw the option. 19:28:38 Are you familiar with the term "tree shaker"? 19:28:55 No. 19:29:17 Are you familiar with how garbage collection works? 19:29:22 Yes. 19:29:28 Mostly. 19:30:03 A tree shaker is a garbage collector that starts at your main() function and removes all of the procedures from your source tree that you can't possibly reach, essentially. 19:30:25 Ah, yes. 19:30:27 I didn't know the term. 19:30:56 A tree shaker makes a lot of sense to use if you have, for example, a Forth system which includes a large set of standard library functions, and some matrix ops, and string words, and parser generators, and a ton of stuff that your particular tool will never call into. 19:31:31 Because Forth generally works by creating a word list, and because most Forths just build up the word list in non-special chunks of memory, it's much easier to just dump and reload the memory image. 19:31:57 Building a relocatable image is a bit more difficult because you have to make sure that your words use offsets instead of literal addresses. 19:32:41 Can't you make words into C functions? 19:32:54 Building a shakeable tree is even more difficult because you have to make sure that every one of your words is free of direct calls to even relative offsets, since words may get moved around (and in fact must, if your shaker is worth a damn). 19:33:02 Hang on. 19:33:32 Writing a general purpose tree shaker is a difficult thing to do, because Forth affords many freedoms and imposes very few strict limits. 19:33:56 Once one accepts that writing a tree shaker is difficult, the next question is "why not just dump an image and call that your executable?" 19:34:02 Which, of course, is easy to do. 19:34:17 Uhm. 19:34:21 The incremental cost of adding a bunch of extra functionality to that image, then, is very low. 19:34:44 There is very, very little reason to duplicate an entire image modulo the couple of kilobytes that turn the Forth system into the utility that you want. 19:35:43 (other image-based programming language implementations like Scheme, Lisp, Smalltalk et al enforce stronger boundaries about memory access and thus make both garbage collection and tree shaking much easier to perform without interfering with code tricks the programmer may have used). 19:36:43 You could write a Forth which would shake out your word list and generate C functions, but that would end up reading (and performing) even more like an interpreter than your native Forth system. 19:37:14 I mean, sure, if you had a naive string- or token-threaded Forth, compiling down to C might improve things; but so would switching to a better execution model. 19:37:51 ...does that make sense to you? 19:37:58 Am I explaining things poorly? 19:38:09 A little of both. 19:39:06 I mean, I see the benefit to using the forth environment, but generating binaries seems really easy, I mean real binaries, not images, and a binary has it's own benefits as well, yet I don't see any compilers that make binaries. 19:39:58 Are you familiar with BusyBox? 19:40:09 Yes. 19:40:32 That's an example of an image-base suite of applications written in C. 19:40:37 Ditto Rob Landley's toybox. 19:40:54 Also the suite of applications provided by the vim binary. 19:41:35 One can apply the same argument to dynamically loadable C libraries, for that matter. 19:41:47 Yeah. 19:42:23 What benefits are you thinking of that standalone binaries provide and image files don't? 19:43:04 Uh, independence mostly, and maybe speed, but I am not sure about that one. 19:44:45 What I mean is, forth is not far from asm, why not translate it in addition to the ability to run it in a forth environment. 19:45:01 Is there some aspect that prevents translation into asm? 19:45:29 It is not that I need binaries, I am just wondering why it doesn't exist. 19:45:36 Well it might. 19:45:41 But I have not seen it. 19:46:06 It *does*, but almost every serious Forth implementation compiles straight down to machine code. It's easier to do that in most cases than to write an interpreter! 19:46:42 But it doesn't make the executable. 19:46:54 In a good implementation, Forth words are a mix of sequences of machine code and calls to other Forth words. 19:47:03 How does that not make them executable? 19:47:26 I'm not trying to be contradictory, but I really don't understand the point that you're trying to make. 19:47:58 Uhm. 19:48:17 Let's see how I can explain this.. 19:48:30 A C app does not need gcc around. 19:48:52 Once it is compiled. 19:48:53 It just makes an elf executable. 19:48:54 yes, but a C program can't compile C programs, a forth progrm can 19:49:17 A Forth program also does not need a compiler. 19:49:40 You can put the compiler in a separate vocabulary, if you see fit, and then leave that out of the image that you dump to disk. 19:50:20 It would be silly to do, since including the compiler opens up a world of potential performance - you can dynamically create words that specialize *at runtime* upon input provided by the user, among other neat tricks - but you could do it. 19:51:04 But what if it doesn't need to be extended at runtime? 19:51:18 thn you aren't programming right :) 19:51:28 I mean, the dictionary is basically a set of global variables. 19:51:31 Also, including a copy of GCC, or even a shared GCC library, in all C programs would be ridiculous because of the immense size of the compiler collection. Your typical Forth compiler will likely end up being smaller than the app that you write with it, sometimes dramatically so. 19:51:44 Deformati, that's just not the case. 19:52:07 That's why vocabularies exist: to make sure that you *don't* have to treat all of your words as global variables. 19:53:01 * Deformati puts hands in face. 19:53:21 Alright, you make your app, and it is initiated by a word, alright? 19:53:43 (A hypothetical situation) 19:53:46 Deformati: VFX Forth supports the creation of ELF binaries on Linux ( www.mpeforth.com ). I imagine that the Windows version can create .EXE or .COM files. 19:54:02 Deformati, righto. Carry on. 19:54:39 gnomon: Alright, pretend I wanted to make that word a stand alone app. 19:55:02 So pretended. 19:55:19 Please go on. 19:55:37 The compiler could go through and take that word's definition, and make the asm for it, then do the same for each of the words it uses. 19:55:44 And make the elf. 19:56:19 When you say "make the asm", that tells me that you think the word definitions are not already in assembly code. 19:56:20 malyn: Do you know if it compiles the way C does, or does it just make an image and wrap it with an environment? 19:56:24 Quartus Forth does this on the Palm OS, for example. 19:56:57 Deformati: I believe it compiles to assembly language, but you would have to ask them directly. 19:56:58 gnomon: From sources. 19:57:20 Sources are not machine code until they go through the compiler. 19:58:31 Deformati, the : Forth word invokes a compiler. 19:58:35 A *real compiler*. 19:58:40 It produces machine code. 19:58:47 I know. :) 19:59:19 Let me hypothesize here for a second. 19:59:38 You're familiar with the SEE word, right? 19:59:53 No. 20:00:07 It's a built-in decompiler. 20:00:20 Alright. 20:00:33 It will look up the machine code of a word and turn it back into source code by resolving all of the word references. 20:00:55 Alright. 20:00:58 Particularly smart implementations of SEE will also handle pure machine code, decompiling it back into human-readable assembly code. 20:01:57 My hypothesis is this: if you had a Forth word which started at the bottom of each wordlist and spat out assembly source code, and you captured this source dump in a text file, you could then compile that assembly code to produce a binary. 20:02:08 Would that be what you want? 20:02:54 What I want is far simpler. 20:03:00 Let me restate my question in better wording. 20:05:12 Human readable asm sources are directly translated into a.out. C is the exact same, with a little optimization thrown in. FORTH can be the same, but yet it isn't. It is generally kept in the forth environment. Why is the option generally not available. (From what I can tell, correct me if I am wrong about the very last assumption) 20:06:04 I hope that cleared up what I am trying to ask. 20:06:10 it's quite commonly available, with native-code compiler especially 20:06:21 Alright. :) 20:06:28 Thankyou Quartus`. 20:06:40 forth compiles very quickly, so it's often used that way 20:06:43 in forth, optimization is usually not available because either it's hard to do (most forths are made by just one person) 20:07:08 Quartus`: Yes I figured. 20:07:30 JasonWoof, that's arguably a philosophical point. Factor has an extensive optimizer; so does MPE Forth. For that matter, GForth does as well. 20:07:35 or because a simple compiler is desired (either for easy of hacking the compiler, ease of understanding the forth, or very fast compilation) 20:08:19 that being said, it's my understanding that the more complete/advanced/polished/professional forths do optomize 20:08:20 Quartus`: I just noticed that all instances I have seen it used, it was with the environment, I was wondering if that was just out of necessity or some limitation that prevented making real independent binaries. 20:08:42 s/that all/that in all 20:08:50 quartus forth makes independent binaries. 20:09:09 Cool. :D 20:09:53 well.. forth is compiled in the same way that java is compiled.. there is usually a virual machine or "inner interpreter".. tho if you use subroutine threading, the inner interpreter kinda disappears 20:10:09 a non-native threading model would need the engine; any code that uses or extends the dictionary at runtime would need the dictionary. 20:10:10 I had Quartusforth on my palm, but very shortly after I put it on there, I got my nokia 770, and I just stopped using the palm, it hardly held a charge. 20:12:08 Wow, my sentences are really thrown together today. 20:12:24 I apologize for the lack of coherence. 20:12:34 s/today/ 20:12:46 Quartus`: You said the other day that Ficl is somewhat non-standard; what sort of things were you referring to? I am using Ficl in an app, but am not enough of an expert to know which things deviate from the ANS standard. 20:13:06 there's no technical limitation to producing stand-alone binaries. It just isn't usually worth the effort. For the Palm, it was. 20:13:53 malyn, I don't remember all the differences, but one that comes to mind is that doubles are stored high low on the stack, instead of low high. 20:14:30 There's also the very odd way that it handles words - there's an editable cascade of "recognizers", I think was the term that it used. 20:14:52 Well, thankyou for all the explanations. It is about time I go to sleep. 20:15:00 Good night, Deformati. 20:15:29 malyn, check out http://ficl.sourceforge.net/parsesteps.html 20:15:30 gnomon: I think that Ficl calls them "parse steps" or something like that. 20:15:39 Good memory, sir. 20:16:07 The double thing is odd; I wonder why Ficl inverts the stack positions? Thankfully I am not using double words in my app... :) 20:16:56 Don't know. 20:17:05 Ficl does clearly (and knowingly) violate the standard when it comes to PAD, which it uses for sprintf()'ing strings together. I need to patch that at some point. 20:17:58 Create pad 80 allot 20:20:04 Well there is that solution. But I would prefer to have Ficl just stop using the PAD pointer internally. That way C extension words can share the internal PAD pointer with Forth words for example. But that kind of thing is low on my list at the moment. 20:25:25 --- join: snoopy_1611 (i=snoopy_1@dslb-088-068-220-209.pools.arcor-ip.net) joined #forth 20:32:32 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 20:32:41 --- nick: snoopy_1611 -> Snoopy42 20:33:17 did I miss any more fun with perfect numbers? 20:34:17 I don't think so. 21:02:22 Quartus`: I went over how it worked for a long time, until this rather amusing breakthrough: http://retroforth.com/paste/?id=524 21:05:34 ok, bed 21:05:39 --- quit: JasonWoof ("Leaving.") 21:06:53 hi Quartus` 22:05:07 --- join: ramkrsna (n=ramkrsna@unaffiliated/ramkrsna) joined #forth 22:28:35 --- join: tane (n=tane@p57903CDD.dip.t-dialin.net) joined #forth 22:42:42 --- quit: tane`weq (Read error: 110 (Connection timed out)) 22:58:53 --- join: Raystm2 (n=Ray@unaffiliated/raystm2) joined #forth 23:01:15 --- part: Raystm2 left #forth 23:05:43 --- quit: ramkrsna ("Leaving") 23:40:09 --- join: ecraven (n=nex@140.78.42.119) joined #forth 23:59:59 --- log: ended forth/08.04.16