00:00:00 --- log: started forth/01.07.10 00:39:54 --- quit: cleverdra (Leaving) 01:16:33 --- quit: lar1 (Ping timeout for lar1[adsl-63-204-132-181.dsl.snfc21.pacbell.net]) 01:16:41 --- join: lar1 (lar1@adsl-63-204-132-181.dsl.snfc21.pacbell.net) joined #forth 01:28:09 --- join: Fare (fare@aboukir-101-1-5-fare.adsl.nerim.net) joined #forth 02:06:08 --- join: adu (andrew@adsl-63-201-89-102.dsl.snfc21.pacbell.net) joined #forth 02:12:43 --- quit: nate37 (Ping timeout for nate37[cx83983-d.irvn1.occa.home.com]) 02:25:22 alanis? 03:07:35 --- quit: Fare (Ping timeout for Fare[aboukir-101-1-5-fare.adsl.nerim.net]) 03:32:04 --- join: Fare (fare@aboukir-101-1-5-fare.adsl.nerim.net) joined #forth 03:47:00 --- quit: Fare (Leaving) 03:47:09 --- join: Fare (fare@aboukir-101-1-5-fare.adsl.nerim.net) joined #forth 04:30:41 --- quit: adu (IRCStep) 05:12:11 --- quit: MrReach (Ping timeout for MrReach[209.181.43.184]) 06:07:16 --- quit: Fare (Ping timeout for Fare[aboukir-101-1-5-fare.adsl.nerim.net]) 06:09:58 --- join: Fare (fare@aboukir-101-1-5-fare.adsl.nerim.net) joined #forth 06:40:49 --- quit: Fare (Ping timeout for Fare[aboukir-101-1-5-fare.adsl.nerim.net]) 08:05:43 --- join: Fare (fare@aboukir-101-1-5-fare.adsl.nerim.net) joined #forth 09:40:26 --- join: MrReach (mrreach@209.181.43.184) joined #forth 09:42:09 --- quit: I440r (Client Exiting) 11:17:55 --- quit: Fare (Connection reset by pear) 11:26:47 --- quit: MrReach () 12:23:29 --- join: cleverdra (jfondren@1Cust38.tnt3.florence.sc.da.uu.net) joined #forth 12:23:30 --- mode: ChanServ set mode: +o cleverdra 12:34:22 --- join: nate37 (nate@cx83983-d.irvn1.occa.home.com) joined #forth 12:34:53 --- mode: cleverdra set mode: +oo lar1 nate37 12:38:42 --- topic: set to 'hex : cntwarn B6 43 pc! ; : bsplit dup FF00 and 8 shr swap FF and ; : cntval! bsplit 42 pc! 42 pc! ; : sp-on 61 pc@ 3 or 61 pc! ; : sp-off 61 pc@ FC and 61 pc! ;' by cleverdra 12:39:23 --- topic: set to 'hex : cntwarn B6 43 pc! ; : bsplit dup FF00 and 8 shr swap FF and ; : cntval! bsplit 42 pc! 42 pc! ; : sp-on 61 pc@ 3 or 61 pc! ; : sp-off 61 pc@ FC and 61 pc! ; decimal : cnt<>freq 1193180 swap / ;' by cleverdra 12:41:30 --- topic: set to 'hex : cntwarn B6 43 pc! ; : bsplit 100 /mod swap ; : cntval! bsplit 42 pc! 42 pc! ; : sp-on 61 pc@ 3 or 61 pc! ; : sp-off 61 pc@ FC and 61 pc! ; decimal : cnt<>freq 1193180 swap / ;' by cleverdra 12:44:34 Your speaker driver? 12:46:08 Yup. 12:46:51 Enth, I assume? 12:47:29 brb 12:47:29 --- part: Trey left #forth 12:47:51 --- join: Trey (bowser@ns.TreySoft.com) joined #forth 12:48:11 cnt<>freq loses precision if you want a frequency of 40.5 (Hz?) or something, but I haven't bothered to think about that, yet. I got my speaker to speak to me, and that's nice. Later I'm going to build a simple library of classical music and a defensive interface. Then I'll load Enth on an unsuspecting display computer and have it play Mozart or something. 12:48:16 * cleverdra cackles evilly. 12:48:30 heh 12:48:35 s/or something//g # overused. bad cleverdra. 12:48:55 Yes, that's Enth. 12:49:19 I can't imagine writing something like that in any other language that Forth. 12:51:31 : pcibuf@ ( a n - ) a@ push a! 256 0 do i offset dup pci@ !a+ [ 1 cells ] +loop drop pop a! ; 12:51:56 create somebuf 256 allot 12:52:15 somebuf 0 0 bus 0 dev 0 fun pcibuf@ 12:52:37 That, plus what I pasted yesterday will fill somebuf with the PCI configuration data. 12:52:51 cool. /me scribbles 12:53:22 Let me know if you have a better implementation for pcibuf@. 12:53:43 Do you want a copy of Color Forth? 12:53:47 I don't know if Enth has a convention for saving/restoring the A register. 12:54:03 A copy of Color Forth? 12:54:14 Chuck's CF? 12:54:18 I'll have to think about that first. um, did you miss a LITERAL after that [ 1 cells ] or does +loop take from the datastack at compile time? 12:54:19 Yeah. 12:54:27 Yes, I missed a literal. 12:54:32 He emailed it to me yesterday. I can't get it working on my machine. 12:54:51 * cleverdra almost never uses do/loop in Enth. 12:54:54 In my code, I used 4 instead. 12:55:19 Oh, I see. 12:55:36 It seriously assumes a 32bit environment, so I could just use 4. 12:56:09 What do you use in place of do/loop? 12:56:23 : ccells here cell- dup >r @ cells r> ! ; -- for compile-time cells operation, with some small compile-time overhead. 12:58:21 Did you drop an immediate? 12:58:27 In Flux I use recursion. I should probably use begin/next in some of the places where I use recursion right now. In Enth I typically don't use any kind of looping operator, because I don't write much complex non-color Forth code. I'd probably just use DO/LOOP then, though a few extra words working on the A register might be better. 12:58:39 Yes :-/ Thank you, Trey. 13:00:05 : A+1 A@ 1+ A! ; : A++ A@ dup 1+ A! ; : ++A A@ 1+ dup A! ; 13:01:04 How does that help for the loop I posted? 13:01:39 Those are just examples. If I'd write that loop, I'd probably use that loop, but another way could be... 13:05:53 : pcibuf@ a! 0 256 push begin dup offset dup pci@ !a+ 4 + dup r@ = until r> 2drop ; 13:05:57 which isn't much of an optimization. 13:07:32 It'd probably be easier if you count down from 256, starting at the end of the buffer and writing backwards. 13:08:24 : pcibuf@ a! 256 begin dup offset dup pci@ !a- 4 - dup 0= until ; 13:08:38 * cleverdra shrugs. 13:09:43 --- mode: cleverdra set mode: +o Trey 13:09:47 You have to load A with a funny value first :-( 13:10:53 * cleverdra nods. 13:11:50 * cleverdra wonders if Enth optimizes 0= UNTIL 13:12:02 Probably not. 13:12:34 Your code won't work. 13:12:38 But there's another simple branching word you can add. !UNTIL ? 13:12:40 Why not, Trey? 13:13:43 offset takes two values on the stack: the pci selector and an offset. 13:13:59 * cleverdra nods. 13:14:16 At that point, you have: (selector) 256 256 13:14:42 You want: 252 (selector) 252 13:15:18 Oh, I see. I loop one more time than I should. 13:16:01 rather, I start wrongly. 13:16:12 : pcibuf@ a! 252 begin dup offset dup pci@ !a- 4 - dup 0= until ; 13:16:58 That doesn't work either. 13:17:09 You still have (selector) 252 252 13:17:19 Oh, I see. 13:17:48 : pcibuf@ a! 252 begin tuck offset dup pci@ !a- 4 - dup 0= until ; 13:19:36 I still don't think that works. 13:20:23 Why not? 13:20:24 At " 4 - ", you have 252 (selector) on the stack. 13:21:42 : pcibuf@ a! 252 begin tuck offset dup pci@ !a- swap 4 - dup 0= until ; 13:22:35 I hadn't looked back at your pci words, and didn't take care of their order. There's a bit of juggling in keeping a count on the stack which you don't see in a do/loop. 13:23:05 Well, when you've other stack items to move around. 13:24:52 Yep. The hidden R stack variables in a do/loop simplifies the code a lot. 13:25:08 : freq! cnt<>freq cntwarn cntval! ; 13:25:35 : beep ( waitms freq -- ) freq! sp-on ms sp-off ; 13:27:07 Are you saving A just as a precaution? 13:36:56 (sorry for the delay) 13:37:16 Yes, I save A as a precaution. I don't know who will call this routine. 13:37:44 We probably ought to have a word for that: A>R and R>A 13:38:28 : A>R A@ PUSH ; : R>A POP A! ; 13:39:19 If Sean finds room in the registers for A, then these become simple push/pop against the CPU stack. 13:39:32 * cleverdra nods. 13:40:19 A really should be a register. after I start writing more code, I'll see if I can fit it in. 14:12:22 --- join: notjunkd (junk@p53-max1.christchurch.netaccess.net.nz) joined #forth 14:12:38 --- mode: cleverdra set mode: +o notjunkd 14:12:48 hi 14:12:49 thanks 14:13:28 gotta wait for I440r 14:15:36 * cleverdra nods. 14:16:17 --- topic: set to 'hex : cntwarn B6 43 pc! ; : bsplit 100 /mod swap ; : cntval! bsplit 42 pc! 42 pc! ; : sp-on 61 pc@ 3 or 61 pc! ; : sp-off 61 pc@ FC and 61 pc! ; decimal : cnt<>freq 1193180 swap / ; : freq! cnt<>freq cntwarn cntval! ; : beep freq! sp-on ms sp-off ;' by cleverdra 14:18:10 --- topic: set to 'hex : cntwarn B6 43 pc! ; : bsplit 100 /mod swap ; : cntval! bsplit 42 pc! 42 pc! ; : sp-on 61 pc@ 3 or 61 pc! ; : sp-off 61 pc@ FC and 61 pc! ; decimal : cnt<>freq 1193180 swap / ; : freq! cnt<>freq cntwarn cntval! ; : beep ( wait freq -- ) freq! sp-on ms sp-off ;' by cleverdra 14:25:25 --- join: futhin (thin@h24-65-199-115.cg.shawcable.net) joined #forth 14:25:53 hi all! long time no chat 14:27:06 Yep. 14:32:00 : tones 1000 100 do 250 i beep 10 +loop ; 14:32:45 --- mode: cleverdra set mode: +o futhin 14:32:52 Trey - hee =) 14:33:04 Trey - you've used that? 14:33:13 Yeah :-) 14:34:20 I had to test it somehow. 14:34:44 Cool! I've done some simple beeping, and left my speaker on for seconds on end while I wrote a word to turn it off, but nothing more. 14:35:00 I'm glad it works. I'll probably email that code in, later. 14:35:58 On my HP49 you have a BEEP and WAIT words used similarly to BEEP above. People have ported Classical music to the HP49 using these. 14:36:37 I think using a string of 32-bit numbers in the form of WAIT:FREQ would be acceptable for storing such music. 14:36:56 --- join: Fare (fare@aboukir-101-1-5-fare.adsl.nerim.net) joined #forth 14:37:06 --- mode: cleverdra set mode: +o Fare 14:37:34 Hello Fare. 14:37:46 cleverdra hello 14:50:39 hello fare & cleverdra 14:52:04 how are you doing today, futhin? 14:52:13 * Trey thinks Enth's ms should have a PAUSE in it. 14:52:23 Trey - it /doesn't/!? 14:52:38 I can't change focus or use the keyboard while beep runs. 14:52:52 i am doing good, got my internet back (i moved) 14:53:58 --- join: TreyB (bowser@ns.TreySoft.com) joined #forth 14:53:59 --- quit: Trey (Read error to Trey[ns.TreySoft.com]: Broken pipe) 14:54:02 --- nick: TreyB -> Trey 14:54:08 Grrr. 14:54:15 The server stopped responding. 14:55:59 I can't find the definition for MS, right now. Once you find it, just define a PMS or something that PAUSEs. 14:56:39 that might be misleading to some readers =) I think adding PAUSE to MS in Enth core may be bad, but you could try it and see. 14:58:56 : PMS begin pause 1 ms 1 - dup 0= until drop ; 14:59:16 s/1 -/1-/ 14:59:49 Try that, Trey. 14:59:54 --- mode: cleverdra set mode: +o Trey 15:00:43 : ms ( n - ) push clkevent begin pause clkevent over - r@ > until pop 2drop ; 15:01:02 (from enth.f) 15:01:33 But I don't know how enth.f figures into a running system. 15:02:02 * cleverdra nods. 15:02:28 I wonder why I can't use the key while the beep thing goes? 15:02:47 Do it in the Enth console. Does the clock keep ticking? 15:03:28 If it does, the reason you can't use the ESC key is probably because the FOCUS task there, even though it is PAUSEing for other tasks, is itself busy with MS and so isn't listening to the keyboard. 15:03:29 It does! 15:03:35 --- quit: nate37 (Ping timeout for nate37[cx83983-d.irvn1.occa.home.com]) 15:04:07 Hmmm. I don't know if I like that behaviour. 15:04:27 I am similarly uncertain. 15:04:36 I suppose that you could make the ESC thing work as its own task. 15:05:08 A keyboard task that passes out input to the current focal task, perhaps? 15:05:30 Which I'd prefer. While EDIT is busy with floppy@ I can be reading Undocumented Features in BRAINCRAM 15:05:32 But this would _require_ multitasking to remain on. 15:05:44 Oh, you're right. 15:06:17 I sure wish Sean would duck in here every now and then. 15:06:47 Sean responds, BTW, that he doesn't get why any other OS would be idling the CPU more than Enth since they most be constantly polling too, but he'd like to hear how you do that, and anyway he thinks that the big energy saver here is turning off what you don't use -- like the hard disk. 15:06:56 Yes, it'd be cool if he did. 15:07:05 s/most/must/ 15:07:24 I just dropped a PS: question when I emailed him yesterday =) 15:08:22 In BeOS (along with most modern OSes), we spend most of our time in the idle_thread. 15:08:50 What does that mean? 15:09:12 It runs at the lowest priority in the system, and executes a single instruction repeatedly that idles the CPU. 15:09:34 The CPU reduces power consumption and waits for an interrupt. 15:09:35 --- quit: notjunkd (su -) 15:10:09 Which the timer or some other hardware delivers when it wants something done. 15:10:23 Oh, OK. 15:10:41 Yeah, Sean'd probably like to hear about that. 15:11:28 He won't have any use for it until he gets a pre-emptive kernel running. 15:12:06 --- join: notjunkd (junk@p96-max1.christchurch.netaccess.net.nz) joined #forth 15:12:07 s/until/unless/ 15:12:10 --- mode: cleverdra set mode: +o notjunkd 15:13:33 ta 15:22:29 --- join: nate37 (nate@cx83983-d.irvn1.occa.home.com) joined #forth 15:23:02 --- mode: cleverdra set mode: +o nate37 15:23:10 --- join: Kookis (Rcvd0@209.78.183.11) joined #forth 15:23:40 * notjunkd is away, not here 15:23:44 * notjunkd is away, not here 15:24:28 --- mode: cleverdra set mode: +o Kookis 15:24:43 Hello, Kookis. 15:25:03 Hi I want to learn forth. Where to start? 15:25:22 Hi cleverdra 15:25:55 www.forth.org has some tutorials and Forth systems, which usually come with some documentation. 15:26:01 What OS are you using? 15:27:25 In particular solaris. Linux* and ofcourse NT 15:27:53 Am interested in openboot on sparcs 15:27:58 * cleverdra nods. 15:28:21 I don't know where OpenBoot information is. gforth (there's a link from www.forth.org in the Compilers section) works on all those. 15:33:57 --- join: BorgHOME_ (ecl@cpu2385.adsl.bellglobal.com) joined #forth 15:34:13 --- mode: cleverdra set mode: +o BorgHOME_ 15:34:18 hello, borg. 15:34:22 hi 15:35:03 Trey - do you have plans for any other hardware interface programs in Enth? 15:36:32 I have a funny for ya. On CansecWest Theo DeRaadt said/asked "what are we supposed to write the operating systems in if not C, java so its all slow..., C++ thats even worse" Some one screamed out FORTH :) he said nothing... 15:37:24 heh. 15:37:34 hm. 15:38:13 I'm going to go, soon. 15:38:35 Trey - I'll probably start working on hard disk access. 15:38:44 --- quit: cleverdra (Leaving) 15:43:26 I presume the topic is the code for beep on F-PC? 15:44:24 uh 15:44:35 i think it was for hp48g? 15:44:43 but i wasn't paying close attention to the chat 15:50:01 actually, nevermind what i said 15:55:30 the very notion of OS is a fraud 15:55:50 LISP is not an OS, it is a CS -- a computing system. 15:55:58 yes. and? 15:56:13 and once again I'm in the wrong channel 15:56:16 doh 15:56:24 FORTH is good, too 15:56:29 which channel was that meant for? #lisp? 15:56:32 yup 15:56:45 Forth isn't an OS either right? it's a CS? 15:56:45 different approaches, different problems. 15:57:03 yup 15:57:25 yup..not an OS, just an interface to a dictonnary of words. 15:57:29 although FORTH is typically low-level 15:58:00 which means it has rather specific application targets. 15:59:04 Forth starts low, but can go as high as needed. 15:59:18 (since it's extensible, kinda like lisp) 16:01:54 except there is no tradition and no code base for FORTH to really go high 16:01:57 which is a shame 16:02:16 so that when you really want to go very high, you'd better start with lisp directly 16:02:35 or maybe with POP-11, that combines the perks of both 16:04:26 Fare: are you familiar with Joy? 16:05:24 POP-11 or PDP-11?? 16:06:45 POP-11 although I'm sure the pun is intended 16:06:50 search for poplog 16:07:06 http://www.poplog.org 16:07:32 last time I saw it, Joy was an interesting conceptual toy 16:07:40 seen unlambda? 16:07:57 http://www.eleves.ens.fr:8080/home/madore/programs/unlambda/ 16:11:20 water likes joy 16:12:25 i am sort of interested in tunes and arrow by i'm hindered by not knowing lisp or smalltalk 16:23:01 but whatever 16:25:18 I never was able to grok lisp-like languages....I don't know why. 16:26:12 just imagine it's FORTH with a weird syntax 16:27:48 I know they are both...darn...what's the term for languages which define algorithms as actions on data and not as imperative constructs? 16:27:59 functional? 16:28:03 yes! 16:28:05 thanks. 16:28:26 both are functionnal...but Forth is the only functionnal language I got so far... 16:28:28 forth isn't functional 16:28:32 how so? 16:28:35 and forth isn't concatenative 16:28:42 which means? 16:28:48 apparently forth doesn't fit into the functional paradigm/concept 16:29:13 when operating on the stack, it seems to be functionnal. 16:29:30 (when using variables, well...that's not functionnal) 16:30:08 yeah, it is sort of functional. but if you check out the comp.lang.functional FAQ they don't even list Forth. i don't really know why forth isn't functional, you'll have to ask somebody else.. like cleverdra or i440r 16:31:01 I don;t know either....I looked at many lists of functionnal languages...Forth seems to mostly fit the bill, but it's almost never listed. 16:31:10 heh 16:31:12 yeah 16:31:45 what does 'concatenativity' and 'reflectivity' mean in the context of languages? 16:31:55 no clue :) 16:32:20 you're the one who said: and forth isn't concatenative ;) 16:32:49 yeah 16:33:22 --- nick: nate37 -> lair 16:33:24 that's what others said :) 16:33:26 --- nick: lair -> liar 16:34:40 * notjunkd is back, hi (1h 10m 56s) 16:35:09 Fare? 16:35:11 Trey? 16:35:12 lar1? 16:35:35 yes? 16:36:32 Fare: is forth functional or concatenative or neither? :) 16:37:54 depends on the precise definition you give for "functional" and "concatenative" 16:38:41 --- nick: liar -> amort 16:39:57 --- nick: amort -> ink 16:40:25 --- nick: ink -> nate37 16:40:55 Fare: well...I know what functionnal broadly means...but what is concatenative? 16:41:12 brog: explain what functional means 16:42:17 a functional language is one where an algorithm is defined by application of successive functions to a data set. It's usually devoid of imperative statements. 16:42:20 correct? 16:43:17 hun 16:43:19 hum 16:43:32 --- join: adu (andrew@adsl-63-201-88-25.dsl.snfc21.pacbell.net) joined #forth 16:43:38 devoid of imperative statements is "pure" 16:44:05 _successive_ functions would very much be imperative 16:45:11 then how do you put step A before step B? 16:48:04 --- quit: adu (Read error to adu[adsl-63-201-88-25.dsl.snfc21.pacbell.net]: Connection reset by peer) 16:50:18 --- join: adu (andrew@adsl-63-201-90-249.dsl.snfc21.pacbell.net) joined #forth 16:51:19 B (A (x)) 16:51:24 x A B 16:51:42 do A ; B ; return 16:51:53 ok...that's what I meant by successive. 16:51:53 --- quit: Fare (Read error to Fare[aboukir-101-1-5-fare.adsl.nerim.net]: Connection reset by peer) 16:53:08 darn. 17:08:35 --- quit: notjunkd ([hienoa] - your ass is glowing!) 17:28:23 --- join: notjunkd (junk@p60-max1.christchurch.netaccess.net.nz) joined #forth 17:28:36 --- quit: notjunkd (epic4 1.0.1 + hienoa 0.40) 17:48:06 life? 17:55:34 futhin: cleverdra wrote the beep code for Enth. 18:23:57 ah 18:30:29 --- nick: adu -> adu_away 19:20:59 --- quit: futhin (gotta go) 19:43:02 --- quit: nate37 (Ping timeout for nate37[cx83983-d.irvn1.occa.home.com]) 19:43:06 --- join: nate37 (nate@cx83983-d.irvn1.occa.home.com) joined #forth 20:13:05 --- nick: adu_away -> adu 20:28:23 --- join: edrx (edrx@copacabana-ttyS17.inx.com.br) joined #forth 20:28:55 --- join: mark4 (mark4@purplecoder.com) joined #forth 20:29:00 --- nick: mark4 -> I440r 20:37:58 --- mode: Trey set mode: +o I440r 20:39:02 I just tried Chuck's colorForth. I had a hard time making the keyboard do what I mean. 20:39:50 Time to sleep. 20:39:55 * Trey is idle: sleeping 21:31:36 --- join: notjunkd (junk@p35-max1.christchurch.netaccess.net.nz) joined #forth 21:31:42 i440r 21:31:44 !! 21:39:12 I440r 21:49:26 --- join: cleverdra (jfondren@1Cust215.tnt3.florence.sc.da.uu.net) joined #forth 21:49:26 --- mode: ChanServ set mode: +o cleverdra 21:49:31 --- mode: cleverdra set mode: +oooo adu edrx nate37 notjunkd 21:49:49 Hello! 21:49:57 hi! 21:50:15 * cleverdra has been writing code words, today. Fun fun. 21:50:22 eh?? 21:50:49 You know, CODE words? CODE is like : except that you use it to define assembly words. 21:50:55 example: 21:50:59 CODE DUP 21:51:10 SUB 4 # SP 21:51:19 MOV 0 [SP] T 21:51:21 RET 21:51:26 END-CODE 21:51:34 too confusing for me :p i dunno forth or so 21:51:56 Well, it's confusing until you learn it =) 21:52:13 heheheh 21:52:47 forth == cool 21:53:04 "SUB 4 # SP" moves the data stack pointer down a cell, and "MOV 0 [SP] T" moves T, what's in the TOS, to the *new* TOS, which what the SP register holds. 21:53:17 eh lol 21:53:35 what exactly can you code using forth? 21:53:37 anything? 21:54:03 I actually wouldn't write it like that. Enth's assembler has a postfix/prefix switch, and that is prefix form. In prefix form instructions are like "INSTRUCTION TO FROM". Confusing sometimes. I prefer postfix form, which is "FROM TO INSTRUCTION" 21:54:27 Yes, you can code anything with Forth. The topic write now implements a simple PC speaker controller. 21:54:42 lol 21:54:44 confusing hehe 21:54:46 Which, mind you, is not 'anything', per se, but I think it's a worthy example of anything. 21:55:22 is like 21:55:33 a bot for ircle possible? because i want to make one (in any language heh) 21:55:52 err 21:55:55 Well, the code in the topic may be confusing, but that's because I'm writing to machine ports and using hex code and working with ideas you're not familiar with. I'll bet you can use the BEEP word, though! 1000 37 BEEP <-- for one second, beep a C tone at octave 1, I think. 21:55:56 not ircle 21:55:57 just irc 21:57:08 Here's a bigger example: ftp://ftp.netwinder.org/users/e/elafo/src/soli.seq 21:57:17 Yes, it's possible. You'd need to connect to remote TCP ports and understand the IRC protocol (there's an RFC -- check it out!). One Forth you might want to try this with is gforth, since that has methods to build words referencing C libraries, which'll cut down on the work of talking to ports. 21:57:21 That's the SOlitaire cryptosystem in Forth. 21:57:39 borg - oh, the one that the Cryptonimicon has? Cool. 21:57:44 (yes...I know it's all CAPS...it was a long time ago) 21:57:45 hey the whole fig.org site is CGI'd with forth 21:58:06 or forth.org 21:58:07 cleverdra: yup. 21:58:42 compiles to ~2kB of code on F-PC. 21:58:47 All caps isn't a bother. 21:59:01 ported to Quartus with only '<=' having to be defined. 21:59:04 cleverdra: about gforth, how i might want to try it, i don't even know forth lol 21:59:33 notjunkd: i know 3 words that have been very helpful in my learning forth 22:00:04 they're 'words' 'see' and ':' 22:00:09 notjunkd - go to www.forth.org and they have a 'Compilers' section in which you can go to the gforth site which has gforth source as well as binaries for DOS. gforth comes with two differently-leveled introductions which should probably get you into things. 22:00:20 : is the coolest because you can make your own things with it =) 22:00:26 dos -- nah :p 22:00:31 notjunkd - depending on your operating system, you might want something else. 22:00:41 i'm using linux 22:00:54 debian? 22:00:59 yea 22:01:03 =) 22:01:12 borg - /me scribbles. Thanks! 22:01:19 notjunkd - gforth should be fine, then,. 22:01:20 There is also TILE for Linux. 22:01:59 cleverdra: it's linked on Schneiers' site. 22:02:02 * BorgHOME_ beams. 22:02:45 * notjunkd downloads gforth 22:04:42 anyway, in postfix that'd be: 22:04:50 (and in my preferred style) 22:05:23 CODE DUP SP 4 # SUB T [SP] MOV RET END-CODE 22:05:40 that's slightly less readable, though, for people who don't know the instructions. 22:05:55 Since I haven't written many code words yet, I haven't really decided. I like that. 22:06:07 is the final asm identical? 22:06:08 oops. 22:06:13 CODE DUP SP 4 # SUB T 0 [SP] MOV RET END-CODE 22:06:25 borg - it may do some optimization. I don't think so. 22:07:00 borg - "I don't think so." referring to the optimization. 22:07:11 ok 22:08:05 hi 22:08:15 http://home.earthlink.net/~neilbawd/solitair.html 22:08:21 tile is gnu forth 22:08:23 written in c 22:08:24 ugh 22:08:29 :) 22:08:29 i440r 22:08:30 that's another implementation, predating me by almost exactly a year. 22:08:37 i cant help you notj 22:08:40 im bizzee :) 22:08:41 I learnt of it after I didi mine. 22:08:54 borg you did a forth compiler in c ? 22:09:16 I440r - Here's a bigger example: ftp://ftp.netwinder.org/users/e/elafo/src/soli.seq 22:09:41 Wow, does he have some long words. 22:09:59 : Exchange-Above-and-Below-Jokers 22:11:25 borg - I once wrote a simple equation that summed the numbers between 1 and any number, and later between any two numbers, only to discover that I'd been beaten by Gauss, approximately a zillion years ago. 22:12:46 borg - that's not a big deal, though. It's not programming. 22:14:39 borg - BTW, I think your comment "BASE 10 NUMBERS" after the DECIMAL word in your program is slightly unnecessary =) 22:14:53 cleverdra, where's the forth tutorial or doc's? 22:15:58 notjunk - where, in gforth? In the ./doc/ directory are some .info documents. Try 'info -f gforth' in that directory. 22:16:36 k 22:17:32 ah 22:17:35 found the tutorial 22:18:14 A good Forth teaching book is 'Starting Forth' by Leo Brodie. 22:18:52 cleverdra: it was my first serious forth prog... 22:19:28 cleverdra: I have a slightly newer version with no significant changes, but most of the comments have been removed or reduced....cut the source size in half. :) 22:19:56 borg - I wasn't being critical, that was just a funny comment =) 22:20:01 borg - cool =) 22:20:31 I left it as such as an (I hope) good example..hence the comments. 22:20:37 borg - comments are OK. You seemed to do them pretty well. 22:20:45 * cleverdra nods. 22:21:00 I read much about Chuck's opinions on comments and other sources of coding style. 22:21:19 anyway...I must go....past my bedtime. 22:21:25 OK. g'night, Borg. 22:21:35 I may be on tomorrow at something more of a reasonable time =) 22:21:54 ok 22:22:04 * BorgHOME_ goes ZZZzzzzzzz..... 22:22:46 --- topic: set to ': home 0 0 at-xy ; : clear home 2000 spaces ; : waitk key drop ; : dark clear waitk 0 1 at-xy ;' by cleverdra 22:24:21 what does that code do ? 22:25:13 It darkens the screen, if you have 25*80=2000 characters on your screen, waits for a keypress, then puts you at the first column of the second line. Useful for Enth. On other systems I'd use different definitions. 22:25:23 see also 'light' 22:25:47 how do i like "compile" things 22:25:47 : light white >bg clear waitk black >bg clear 0 1 at-xy ; 22:25:52 because i typed it into gforth 22:25:55 and it just said ok 22:26:00 I could factor that more, but I never actually define LIGHT. 22:26:04 ok is the post-prompt 22:26:18 it shows that its procesed things and is ready again 22:26:33 adu - 'acknowledgement' is a good for that =) Forth is reassuring you that things went OK. 22:26:48 word? 22:26:52 notjunkd - I don't understand your question. How do you like "compile" things? The tutorial is not helping? 22:27:00 adu - yes, I meant to say that. 22:27:12 i dont think i got that ar 22:27:13 lol 22:27:15 =) 22:27:15 this is confusing 22:27:36 notjunkd: you don't need to compile forth 22:27:54 but you can 22:27:56 notjunkd - want me to give you a brief rundown on the operation of Forth? 22:28:03 ok 22:28:11 it depends on the forth your using tho 22:28:21 adu - yeah, but I know gforth. 22:28:25 so can't you go ./name 22:28:27 o ok 22:28:36 notjunkd - right now you are speaking to something called the 'outer interpreter' 22:28:43 notjunk - (yes you can, wait a sec) 22:29:08 k 22:30:09 notjunkd: forth by nature is interpreted, everything is separated by a space, these 'WORDS' are each executed separately, usually, and programs are traditionally made by adding WORDS to the dictionary 22:30:32 notjunk - right now when you type lines into the outer interpreter it looks each word in that line up in its dictionary and executes it. Very simple. "FOO BAR BAZ ", where is you actually pressing the return key, would cause the outer interpreter to FIND and EXECUTE FOO, BAR, and BAZ in sequence. 22:30:41 Right, what adu said. 22:30:58 notjunk - there's a lot of detail I'm going into. I mention that so you realize that there's a lot of detail you're not hearing. 22:31:32 hehe ok 22:32:03 the dictionary is like a stack with 2 parts in each element a word's name and a place where the code is stored 22:32:23 notjunk - In Forth, there are two general time: 'compile time', which is the interpreter interpreting the source of your program, and 'run time', which is when individual words are being executed. This means that a word might have its own runtime that happens while another is being compiled. 22:33:22 a word can have a run time action = compile a new definition - and an execution time action - when the word it compiled executes 22:33:31 neway like i said im not here hehe 22:33:41 eh? 22:33:44 notjunk - yeah, when you compile something, it typically goes in your dictionary. The dictionary is a mixture of word bodies, word headers, variables and miscellaneous data, and anything else you put in there. It's all in memory, and you can modify it (on some systems, part of it are in ROM, which you can't modify. Gforth's is contiguous. On others it isn't.) 22:33:49 is that what [if] is? 22:34:05 sort of 22:34:05 --- join: colorg_ (r@humbubba.smart.net) joined #forth 22:34:12 adu - who are you responding to? [if] is a wierd interpreter macro, as far as I can tell =) 22:34:13 ok 22:34:13 but not realy 22:34:16 hey, colorg! 22:34:19 --- mode: cleverdra set mode: +o colorg_ 22:34:24 if is a word that is used to compile a conditional branch 22:34:24 3 4 + 00000007 22:34:42 EFnet is split to shit 22:34:46 i thought [IF] was a compile time word 22:34:49 adu - [if] [then] is used for conditional compilation, and also (wierdly) for embedded documentation. 22:34:51 efnet is always split 22:34:58 if is a compile time word 22:35:01 its a creatign word 22:35:05 or rather 22:35:05 hehehe i've seen that 22:35:07 adu - yeah. 22:35:07 a comp[ilign word 22:35:16 it compiles a conditional branch 22:35:26 adu - or were you asking something else? 22:35:33 actually it compiles a DUMMY c onditional branch 22:35:36 I440r - we're talking about [if], which doesn't compile anything. 22:35:44 [if] ? 22:35:55 i guess this is a new fangled ans bs word ? 22:36:00 I440r - Yes. Here's an example of [IF] usage. 22:36:08 i thought [if] was like #if in C like a preprocesor 22:36:14 FALSE [IF] OK, the interpreter never sees any of this, so I can go on and on 22:36:26 for PAGES talking about the following program, like Wil Baden =) 22:36:26 oh its a conditional compile 22:36:28 [THEN] 22:36:32 it starts a comment block 22:36:34 Is trey awake? 22:36:39 i NEVER use block comments 22:36:44 if i want to comment a BLOCK i do 22:36:46 \ 22:36:46 \ 22:36:47 \ 22:36:47 \ 22:36:48 \ 22:36:48 I440r - not really. You can do that if you want. You can also use it for conditional copmilation. 22:36:56 point gotten 22:37:00 yes which i also frown upon 22:37:03 #if x 22:37:06 compile this 22:37:12 #elseif y 22:37:16 compile this 22:37:18 #else 22:37:19 colorg - I don't know if he is. Do you want me to take a message? I speak to him occasionally. 22:37:21 compile this 22:37:22 #then 22:37:25 sphagetti code 22:37:29 visual clutter 22:37:30 so it is like #if 22:37:43 no thanks 22:37:49 colorg - OK. 22:38:01 actually #ifdef is more commonly found, and there isn't elseif only #elif 22:38:02 well, he's only been idle for 117 minutes. 22:38:13 i think 22:38:33 adu - #ifdef's just a shortcut for #if defined -- but anyway. Enough C, please? 22:38:36 no thanks? 22:38:51 cleverdra: ok sorry 22:39:06 hehe yea any c is too much c :P 22:39:14 but #if is defined in fpc too 22:39:15 guess what? 22:39:21 cleverdra: you telling these guys how cool H3sm is? 22:39:23 --- topic: set to 'hex : cntwarn B6 43 pc! ; : bsplit 100 /mod swap ; : cntval! bsplit 42 pc! 42 pc! ; : sp-on 61 pc@ 3 or 61 pc! ; : sp-off 61 pc@ FC and 61 pc! ; decimal : cnt<>freq 1193180 swap / ; : freq! cnt<>freq cntwarn cntval! ; : beep ( wait freq -- ) freq! sp-on ms sp-off ;' by cleverdra 22:39:23 printf("hi"); 22:39:23 block comments are dangerous 22:39:28 oops too much c i440r :P 22:39:29 it obsures whats being done 22:39:30 i finnished my non-keyword language specification today 22:39:36 colorg - yes, I've been showing them some H3sm code =) 22:39:45 :o))) 22:39:49 neway bbl - bizzee hehe 22:40:14 l8r I440r 22:40:21 adu just semantics? 22:40:26 bye I440r. 22:40:37 adu - I'm sorry. What does that mean? 22:40:38 colorg_ yup 22:41:07 no actually its semantics are implicit thru the operators used rather than being explicit thru keywords 22:41:27 That impressed me about that Forth IOCC winner. It boots by you telling it what the strings for it's 13 words are. 22:41:48 string? 22:41:59 it only has 13 words? 22:42:17 whats IOCC? 22:42:26 It has 13 words, but he didn't want to use the space to name them, so it asks you to name them. 22:42:37 adu - programming competition. There's a thread about it on clf. 22:42:42 International Obfuscated C Contest 22:42:52 oh. nevermind. 22:43:17 colorg - oh. No names in the name dictionary? 22:43:24 right. 22:43:44 oooooooic 22:43:52 you give it the words 22:43:56 right 22:43:56 Yes, that's cool =) 22:44:03 but no thats different 22:44:11 you don't get to make up your own keywords 22:44:32 and you have to know the semantics and order of the words. Or give it a file or something I guess. 22:44:59 its a compiled language with semantics similar to Java or ObjC. 22:45:01 adu so yours does have named operators 22:45:15 no 22:45:21 here i'll give you some of the spec 22:45:45 try catch p , e ? p 22:45:46 try..finally p , e ? p , p 22:45:47 switch (v) , p 22:45:47 loop : p . 22:45:48 do while : p c ? 22:45:49 while c ? : p 22:45:49 for p , c ? p : p 22:45:50 if c ? p 22:45:52 if else c ? p , p 22:45:54 if elif else c ? p , c ? p , p 22:46:14 wow 22:46:19 p is a procedure which can be either a single statement or a group and if its the last then it must end in a . 22:46:23 is the text online? 22:46:28 e is an exeption type 22:46:35 c is a condition 22:46:35 That i figured 22:46:43 e I got 22:47:05 time to sleep, bye 22:47:05 That's fine for a spec, but p covers a lot of ground 22:47:07 a group is like {p.p.p.} 22:47:29 ? is a test? 22:47:35 --- quit: edrx ([x]chat) 22:47:37 usually 22:47:52 comma is compile? 22:48:17 uuuh a comma works differently depending on preceding things 22:48:33 ah, syntax. Bad. ;o) 22:48:43 hehe 22:49:02 but i've been trying to come up with a forth version 22:49:29 : is a branch target? 22:49:56 H3sm branch target looks like a target, (O) 22:50:03 no : generally signifies a loop in procedural context and a type in a variable context 22:50:25 like myNum:int. is a variable declatation 22:50:49 I was just looking at the BNF for C in the back of K&R2. Chuck got it right. Syntax sucks. 22:51:25 colorg - if you ever get inklings otherwise, look at C's comma operator. 22:51:40 but :{printf("Hi").i++.} i<4? is a while that goes 4 times 22:52:03 I used that today, actually. for ( i = 1 ; i ; i = i << 1 , j ++ ) 22:52:38 i? 22:52:55 adu the other thing is just cause they're single letters doesn't mean they aren't keywords. 22:53:21 but ther's only 3 of them 22:53:29 That for() is for bitops, i goes 1, 2 , 4 , 8 to 0 22:53:39 hmm maybe 4 22:54:05 p e c : , ? that's 6 22:54:19 o so if it gets shifted over enough it would be 0 again? ok that makes sense 22:54:38 That's another thing Chuck got right. Computers don't have "punctuation" 22:54:51 hehehe 22:54:53 adu pretty nifty eh? 22:55:22 whats nifty? the for()? or p e c : , ? 22:55:34 run it with printf ("%d %d \n", i , j ) ; 22:55:40 p e and c aren't keywords they're place holders 22:55:43 adu both. 22:55:49 : , . and ? are the keywords 22:56:19 As far as I'm concerned all defined tokens that aren't literals are keywords. 22:56:53 so a function call is a keyword? 22:57:04 I'm starting to space my C code so I don't have to write a tokenizer for it in H3sm ;o) 22:57:17 an expresion is a keyword? 22:57:21 adu in an extensible language it is. 22:57:35 lol 22:57:40 you have some wierd ideas 22:57:44 an expression is an abstraction 22:58:13 but the definition of a keyword is a token that has special meaning to the interpreter 22:58:14 . o O ( this guy codes with p e and c and thinks I'M wierd) 22:58:30 lol ok point taken 22:59:14 adu in Forth it seems to me keywords are primitives or threads. But , and so on are keywords. 22:59:36 but since the operators only depend on what comes before, then it could be made into a forth extention 22:59:57 adu in yours? Yours is stack-based? 23:00:04 It's better no to think of them as being different, colorg, except from some knowledge that THIS word is written in optimized assembly and THAT word is a high-level hack. That's important information. 23:00:26 cleverdra: especially to the system itself. 23:00:36 my what? 23:00:38 But once you start breaking a Forth into 'system' words and 'user' words, I get edgy. 23:00:49 adu p e c is stack-based? 23:00:50 yes my operators 23:01:06 no its not, but i'm trying to make it flexible enough to be such 23:01:22 --- quit: notjunkd ([hienoa] - your ass is glowing!) 23:01:28 lol 23:01:30 Well if it's already postfix it's a short hop maybe 23:01:37 your ass is glowing... 23:02:49 thats the best line ever 23:03:06 how about this... 23:03:16 - your gluttomous maximus is emitting visible light! 23:03:31 and all the keywords having to do with return or break have shorter similar keywords that step from a unary < 23:03:38 that's the C++ version 23:03:43 return # <(#). 23:03:44 break <-. 23:03:44 continue <+. 23:03:45 goto L <:L. 23:03:46 throw T <-:T. 23:03:50 hehe 23:04:01 http://fly.cc.fer.hr/GDM/articles/ <-- decent web page. It is from these people that I got information enough to write the above (see topic) Forth PC speaker interface. 23:04:24 adu - aww, that's cute. You've got a little emoticon. 23:04:35 eh? where 23:04:40 <-:T. 23:04:41 emotiforth 23:04:52 <:L. 23:04:58 nono its a command! 23:05:03 L is a label 23:05:20 you guys know this guy ---> ##;^7 23:05:23 actually that should be <-:E. 23:05:25 <:L. looks like a sad person drooling a little. 23:05:32 colorg - no, who's he? 23:05:39 lol 23:05:42 Lyle Lovette :o) 23:05:55 I don't know her. 23:06:00 he 23:06:05 lol 23:06:09 Texas songwriter. 23:06:23 I've got to go now. Bye! 23:06:27 and that emoticon is shit-hot-on 23:06:32 bye 23:06:39 colorg - she looks like that? 23:06:41 function definitions are just like an assignment so this is a sample function: 23:06:44 abs(x) := x>0? <(x), <(-x). 23:06:46 he 23:06:54 a templated function at that 23:07:22 --- quit: cleverdra (Leaving) 23:07:29 What is "templated"? 23:07:38 When clev has to go he's gone 23:07:40 like in C++, any type 23:07:53 overloaded? 23:07:55 o is he gone now? 23:08:14 no template lets C get away with not needing to know the type of the arguments 23:08:33 C++ you mean 23:08:37 ya 23:09:09 in C++ you haveto do this thing before tho like this: 23:09:19 H3sm has 255 sizes of int for the same code, but no types like in C 23:09:47 template Type abs(Type x); 23:10:13 then you do Type or something 23:10:28 and int num; then abs(num) or somehing 23:10:32 OOP is horrid. A complete scam. 23:10:35 hehe i'm the worst programmer 23:10:45 templates aren't part of OOP tho 23:11:02 mostly a C++ thing 23:11:13 OK, but similar. A one-method object or something 23:11:33 well, not that either... 23:12:12 OOP is all its cracked up to be actually 23:12:21 but its never used the way it was intended 23:12:32 fully i mean 23:12:33 I haven't seen it. 23:12:41 seen what? 23:12:55 the OOP light. Java is a joke. 23:13:06 SmallTalk is the way OOP was intended 23:13:27 It's just too heavy. 23:13:43 Java is just a dual mistake that seemed to be the right answer at one time 23:14:20 colorg_: the OOP you know is probably heavy from everything used to fit it into today's systems 23:14:22 I have one thing where you could say I'm getting OOPy. I did an OS spec where "everything is a device". 23:14:28 SmallTalk is actually a very light system 23:14:39 since when? 23:15:06 have you tried Squeak? 23:15:12 nope. 23:15:29 its the most portable smalltalk 23:15:45 how big is it? 23:15:47 versions exist for Win, Mac, UNIX 23:15:57 like 2mb 23:16:17 The sources or the executable? 23:16:46 executable of interpreter + disk image of src 23:17:11 not bad. The H3sm executable gzips to 8k. 23:17:27 o well 23:17:29 Which is how much it enlarges a Linux kernel 23:18:37 Squeak needs a disk image to save to, and it includes a System Object browser written in Small Talk, and a self hosted display environment, and all modifications are made using the System Object browser 23:19:08 cool 23:19:10 and the Virtual Machine is written in SmallTalk again for flexibility 23:19:47 google Squeak i bet its easy to find 23:20:11 its got an ugly window system tho 23:20:15 so i don't use it much 23:20:17 =) 23:22:54 sounds quite interesting, but I'm getting sleepy 23:23:54 ok good night 23:25:01 nice meeting you 23:25:08 --- quit: colorg_ (zzz) 23:59:59 --- log: ended forth/01.07.10