00:00:00 --- log: started forth/05.08.25 00:11:10 --- join: snoopy_16 (i=snoopy_1@dsl-084-058-150-155.arcor-ip.net) joined #forth 00:12:46 forth cannot be easilly described in bnf 00:13:08 tho... im sure someone could produce a fairly good bnf description of forth if they tried heh 00:13:25 but it wouldnt be as pretty as the bnf description for say.. the irc protocol or even C 00:13:27 ick 00:13:31 in both cases 00:27:19 --- quit: Snoopy42 (Read error: 110 (Connection timed out)) 00:27:25 --- nick: snoopy_16 -> Snoopy42 00:44:57 --- join: YoyoFreeBSD_ (n=yoyofree@222.90.3.178) joined #forth 01:12:07 --- quit: Quartus (Remote closed the connection) 01:33:24 --- join: amca (n=plump@as-bri-4-1-151.ozonline.com.au) joined #forth 01:33:24 --- quit: YoyoFreeBSD_ (Read error: 104 (Connection reset by peer)) 02:36:23 --- quit: amca ("d34d") 02:55:12 --- join: onetom_ (n=tom@ns.dunasoft.com) joined #forth 02:55:13 --- quit: onetom (Read error: 104 (Connection reset by peer)) 03:03:59 --- join: YoyoFreeBSD_ (n=yoyofree@219.144.168.209) joined #forth 04:52:12 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 05:32:49 --- join: PoppaVic (n=pete@0-2pool198-19.nas30.chicago4.il.us.da.qwest.net) joined #forth 05:33:04 G'day 05:33:21 Hi 05:33:30 Howdy ;-) 05:33:48 --- nick: Raystm2 -> nanstm 07:07:26 --- join: snoopy_16 (i=snoopy_1@dsl-084-058-174-004.arcor-ip.net) joined #forth 07:15:44 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 07:15:54 --- nick: snoopy_16 -> Snoopy42 07:18:00 --- join: sproingie (i=foobar@64-121-15-14.c3-0.sfrn-ubr8.sfrn.ca.cable.rcn.com) joined #forth 07:18:07 lo, sproingie 07:18:32 mornin 07:20:49 well, except for some pretty code - which I have trouble visualizing - to ascertain typedefs, structs, vars and funcs - I guess I am as golden as possible. 07:23:03 --- join: Quartus (n=trailer@ansuz.pair.com) joined #forth 07:56:52 --- join: X-Scale (i=email@213-205-64-102.net.novis.pt) joined #forth 08:27:18 --- quit: tathi ("leaving") 08:33:11 --- quit: PoppaVic ("brb - lemme recycle ISP") 08:35:49 --- join: PoppaVic (n=pete@0-1pool46-141.nas30.chicago4.il.us.da.qwest.net) joined #forth 09:18:13 --- join: virl (n=hmpf@chello062178085149.1.12.vie.surfer.at) joined #forth 10:05:04 --- join: tkb (n=tkb@63.163.164.6) joined #forth 10:11:41 --- join: JasonWoof (n=jason@pdpc/supporter/student/Herkamire) joined #forth 10:11:41 --- mode: ChanServ set +o JasonWoof 10:12:39 lo, jas 10:16:26 hi 10:16:41 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 10:20:27 Jason, thanks for your comments on BNF last night. I realize the impossibility of a complete BNF for the language. It should be possible to BNF a Forth with no dictionary entries, though. 10:20:56 i have a forth syntax highlighting mode for jedit, its not close to a full BNF though. 10:21:04 it just highlights the common stuff, and retroforth words 10:22:35 np 10:31:10 you mean a parser/scanner? 10:38:30 It seems like BNF is not going to work with a RPN-like language, because we can look-ahead or not. 10:42:34 Right, I know that. I'm thinking of a Forth with no dicitionary entries, and not for building a parser, but just as an overview. I imagine it would primarily cover the numeric input formats allowed. 10:42:54 hmm 10:43:07 not really 10:43:37 A Standard Forth with no dictionary would allow two or three different numeric input formats, depending on whether floating-point is available. 10:43:41 input is easy: chars & whitespace 10:43:58 And it'd be able to report 'undefined word' for any invalid number of other whitespace-delimited sequence. 10:43:59 ..mark begin/end 10:44:32 Quartus: I don't believe you have generisized enough 10:44:39 What do you mean? 10:45:12 well, it sounds like confusing vm with numbers with immediate/pp, etc 10:45:20 I still don't follow. 10:45:39 sorry, maybe I'm already over-the-hill for the day. Damn. 10:46:34 I'm looking to BNF-describe the allowable inputs at the console, in a very high-level sort of way. I can certainly draw this up myself, but I didn't want to bother if it'd been done already. The floating-point format is already BNF'd in the Standard document. 10:47:05 Quartus: trust me, there is no bnf 10:47:05 --- part: tkb left #forth 10:47:08 Anyway, got to run presently. Back later. 10:48:17 --- quit: madwork ("*frotz*") 10:48:49 --- join: madwork (n=madgarde@derby.metrics.com) joined #forth 11:14:28 --- quit: PoppaVic ("Pulls the pin...") 13:26:29 --- quit: X-Scale () 14:50:49 --- join: amca (n=plump@as-bri-4-1-175.ozonline.com.au) joined #forth 16:04:40 --- quit: amca ("d34d") 16:41:11 --- nick: nanstm -> Raystm2 17:32:21 --- quit: tathi ("leaving") 18:09:04 --- join: amca (n=plump@as-bri-4-1-214.ozonline.com.au) joined #forth 18:15:33 hi amca 18:15:40 welcome to the club ;) 18:15:57 Thank you :) 18:16:04 What do you like about Forth? 18:16:50 simplicity 18:16:56 flexibility 18:17:24 * amca nods 18:17:45 the coding-style/language/philosophy gets me to rethink and rewrite code in a way that: 18:17:50 1) teaches me a ton 18:17:54 2) produces really nice code 18:18:53 I just found some forth code that I wrote 3 years ago 18:18:58 and I don't write like that any more :) 18:19:14 I like how you can change everything 18:19:24 write your own interpreter if you like 18:19:28 (and I do like :)) 18:19:38 hehe 18:19:55 So what other langs are you familiar with? 18:20:32 C C++ PPC-asm perl python obective-C... 18:20:39 PHP 18:21:28 um.. that's what comes to mind 18:21:33 Have you seen that article on bbspot about PHP? 18:21:39 no 18:22:15 my theory is that different languages have different emphases. forth's emphasis is factoring. 18:22:26 bash, basic 18:22:32 yeah 18:22:33 docl: I would agree with you there 18:22:36 I love factoring 18:22:48 JasonWoof: Ill see if I can find it. It is funny (IMO) 18:22:58 cool :) 18:23:24 factoring is quite an art 18:23:50 factor well, and everything just falls into place, and big changes turn out to be a breeze 18:24:30 Maybe I have the wrong idea, but I find factoring just to be about very simple abstraction. 18:24:37 I think scheme teaches a kind of abstract understanding 18:25:12 python is a lot about modularity 18:25:56 abstraction... 18:26:12 hmmm... doesn't seem like the same concept to me 18:26:30 What is it about languages like C, python etc that make it harder than Forth to factor with? Im not trying to troll, I genuinly dont know. 18:26:54 don't worry about trolling :) as long as you're interested :) 18:27:04 mostly how you don't name arguments 18:27:22 : foo 1 2 3 4 ; 18:27:38 can be written: : bar 3 4 ; : foo 1 2 bar ; 18:28:27 as a comparison, with pythonb you could have all arguments be like *args so that in effect they are just positional parameters like forth. Same with bash. 18:28:40 silly example probably, but... hmm.. you can't do that in C at all 18:29:10 amca, there's absolutely minimal overhead for factoring in Forth, both from a coding and a run-time perspective. 18:29:23 not unless you want to drive yourself crazy with varargs, no :) 18:29:42 even if you compare it to a language like perl where you don't declare arguments, it's still easier, because in forth they are just there. wheras perl you have to pull them out of that $_ array 18:29:54 Quartus: Would part of that have to do with having seperate data and return stacks? 18:30:16 maybe this example will make more sense: 18:30:27 It has to do with the design of the language itself. 18:30:30 : dist dup * over * * sqrt ; 18:30:34 JasonWoof: That it is implicit in Forth gives it a large factoring advantage - is that what you are saying? 18:30:47 (distance formula, give the height and width and it gives you the diagonal distance) 18:30:52 might be factored like so: 18:31:15 : squared dup * ; : dist squared swap squared + sqrt ; 18:31:40 oops... in factoring nicely, I noticed that there's a bug in the original... (one of the reasons I love refactoring) that last * should be + 18:31:48 hehe 18:32:30 basically, yeah 18:32:42 the language flexibility helps a bit too 18:33:02 in forth you can make a word (function) that reads chars in from the source just past it 18:33:03 So which flavour of Forth do you use? How did you get into coding Forth? 18:33:26 eg, if you often want to create variables that have a default value of 1, you can... 18:33:59 : 1var variable 1 last execute ! ; \ or some such 18:34:12 1var foo 1var bar 18:34:24 I work with Standard Forths. I've always had a passing interest in it, since the early 80s, but didn't invest seriously in it until it was standardized. 18:34:39 I mostly use my own :) 18:34:44 http://herkamire.com/jason/herkforth 18:35:13 I'm kind of fond of mine, too -- http://quartus.net/products/forth 18:35:13 :) 18:35:20 I'm about to port it to a virtual machine so it can easily run on more systems 18:35:42 quartus forth is cool too 18:35:59 Thanks. 18:36:01 I've used gforth a bit 18:36:10 started with gforth 18:36:17 * amca has a look at the personal forths 18:36:18 I found out about forth talking to a friend 18:36:28 got totally excited, read about it and tried stuff 18:36:33 wrote lots of rediculous code 18:36:40 wasn't long before I wrote my own 18:37:03 Would it be rude for me to ask how old you ppl are? 18:37:19 Old. Long beards & gray hair all 'round. :) 18:37:32 heh 18:37:34 riiight 18:37:36 I'm 25 18:37:37 * docl is 22 18:38:03 we seem to mostly get people from 18-28 and 40-50 I think 18:38:24 a bit of a gap in the 30's range, eh? 18:38:29 I'm in the gap. 18:38:32 yeah 18:38:35 maybe there's no gap 18:38:49 cool, quartus stands in the gap :) 18:39:02 a bridger of worlds :) 18:39:09 Im 30 18:39:12 * crc is 22 18:39:21 (somebody kick me for using "bridge" as a verb) 18:39:22 Well, my name is Bridges. :) 18:39:28 hehe 18:39:49 lol 18:40:49 well, time for a shower. a bit sticky from my bike ride, and I managed to scrape my shin on my pedal getting the bike in the door, so I want to make sure that's clean just in case 18:40:52 bbiab 18:41:01 Enjoy! 18:42:20 Quartus: Just thought Id let you know on the http://quartus.net/products/forth/ page I got "[an error occurred while processing this directive] [an error occurred while processing this directive]" right after the two side-by-side
's. I use Firefox in Fedora Core 3 Linux. 18:43:15 That's odd. I'll check. Thanks. 18:44:19 Quartus: What lang's had you used before seriously getting into Forth? 18:44:26 I checked. I sincerely have no idea why you're getting that. 18:45:07 Is there something that is usually below the
's? 18:45:21 amca, I'd coded in lots of things. Plenty of C, both K&R and Standard; assembler, Z80, 6502, 68K; BASIC of various forms; REXX; APL. 18:45:32 Below them is "Quartus Forth 2.0.0". Above them is two drop-down menus. 18:46:28 18:46:28 [an error occurred while processing this directive] 18:46:28 [an error occurred while processing this directive] 18:46:28
18:46:28

Quartus Forth 2.0.0

18:46:56 Possibly I'm over-terminating a row or column. 18:47:04 that is the code in the html page. The table closure at the top is the table that has the dropdowns 18:47:34 What server scripting are you using? 18:48:04 I see the problem. Han gon. 18:48:09 Hang on, even. :) 18:48:23 lol. I thought you were talking Chinese for a sec. 18:48:52 Any change? 18:49:08 Ill check 18:49:34 Nope. Same thing. 18:49:55 Might still be cached. 18:50:11 * amca nods 18:50:47 What did you work in z80 on? Like what systems? 18:51:44 Hang on, reading HTML; I'll have to load an ancient brain backup to answer that one. 18:51:53 no probs 18:54:14 Anyone else want to let me know how they got into Forth and what langs they knew before it? 18:54:59 ahhhhhh 18:55:50 My first z80 system was a Sinclair ZX81. 18:56:18 Ah 18:58:07 What other Z80 systems have you had? 18:58:51 I think I mostly just know BASIC, C and C++ at the time 18:59:02 * crc discovered forth while looking for a language to port to his first hobby OS 18:59:03 Jupiter ACE was the other one that comes to mind. 18:59:28 I was into scheme when I found forth 18:59:45 I had used BASIC, C, C++, Pascal, Oberon, Lisp, and a few other languages before finding forth 19:00:00 docl: Do you find much of a conceptual difference going from recursive prefix to iterative postfix? 19:00:21 hmm I could answer that better if I had actually used scheme more 19:00:37 Not sure I'd exclude Forth from being recursive. 19:00:47 amca: what languages are you coming from? 19:00:51 I guess it's not as big of a difference as from infix 19:01:14 Quartus: True, but it is not as part of the coding style as in LISP langs 19:01:38 amca: depends who you ask. 19:01:41 I daresay that depends on the developer. 19:01:51 amca: probably true generally, because some forthers don't use recursion unless they have to 19:02:13 I use recursion at least as often as my other kind of loop (counted) 19:02:52 BASIC (suprise, suprise), Pascal, Smalltalk, Java and C are the languages I have some familiarity with 19:02:59 I tried to learn basic, c, and python, but lost interest before learning to code proficiently. perl I can do enough to get by on 19:03:15 tail-recursion isn't all that "scientific" or "theoretical" or "special" 19:03:17 it's just a goto 19:03:32 well I did learn one basic-based language (RealBasic on the mac) enough to get by on 19:03:48 now doing coroutines with mutual recursion can be deep magic ... tho not in forth 19:04:00 I had been using AWK quite a bit as well. Still do. 19:04:12 Oh! Currently I use Python as the lang I try to implement my ideas in. Including trying to code an implementation of False. 19:04:20 Perl as required -- most of my website is in Perl, though there's Forth in there too. 19:04:27 sproingie: yeah, tail-recursion isn't to technically demanding, just a coding style 19:04:35 * amca has avoided Perl because of perceived inelegance 19:04:49 it's elegant in its own way 19:04:54 depends on what you want to do with it 19:05:04 it just ain't pretty. there's a reason its mascot is a camel 19:05:11 perl is nice for regexps, strings, loops, arrays 19:05:13 hehe 19:05:21 perl is definitely not eligant 19:05:24 well prettyness is an important part of elegance to me ;) 19:05:28 much as I like it :) 19:05:37 Perl is pragmatic, I would agree 19:06:00 I certainly prefer perl over PHP 19:06:08 python seems more object-conscious 19:06:20 certainly 19:06:22 but not to the point of java 19:06:33 I'd probably be using python right now if I was more into OOP 19:06:35 perl can even get you some fairly advanced constructs ... it has real closures for one 19:06:40 I tend to be more of a "scholar" of coding langs than an actual coder - Iveread more about it, and thought (design etc) than have done it. Although Im trying to change that these days to be more balanced 19:06:45 java is a bit too much that way I figure 19:07:04 What I dont like about Java is it is too isolated from the hardware 19:07:08 i had this utility function that i passed raw data to, and it spit out html, basic rendering function 19:07:19 later, that function needed a counter 19:07:39 in perl, i could have just used a closure. python made it extremely cumbersome 19:07:39 yeah amca I'm the same way. trying to get down to brass tacks more 19:07:47 I'm much more into just coding and making everything up 19:08:05 JasonWoof: A hacker :) 19:08:12 in most cases I'd rather write my own than learn an API 19:08:24 most API's suck 19:08:28 the only exception seems to be SDL 19:08:40 the best API is the one you understand intiutively. what better than one you wrote yourself 19:09:25 * sproingie does have some code in python that uses some of its elegance 19:09:28 when you write it yourself it's perfectly suited to your project :) 19:09:42 i have itertools composing generator expressions, with a single loop over all of them 19:09:44 I really like the indenting thing in python 19:09:58 it's no haskell, but it's more elegant than perl would have made it 19:10:46 yeah the indentation thing in python is cool 19:10:52 it's a shame icon never went anywhere. generators are the bees knees 19:12:23 Are ppl in here familiar with any other posrfix lang's? If so, how do they compare with Forth? 19:12:40 well forth is sort of the reference of postfix langs 19:12:49 Just having postfix notation wouldn't make a language comparable anyway. 19:12:57 postscript is interesting. it's even more postscript than forth 19:13:05 er postfix that is 19:14:00 I actually started getting into Forth through False via Postscript. 19:14:23 so you know postscript 19:14:33 there's factor of course 19:14:35 Im familiar (to some extent) to it 19:14:46 factor is more like a postfix lisp 19:15:37 has a real pretty FFI. it's even getting its own CLIM workalike 19:15:44 Like I read up a bit about postscript, from it and False finally "got" postfix/stack-based langs and so looked for a mainstream language that was stack-based and postfix and remembered that Forth existed. 19:17:06 Keep asking questions, this is distracting me from the pain of today's dental surgery. :) 19:17:30 don't remind me. i gotta get my wisdom teeth out sometime 19:17:49 That's what I had done today, one of. 19:18:00 I actually got to "get" stack/postfix languages from designing my Simple Virtual Machine. I initially designed it to be a RISC based VM but was alway uncomfortable about the arbitary decision on the number of registers in it. Stack based machines allow effectively for a dynamic amount registers - the number of registers is however many numbers are needed on the stack 19:18:03 ouch 19:18:06 i gotta get all four out. i guess i may as well get 'em all over with at once 19:18:25 i'll probably just be addicted to painkillers afterward 19:19:07 there's really only one "register" in a stack machine, and that's TOS 19:19:21 sproingie: Morphine is niiiiice. Ive recently had major bowel surgery 19:19:30 some implementations map the first few items to registers. cf and rf just map TOS to EAX 19:20:10 mapping TOS to EAX makes forth a sort of super-duper macro assembler 19:20:12 Quartus Forth maps TOS to a regster too. 19:20:55 i've wondered often whether it'd be possible to have a pure register-based postfix language 19:21:13 i think i found some pretty big reasons why it's impossible 19:21:34 sproingie: You can think of the stack in a register machine as a variable number of registers. If you want 3 registers to manipulate numbers, you push 3 numbers on the data stack. If you want your machine to have 4 registers to play with four niumbers at a time, just push another number on the stack. 19:21:51 --- join: ayrnieu (n=julian@ip68-13-110-105.om.om.cox.net) joined #forth 19:21:59 yeah but that's not really using them as registers 19:22:07 I440r - ping. 19:22:07 register machines are all about register transfer 19:22:23 transfer and allocation anyway 19:22:55 Conceptually (not practically) a register is a memory location where you have the numbers you are working with in the short term in couldnt you say? 19:23:14 that's a fairly simple view of a register, yes 19:23:29 it's not a complete enough definition for a register machine 19:24:32 I wasnt just thinking spoecifically of "register" VMs, but the structure of VMs in general. 19:24:46 stack and register are the main two 19:25:22 And then you have a large allocation of "registers" called memory 19:25:31 no 19:25:57 from the POV of a register machine, you don't think of registers as just "fast short term scratch areas" 19:26:05 they're a fundamental dataflow thing 19:26:39 you're using memory for them anyway, true, but treating all of memory as registers isn't ideal 19:27:20 sproingie: Would you like to expand on the dataflow statement? (I wanna understand more about how computers work in detail and in general) 19:27:24 ideally your vm registers map to real registers. or at least a single cache line that never gets flushed 19:27:43 Ah 19:27:53 But that is worrying about implementation details 19:28:19 true, but practical vm's are always constrained by their host hardware 19:28:26 I was trying to design a VM design that ignored implementation efficiencies etc. Somthing that was very generic 19:28:51 It isnt meant to be fast. Or practical. 19:28:53 you could try a SECD machine 19:29:00 It is only 8 bit after all. 19:29:08 * amca googles SECD 19:29:26 amca: grab a book called "structure and interpretation of computer programs" 19:29:50 amca: i believe they have a SECD machine in there somewhere 19:30:07 An 8 bit machine that is capable of addressing memory up to 255 * 8 bits... 19:30:16 Thanks for that 19:30:27 you could also try the Warren Abstract Machine 19:30:31 which is used for implementing Prolog 19:30:40 most prologs are based on WAMs 19:31:58 Cool. I didnt come across those while searching for VM implementations online. It is hard finding any with all the JVM references :) 19:32:26 Mozart/Oz has a pretty unusual VM too 19:32:34 Koopman's "Stack Machines" is worth a read. 19:32:41 in fact it's a pretty unusual language well worth learning 19:33:03 --- part: ayrnieu left #forth 19:33:10 Quartus: That is what Ive been reading to get a ideas for my SVM :) 19:33:33 amca: the JVM is sadly a pretty primitive VM with a few innovative features bolted on 19:34:01 the bytecode verification stuff is nifty, even if it's mathematically unsound in the general case 19:34:04 sproingie: What is primitive about it? The lack of stack manipulation instructions? 19:34:10 amca: the design 19:34:25 How could it be improved? What aspect of it? 19:34:52 well it has been improved some. the hotspot JIT comes from self, and it's got some pretty nice design 19:35:22 though self's version was specializing, whereas java's totally statically typed 19:36:01 but it's based on a design no more advanced than UCSD pascal. it was never even designed to be sophisticated 19:36:23 it was designed to control set top boxes 19:37:05 ah 19:37:19 sun has a long history of separating the wheat from the chaff 19:37:27 and keeping the chaff 19:37:57 lol 19:38:15 NeWS and X, self and java 19:39:41 Quartus: Do you remember much from "Stack Machines"? I dont understand how the Generic Stack Machine design can be claimed to be minimal when it has "over" as an instruction (which could be simulated with swap and dup)? 19:40:37 sproingie: How did you come across all these different VMs? 19:40:48 i dont think it claimed to be minimal in the purely mathematical sense 19:41:03 amca: i'm sort of a language gadfly myself 19:41:21 I wouldn't think the inclusion of 'over' would kick it too far up from 'minimal'. 19:41:30 right now i'm bouncing to lisp, since it may actually have practical uses for me 19:41:32 So it was more "a practical minimal" machine. 19:41:49 SWAP DUP is a clumsy way to perform OVER. 19:41:54 Maybe Im too literal. I interpret "minimal" to mean that you cant subtract anything from it. 19:42:12 hm 19:42:18 Well it is clumsy and inefficient, but it *is* minimal ;) 19:42:23 well you could probably get away with just two or three operations then 19:42:40 but who wants a stack-based brainfuck? 19:42:54 * amca nods 19:44:07 True. 19:45:37 I didnt understand how "if 0" could simulate "if >" etc until I realised that using subtraction and masking the sign bit in the integer could be used instead. 19:46:47 So have you (all) tried to implement Forth on different platforms yourself just for the challenge of it? 19:47:11 I'd love to have that kind of free time. 19:47:20 i sorta hang around and chat about forth and help create small retroforth hacks 19:47:29 mostly annoy crc with questions :) 19:47:42 hehe 19:48:06 In truth I'm oriented toward practicality. Building useful things. Not so much the playing-with for the sake of it. 19:48:10 quartus has his well-known eponymous forth for the palm pilot 19:48:19 * amca nods 19:48:37 I was wondering if perhaps that was done at first just to do it. 19:48:51 back when i had a palm i got a copy of quartus forth for it 19:48:52 I take it you did it so you could have Forth everywhere you went? 19:48:56 but never got around to using it 19:49:05 amca, yes. 19:49:17 Well, not quite. So I could write code wherever I was. 19:49:49 Well there are other language compilers/interpreters for the Palm :P 19:50:05 yeah but none with the low-level coolness of forth 19:50:16 not many that have their dev environment ON the palm itself 19:50:27 True. Im just being difficult. 19:50:40 There are. The only other one that's a real native-code compiler is On-Board C. K&R C, far too verbose for the Palm IMO. And it didn't exist in 1997. 19:51:02 mostly i sort of wax philosophical about garbage collection for forth, but never get around to actually implementing it 19:51:12 hehe 19:51:29 Too busy thinking and talking about the gc to implement it? :) 19:51:30 garbage collection and continuations that is 19:51:48 my secret plan is to get others so excited about the idea that they implement it themselves :) 19:51:59 Good idea ;) 19:52:04 i've already taught a couple people about continuations, so my plan is slowly working 19:52:12 Do continuations have anything to do with co-routines? 19:52:24 they're often used to implement coroutines 19:52:46 they're like a GOTO on steroids. you can do literally ANYTHING control-flow related with continuations 19:53:29 coroutines, generators, exceptions, restarts, backtracking, you name it 19:53:42 Can you give a quick example of a "GOTO on steroids" example of continuations? 19:54:37 hm ... not in 3 lines or less ... 19:54:50 afk, bbias 19:55:15 k 19:55:27 * amca loooves wikipedia 19:55:48 you could look up continuations there 19:56:32 for all my talk i can't manage to come up with *simple* non-contrived uses of continuations 19:56:50 most code that uses 'em is wrapped up in lots of layers of abstractions 19:57:04 I was going to after I got a sample of the subject from you :) 19:57:09 Co-routines are pretty nifty, though. 19:57:17 what about coming up with a contrived eg? 19:58:40 (define (yield) 19:58:42 sproingie, web stuff 19:58:42 (call/cc 19:58:44 (lambda (this-thread) 19:58:45 (if (not (empty-stack? thread-set)) 19:58:47 (let ((next-thread (pop! thread-set))) 19:58:48 (push! (lambda () (this-thread 0)) thread-set) 19:58:49 (next-thread)))))) 19:58:52 wtf 19:59:00 don't flood 19:59:01 sorry, was more lines than i realized 19:59:13 anyway, a lot of things can be expressed naturally with call/cc 19:59:16 it looked small on the other screen 20:00:08 amca: continuation-based web frameworks are getting to be the rage these days, they're even creeping into java 20:00:30 java doesn't have call/cc 20:00:40 anyway, its not just about web stuff 20:00:45 no, but there's frameworks that fake it heroically 20:00:49 a modal dialog in a gui is expressed naturally with call/cc 20:00:59 amca: they use continuations to save the current place you're at in a multi-page process 20:01:03 factor uses continuations for exceptions and threads, it makes it very simple 20:01:14 the prettyprinter uses a continuation as a non-local exit 20:01:18 amca: then restarting from where you left off is a matter of calling the continuation like a function. in fact that's what call/cc is entirely about 20:01:28 its one construct that can express so many other things 20:01:30 amca: saving where you were, then picking up at a later point 20:02:10 cool 20:02:40 it can express pretty much everything ... except perhaps logic variables, but that's more a matter of syntax restrictions than anything else 20:03:07 sproingie, call/cc is a primitive, not something used directly much of the time 20:03:37 \ callcc0 usage . 20:03:38 [ 20:03:38 store-callback-cc stream-flush yield sleep wait-to-accept 20:03:38 wait-to-read do-pprint in-thread 20:03:38 ] 20:03:56 there is a handful of key words, like yield, sleep, and i/o stuff, that wraps it for you 20:03:59 gotta love factor at the high level 20:04:25 at low-level, stack juggling confuses me 20:04:30 common lisp has a ton of stuff that could be built from continuations, but most implementations don't because CL has unwind-protect 20:04:45 uncommon web uses continuations 20:04:48 its a hack 20:04:56 they have a custom defun, flet, labels macros 20:05:00 that do a CPS transform of your code 20:05:08 yeah, but it works ok for its limited purpose 20:05:11 yup 20:05:43 about stack juggling, the goal is to abstract away dataflow 20:06:01 In case I didnt paste it before - the PHP article I referred to before. http://bbspot.com/News/2000/6/php_suspend.html 20:06:38 yep, seen that one 20:07:18 sproingie, in the end, stack juggling is more low level than enforcing named bindings, but it makes code more fine-grained and easier to manipulate reflectively 20:07:33 PHP use is associated with kids who pick up something to program and PHP is there and produces immediate results 20:07:41 it's sort of the modern day BASIC 20:07:45 i'd rather kids learned smalltalk. 20:08:22 i'd rather they learned perl. if mod_perl wasn't such a pain to maintain, php would have been stillborn 20:08:35 perl should be banned 20:08:44 What about them learning Python? 20:08:47 eventually. PHP should be first in line 20:09:01 PHP: first against the wall when the revolution comes 20:09:26 the "unix scripting languages", python, perl, php, and tcl all have this peculiar style, unique among themselves, that makes them suck 20:09:32 amca: python's ok. mod_python is certainly easier to work with too, and the object publisher works right out of the box 20:09:48 i guess its just the way they all tend to be so broken that they have to rely on C code for performance/stability/functionality 20:09:59 php encourages terrible practices like mixing code and data, which is not something i normally care about, since that's a sign of power 20:10:07 but with PHP it's virtually the ONLY way to program 20:10:09 slava: Which element of their style? 20:10:16 amca, i said above 20:11:06 You said the reason for the style but you didnt detail what the style was 20:11:22 I do php, and don't mik them 20:11:26 I make an html template 20:11:30 slava: it's the "scripting language" mentality. tcl isn't even a contender these days 20:11:32 they're all limited and crude, and tied to inelegant implementations 20:11:36 Is it the "hackish rather than rigorous" style of them? 20:11:41 and they're slow 20:11:46 and the php reads it in and inserts content where the template says to 20:11:47 each perl object is like a struct with 3 fields and a refcount 20:11:55 s/mik/mix/ 20:12:34 slava: you seen how may fields python objects have? 20:12:49 perl uses dobule precision values for all internal math 20:12:51 even on integers 20:12:56 O_O 20:12:59 Holy... 20:13:00 python's internals are ... readable. that's about the nicest thing i can say about it 20:15:03 As a "scripting" language, Id say Forth is the least broken out of the above mentioned ones - it seems consistant throughout the language where as the other have quirks. The only disadvantage is the unusual syntax, but that is more a cultural issue. That's how I see it anyway 20:15:17 amca: you want to study a postfix language, you should definitely give factor a look 20:15:20 some php library functions fake higher-order functions by letting you pass in string parameters naming the function 20:15:35 amca: it's forth meets lisp, and it runs circles around most everything 20:15:37 this is just a great way to ensure all code is written in one, giant global namespace 20:15:48 doesn't run circles around CL definately :) 20:16:05 except the GUI of course 20:16:14 nah, there's McCLIM 20:16:32 factor's GUI doesn't win many speed races :) 20:16:55 try the one in cvs 20:17:25 will do 20:18:04 anyway, i'd rather get the compiler generating decent code before doing too much gui stuff 20:18:08 sproingie: What I like about Forth is that it turns LISP on its head. I dont feel comfortable with lisp. Waaay to abstract for me. It seems to me like you have to have too much of a hlistic view with lisp programs. I need to analyse things in small parts. 20:18:36 * amca checks out factor none the less 20:21:08 amca: you like small parts, you'll like factor 20:21:38 i do agree a bit with the lisp sentiment, tho it's not really that abstract when you know what it's doing und 20:21:42 under the hood 20:22:57 no more abstract than C++ anyway 20:23:09 You say that like it's a good thing. :) 20:23:12 Well you cant directly manipulate pointers in LISP can you? 20:23:29 you can in sbcl, using internal functions, but *you never need to* 20:23:38 the compiler does, and the rest of the implementation does, but they deal with it for you 20:24:04 What are the list items called in lisp? 20:25:06 cons cells 20:25:53 And would it be fair to say they are the equivelant to Words in Forth? 20:26:11 no 20:26:13 not at all 20:26:14 No. 20:26:21 you can have cons cells in forth... 20:26:23 factor does... 20:26:26 ok, watching movie with the gf. i leave you in capable hands ... 20:26:31 * sproingie waves 20:26:33 * sproingie & 20:26:52 hehe 20:27:17 fg sproingie 20:27:24 hmmm...didnt work... ;) 20:28:53 The way I conceptually view lisp versus Forth is that in lisp it looks like "(+ dog 2)" where in Forth it looks like "2 dog +" 20:29:14 in both cases, a function/word named '+' is being executed 20:29:20 Where is my mental model broken? 20:29:59 first, '2 dog +' in forth could be (+ dog 2) or (+ (dog) 2) or (+ (dog 2)) in lisp, depending on if dog was a variable, or a function with however many arguments 20:30:45 And in Forth it could also be "dog 2 +" 20:32:20 go on 20:33:10 lisp has something forth doesn't: named bindings 20:33:29 eg, dup f g -vs- (let (x ...) (f x) (g x)) 20:33:37 you name end-points of dataflow, instead of the dataflow itself 20:34:16 * amca nods 20:34:54 As in lisp you name the end points and in Forth you name the dataflow itself? 20:35:30 yes 20:35:34 * amca nods 20:35:53 fundamentally neither approach is closer to the hardware, you can do a low level C-like langaueg with lisp syntax if you want (see prescheme) 20:36:03 Thats why I like Forth over Lisp 20:36:50 * amca looks up prescheme 20:36:59 prescheme is what scheme48 is written in 20:40:22 does the '48' in scheme48 refer to 1948? 20:40:27 no, it cant 20:40:30 nm 20:41:14 I dont think they programmed ENIAC in scheme :) 20:43:31 scheme48 is named because they wrote it in 48 hours 20:43:47 the first version. it's got almost as much work in it these days as PLT scheme 20:43:54 lol. That was quick 20:44:05 naw, movie's paused, she's feeding the cats :) 20:44:22 no I meant the 48 hours was quick 20:44:30 the dataflow explanation of forth's interesting 20:44:37 You are slow: I fg sproingied you ages ago :P 20:44:39 i always thought of the dataflow in forth as being more implicit 20:44:46 * sproingie is swapping 20:44:53 lol 20:45:00 sproingie, i have code that produces a symbolic graph of dataflow for words and quotations 20:45:10 sproingie, i'm hooking this up to the ui real soon now 20:45:22 well-factored forth is rather similar to point-free haskell code 20:45:56 nice -n -20 sproingie 20:46:09 asshole 20:46:12 :P 20:46:14 well you wanted me to not be nice 20:46:18 :) 20:46:21 lol 20:47:36 slava: considering how sensitive forth is when you do something that affects arity, what would be really useful would be to show every function affected by over- or under-pop in the current def 20:48:13 slava: which i guess is every caller and following call 20:48:21 i have stack effect inference, and it will be integrated into the UI 20:48:33 i dunno, some sort of "YOU ARE HERE" diagram in the call graph as i cursor around 20:48:37 ok, gotta bg again 20:48:40 * sproingie & 20:48:55 [1] sproingie - Suspended (tty output) 20:48:59 bg %1 20:49:14 hehe 20:49:42 Well I need to rest my eyes from the computer, so I shall depart and see ye ppl later 20:49:43 sproingie, that would be thwarted by words that return variable numbers of results 20:49:52 ttfn 20:49:55 --- part: amca left #forth 20:49:57 cya amca 22:11:06 --- quit: virl (Remote closed the connection) 22:24:51 --- join: Serg[GPRS] (n=Miranda@193.201.231.126) joined #forth 22:25:50 hi! does one here have experience w/ SPF4 ( http://spf.sf.net ) ? 22:26:41 i mostly need a network and strings processing examples, like getting data by text-based internet protocols 22:31:55 --- quit: sproingie (Remote closed the connection) 22:59:04 --- quit: docl (brown.freenode.net irc.freenode.net) 22:59:04 --- quit: Jim7J1AJH (brown.freenode.net irc.freenode.net) 22:59:04 --- quit: YoyoFreeBSD_ (brown.freenode.net irc.freenode.net) 22:59:06 --- quit: Quartus (brown.freenode.net irc.freenode.net) 22:59:06 --- quit: cmeme (brown.freenode.net irc.freenode.net) 22:59:06 --- quit: Raystm2 (brown.freenode.net irc.freenode.net) 22:59:07 --- quit: warpzero (brown.freenode.net irc.freenode.net) 22:59:07 --- quit: ccfg (brown.freenode.net irc.freenode.net) 22:59:07 --- quit: Snoopy42 (brown.freenode.net irc.freenode.net) 22:59:07 --- quit: onetom_ (brown.freenode.net irc.freenode.net) 22:59:07 --- quit: slava (brown.freenode.net irc.freenode.net) 22:59:09 --- quit: madgarden (brown.freenode.net irc.freenode.net) 22:59:09 --- quit: skylan (brown.freenode.net irc.freenode.net) 22:59:09 --- quit: virsys (brown.freenode.net irc.freenode.net) 22:59:19 --- log: started forth/05.08.25 22:59:19 --- join: clog (i=nef@bespin.org) joined #forth 22:59:19 --- topic: 'Forth: One language, many dialects. #forth - general forth discussion. #c4th - ColorForth. #retro - RetroForth. #c4th-ot - social channel. #1xforth - a secret channel for 1xforthers. #concatenative - the category of language that forth belongs to (sorta).' 22:59:19 --- topic: set by crc on [Sat Jul 23 13:29:38 2005] 22:59:19 --- names: list (clog @JasonWoof Snoopy42 onetom_ madgarden @crc skylan virsys slava saon|fbsd OrngeTide ianp) 22:59:31 --- quit: virsys (calvino.freenode.net irc.freenode.net) 22:59:35 --- quit: Snoopy42 (calvino.freenode.net irc.freenode.net) 22:59:35 --- quit: onetom_ (calvino.freenode.net irc.freenode.net) 22:59:36 --- quit: slava (calvino.freenode.net irc.freenode.net) 22:59:42 --- join: Snoopy42 (i=snoopy_1@dsl-084-058-174-004.arcor-ip.net) joined #forth 22:59:44 --- join: onetom (n=tom@ns.dunasoft.com) joined #forth 22:59:45 --- quit: JasonWoof (calvino.freenode.net irc.freenode.net) 22:59:45 --- quit: crc (calvino.freenode.net irc.freenode.net) 22:59:46 --- quit: saon|fbsd (calvino.freenode.net irc.freenode.net) 22:59:46 --- quit: OrngeTide (calvino.freenode.net irc.freenode.net) 22:59:46 --- quit: ianp (calvino.freenode.net irc.freenode.net) 22:59:47 --- join: virsys (n=virsys@or-65-40-182-104.dyn.sprint-hsd.net) joined #forth 22:59:52 --- join: crc (i=crc@pool-70-16-157-19.phil.east.verizon.net) joined #forth 22:59:53 --- quit: Snoopy42 (calvino.freenode.net irc.freenode.net) 22:59:58 --- join: ccfg (i=ccfg@dsl-roigw3de0.dial.inet.fi) joined #forth 23:00:00 --- quit: ccfg (calvino.freenode.net irc.freenode.net) 23:00:00 --- join: Snoopy42 (i=snoopy_1@dsl-084-058-174-004.arcor-ip.net) joined #forth 23:00:04 --- quit: Snoopy42 (calvino.freenode.net irc.freenode.net) 23:00:04 --- quit: virsys (calvino.freenode.net irc.freenode.net) 23:00:04 --- quit: crc (calvino.freenode.net irc.freenode.net) 23:00:04 --- quit: onetom (calvino.freenode.net irc.freenode.net) 23:00:33 --- join: onetom (n=tom@ns.dunasoft.com) joined #forth 23:00:33 --- join: crc (i=crc@pool-70-16-157-19.phil.east.verizon.net) joined #forth 23:00:33 --- join: Quartus (n=trailer@ansuz.pair.com) joined #forth 23:00:33 --- join: I440r (n=mark4@rrcs-24-242-160-169.sw.biz.rr.com) joined #forth 23:00:33 --- join: YoyoFreeBSD_ (n=yoyofree@219.144.168.209) joined #forth 23:00:33 --- join: Jim7J1AJH (n=jim@221x115x224x2.ap221.ftth.ucom.ne.jp) joined #forth 23:00:33 --- join: ianp (n=ian@inpuj.com) joined #forth 23:00:33 --- join: saon|fbsd (n=saon@c-66-177-224-235.hsd1.fl.comcast.net) joined #forth 23:00:40 --- join: virsys (n=virsys@or-65-40-182-104.dyn.sprint-hsd.net) joined #forth 23:00:41 --- join: Snoopy42 (i=snoopy_1@dsl-084-058-174-004.arcor-ip.net) joined #forth 23:00:46 --- join: slava (n=slava@CPE0080ad77a020-CM000e5cdfda14.cpe.net.cable.rogers.com) joined #forth 23:00:49 --- quit: YoyoFreeBSD_ (calvino.freenode.net irc.freenode.net) 23:00:49 --- quit: ianp (calvino.freenode.net irc.freenode.net) 23:01:00 --- join: Raystm2_ (n=vircuser@68.95.254.73) joined #forth 23:03:37 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 23:03:40 --- join: docl (n=docl@67-138-198-36.bras01.mcl.id.frontiernet.net) joined #forth 23:04:16 --- join: saon (i=1000@c-66-177-224-235.hsd1.fl.comcast.net) joined #forth 23:04:50 --- quit: cmeme (Client Quit) 23:04:52 --- join: OrngeTide (i=orange@rm-f.net) joined #forth 23:05:00 --- join: ccfg (i=ccfg@dsl-roigw3de0.dial.inet.fi) joined #forth 23:05:28 --- join: warpzero (n=warpzero@wza.us) joined #forth 23:05:33 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 23:06:47 --- quit: cmeme (Client Quit) 23:07:29 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 23:07:54 --- join: JasonWoof (n=jason@pdpc/supporter/student/Herkamire) joined #forth 23:07:54 --- mode: ChanServ set +o JasonWoof 23:08:43 --- quit: cmeme (Client Quit) 23:09:25 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 23:09:50 --- join: ianp (n=ian@inpuj.com) joined #forth 23:10:39 --- quit: cmeme (Client Quit) 23:11:22 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 23:18:55 --- join: YoyoFreeBSD_ (n=yoyofree@219.144.168.209) joined #forth 23:59:59 --- log: ended forth/05.08.25