00:00:00 --- log: started forth/07.10.23 00:28:41 --- quit: arke (Read error: 113 (No route to host)) 00:47:36 --- quit: Off_Namuh72 (Remote closed the connection) 00:47:54 --- join: arke (i=arke@x357.vpn.hrz.tu-darmstadt.de) joined #forth 00:47:54 --- mode: ChanServ set +o arke 01:33:02 --- quit: arke (Read error: 110 (Connection timed out)) 01:36:25 --- join: H4ns (n=Hans@p57BBB93B.dip0.t-ipconnect.de) joined #forth 02:33:15 --- join: arke (i=arke@x154.vpn.hrz.tu-darmstadt.de) joined #forth 02:33:15 --- mode: ChanServ set +o arke 02:36:46 --- join: ravenex (n=raven@146-59.vpn.aichyna.com) joined #forth 02:53:04 --- join: Off_Namuh72 (i=GPS@gateway/tor/x-5f3a3fb57a14bd02) joined #forth 04:12:27 --- part: Stepan left #forth 04:20:26 --- quit: Off_Namuh72 (Read error: 104 (Connection reset by peer)) 04:39:58 --- quit: ravenex (Read error: 110 (Connection timed out)) 04:46:13 --- join: Off_Namuh72 (i=GPS@gateway/tor/x-191dccfa0cda1aad) joined #forth 05:11:12 --- join: arke_ (i=arke@x448.vpn.hrz.tu-darmstadt.de) joined #forth 05:19:26 --- quit: Quartus (Read error: 110 (Connection timed out)) 05:19:46 --- join: Quartus (n=neal@CPE0001023f6e4f-CM001947482b20.cpe.net.cable.rogers.com) joined #forth 05:19:46 --- mode: ChanServ set +o Quartus 05:23:23 --- quit: arke (Read error: 110 (Connection timed out)) 05:28:57 --- join: arke (i=arke@x422.vpn.hrz.tu-darmstadt.de) joined #forth 05:28:57 --- mode: ChanServ set +o arke 05:33:09 --- quit: arke_ (Read error: 104 (Connection reset by peer)) 05:33:09 --- nick: arke -> arke_ 06:07:16 --- join: ruediger (n=the-rued@chello062178150152.7.14.univie.teleweb.at) joined #forth 06:49:46 --- quit: ecraven ("bbl") 07:01:54 --- join: madwork (n=foo@204.138.110.15) joined #forth 07:07:34 --- quit: ruediger ("This computer has gone to sleep") 07:24:01 --- quit: arke_ (Read error: 110 (Connection timed out)) 08:35:07 --- join: forther (n=forther@c-67-180-150-67.hsd1.ca.comcast.net) joined #forth 08:42:05 --- join: malyn (i=malyn@gateway/tor/x-2a20a208447615ee) joined #forth 08:49:42 hey 08:49:59 Howdy Quartus. 09:36:13 --- join: ehird1 (n=test@user-544158a3.l5.c5.dsl.pol.co.uk) joined #forth 09:36:37 anyone know the JonesForth tutorial thing? someone should make one of them, but a self-hosting x86 thing 09:36:44 i.e. it boots up, no linux required 09:39:52 --- quit: H4ns (Read error: 110 (Connection timed out)) 09:53:50 =) 09:54:34 --- quit: malyn (Remote closed the connection) 09:56:24 --- join: malyn (i=malyn@gateway/tor/x-2a7dbabe095047af) joined #forth 09:58:13 oh well 10:02:08 ehird1: some people get excited about self-hosting 10:02:19 it's not the most practical thing though 10:03:02 still, it'd be quite nice to have a tutorial that goes from just out of the BIOS to a forth prompt 10:03:12 it would literally describe everything about a system 10:04:43 ehird1, you might could get a similar effect of such a tutorial here at... http://www.karig.net/os/ 10:33:00 You'd end up with a jack-of-all-trades tutorial. 10:33:12 --- nick: TreyB_ -> TreyB 10:33:13 --- join: H4ns (n=Hans@p57A0E50A.dip.t-dialin.net) joined #forth 10:33:17 TreyB_: jonesforth is pretty jack-of-all-trades 10:33:29 basically the only thing missing is that it doesn't include bootup code and it uses iirc 3 linux syscalls 10:36:43 You could get close with some BIOS I/O words and a copy of grub. Have at it :-) 11:17:14 --- join: ruediger (n=the-rued@chello062178150152.7.14.univie.teleweb.at) joined #forth 11:20:47 --- quit: Quartus__ (Read error: 104 (Connection reset by peer)) 11:28:18 --- part: ehird1 left #forth 11:35:14 --- join: Quartus__ (n=Quartus_@205.205.50.2) joined #forth 11:51:19 --- join: geartooth (n=w@CPE00195b252b77-CM001a666a6e78.cpe.net.cable.rogers.com) joined #forth 12:01:19 --- quit: wossname (Read error: 113 (No route to host)) 12:04:16 --- quit: malyn (Remote closed the connection) 12:06:58 --- join: malyn (i=malyn@gateway/tor/x-b550cea7f8a61d8d) joined #forth 12:16:00 --- join: arke_ (n=arke@p54A7E0B6.dip.t-dialin.net) joined #forth 12:20:00 --- join: snoopy_1711 (i=snoopy_1@dslb-084-058-151-228.pools.arcor-ip.net) joined #forth 12:27:08 --- quit: Quartus__ (Read error: 104 (Connection reset by peer)) 12:28:07 --- quit: Snoopy42 (Read error: 145 (Connection timed out)) 12:28:13 --- nick: snoopy_1711 -> Snoopy42 12:30:22 --- join: ygrek (i=user@gateway/tor/x-8213d79d7f9f7ba6) joined #forth 12:37:26 --- join: timlarson (n=timlarso@user-12l37rb.cable.mindspring.com) joined #forth 12:42:56 --- join: Quartus__ (n=Quartus_@205.205.50.2) joined #forth 12:57:13 --- join: linxu (n=gav@147.21.16.3) joined #forth 13:05:32 --- join: alexshendi (n=alexshen@dslb-088-067-080-012.pools.arcor-ip.net) joined #forth 13:35:15 --- quit: Raystm2 ("Should have paid the bill.") 13:36:25 --- join: C0ltZs1 (i=Unix@74-132-210-197.dhcp.insightbb.com) joined #forth 13:48:43 --- join: saon (n=saon@207.138.42.211) joined #forth 13:54:57 --- join: doublec (n=doublec@202.180.114.137) joined #forth 14:09:32 oin ##forth 14:09:46 Sorry 14:12:07 --- part: alexshendi left #forth 14:36:47 --- quit: ygrek (Remote closed the connection) 14:46:44 --- join: Al2O3 (n=Al2O3@207.190.0.11) joined #forth 14:57:25 --- quit: Al2O3 () 15:01:12 --- nick: arke_ -> arke 15:09:44 --- quit: JasonWoof (Read error: 104 (Connection reset by peer)) 15:09:52 --- join: JasonWoof (n=jason@c-71-192-28-153.hsd1.ma.comcast.net) joined #forth 15:09:52 --- mode: ChanServ set +o JasonWoof 15:14:16 --- quit: saon ("Lost terminal") 15:27:31 --- quit: C0ltZs1 (Remote closed the connection) 15:29:17 --- join: Sieur_de_Bienvil (n=cuss@user-1120bda.dsl.mindspring.com) joined #forth 15:30:27 --- quit: geartooth (Read error: 110 (Connection timed out)) 15:30:36 I am writing a portal based indoor 3D engine in forth and I was wondering if anyone new of 15:30:41 Oops. 15:30:49 I tried to delete that. 15:31:26 You violated your company's NDA. This incident will be reported. The authorities are on their way now. Please stay where you are, and this will be over quickly. ;D 15:31:38 lol 15:32:18 So I violated an agreement with myself? 15:32:28 I new I shouldn't have trusted me. 15:35:45 Anyway, all the examples of portal based engines that I have seen have had a lot of data structures, nad I was wondering if I could cut down on any of them. 15:36:02 ' 15:37:03 hmm...that's a pretty domain-specific question. I'm not knowledgable in that area. :/ 15:37:49 Yeah... has anyone ever written a FPS in Forth before? 15:38:30 Most Forth applications tend to be deep-embedded applications. I'm not aware of anyone writing any modern game in Forth. 15:39:27 Ok, so when I have finished mine I should post a how to somewhere. 15:39:39 That would be pretty cool, actually. 15:40:07 * kc5tja has been considering starting some kind of CPAN-clone for Forth; this kind of thing would be nice to have. 15:41:02 I mean, Python has python.org, CPAN is for Perl, Haskell has Hackage... 15:41:21 Yes, Forth needs one. 15:41:29 It seems to me that most of the widely successful languages have some kind of centralized repository of packages. 15:42:28 That seems like a great idea. As it is, you have to troll/Google the net for Forth examples, modules, etc. 15:42:35 They also follow the CS party line that was urrent when they were made. 15:43:11 Some sort of "official" module words would make such a site even more useful. Something like Quartus Forth's module .. end-module, for example. 15:43:29 --- join: heraclitus (n=heraclit@sa-184-26.saturn.infonet.ee) joined #forth 15:43:38 I think they have the repositories because they are mainstream and not vice-verca. 15:43:46 And yes that would be nice. 15:44:07 Not sure how Quartus' module system works. I know that GForth has a REQUIRE word that is smart enough to not doubly-import a module. 15:45:25 Here's the source for Quartus Forth's module words: http://nealbridges.com/source/modules.fs 15:45:49 I haven't used GForth's module system, so I cannot compare the two unfortunately. 15:46:31 That's easy. Check if the MARKER word for the module is defined and if so skip to the end of the module. 15:46:33 i think they have repositories because they are mostly 'single implementation' languages 15:46:36 and so it's easier to share code 15:47:02 That helps. 15:47:22 Maybe a Forth forum? 15:47:45 Sieur_de_Bienvil: I think GForth won't even bother reading the file. 15:48:17 When you REQUIRE a file, it will create a word that stands as a flag indicating it's been required. Then, if that word already exists, it won't bother INCLUDE-ing the file. 15:48:35 Ah. That means it keaps a list of INCLUDEd files and doesn't reinclude them. 15:49:22 brb 15:49:31 Ok. 15:51:31 Is there a tutorial anywhere on when, where, and how to use datastutures in Forht? 15:53:28 Aside from Thinking Forth, which didn't really cover 3D engines. 15:55:40 is thinkin forth ok for beginners? 15:57:05 Sure, although reading Starting Forth first might be a good idea. I think that Thinking Forth is great for everyone, BTW, not just Forth programmers. 15:58:39 Of course it is. I have print copies of both. 15:59:39 2nd edition Starting Forth, and the 1st edition of Thinking Forth. 16:00:11 back 16:00:43 * kc5tja wishes the publisher would stop trying to horde a dead book. 16:00:52 And allow Leo to go open source with it like they have with Thinking Forth. 16:01:29 I know, the online one suks without the Illustrations. 16:02:01 And the updated bits aren't that well written. 16:02:46 The thinking forth PDF, however, is wonderfull. 16:05:40 Anyway, I decided to start out relatively simple and start with rooms that are 2D polygons with variable height floors and ceilings. 16:06:24 damn 16:06:29 publisher won't let him 16:06:40 thatas wak 16:07:05 They will be rendeed in true 3D but they are a lot easier to work with than a full 3D polygons for rooms. 16:09:24 --- quit: forther ("Leaving") 16:13:49 forth is nice, easy to implement, but not the easiest to implement... my actsl compiler is less than 300 lines of c code... 16:14:44 Wow, three hundred lines? Does it optimize? 16:15:02 no of course 16:15:28 Then no it isn't easier to implement than Forth. 16:16:54 can you write forth compiler in less than 300 lines, of normal code? i don't think so, my compiler is as minimal as a compiler can be... 16:17:22 Yes I can, but I wouldn't do it in C. 16:18:46 such code mainly consists of assembly instructions, there is no room for much else... 16:20:09 but the language is somewhat similar to forth, at least it's reverse polish... 16:21:03 hm 16:21:17 any docs on howto use colorforth? 16:21:41 no i don't think you can, already parentheses in forth need more code... 16:24:43 the function calls don't happen as in assembly, in assembly the arguments would be pushed into stack... 16:26:31 --- quit: Off_Namuh72 (Read error: 104 (Connection reset by peer)) 16:36:19 linxu, check colorforthray.info for some notes on using colorforth 16:41:19 --- quit: Sieur_de_Bienvil (Read error: 101 (Network is unreachable)) 16:41:59 --- join: Sieur_de_Bienvil (n=cuss@user-112076m.dsl.mindspring.com) joined #forth 16:42:04 --- join: tgunr_ (n=davec@70-41-240-186.cust.wildblue.net) joined #forth 16:42:09 Bak. 16:42:45 wher abouts? 16:42:56 colorforthray.info ? 16:43:03 Now when you said Paens already take more, you didn't actually mean that parenheses take more than 300 lines to implement did you? 16:45:13 ohh i hate doctrines, they force them on you, so many, but everything must come from the properties of the computer, be self-evident, not someone's fantasy... 16:46:37 Um... I must of missed something when my connection dropped. 16:46:51 no parentheses don't take 300 lines, but parentheses always need some parsing... 16:47:34 Forth is the simplest possible language compiler possible. 16:47:45 What makes it not-the-easiest-to-implement is the vocabulary for it. 16:47:51 Yeah, you read the input char by char and DROP it until you reach a left paren. 16:47:53 The smaller the compiler, the larger its library. 16:47:59 Yep. 16:48:33 Paren is a loop. 16:49:16 2 lines at most if it is a colon def. 16:49:24 Probably less. 16:49:37 1 1/2 lines. 16:50:22 Lets see, do you want the < 300 line forth ompiler to be ITC, DTC, or STC? 16:50:37 : [ state on begin word find dup 0< if drop execute else 0> if compile, else number literal then then state @ until ; 16:50:44 That is ANSI Forth's compiler. :) 16:51:21 Yes, but I was going to go farther and implement everything up to QUIT. 16:51:22 Literally everything else is some word to be compiled or to be executed during compile-time. 16:51:58 Yeah. I was just making the point that there is a trade-off between the complexity of the compiler and the complexity of the language's standard library. 16:51:58 larger library? actsl can use c library fuctions and posix fuctions, cannot forth do that? 16:52:17 heraclitus: forth's dictionary is its standard library. 16:52:32 Many Forth's offer some form of foreign function interface to invoke C functions. 16:52:41 GForth I know for sure, as I've used it to code SDL applications before. 16:52:52 It's not documented worth a damn though. 16:53:14 Almost any Forth can call the C standard library if you want. 16:53:32 Especially if it has an assembler you can depend on. 16:53:43 If it doesn' you an ad one. 16:54:08 Sorry, my keyboard is screwing up. 16:54:12 yes, assuming you know how the dictionary's memory layout works. Most Forth systems ship at least with that though. :) 16:54:38 GForth is a notable exception -- I've not seen a satisfactory amount of documentation on how the dictionary internals work. 16:54:42 On the subject of the ANS Forth compiler, is there a way to compile runtime-accessible data into a definition? I have a CREATE..DOES> word that basically acts like a counter, but I only ever define a single instance of that counter. I am wondering if I can bypass CREATE..DOES> and just tuck the counter's state into the word itself. 16:54:59 what is so different then in calling forth functions (or words or whever)? c functions are the most simpe, the arguments would be pushed into stack, and function called, exactly how it's done in assembly... 16:55:15 malyn: I'd need to see how it'd be used in an ideal situation before I can answer that. 16:55:30 heraclitus: Forth functions are simpler. 16:55:42 In Forth you don't need stack frames. 16:55:44 Forth defines a two-stack runtime environment: one stack is used for data, one used for return addresses. 16:55:57 as a result, you have no need for stack frames, no need to clean up the stack afterwards, etc. 16:56:33 Forth also exposes the return address stack to the programmer, allowing for things like partial continuation manipulation, so you can implement multitasking and whatnot trivially, right from within the language itself. 16:56:55 you don't need stack frames even for calling c functions, you need them only for compiling a function, when the function has local variables... 16:56:58 It wasn't until Scheme that this was implemented in another language, and even today, "high level" continuation management is a black art. 16:57:00 A lot of Forths come with muli-tasking. 16:57:26 kc5tja: Something like this ": makecounter CREATE 0 , DOES> DUP 1 SWAP +! @ ;" basically, but without needing to then "makecounter myonlycounter" right after it. 16:57:40 heraclitus: Sometimes. If your CPU has enough registers, you can pass everything in registers, and be done with it. 16:57:58 i.e. ": myonlycounter 0 , DOES> DUP 1 SWAP +! @ ;" for example (which obviously doesn't work). 16:58:13 heraclitus: However, if you need to take the address of a passed parameter (something that happens more often than you think in OS-level code, for example), you have to pass it on the stack. 16:58:50 malyn: How would this be used though? In a semi-real-world example, how would this be used? 16:59:00 malyn: If you can paste something on pastebin.ca that would help me out. 16:59:45 i386 has only 4 general purpose registers, and these are used for so many things that it hardly ever makes sense to use them to pass arguments... 16:59:59 Sieur_de_Bienvil: Yes, but the property of being able to use "intelligent return address" munging is something that no other language can provide except the likes of functional programming languages, and even then, only very recently. 17:00:20 heraclitus: 7 actually; EAX, ECX, EDX, EBX, ESI, EDI and EBP are all general purpose in 32-bit mode. 17:00:33 But, you're correct, the runtime environment makes extensive use of them. 17:01:02 does forth have local variables? and if it has, then how can they be implemented without a stack frame? 17:01:12 Nonetheless, the Linux API passes parameters and results using registers alone -- it doesn't touch stack frames directly (if it does, you pass an address explicitly to whatever is on the stack) 17:01:25 Forth does not have local variables. 17:01:39 There is an extension wordset called LOCALS| that implements them on the return stack. 17:01:41 Push on the reurn stack, but local variables aren't realy needed. 17:01:47 However, they're not part of Forth as such. 17:02:18 kc5tja, only EAX, ECX, EDX, EBX are truly general purpose, and even these are each special in some way... 17:02:34 heraclitus: If you use older instructions from the 16-bit processors, yes. 17:02:57 * kc5tja has been coding assembly language for years... ;) assembly is one of my favorite ways to code. 17:03:26 But, I'd like to offer a counter-point too, that specific purpose registers are damn handy to have too. :) 17:03:28 Me to but I dont know x86 assembly, and I just stared to learn Z80. 17:03:43 Im sure they are. 17:04:00 assembly? 17:04:05 how does one learn assembly? 17:04:32 Well for starters google Assembly Language Tutorial. 17:04:33 kc5tja, no 32, like, i found that there is no way to do a shift, without using ECX... 17:04:52 kc5tja: The word in question checks its internal state and then outputs a number that is used as the limit of a DO..LOOP. The limit has to change based on the previous values returned by the word. It's generator, basically. You could envision a similar word that creates unique id values; each time the word is called a new value is returned. As I said, this works fine with CREATE..DOES>, but it requires me to immediately define the target wo 17:06:24 Hhm... that's a toughy. 17:06:39 --- quit: gnomon (Remote closed the connection) 17:06:55 I think it depends on how your Forth does loops. 17:06:58 forth has no local variables? then how is it better than my actsl, which also has no local variables (this is because i wanted to make it very minimal, without a symbol table) and has stack which can be used to pass arguments... 17:08:01 WOuld anyone code the Space Shutle computer using you actsl compiler? 17:08:47 And Forth has 2 stacks remember? That makes a big difference. 17:09:09 but it's quite easy to add symbol table, and also floating point variables, but the code may then be extremely large, 600 lines instead of 300 lines... 17:09:36 and so large code is horrible... 17:10:27 Lol, Forth has a dictionary, and you can add floaing point in much less than that. 17:10:29 --- join: arcus (n=Miranda@130.195.209.73) joined #forth 17:10:46 no one would use any programming language for programming shutle, which is different from the doctrines... 17:11:05 They used Forth for the Shutle. 17:11:15 is gforth and starting forth on linux a good learning combo? 17:11:23 or is there another forth I should learn. 17:11:28 dictionary is the same as symbol table, and this makes compiler larger... 17:11:30 I have a linux box .. 17:11:55 It's not a bad combo. and it only hads a handful of lines of code. 17:12:06 The ditionary I mean. 17:12:37 yes it's handful, but 300 lines is itself handful... 17:13:07 No, 16-32 lines is a handful, 300 is madness. 17:13:17 Madness? 17:13:41 This... is.. Sparta! 17:13:48 Sorry... 17:13:55 Couldn't help myself. 17:14:18 linxu: I'm just starting with forth myself, and wiser heads than mine have recommended gforth to me. 17:14:27 300 is a bucket O'code. 17:14:58 And yes use GForth to start with. 17:15:40 On Linux anyway, on windows use Win32Forth. 17:16:14 --- join: wossname (n=w@CPE00195b252b77-CM001a666a6e78.cpe.net.cable.rogers.com) joined #forth 17:16:20 And on the Mac use Mops. 17:17:01 ok 17:17:11 I have the interpreter saying 'ok; 17:17:14 'ok' 17:17:15 lol 17:17:20 ok this book is awesome 17:17:24 very easy to read so far 17:17:26 :) 17:17:29 That means that i did what you old it to with no errors. 17:17:38 --- quit: cmeme (Excess Flood) 17:17:40 now onto 15 SPACES 17:17:42 :) 17:17:43 It is a wonderul book. 17:17:54 and forth can do anything? 17:18:00 Anything. 17:18:01 heraclitus: SHL EAX,5 works just fine for me. 17:18:06 cool 17:18:13 Unless you mean to shift by an amount not known at assemble-time... 17:18:17 well, then you may look at the actsl code http://groups.google.com/group/comp.compilers/browse_thread/thread/df960282039f6762/105068d0fa7df5c6#105068d0fa7df5c6 and say what forth-like improvement would make the code shorter... 17:19:00 kc5tja, nut then try shift where the second argument is also register... 17:19:44 but 17:20:16 --- join: cmeme (n=cmeme@boa.b9.com) joined #forth 17:20:20 heraclitus: Yeah; if the second argument needs to be ECX in that case. But, how often does this happen? 17:20:25 As it is the custom, this description should also include the Hello 17:20:25 World program written in actsl language. Here it is: 17:20:25 int nul 17:20:25 fun main 17:20:25 "Hello World!\n" arg call printf ref nul = 17:20:26 0 return 17:20:28 endfun 17:20:30 Unless you're working with graphics code, not often, I think. 17:20:52 s/if// 17:21:03 In Forh it is : Hello CR .( Hello, world.) ; Hello 17:21:18 .( is an immediate word. 17:21:20 Use this instead: 17:21:27 : hello-world ." Hello, world!" cr ; 17:21:52 Thanks I meant o use ." but I was thinking about just typing it in on the ommand line. 17:22:11 However, actsl has something Forth doesn't -- the ability to represent a string object as such on the stack. That's pretty dang useful. :D 17:22:14 : Hello CR ." Hello, world!" ; Hello 17:22:15 kc5tja, it is when you write a compiler, there are a number of standard operators, which should work with both arguments variables, and shift is one of them... 17:22:30 You can do hat in Forth. 17:22:35 --- join: edrx (i=edrx@189.25.174.202) joined #forth 17:23:08 Sieur_de_Bienvil, such print function is not posix ;) 17:23:10 Sieur_de_Bienvil: I'm not talking about (caddr u) representation. That's valid, but it's two separate entities. And, there's no GC, so you almost never can use more than one string constant on the command-line, for example. 17:23:17 Not saying it's bad, it's just something to be aware of. 17:23:34 But, then again, with a CPAN-like thing, if this becomes an issue, we can at least recommend a module that addresses the problem. 17:24:43 and the best part is ref nul = :) 17:25:03 I'm actually curious about that. What exactly does that do? 17:25:47 --- part: edrx left #forth 17:26:29 kc5tja, this does reference variable nul, and assign all the previous expression to it, to empty stack... 17:27:15 we can just type QUIT or a nonsense word like 2ifm. 17:27:41 because this language has minimal rules, there is no operator to empty stack, which i'm sure forth has... 17:28:29 and no implicit emptying stack, all implicit rules make the compiler bigger... 17:28:42 Atl doesn't have minimal rules, Forth has no rules. 17:29:36 yes it certainly has, every language has rules... 17:30:36 Anyone want to field that one? I have to make dinner. 17:30:44 bbl 17:33:29 ohh sorry, i tortured you... but there are no miracles to make this compiler smaller :) 17:34:34 Nope; Forth has no operator to empty the stack. But it does have DROP, which drops the top element, and QUIT, which resets the state of the runtime environment (in case there is an error that corrupts the stack, for example). 17:34:54 But QUIT will completely abort any running program. 17:35:39 Forth has only one rule: all words do something. 17:35:41 That's the only rule. 17:35:53 --- join: Off_Namuh72 (i=GPS@gateway/tor/x-e28268c47d088685) joined #forth 17:36:48 It is this approach towards words that allows Forth to take on strings via the S" word. It looks kinda sorta like a normal quotation, but in reality, S" is a real, honest to goodness parsing word. 17:41:23 actsl has a separate data stack, it's not the processor stack, so when the program quits, the stack would be abandoned, with no harm to processor stack... 17:57:38 --- quit: arcus (Connection reset by peer) 17:57:51 --- join: gnomon (n=gnomon@74.210.55.230) joined #forth 18:08:37 --- quit: ruediger ("This computer has gone to sleep") 18:10:07 --- join: tosvar (n=ziggurat@pool-71-164-227-62.dllstx.fios.verizon.net) joined #forth 18:22:03 Ditto for Forth. 18:22:16 In GForth, both the return and data stacks are separate stacks. 18:22:31 In the Forth systems I create, the CPU stack is the return stack (since that lets me use subroutine threading). 18:24:24 gforth is for gcc? 18:24:43 gforth is built with gcc 18:34:54 Yeah. GForth is just a plain-vanilla, direct-threaded or indirect-threaded (depending on your build configuration; I think it defaults to direct threaded) Forth implementation. 18:35:06 (In)direct threading has nothing to do with multithreading, BTW. :) 18:38:01 brb 18:45:43 back 18:46:20 --- join: arcus (n=Miranda@130.195.209.73) joined #forth 18:53:27 if you can get the size of the stack, it would be trivial to write something to empty the stack using DROP, though. 18:53:37 and you can get the size of the stack 18:53:42 at least in some Forths 18:53:52 I forget the name of the word, though. 19:01:43 --- quit: tgunr_ (Read error: 104 (Connection reset by peer)) 19:02:30 DEPTH 19:06:34 Yes, I'm aware of that. 19:07:14 ASD usually clears the stack as well. 19:18:24 * kc5tja alters KestrelForth to include a word ASD that populates the stack with 1000 arbitrarily chosen integers... 19:18:27 --- join: arke_ (n=arke@p54A7E0AF.dip.t-dialin.net) joined #forth 19:19:04 But, there again, like I said above, you must resort to QUIT (which the 'word not found' error handler calls upon via the abort" word) to reset the stack state. 19:19:34 that sounds very metal when you put it that way :] 19:20:44 that 'depth' sounds very metal when typed as a single response all in caps? 19:21:05 --- join: Al2O3 (n=Al2O3@dsl-216-66-236-3.static.linkline.com) joined #forth 19:21:27 DEPTH isn't standard, though, is it? 19:21:34 yup 19:21:37 wait -- yes, it's standard 19:21:40 sorry, misread that 19:23:23 DEPTH is in CORE 19:24:00 The standard states that only uppercase names are officially standard. 19:24:10 Support for mixed-case or lower-case names is implementation specific (though most support it) 19:24:46 In fact it states that all standard words must be findable if specified in all caps 19:24:54 * kc5tja nods 19:25:04 It doesn't preclude anything else 19:25:06 --- join: KNY (n=KNY@samp.rh.rit.edu) joined #forth 19:25:28 That means your Forth environment can perform language translation via Babelfish to find the real implementation if it needed to -- it'd still be standard. :D 19:25:34 why is the line ". variable x" giving me "Undefined word" (on the x) in gForth? 19:25:48 not enough context, kny 19:25:52 what are you trying to do? 19:26:03 take . and store it in x 19:26:14 VARIABLE just declares a variable. 19:26:17 what is . 19:26:22 It doesn't assign anything. 19:26:39 Here's a snippet: 19:26:41 variable x 19:26:42 5 x ! 19:26:43 x @ . 19:26:47 kc5tja, just "variable x" fails 19:26:50 same problem 19:26:58 Not on my GForth it doesn't. 19:27:00 Start Gforth; type variable x 19:27:04 if I enter into the interpreter, it works but if I include a file, it fails 19:27:05 press enter 19:27:21 sorry, I got distracted when typing that minor detail 19:27:25 Can you pastebin the file you're working with? 19:27:27 Paste the file into the pastebin from the topic 19:27:34 will do; give me a second 19:28:04 Shoot -- I somehow lost the link to the implementation fo Quartus Forth's module words. 19:28:13 Sieur_de_Bienvil: Can you re-post the link you found earlier? 19:28:50 (I think it was Sieur_de_Bienvil at least0 19:28:52 http://nealbridges.com/source/modules.fs 19:29:02 Ahh, yeah, I suppose I could ask the AUTHOR... ;D 19:29:11 Thanks. 19:29:54 http://forth.pastebin.ca/747497 19:30:16 as I suspected 19:30:26 you're doing things inside a : ; that don't belong there 19:30:36 do 19:30:37 variable x 19:30:45 : vartest 5 x ! x @ . ; 19:30:51 ah-ha 19:30:52 --- join: arcus_ (n=Miranda@130.195.209.73) joined #forth 19:31:22 --- quit: arcus (Nick collision from services.) 19:31:27 --- nick: arcus_ -> arcus 19:32:55 So, I'm not seeing how this works. 19:33:05 I know it works by way of wordlist creation and manipulation. 19:33:13 But, when create-wordlist is invoked, does it create only ONE wordlist, or two? 19:33:41 One 19:36:34 --- quit: arke (Read error: 110 (Connection timed out)) 19:36:35 --- nick: arke_ -> arke 19:37:07 I guess I don't see how private words are kept separate from public words then. 19:37:25 The private words are in the newly-created wordlist. 19:39:03 Right. And the public words just get dumped into whatever vocabulary you happened to be in prior to calling begin-module or module, right? 19:39:10 Right. 19:39:12 (if I'm understanding the code correctly) 19:39:30 So, in order to properly partition the namespace, you must use both vocabularies AND modules. 19:39:31 Only the public words see the light of day, unless you later expose the private words of a module 19:39:42 ... no, you can just use modules 19:40:01 But both are available 19:40:05 I don't see how, if all words in a module just get dumped into whatever vocab you were in first. 19:40:13 vocabulary foo 19:40:15 module bar 19:40:15 ... 19:40:18 module baz 19:40:19 ... 19:40:27 the public words of bar and baz will appear inside foo 19:40:42 Well, you didn't switch to foo, but I take your meaning. 19:41:03 Yeah, I should have said also foo definitions too, but... 19:41:23 Yes, and in fact if you created no vocabulary, they'd wind up in whatever your default wordlist happens to be. 19:41:44 * kc5tja is just thinking (though I shouldn't be) about how I'd perhaps employ this in a CPAN-clone for Forth. 19:42:26 Now, if I just execute: 19:42:27 bar 19:42:38 then I'll have access to the guts of bar because that's added to my wordlist. 19:43:14 I think I see how this fits together now. :) 19:43:50 It works pretty well for what it is. 19:44:23 * kc5tja will have to tinker around with some of my ideas. 19:46:36 Well, I'm going to head home. There is nothing for me to do here at work any more. I'm blocked on pygdchart2 retardation, and I am just sitting here, waiting for a response to my e-mail. *sigh* 19:47:06 OH, I need to send one more e-mail out...THEN...it's bike time. 20:04:22 --- quit: arcus (Connection reset by peer) 20:09:50 Quartus: Are you still around? I have a question about a Quartus Forth app that I am working on (although at the moment I am testing this particular piece of code on my desktop). 20:11:39 --- quit: Al2O3 () 20:13:01 hi 20:13:09 More in body than spirit, but go ahead :) 20:13:56 Hehe... thanks, I appreciate the help. :) 20:15:31 In a nutshell, I have a defining word that basically creates a counter. When called, the word pushes a value onto the stack and updates some internal state. It's basically a generator. In any event, I only create a single instance of this word. Is there some way in ANS Forth to just create a normal word that has a bit of state inside of it? Something like ": COUNTER [ 0 , ] DOES> DUP 1 SWAP +! @ ;" for example (which doesn't work, of cours 20:15:48 a normal word? 20:16:05 why would you not do this with CREATE ? 20:16:09 Right. 20:16:27 Ah, you were asking what I meant, I guess. A plain colon definition, not a defining word. 20:16:56 If you want to store data in association with a definition, you want a defining word that calls CREATE. 20:17:02 I can, and I do at the moment, but since I only have a single instance of the word I thought that it might be cleaner to not create a defining word for the singular purpose of creating one other word. 20:17:16 In that case you'd need a variable, which is to my mind the messier solution. 20:17:32 The CREATE..DOES> version of my example looks like this of course ": makecounter CREATE 0 , DOES> DUP 1 SWAP +! @ ; makecounter counter" 20:17:51 Yeah, that's how I felt as well. 20:18:00 It's a bit clumsy, storing and then fetching, but looks like it'll work. 20:18:20 So the proper Forth solution is in fact to just CREATE..DOES> a defining word and then use that for the "real" world that gets called through the code? 20:18:46 I'd use create/does>, though I'm not sure what you mean by the last bit 20:19:52 My example is more complex than the one I provided, but I basically only need a single instance of that generator word. In other words, I am only every going to "makecounter" a single counter. My goal was to see if I could eliminate the defining word and just use a normal colon definition, but one that pokes into its own parameter field to get at its internal state. 20:20:21 um, er, you're assuming an internal model in which code definitions are in dataspace, and writable 20:20:42 Ah, that's good a point. 20:20:57 If you associate a cell in dataspace with the definition, at best you'll be managing to duplicate most of what create/does> already does quite nicely 20:21:02 I suppose that CREATE doesn't guarantee that behavior. Which probably explains why I am having so much trouble abusing the system to get what I want. :) 20:21:12 I don't follow. 20:21:37 CREATEd words always have an associated address in writeable dataspace. 20:26:04 Sorry, I was responding to your comment about writable definitions re: trying to avoid CREATE. 20:26:25 But yes, it seems like CREATE..DOES> is the way to go. I wasn't sure if I was just missing a Forth idiom that allows for the creation of generators. But apparently CREATE..DOES> is that idiom, even if it is only used once. I was trying to avoid creating superfluous definitions in other words. 20:27:27 "in other words" not referring to Forth words, of course. 20:30:19 Quartus Forth words don't even have parameter fields, as such. 20:30:50 As an aside, is there a preferred way to write something like this (going back to your "storing and fetching" comment)? "DUP @ 1+ TUCK SWAP !" comes to mind, although feels roughly the same..? 20:31:47 Well, that definitely is a vote in CREATE..DOES>'s favor then. 20:32:17 autoincrementing constants -- : counter create , does> dup @ 1 rot +! ; does the trick, I think -- 5 counter moo moo . moo . moo . -> 5 6 7 20:35:28 That does seem a bit simpler. You're returning the pre-increment value, which avoids the fetch-and-store. 20:37:17 Well, it's not just Quartus Forth; it's not necessary for a Standard Forth to follow any particular historical layout for headers. Implementation techniques are wide open. So t0 write code which is portable to other Standard Forth systems, you want to adhere to defined behaviours. 20:37:29 Thank you again for the help! I am working through a Quartus Forth app that I built about a year ago and refactoring it so that it actually looks like Forth code (instead of the C-style code that it somehow managed to become). 20:37:46 Glad to help :) 20:37:57 Sorry I'm not at my sharpest this evening. 20:38:37 I absolutely agree. My example was somewhat contrived; mostly I was trying to see if there was an angle to Forth definitions that I was not aware of. 20:38:49 No worries, your answer made perfect sense and was very helpful. :) 20:38:52 --- join: Al2O3 (n=Al2O3@63.139.148.74) joined #forth 20:38:54 If it comes down to wanting to fiddle with internals, there's likely a simpler solution. 20:40:37 That was part of the confusion. I wasn't able to determine if I was attempting to fiddle with the internals or not. My assumption was that DOES> was more of a reusable word and not as tightly coupled with CREATE as it appears to be. In other words, any colon word could be DOES>'d and some data stashed into the dictionary. That appears not to be the case, and for good reason as you pointed out. 20:41:19 Right. DOES> is for CREATEd words; in some systems it may do something meaningful with other definitions, but it is in no way required. 20:41:25 You can't depend on that, in other words. 20:42:22 And portability is a boon, so you want to stay with what you can depend on. 20:42:34 Right, that makes sense. I wonder if the ANS spec would have steered me clear of that path; I was most recently referencing the Forth Programmer's Handbook and assumed it was fairly ANS-ish. 20:42:51 I haven't reviewed the most recent version. 20:42:58 The Standard is a useful reference. 20:43:12 Agreed. It is nice to be able to test my code in various environments as well as to pack around my small set of library words. 20:43:42 --- quit: Al2O3 (Client Quit) 20:43:54 --- join: forther (n=forther@c-67-180-150-67.hsd1.ca.comcast.net) joined #forth 20:44:12 Yep, I usually keep a copy open in my web browser, but the index in FPH is convenient for looking up stack effects. Since I am still getting started with Forth, that sort of thing is nice extra. 20:44:44 As I recall FPH had stuff in it that was specific to Forth, Inc. systems; perhaps that's less true in the newer revision? 20:45:32 In any event, my application is looking much better now that I have started making a real effort at refactoring the definitions. I am pushing very hard to stay in the ~7 word definitions and the results are very rewarding. You have to adjust your thinking a bit to make that happen, but that's what attracted me to Forth in the first place. 20:45:53 It's good exercise for the thinking processes. :) 20:46:23 Hmm... I have the 2nd edition (1999), which seems fairly platform-neutral, although I am probably not the best judge of that sort of thing at this point. 20:47:10 That may be the one I looked at. 20:47:15 --- join: Al2O3 (n=Al2O3@63.139.148.74) joined #forth 20:47:32 My copy is not here presently. 20:48:16 Yep. I read Thinking Forth a number of years ago and it really clicked with the feelings that I had about software design. It was clear that I had to find as many ways to use Forth as possible. Sadly I haven't found as many outlets for Forth as I would like, but I have to credit Quartus Forth with giving me most of the ones that I do have. QF is really a great platform for experimenting as well as building useful apps. Kudos to you for all 20:48:31 Thank you kindly! :) 20:49:50 My pleasure. 20:51:03 Thanks again for the help. I'm off to wrap up a few things before I turn in for the evening. 20:51:14 Ok. Take care. 20:51:57 back 20:52:14 You too. 20:56:59 --- quit: heraclitus ("Leaving.") 21:04:25 --- quit: Al2O3 (Read error: 113 (No route to host)) 21:14:39 if I have a memory address on the stack, how can I execute what's at that location? 21:15:24 If it is an address of a chunk of Forth code, you can just push it onto the return stack using R> and then EXIT. 21:15:48 If it is an execution token (something you'd get from ' or [']) then you use EXECUTE. 21:16:05 EXECUTE seems to be what I'm looking for, thanks 21:16:19 If it's some random, arbitrary piece of machine language code, then that's usually Forth specific. Some work fine with EXECUTE, others need the R> EXIT approach, and still others might use something else. 21:16:36 n/p 21:16:37 nah, just basic word outputs 21:16:38 thanks 21:18:29 FEARS: Forth Entheusiast's Archive of Re-usable Stuff. 21:18:37 I *LIKE* IT! 21:19:07 Must record thoughts... 21:26:38 Back 21:27:11 kny, bear in mind an xt is not necessarily a memory address 21:27:35 an xt? 21:28:06 : foo 5 . ; ' foo . -> some-number shows here 21:28:20 EXECUTE will run foo from that number 21:28:26 but that number is not necessarily an address 21:28:28 I have full control over what the words are :) 21:28:40 You're not following me. 21:29:50 I think what he means is, it's his Forth, and his ' puts an address on the stack. :) 21:30:05 if it's his, I daresay he'd know what EXECUTE is for already 21:30:27 Good point. 21:30:55 An execution token or XT is an id for a word. 21:31:11 ah 21:31:23 Execue akes that id and exeute the worde it idenifies. 21:31:39 It may or may no be te address of the word. 21:31:42 just so, and while it may be an address in some implementations, it could quite easily and reasonably be something else entirely. 21:32:32 Quartus, good point, but that's beyond the scope of this homework assignment :) 21:32:44 But he only reason that I personally would make i somehing oher han an address is if I had a really small address space. 21:33:01 Just trying to assist you in your understanding, as you did ask how to execute something at a location. 21:33:10 Sorry, my keyboard doesn' always noie when I press a key. 21:34:20 Quartus, I'd say you were [reasonably] successful, though I'm very new to Forth 21:34:33 Sieur_de_Bienvil, sounds like a new keyboard is in order 21:35:28 Sieur_de_Bienvil, even if an xt is an address of some kind, two words might share the same xt, or other conditions might apply 21:35:43 Speaking of small address spaces, the sound processor on a SEGA genesis is a Z80 wih 8k of ram and I was wondering if I could fit a Forth in there without token threading. 21:35:59 I didn't say it was a uniwue id. 21:36:04 *unique 21:36:59 I think there is somehing stuck under my keys. 21:37:27 I am oing o lean my keyboard over the weekend. 21:37:39 why would 2 words ever share an xt 21:37:53 They may have identical semantics. 21:37:58 Because you needed o names for he same thing. 21:38:07 *two not o 21:38:12 oh right, words, not definitions 21:41:26 Can I fit a Forth in 8k and still ave room for real time sound processing? 21:41:50 depends on what you mean by forth, and what you mean by real-time sound processing 21:43:04 you can fit a simple Forth in 8k, but if 8k is your lot, you won't have a lot of spare RAM left over for whatever 21:44:40 I would like to be able to test and modify my sound engine in real time and I was going to tether it so the dictionary doesn't have o be in the Z80 address space. 21:44:43 "It is commonly understood, even by technically unsophisticated computer users, that if you have a piece of software that works on your Macintosh, and you move it over onto a Windows machine, it will not run. That this would, in fact, be a laughable and idiotic mistake, like nailing horseshoes to the tires of a Buick." 21:45:11 And it is for some homebrew Genesis games. 21:46:00 That depends, which Mac did it run on, and what PC are you using? 21:46:48 I can emulate a Quadra running system 7.5 on my machine. 21:47:01 And it is a pos. 21:47:28 --- quit: doublec () 21:47:34 A good computer could run OSX86. 21:47:50 And emulate system 9. 21:49:41 Wait... 21:50:39 nvm 21:51:13 I thought I had fiured out my Z80 problem ore a second there. 22:02:26 Well, an XT may refer to a word header (aka a handle) to the code in an indirect threaded system, even with terabytes of storage space available. :) 22:03:11 could be an index into a list, a token, anything that permits EXECUTE to locate and perform the semantics 22:03:11 Maybe I am better off just using assembly and having the 68k load a new program on to the Z80 whenever I rewrite my sound engine. 22:04:17 What do you think? 22:04:43 Sieur_de_Bienvil: Have you read about the 3-instruction Forth interface by the author of PygmyForth? 22:05:18 It is basically a tether system, with the host system implementing a special Forth where @ and ! are diverted to read and write the target's address space instead. 22:05:32 I forget what the third instruction was for; I can find the URL. 22:06:02 You sent me the link last time I was on, or at least I think it was you. I don't remember if I bookmarked it. 22:06:06 But it sounds like what you want is something close to this, where you can use a Forth on the host machine, but where @ and ! affect the target's address space instead. 22:07:03 I was going to use hat or the main processor. But that would work for the Z80 too now that you mention it. 22:07:14 *that for 22:07:55 The third command is execute code a address I think. 22:08:17 Oh, yeah. I forgot about that. :) 22:08:28 That would make sense, wouldn't it? :) 22:09:03 I forgot to bookmark it. 22:09:23 http://pygmy.utoh.org/3ins4th.html 22:09:31 Thanks. 22:10:17 JasonWoof: Hehe -- I think I've seen that somewhere before. But, did you take the quote in its entirety? The last sentence is not grammatically correct. 22:10:19 Again. 22:10:25 n/p :) 22:11:13 Is it that last comma? 22:11:36 That this would, in fact, be a laughable and idiotic mistake, like nailing horseshoes to the tires of a Buick. 22:11:43 kc5tja: should probably have a period instead of a comma before the last sentence 22:11:53 --- join: skas (n=skas@203-217-61-74.perm.iinet.net.au) joined #forth 22:11:55 +8 22:11:56 It does have a period before the last sentence. 22:12:11 kc5tja: and it might be gramatically correct if it were a comma instead 22:12:20 That this would, in fact, be a laughable mistake. <-- this is even more incorrect. :) 22:12:49 oh, I said it backwards 22:12:55 sorry 22:13:18 kc5tja: should probably have a comma instead of a period before the last sentence 22:13:25 there, all fixed 22:13:26 lol 22:13:36 whatever, made me laugh anyway 22:14:35 It is commonly understood, even by technically unsophisticated computer users, that if you have a piece of software that works on your Mac, and you move it over onto a Windows machine, it will not run; in fact, that this would be a laughable and idiotic mistake even, very much like nailing horseshoes to the tires of a Buick. 22:14:40 That's how I would have written it. 22:14:49 Oh, I agree -- it was definitely a funny quote. 22:14:53 Is that Dave Berry? 22:14:59 That sounds a lot like his style. 22:18:36 --- join: geartooth (n=w@CPE00195b252b77-CM001a666a6e78.cpe.net.cable.rogers.com) joined #forth 22:18:58 --- quit: malyn () 22:20:40 --- join: jdrake_ (n=jdrake@fyodor.hcoop.net) joined #forth 22:20:46 --- join: Baughn_ (n=svein@084202038064.customer.alfanett.no) joined #forth 22:23:03 --- join: warp0x00 (n=warpzero@208.74.136.138) joined #forth 22:28:55 --- quit: warpzero (Read error: 104 (Connection reset by peer)) 22:28:56 --- join: Off_Namuh74 (i=GPS@gateway/tor/x-88f5c9dfa669606f) joined #forth 22:29:57 --- quit: segher (Nick collision from services.) 22:30:07 heh, no 22:30:10 --- join: segher (n=segher@82-217-247-28.cable.quicknet.nl) joined #forth 22:30:43 from an artical called "in the beginning was the command line" 22:31:07 Ahh, I read that before. I knew I read it somewhere. 22:31:32 --- quit: jdrake (Read error: 110 (Connection timed out)) 22:32:03 --- quit: wossname (Connection timed out) 22:32:12 --- quit: madgarden (Read error: 110 (Connection timed out)) 22:32:12 --- quit: Baughn (Read error: 110 (Connection timed out)) 22:32:37 --- quit: Sieur_de_Bienvil (Read error: 110 (Connection timed out)) 22:37:40 --- quit: Quartus (Read error: 110 (Connection timed out)) 22:37:45 --- join: Quartus (n=neal@CPE0001023f6e4f-CM001947482b20.cpe.net.cable.rogers.com) joined #forth 22:37:45 --- mode: ChanServ set +o Quartus 22:39:04 --- quit: Off_Namuh72 (Read error: 104 (Connection reset by peer)) 22:54:07 --- quit: skas ("Ex-Chat") 23:10:40 --- join: H4n1 (n=Hans@p57A0E3B1.dip.t-dialin.net) joined #forth 23:26:22 --- quit: H4ns (Read error: 110 (Connection timed out)) 23:32:37 --- quit: arke (Read error: 110 (Connection timed out)) 23:33:48 --- join: saon (n=saon@207.138.42.211) joined #forth 23:41:26 --- join: ecraven (i=nex@eutyche.swe.uni-linz.ac.at) joined #forth 23:58:59 --- join: arke (i=arke@x10.vpn.hrz.tu-darmstadt.de) joined #forth 23:58:59 --- mode: ChanServ set +o arke 23:59:59 --- log: ended forth/07.10.23