00:00:00 --- log: started forth/13.11.05 00:03:52 yes i got your point, but oop is just an example, what i really need, you know, is the dynamic word deferencing 00:04:33 If you another "dynamic word dereferencing" there's "defer". 00:04:39 If you mean... 00:04:43 yes 00:05:26 --- quit: mnemnion (Remote host closed the connection) 00:05:59 --- join: mnemnion (~mnemnion@c-98-210-219-91.hsd1.ca.comcast.net) joined #forth 00:10:43 --- quit: mnemnion (Ping timeout: 260 seconds) 00:10:49 --- quit: tangentstorm (Quit: 'enough nonsense for one night.') 00:13:02 --- quit: nighty-_ (Quit: leaving) 00:14:11 --- join: nighty- (~nighty@static-68-179-124-161.ptr.terago.net) joined #forth 00:24:27 --- join: nighty-_ (~nighty@lns-bzn-49f-62-147-170-46.adsl.proxad.net) joined #forth 00:24:32 --- quit: nighty-_ (Remote host closed the connection) 00:26:02 --- quit: nighty- (Quit: leaving) 00:26:11 --- join: nighty- (~nighty@static-68-179-124-161.ptr.terago.net) joined #forth 00:31:15 --- quit: nighty- (Quit: leaving) 00:31:32 --- join: nighty- (~nighty@static-68-179-124-161.ptr.terago.net) joined #forth 00:46:17 --- quit: LinearInterpol (Read error: Operation timed out) 02:34:22 --- quit: nisstyre (Ping timeout: 245 seconds) 02:40:33 --- quit: kludge` (Ping timeout: 272 seconds) 02:43:51 --- join: kludge` (~comet@unaffiliated/espiral) joined #forth 03:06:57 --- quit: true-grue (Ping timeout: 246 seconds) 03:17:48 --- join: true-grue (~quassel@37-144-8-197.broadband.corbina.ru) joined #forth 03:46:42 --- join: LinearInterpol (~RJones@cpe-76-179-150-229.maine.res.rr.com) joined #forth 03:57:58 --- join: john_metcalf (~digital_w@87.114.126.86) joined #forth 04:09:06 --- quit: Eth|cal (Ping timeout: 245 seconds) 04:12:18 --- join: Eth|cal (~sam@139.216.253.31) joined #forth 04:19:32 --- quit: LinearInterpol (Ping timeout: 245 seconds) 04:59:43 --- join: LinearInterpol (~RJones@169.244.180.190) joined #forth 05:48:00 --- quit: Bahman (Quit: Leaving.) 06:00:52 --- join: ttmrichter_ (~ttmrichte@192.241.205.8) joined #forth 06:05:23 --- quit: ErhardtMundt (Ping timeout: 248 seconds) 06:07:13 --- join: ErhardtMundt (~Lawrence@95.234.75.18) joined #forth 06:07:58 --- quit: ttmrichter_ (Quit: ZNC - http://znc.in) 06:08:13 --- quit: kulp (Ping timeout: 246 seconds) 06:08:33 --- join: ttmrichter_ (~ttmrichte@192.241.205.8) joined #forth 06:11:43 --- join: kulp (kulp@unaffiliated/kulp) joined #forth 06:13:40 --- quit: ttmrichter (Quit: ttmrichter) 06:13:54 --- nick: ttmrichter_ -> ttmrichter 06:48:48 --- quit: bjorkintosh (Ping timeout: 251 seconds) 07:34:05 --- quit: LinearInterpol (Ping timeout: 245 seconds) 07:58:03 --- join: LinearInterpol (~RJones@WatchGuard.ellsworth-hs.ellsworth.k12.me.us) joined #forth 08:06:42 --- join: mnemnion (~mnemnion@c-98-210-219-91.hsd1.ca.comcast.net) joined #forth 08:39:15 --- quit: true-grue (Ping timeout: 246 seconds) 08:57:18 --- join: true-grue (~quassel@37-144-8-197.broadband.corbina.ru) joined #forth 09:00:17 --- quit: true-grue (Read error: Connection reset by peer) 09:01:20 --- join: true-grue (~quassel@37-144-8-197.broadband.corbina.ru) joined #forth 09:06:59 --- join: kumul (~mool@adsl-64-237-226-108.prtc.net) joined #forth 09:33:34 --- join: bjorkintosh (~bjork@ip68-13-229-200.ok.ok.cox.net) joined #forth 09:36:39 --- quit: LinearInterpol (Ping timeout: 245 seconds) 09:40:29 good morning. what's the word for the largest value a cell can store? 09:57:16 -1 u. :) 09:57:24 not portable :-) 09:59:08 : max-unsigned S" MAX-U" ENVIRONMENT? 0= ABORT" dunno!" ; 09:59:22 MAX-N for maximum signed 09:59:54 ugly :) 10:00:29 i'd go with -1 as unsigned though, just declare a dependency on two's complement arithmetic 10:03:50 (and all bits in a cell used for the number, etc. the usual) 10:04:15 On practice the CELLS word is enough... 10:04:53 that gives you the size of a cell, in address units. not enough in practice i'm afraid 10:05:30 I mean for most of real tasks. 10:05:48 it depends on your platform 10:06:17 Portability and Forth are mutually exclusive, by the way :) 10:06:22 i have this target that has 16-bit addressable memory only :-) 10:06:40 And so, you really need to calculate largest value?? 10:06:43 oh, you can make things portable enough 10:06:47 huh? 10:06:57 largest value of cell? 10:07:11 no, it means just using CELLS won't tell you how big the biggest integer is 10:07:25 1 CELLS gives you 1 10:09:35 your -1 thing will do fine though; everyone sane uses two's complement integers these days 10:10:16 Well, even on x64 there are different sizes for int and pointer. 10:10:32 not in Forth :-) 10:11:07 Why? I can easily write my Forth with separate pointer stack. 10:11:18 not in standard Forth :-) 10:11:31 Oh, the Standard!... 10:11:35 heh 10:12:13 let's assume both integers and addresses fit in a single cell 10:12:37 you did want sanity, right? 10:16:15 that was a really helpful discussion! 10:16:26 or is 10:16:28 I understand you, there are architectures where using of CELLS is not enough. But knowing "largest value" is even more pointless, that was my point (sorry for a pun :) 10:17:04 I keep forgetting I'm programming a magic abacus 10:17:16 not a language in the sense I have come to understand 10:17:40 so yes, a cell can be full of 1 or full of 0 but the question was not particularly well-formed 10:17:51 What can be more usual that stack? 10:17:53 than 10:18:37 If you say so, grue. in my experience, priority one for most language designers is 'hide the stack' 10:18:59 this might have something to do with them schmancy "registers" that get used on typical architectures 10:19:55 I'm here mostly because Forth doesn't pretend to be things it isn't. which I like. 10:21:13 any good resources on changing the behavior of the reader? 10:22:02 Yes, stack architecture is most natural one. Registers... they are just another example of premature optimisation :) 10:38:05 --- join: LinearInterpol (~RJones@WatchGuard.ellsworth-hs.ellsworth.k12.me.us) joined #forth 10:44:01 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #forth 10:45:58 --- join: alexshendi (~alexshend@HSI-KBW-078-043-199-120.hsi4.kabel-badenwuerttemberg.de) joined #forth 11:00:14 --- quit: LinearInterpol (Ping timeout: 260 seconds) 11:17:53 --- quit: jevin (Ping timeout: 246 seconds) 11:20:46 --- join: jevin (~jevin@72.12.217.220) joined #forth 11:42:05 --- join: w0rm_x (~w0rm@client-86-31-185-43.oxfd.adsl.virginm.net) joined #forth 12:06:39 --- join: cem_ (75c0bdbd@gateway/web/freenode/ip.117.192.189.189) joined #forth 12:25:24 --- part: cem_ left #forth 12:37:45 --- quit: true-grue (Read error: Connection reset by peer) 12:42:12 mnemnion: hide the *function call* stack; and most languages do not succeed 12:42:31 most conflate it with the data stack even 12:42:36 segher: quite 12:43:13 "behaviour of the reader"... what do you mean? 12:45:33 the parser mnemnion means, it's lisp vocabulary 12:47:05 parser thank you 12:47:10 I'm new here 12:48:01 at the moment I'm fine with the way it works 12:48:17 the parser in Forth is very simple 12:48:20 for optimization, I want to do some odd things 12:48:58 Is there any forth that runs on Linux that (somehow) resembles colorforth? 12:49:14 it skips whitespace and then finds a name that is non-whitespace characters 12:49:33 --- part: w0rm_x left #forth 12:49:43 segher: my question is, I believe, what are the parser words, and thus, how do I redefine them 12:49:51 it looks up that name in the dictionary 12:50:05 some tutorial, somewhere, would be lovely. 12:50:13 if found, if in interpreter mode, it executes the word 12:50:37 segher: I am interested in changing the behavior of the reader 12:50:38 if in compilation mode, it compiles the word; unless the word is immediate, in which case it executes it 12:51:01 though your description is admirably clear, I do understand the existing behavior, at least, your explanation is consonant 12:51:04 now, any word can do its own parsing! 12:51:17 ^^^ the punch line 12:51:23 ah hah! 12:51:32 thanks for bearing with me :) 12:51:38 no problem :-) 12:52:05 so I can push a word, that executes, and then I have a new parser 12:52:11 and I could maybe even stash the old parser and restore it? 12:52:26 you don't need to 12:53:03 when your word finishes executing, the parser will simply pick up where you left the input stream 12:53:24 I don't quite understand that 12:53:31 oh, okay 12:53:43 so if my parser isn't an infinite loop, we get it back once it clears the return stack. 12:53:55 : .( [char] ) parse 2drop ; 12:54:04 erm. 12:54:13 s" it" s" the old one" swap 12:54:30 : .( [char] ) parse type ; \ let's use the correct semantics shall we 12:55:09 what should that do? 12:55:11 I don't know the word .( 12:55:19 though [char] will evaluate at compile time. 12:55:22 do you know ." ? 12:55:27 yes 12:55:42 it pushes a string reference, then the length, then types them 12:55:42 .( is like it, except it works in interpretation mode 12:56:05 it simply outputs the string until the next ) 12:56:38 cr .( Hello, World!) 12:57:55 .( [char] ) parse type ; 12:57:57 (it is usual in Forth do print your newlines *before* each line) 12:58:03 produces an alignment error from the interpreter 12:58:13 it was a definition 12:58:18 : .( 12:58:20 oh so it is 12:58:36 [char] is compiletime-only 12:59:19 [char] ) compiles to something that does the same thing as char ) 12:59:25 so this redfines .( 12:59:29 yeah 12:59:46 I'm still *slightly* lost... 12:59:53 parse is a word that will take the string and do something to it? 13:00:15 parse takes a single number as input: a character 13:00:27 it returns a string 13:00:49 okay. so where your definition say "type", I should have some kind of evaluator. 13:01:17 type outputs a string. yeah, i guess so 13:01:56 .( wants type , ( wants 2drop , you want something else 13:03:22 that was enough for one gulp, thanks segher! I know where to start now. 13:03:56 do you have the Forth Programmers Handbook? get it (google for the pdf) 13:09:55 --- join: kumool (~mool@adsl-173-228-252-249.prtc.net) joined #forth 13:10:02 I would like to explore colorforth or something similar. Is there any forth that runs on Linux that (somehow) resembles colorforth? 13:12:28 I have what looks like the first edition now 13:12:32 it should do for a start 13:12:42 printed in 2000 13:13:40 --- quit: kumul (Ping timeout: 264 seconds) 13:17:17 alexshendi: I would think it's possible to run colorForth itself as a VM 13:17:21 though I've not tried it 13:17:27 I can't imagine it's system hungry ^_^ 13:17:42 there also is a version that runs directly on linux 13:17:53 segher: nice to know 13:17:56 just search a bit, you'll find it 13:23:31 segher: for future reference, suggest that us n00bs download swiftforth 13:23:35 which contains a legal copy of the handbook 13:23:52 not that I *mind* evaluating pirate editions... but someone might 13:25:10 thanks for the tip in any case, just returning the favor 13:25:40 --- join: Azel (~Thunderbi@83.82.69.86.rev.sfr.net) joined #forth 13:26:23 segher: I found http://mosquito.dyndns.tv/freesvn/trunk/forth/glcolorforth/ 13:26:27 hey, if you look for the book you will find swiftforth :-) 13:27:04 true! though I found myself cruising some seedy Russian joints on the way in. Forth: notoriously hard to Google for. 13:27:14 heh true 13:27:14 Go would be much, much worse. But of course, they're cheating. 13:27:46 they had to :-) 13:28:09 I will need an x86 machine though. 13:30:26 don't look at me, i don't have any 13:30:41 well... i have some 486 13:32:21 .oO( Should be sufficient ) 13:33:02 Just joking :) 13:38:44 : .oO( base @ [char] ) parse base ! drop 6 9 * . base ! ; .oO( Just kidding.) 13:45:42 --- join: kumul (~mool@adsl-173-228-252-249.prtc.net) joined #forth 13:47:03 --- quit: Azel (Ping timeout: 246 seconds) 13:47:23 --- quit: kumool (Ping timeout: 260 seconds) 13:48:26 --- quit: kumul (Read error: Connection reset by peer) 13:49:26 --- join: kumul (~mool@adsl-173-228-252-249.prtc.net) joined #forth 13:51:11 --- join: Azel (~Thunderbi@83.82.69.86.rev.sfr.net) joined #forth 13:54:07 --- quit: kumul (Ping timeout: 264 seconds) 14:04:33 --- join: kumool (~mool@adsl-64-237-227-72.prtc.net) joined #forth 14:37:59 --- join: noneofmynickswor (~mool@173.228.252.249) joined #forth 14:41:44 --- quit: kumool (Ping timeout: 272 seconds) 15:05:25 --- quit: nighty^ (Quit: Disappears in a puff of smoke) 15:34:26 --- join: LinearInterpol (~RJones@cpe-76-179-150-229.maine.res.rr.com) joined #forth 16:03:12 --- join: nisstyre (~yours@oftn/member/Nisstyre) joined #forth 16:06:00 --- quit: noneofmynickswor (Ping timeout: 272 seconds) 16:33:12 mnemnion: thanks for the tip on swiftforth for the pdf :) 16:33:47 bluekelp: ^_^ 16:34:08 i think i had bochs running colorforth but +1 the tip to find the linux version 16:34:26 i tried it on bare hardware c2001 but couldn't get it to boot on my hardware 16:34:36 --- join: kumul (~mool@adsl-64-237-226-243.prtc.net) joined #forth 16:39:58 most people do not really want the special keyboard or the colours 16:46:00 I want the colors! Though I'm content with the colons and semicolons too 16:46:20 I've been plinking away at a Forth syntax highligher, but, too busy writing Forth mostly 16:52:51 other than highlighting certain known words/patterns the highlighter must be pretty easy: \w+: 16:52:54 ;) 16:54:22 mnemnion: you also have to type in the colours 16:54:45 This applies strange colours to words like "#s" and "block#". 16:55:05 \S+ :-) 16:55:11 yeah there are ways of rigging say Emacs so the : and ; won't display 16:55:18 but, nah 16:55:46 I do like the basic idea of red definitions, green expansions, white code and yellow numbers 16:55:48 kinda 16:56:27 Is "joke" a code or a number? 16:58:00 decimal 36 base ! 16:58:33 maybe you should include the Forth system in the editor :-P 17:01:39 Part of the problem is that humans and computers are fine with L-attributed grammars, 17:02:44 but Forth implements something different. 17:06:37 Hm. 17:07:28 The key is that humans are not quite well with grammars that are heavily context-sensitive. 17:09:44 glad someone else did that for me 17:17:08 --- quit: alexshendi (Quit: Leaving) 18:22:05 --- join: ASau` (~user@p54AFFE1B.dip0.t-ipconnect.de) joined #forth 18:24:31 --- quit: ASau (Ping timeout: 240 seconds) 18:29:18 actually i am interesting of how they implment those grammar parser by manual not flex 18:41:15 ok, stumped again. How do I use a word I haven't defined yet? 18:41:56 I gather this is normally bad practice, can't be helped here 18:48:18 postpone doesn't seem to be quite it 19:02:21 sorted 19:10:30 if you havnt defined it, how can you use it? 19:24:54 jyf: Recursive definitions. 19:28:29 mnemnion: http://rosettacode.org/wiki/Mutual_recursion#Forth 19:29:01 oh defer, how perfectly handy 19:29:13 --- join: w0rm_x (~w0rm@client-86-31-185-43.oxfd.adsl.virginm.net) joined #forth 19:29:15 Yep. 19:29:31 I was using 0 value #foo, then #foo execute, then ' foo to #foo 19:29:37 If you're doing single recursion then the recur word is enough. 19:29:40 which, y'know, works, but that's probably what defer does 19:29:45 no no, trampoline 19:29:50 But for mutual recursion or other such scenarios defer is needed. 19:30:02 you can totally hack it with the atomic operators 19:30:07 Of course. 19:30:16 recur and defer are probably written in atomic operations. :) 19:30:22 I'm still kinda giddy about that 19:30:34 and about that fact that 20 minutes of poking around found two ways to do it 19:30:38 one with variable and one with value 19:30:43 the value one being less verbose. 19:31:03 You might want to measure performance (space and time) though. 19:32:13 ttmrichter: then it need dynamic dispatching 19:32:33 I almost like my way more just because deferring the name means the definition is :noname 19:32:35 No, it really doesn't. 19:32:52 though this way I don't create a dummy word, which is nice. I'll keep it. 19:32:55 It can be statically dispatched once the parser has completed everything. 19:33:19 ttmrichter: that's what I was thinking, that even a Really Dumb compiler could statically handle a word like 'defer' 19:33:26 Yep. 19:33:30 whereas my tricky business with values, well, I could redefine it later 19:33:36 the compiler can't know 19:33:57 For things like mutual recursion it's trivial to do it statically. 19:34:19 The compiler just has to keep relevant information "in mind" until it has everything it needs. No runtime dispatch logic is required after that. 19:36:05 --- nick: ASau` -> ASau 19:37:34 jyf: look up "parser combinators". 19:38:07 Especially works of Frost where he discusses left recursion termination. 19:39:57 --- join: Bahman (~Bahman@2.146.217.62) joined #forth 19:48:18 right but if I used ' foo is #foo I could ' bar is #foo later 19:48:46 wheras defer works, if I'm reading the docs right, more like a constant 19:49:27 or, that would have to be ' foo to #foo wouldn't it 19:49:30 mnemnion: Get the listing for defer. 19:49:30 But yeah, it works more like a constant. 19:49:36 Well... "Defer" works differently, for sure. 19:49:44 ASau: what? 19:50:21 "Defer" definitly works not like a constant. 20:12:06 --- quit: LinearInterpol (Ping timeout: 260 seconds) 20:32:56 --- quit: kludge` (*.net *.split) 20:35:37 --- join: kludge` (~comet@unaffiliated/espiral) joined #forth 20:51:12 --- quit: cataska (Remote host closed the connection) 20:54:28 Argh! Does anybody happen to remember the word in GForth for listing words' implementations? 20:56:53 --- join: cataska (~cataska@210.64.6.233) joined #forth 21:04:48 you mean the word `words` ? 21:09:24 see? or is there something else 21:09:57 see is for checking the single word implement 21:11:41 That's the one. see. 21:11:45 Thanks, tangentstorm. 21:11:58 * ttmrichter gets languages all twisted up sometimes. 21:12:09 I was fixating on variants of "list" because of my recent Prolog work. 21:27:38 --- part: w0rm_x left #forth 21:28:53 --- quit: kumul (Quit: Leaving) 21:57:00 --- quit: nisstyre (Quit: Leaving) 21:57:40 --- join: nisstyre (~yours@oftn/member/Nisstyre) joined #forth 22:17:08 --- quit: ErhardtMundt (Ping timeout: 245 seconds) 22:19:24 --- quit: nisstyre (Quit: Leaving) 22:43:17 --- join: nisstyre (~yours@oftn/member/Nisstyre) joined #forth 23:49:00 --- join: true-grue (~quassel@95-25-35-237.broadband.corbina.ru) joined #forth 23:57:45 --- quit: Azel (Ping timeout: 246 seconds) 23:59:59 --- log: ended forth/13.11.05