00:00:00 --- log: started forth/05.09.22 00:01:37 --- join: amca (n=plump@as-bri-1-223.ozonline.com.au) joined #forth 01:56:58 --- join: amca_ (n=plump@as-bri-1-197.ozonline.com.au) joined #forth 01:58:32 --- quit: amca (Read error: 110 (Connection timed out)) 02:25:06 --- join: tattrdkat (n=virsys@or-65-40-177-69.dyn.sprint-hsd.net) joined #forth 02:25:09 --- quit: virsys (Read error: 110 (Connection timed out)) 03:28:29 --- part: amca_ left #forth 03:41:45 --- quit: Quartus (Remote closed the connection) 05:43:24 --- nick: Raystm2 -> nanstm 05:51:10 --- join: PoppaVic (n=pete@0-1pool73-101.nas24.chicago4.il.us.da.qwest.net) joined #forth 05:51:32 Mornin' 05:52:54 --- join: aardvarx (n=folajimi@shell2.sea5.speakeasy.net) joined #forth 05:56:39 Morning, all. 05:56:46 howdy 05:57:03 Not bad, not bad. 05:57:08 Thank you for asking. 05:57:11 How about you? 05:57:27 Fine. Wakin' up. 06:06:39 --- quit: crc (Read error: 110 (Connection timed out)) 06:11:01 --- join: madwork (n=foo@derby.metrics.com) joined #forth 06:19:34 good morn 06:19:49 hiya 06:22:05 good conversations, the last few day. 06:22:32 Glad to help ;-) It seems to aggravate some folks. 06:23:16 Live development, new entertainment. 06:24:03 I've further simplified the std "opcodes", but I'm also thinkin' about the std branch/flow words... I think they are higher than this level. 06:28:44 Not sure I can really do what I need... Trying to think up & down code and nesting and shit can be a real bother. 06:29:42 The excersize is not lost on me. 06:29:48 heh. 06:30:04 ballance away. 06:31:35 OK, gimme' some insights here... I've added opcodes for assorted jmps (aka "branching" - such as jmp, zjmp, nzjmp)... These are the lowest WE suffer - at the vm. These are NOT complete "begin...repeat" or "if...then". 06:32:49 I'm just about convinced that we need to look at the vm "registers" or RS value, and tweak from there to really get the familiar flow-controls. 06:34:04 OR.. Maybe I am being silly, and I should just write those familiar flow-controls as opcodes, and dump the more universal 'jmp' stuff? 06:34:16 * Ray_work novice and not much help, but please continue to think aloud so I can get an appreciation for the process. 06:35:01 http://rafb.net/paste/results/4C3Lof85.html 06:35:18 Above is the streamlined "opcodes". See the stuff around C(jmp) 06:35:40 line 32+ 06:35:43 clicking... 06:36:09 Down to 93 opcodes in this table, anyway 06:39:36 As you can see, this table/opcode-set is about the bare-bones minimum for just about anything (excepting strings and headers/vocs). 06:40:18 or, strings+io, headers+vocs. 06:40:50 _mechanically_, these opcodes should let us DO just about anything, at the bytecode level. 06:42:20 But, I find myself glaring at the 'jmp' stuff and pondering. Readability would be OK for asm-familiar folks, I suspect. But, decompiling would suffer nastily. 06:44:56 --- join: sproingie (i=foobar@64-121-2-59.c3-0.sfrn-ubr8.sfrn.ca.cable.rcn.com) joined #forth 06:46:20 --- join: JasonWoof (n=jason@pdpc/supporter/student/Herkamire) joined #forth 06:46:20 --- mode: ChanServ set +o JasonWoof 06:46:26 lo, jas 06:46:56 yo 06:47:31 --- join: Quartus (n=trailer@ansuz.pair.com) joined #forth 06:47:34 Hey all. 06:48:47 hi Q 06:49:26 hey, jas? YOu've a running herkforth there, right? Using the opcodes? Do you have a decompiler ala' "see" running, too? 06:53:52 hmm 06:54:04 I think JasonWoof fell asleep 06:54:36 Decompilation is highly over-rated. 06:54:53 Not in an interactive environment it isn't. 06:55:01 Decompilation in any enviroment is highly over-rated. 06:55:22 I will definitely agree that I remember vfa's and fpc/f83 fondly, however. 06:57:13 Why decompile? 1) Out of curiousity 2) ...? To see that the compiler is working properly? 06:57:38 Both. Examining what already works, and checking you laid down the proper code. 06:58:16 If you need to check the decompilation to see if you're coding right... do I need to finish that sentence? 06:58:52 no, and you'd be wrong 06:59:35 Then you're incapable of coding in a language that doesn't provide decompilation facilities? 06:59:36 I've had to do this several times just today - because there are times when words COMPILE, but they are just not right... using DOES> can do this. 07:00:00 Quartus: don't be silly, I've coded far longer in C than I ever did in forth. 07:00:08 Which can also be decompiled. 07:00:38 Ok, so you have a sketchy understanding of when to use what compilation word, so decompilation helps you figure out what you're doing? 07:00:44 no, it may be unassembled, but the chances of "decompiling C" are seriously limited. 07:00:51 Right 07:01:08 if the code laid down looks "wrong", it means you missed some tidbit 07:01:14 Then I clearly do need to finish that sentence -- If you need to check the decompilation to see if you're coding right, you don't understand the programming language well enough yet. 07:01:51 Quartus: forth has changed greatly in 20 years, and there are so many variants that I do indeed like to have "see" around. 07:02:27 I could certainly live w/o it. But, then - I can live w/o a lot of things. 07:02:31 That doesn't alter the truth of what I've just said -- it means you don't understand the particular variant that you're using well enough. 07:03:12 Quartus: and you'd be correct, since it has appeared for years that every variant strives to out-variant the prior variant. 07:03:25 Though decompilation will usually represent the underlying code in a format similar to the source, so if you don't understand the semantics of the language (or variant) properly, you'd be no further ahead looking at the decompilation. 07:03:37 It may also have a lot to do with docs that often say something like "to be written" 07:04:24 Anyway, this takes us quite far afield. Frankly, reintroducing VFA's is prolly more than sufficient. 07:04:31 What is a VFA? 07:04:37 view-field-address 07:04:44 What is a view-field-address? 07:05:00 oop 07:05:01 back 07:05:10 I don't decompile 07:05:12 don't see the point in it 07:05:16 a header-component that was used by F83 and FPC to get "help" by just listing the block or source/lines of the "definition" 07:05:16 I'd rather look at the source 07:05:20 hi JasonWoof hi Quartus. A good day to you all. 07:05:26 Hi Ray. 07:05:29 hi ray 07:05:38 pray we don't wash away this weekend... 07:05:39 JasonWoof: cool. That settled that, then ;-) 07:05:51 herkforth shows you the source all the time 07:06:08 Keeping fingers crossed, Ray. 07:06:12 I can't think of any reason it'd be better to look at dissassembly than the source 07:06:18 unless you don't trust the compiler 07:06:19 Ray_work: well, Rita is likely to start a lot of folks thinking about hand-holding-government, anyway ;-) 07:06:42 my herkforth environment is not yet rewritten for fovium 07:06:45 JasonWoof: I agree all the way, and yeah: I think the VFA solutions are the way I'll go 07:06:46 I'm working on it though 07:06:58 SEE is great stuff on some systems 07:07:02 a self-documenting forth system would be awesome 07:07:11 JasonWoof: you now need to argue "see" with Q ;-) 07:07:13 but mostly because it's the only convenient way to find out how words work (or even what they do) 07:07:16 and i don't mean blocks 07:07:18 right 07:07:33 if there's an easier/better way to do it like VIEW, then see is useless 07:07:35 sproingie: I agree, I'm thinking - I'm thinking! 07:07:40 tho i think it would annoy most people to have to write documentation longer than the word 07:07:46 hi sproingie :) 07:07:50 hey all 07:08:02 sproingie: that's true in every language, and it's still necessary 07:08:03 I'm in favour of literate programming for large projects. 07:08:10 can't force people to write legible code :) 07:08:16 right 07:08:25 more true in forth -- i suppose top-down documentation would work out 07:08:40 Quartus Forth itself is written that way; it generates as a document or as an executable. 07:08:43 document the high level words, then as time and inclination permit, go to the low level words 07:09:08 Quartus: sounds like literate programming. i'm thinking more like the way emacs does it 07:09:16 sproingie, what are you talking about? 07:09:24 or the way python could have done it if it weren't so bad at itt 07:09:36 My only bitch about documenting funcs, structs and headers is: 1) Either you must do almost the whole header again PLUS or; 2) you use a freaky tool to generate some silly thing that might almost help. 07:09:42 Quartus, why do I still need to put comments in code if the code can "document itself?" 07:09:59 aardvarx, code can only document how it does what it does -- not why. 07:10:00 aardvarx: self-documenting systems. where everything can have a docstring -- functions, variables, whatever. combined with a really good hypertextified search interface 07:10:08 aardvarx: better code and languages simply reduce the AMOUNT of comments needed. 07:10:32 sproingie: wtf is a "docstring"? 07:10:49 Quartus: i disagree somewhat -- it should also mention just what it does, in some detail, if it's a high level word 07:10:58 right 07:11:01 Quartus: rather than force you to drill down to each low level piece 07:11:15 sproingie, you disagree with what? That code cannot document its own 'why'? 07:11:15 otherwise i agree, docs should be about why, not how 07:11:41 For example, say I want to use a 'for loop' in C as opposed to a while loop; I then say "/* for loop used here to avoid infinite looping that is possible with a while loop */ 07:11:42 Quartus: that it's sometimes not obvious when it's really abstract 07:11:51 in forth, for example: 1) typify input and output; 2) definitely mention any vars/stacks that get altered such that some other word can blow up 07:11:54 Are you saying that the code can do that by itself? 07:11:55 sproingie, that sounds like agreement, not disagreement. 07:12:13 Quartus: qualified agreement anyway 07:12:18 aardvarx: the for/while comment sounds bad 07:12:21 mostly "why" and a bit of "what" 07:12:27 right 07:12:28 PoppaVic: in langs like python, a docstring is a string in an agreed apon position in the def, where an application can scour your work and just pick up all the names and docstrings and auto document your work. 07:12:37 PoppaVic, could you please explain? 07:12:37 ahhhhh 07:12:57 PoppaVic: just verbose. i might put "the obvious 'while' loop is infinite -- need the pre-test of 'for'" or whatnot. or just fix the code instead :) 07:12:57 Ray_work: a verbous vfa! 07:13:09 sproingie: right 07:13:12 A stack diagram and a comment are the 'what' for a Forth word. The 'why' is very rarely going to be self-evident. The 'big-picture' needs docs, too. 07:13:18 PoppaVic, was my line of reasoning wrong? 07:13:50 aardvarx, that would be over-commenting in my book. Comments shouldn't explain the programming language. 07:13:52 a lot of emacs is representative of very excellent documentation 07:13:52 aardvarx: there are times for for() and while() and even do{}while() - the code should strike you as the best solution to 2+ issues, or it just doesn't matter. 07:14:23 swap \ swaps the top two stack items ( a b -- b a ) is not good commenting. 07:14:32 * aardvarx shocked by Quartus analysis 07:14:43 Quartus: actually it makes a great docstring 07:14:44 Quartus, how can I learn to comment properly? 07:15:25 aardvarx: read "Code Complete". it's by microsoft press, but don't let that turn you off 07:15:34 PoppaVic, I do understand what you are saying -- "Use the right tool for each job", right? 07:15:48 * aardvarx googles for sproingie's suggestion... 07:16:18 Straightforward rules-of-thumb; assume the reader is conversant with the programming language. Explain why. Explain how only when it's necessary. Write to a larger context -- "a++; /* increment a by one */' is not good commenting. Don't write arcane or opaque code in the first place, and if you have to, explain it thoroughly. 07:16:25 goddamnit's getting dark 07:16:32 Code Complete is actually a very good book, yes. 07:16:32 microsoft press is just a publisher. their books tend to be top notch 07:17:09 i liked Don Box's Inside COM too ... tho i dont think that was MS press 07:17:15 not relevant to style anyway :) 07:17:18 Quartus: decent thumb-rules 07:17:23 aardvarx, also -- use descriptive variable and function names. 07:17:29 gods yes 07:17:41 Quartus, I did learn that in school. 07:17:53 Don't go overboard; Hungarian notation is ridiculous, for instance. Use i for a loop index, unless there's some really compelling reason not to. 07:17:54 What I did not learn is everything else you mentioned :( 07:17:54 there's definitely a difference between good comments and good docstrings 07:18:01 and, (and this from my early forth years): try to keep functions as FUNCTIONS and always within a screen 07:18:16 docstrings should usually assume less familiarity with the language, they're aimed at people learning the API, not necessarily the ins and outs of the language 07:18:21 Yes, factor well. 07:18:22 sproingie, comments != docstrings ? 07:18:43 aardvarx: the latter means, if a func starts hitting 2_ loops or 40+ lines, you need to break it down more. 07:19:00 I see. 07:19:08 aardvarx: docstrings are a synopsis sort of comment at the very top, written as a string. lisp and python treat them specially 07:19:14 Assume familiarity with the idioms of the language, too. 07:19:26 aardvarx: from what sproingie and ray have said, no.. comments are immediate notes. docstrings are like precursors to manpage-entries 07:19:33 emacs has oodles of good docstrings. python's are quite a mixed bag 07:19:48 Quartus, do you have any examples to distinguish between good and bad commenting? 07:20:03 PoppaVic, sorry to put you on the spot, but... 07:20:16 I'd rather hear of good/bad "docstrings" and how they'd "compile" 07:20:22 aardvarx: np 07:20:27 PoppaVic: heh if your forth word is "within a screen", that doesn't say much 07:20:29 do you have code samples which exemplify proper commenting? 07:20:54 sproingie: forth, Cm whatever - I try to keep shit short & sweet. 07:20:58 Easier to find the ones that aren't good, aardvarx :) 07:21:06 Hmm 07:21:16 Bummer. 07:21:22 most BAD comments are those kids throw off just "because the teacher said so" 07:21:25 i was reading somewhere where one person was asked on an interview question, "how long should a method be, at most?" 07:21:35 sproingie: right 07:21:42 he replied "no bigger than my head". the interview asked "so, no bigger than you can keep in your head at one time?" 07:21:51 Code Complete has some good examples. So does "The Practice of Programming", and "Writing Solid Code". 07:21:58 he responded "no, i put my head up to the monitor. no bigger than that" 07:22:24 I'm a bit leery of Code Complete; it looks like it only uses MS tools. :( 07:22:28 short & sweet is best, and yeah the screen-size. For most folks, we think 80x24. 07:22:35 aardvarx: if only MS followed the guidelines in CC 07:22:45 aardvarx, it doesn't use any tools -- it's programming philosophy. 07:22:58 "Thinking Forth" has discussion of comments too, I believe; freely available on the weg. 07:23:01 web, even. 07:23:04 hell if only MS followed their own UI guidelines 07:23:09 Brodies "Thinking Forth" was pretty handy as well 07:23:27 I have to dig out my copy, soon 07:23:49 one of those guidelines is, in a nutshell, "avoid cascading menus. if you must use them, make them no more than one level deep off the main menu" 07:23:54 then they give us the start button 07:23:54 sproingie: no doubt - and we have M$ versus Apple versus GNU/gnome 07:23:57 "The elements of programming style" is another oldie but goodie. 07:24:15 yes, I recall it vaguely,Q 07:24:27 thinking forth is really quite nice 07:24:34 Quartus, the other two references are very helpful, though :) 07:24:42 sproingie: I need to check his DOER code again, too 07:24:49 i wasn't a big fan of starting forth, it runs out of steam and goes straight for the guts of a forth interpreter 07:24:58 Code Complete is, again, quite good, and does not focus on MS tools. 07:25:06 sproingie: worse, it was FORTH, INC targeted 07:25:11 and the analogy it uses for CREATE..DOES> is stretched and hard to follow 07:25:35 I believe I may return to the paradigm 07:25:36 thinking forth is pretty good 07:25:38 sproingie -- I agree with you. So many books start to teach Forth, and then launch into the structure of the dictionary header, and threaded internals, etc. 07:25:58 I was really unhappy to see many tests COMPILE that lacked create, but had does> 07:26:58 there should be a starting forth type doc for gforth and retroforth 07:27:22 Anyway, that's every book I own that I'd recommend for good coding practices. 07:27:22 Unless, of course, I've missed something about DOES> that can skip a generation. 07:27:33 sproingie: I agree 07:27:33 rf's perhaps too much in a bit of flux to finalize a starting forth for it, but some stuff is solid, like its unusual way of handling conditionals 07:27:37 'skip a generation'? 07:28:11 one thing i'd leave out is the nasty fixed-point stuff. this is the 21st century, we have insane fast dedicated hardware for floating point 07:28:15 Quartus: oh. Thinking maybe you'd define a does> word early, use it later on with a word using create 07:28:26 PoppaVic, you can do that. 07:28:32 sproingie: I only partially agree 07:28:52 Quartus: ahh, then this is why they dropped for create does> ? 07:28:54 --- join: thinfu (i=thin@bespin.org) joined #forth 07:28:54 --- mode: ChanServ set +o thinfu 07:29:17 Yes, floating-point is sometimes very useful, but can cause disasterous problems if you are unaware of its limitations. 07:29:23 sproingie: there are a ton of situations where a single works great. 07:29:27 PoppaVic, yes. 07:29:32 rf only runs on i386, so people learning to use forth on an ARM or whatnot are going to have to learn fixed point elsewhere 07:29:40 Yes to the 'why they dropped . 07:30:06 this is why I merged the single-precision with "core" and made the double (long) and reals (floats) optional. 07:30:31 Quartus: that explains a lot. Too bad it's not clear from docs I have here. bastards! ;-) 07:30:41 single may work for maths, but i'm thinking of a tutorial on writing pixel shaders in forth 07:30:47 once i learn shaders myself 07:31:14 basically, something relevant. no one cares to learn how to print lines of stars to their terminal 07:31:16 sproingie: you could explain 3D wireframes and viewpoint as well 07:31:47 But I agree, treating the screen as more simple-minded than a teletye was depressing. 07:31:53 teletype 07:32:48 http://rafb.net/paste/results/k7C0ZC21.html 07:33:16 Q, sp: above is the latest opcore.h - I think that covers the eseentials, sans io/strings 07:33:35 Going to update the wiki? 07:34:07 Quartus: I'm cogitating that - would it be better to update the LINKS to other pages, or just add new linkages? 07:34:52 Up to you, I guess. 07:35:13 I may also use an "attach" - assuming a tarball would work. (ie: I can upload that tarball) 07:35:19 Sure. 07:35:27 Plenty of room on the server. 07:35:42 Cool, I did not want to be a pig or sloppy 07:35:51 Go nuts. 07:35:55 --- part: thinfu left #forth 07:36:01 you-da-man! ;-) 07:36:06 * JasonWoof wanders back in 07:36:35 I think the ease in factoring forth can help a great deal in making your code easy to understand 07:37:01 yep 07:37:06 I've sometimes seen over-factoring, but usually the opposite. 07:37:14 This is also true of using structs, locals and funcs in C 07:37:15 but I think it is very very important to have a browser/editor/interpreter/whatever environment where you can easily see the definitions of things 07:37:49 if you have to grep around for definitions, then it becomes frustrating when things are highly factored 07:37:53 Quartus: well, my own "rule-of-thumb" is: will/can I reuse this? 07:38:05 Well, sure, PoppaVic. But I've seen : a! a ! ; 07:38:23 Quartus: yeah, me too - damned silly 07:38:55 the only excuse can be that it is used soooooo often, you save a shitload of space 07:39:09 Idioms do not need to be factored, unless so doing hides an implementation detail. 07:39:22 And if it does that, it needs to be well-named. 07:39:25 Quartus: yeah, I've done stuff like that probably. now I realize that taking a space out is not useful 07:39:31 This is why I think we could benefit from a "true macro" 07:39:48 I had a Quartus Forth user ask me to day why 1+! wasn't in the kernel. 07:39:54 having something named only makes sense if it's something nameably (in that case you're just typing the contents) 07:40:01 how would a "true macro" function in forth? 07:40:20 : a! a ! ; could be useful if it was for something you might change how it is set later 07:40:27 forth is driven by the lexer ... something like a lisp macro would be ... difficult 07:40:31 JasonWoof, hopefully it's not called a!, in that case! :) 07:40:46 why not? 07:40:54 Because that says nothing about what it does. 07:41:02 to me a! means "set a" 07:41:21 this being an example, presumably a is metasyntactic .. 07:41:23 eg yesterday I implemented here! 07:41:33 If it sets a limit, call it 'set-limit'... the fact that it stores a value in a variable isn't useful information at the next level of abstraction. And a name should advance the level of abstraction. 07:41:51 to me, foo! means do foo with some side effect 07:41:57 Quartus, speaking of kernels... 07:41:59 but that's just the schemer in me 07:42:03 are you familiar with L4 ? 07:42:08 aardvarx, no. 07:42:10 sproingie: a "true macro" would just be a stored string, and the func to shovel it into the input-stream in PLACE of some other text. 07:42:17 sproingie: yeah, ! means "store" in forth 07:42:21 PoppaVic, Wil Baden has written such a facility. 07:42:32 PoppaVic: not very interesting unless it takes parameters 07:42:40 Wil's does. 07:42:41 Quartus: yep, my ancient Forth Dimensions mentioned them 07:42:50 Quartus: yeah, we have different naming conventions. I consider "!" a good shorthand for "set-" 07:42:57 not an exact match, but close enough 07:42:58 sproingie: perhaps, THAT I'd like to see 07:43:03 how does it take parameters? forth style? 07:43:07 hm... actually 07:43:18 that's not my convention at all... usually I'd name it >here 07:43:20 i mean you could run forth code through a macro preprocessor, but ick 07:43:28 yeah 07:43:29 * JasonWoof renames a word now 07:43:44 sproingie, it replaces markers in the macro string with parsed text, as I recall. 07:43:47 to me, >foo means push onto the foo stack 07:43:52 where !foo means set foo 07:43:56 and @foo means get foo 07:44:03 well, perhaps we could use a "pre-interpreter" - I dunno 07:44:14 JasonWoof, >foo means to either move, or translate. For translation words I prefer before>after. 07:44:19 foo@ does a foo-fetch 07:44:22 To me, anyway :) 07:44:23 yeah 07:44:28 I do > for putting something somewhere 07:44:28 Quartus: agreed 07:44:31 -> for convert 07:44:39 dict->cfa 07:44:40 or at least a Cish foo2bar 07:44:48 dict->cfa ( dict -- cfa ) 07:44:51 foo@ to me means fetch the foo at that address 07:45:00 ah pity da foo 07:45:07 : >a ( x -- ) \ put's TOS in the A register 07:45:10 Quartus Forth, being 16-bit, has >rel and >abs, which do translation; they're not ideally named, but it's a bit late to rename them. 07:45:36 sproingie: if foo! puts to foo; foo@ fetches it. It's not that difficult. 07:45:41 I like ">here" much better than "here!". because it does something very different from "here !" 07:45:50 Quartus: not a lot of options there 07:45:59 PoppaVic: fits your convention .. i just move the ! and @ to the left for mine 07:46:01 PoppaVic, abs>rel and rel>abs, perhaps. 07:46:12 hmm 07:46:19 yeah, Quartus that's better 07:46:21 yeah, I have the rather nice freedom to rename anything easily and instantly and without bothering anyone 07:46:22 I went with the shorter version, because it's on a Palm. 07:46:25 tho the only real code i have recently has even odder naming 07:46:31 I still think 'typing' the stack would benefit us. 07:46:57 Quartus: when space is limited, cheat however you can 07:47:02 char+@ and char+! ... but those are setting at absolute addresses, not getting variables 07:47:06 PoppaVic: typing the stack? what do you mean by that? 07:47:15 the + means it also advances by one (variable sized) char 07:47:30 sproingie -- char+@ is COUNT, right? 07:47:50 JasonWoof: an idea we chucked around a few days back.. I think it was Quartus that referenced strongforth, but something similar - only for COMPILING 07:48:09 Not me. I've heard about strongforth, but the idea of a typed Forth makes me itch all over. 07:48:18 hmm 07:48:24 maybe sproingie then 07:48:45 Quartus: char+@ ( a -- a' u ) | returns codepoint at a, returns address of the next char and codepoint 07:48:52 Quartus: not the language - just while interpretive-compiling. 07:48:58 sproingie -- codepoint? 07:49:00 whups, bad comment. wrote that on the fly 07:49:05 oh data types 07:49:05 ok 07:49:08 nm 07:49:09 Quartus: integer value of a unicode char 07:49:13 * JasonWoof wanders of to find food 07:49:25 it's half of the utf-8 codec 07:49:25 sproingie, then yes, traditionally called COUNT. 07:49:30 JasonWoof: yeah, typing stack-entries broadly. 07:49:41 Quartus: what's this about COUNT? 07:49:54 did i reinvent the wheel here? 07:49:59 yep 07:50:02 Standard word. COUNT ( c-addr1 -- c-addr2 c ) 07:50:08 I'd use an ALIAS 07:50:09 c-addr2 is one char further along than c-addr1. 07:50:26 i don't recall seeing COUNT in DPANS 07:50:32 It's there. In CORE. 07:50:46 oy. i'll check 07:50:52 http://quartus.net/dpans/dpans6.htm#6.1.0980 07:50:56 I still need to create an opset for strings. 07:51:49 PoppaVic: ah, that returns an entire string. this returns the char itself 07:52:01 hmm???? 07:52:02 maybe i could work COUNT into the naming scheme though 07:52:04 no 07:52:17 count can be looped to index the string and get each char 07:52:18 sproingie - COUNT? No, COUNT does exactly what your char+@ does. 07:52:46 The ( c-addr u ) isn't a string, as such. It's an incremented address, and a character. 07:52:50 not at all. it returns the next address all right, but the u is the "size in characters 07:52:56 Nope. 07:52:58 i'm not interested in the size, i'm interested in the char itself 07:53:02 UNLESS you are redefining the count-element as 16 or 32 bit 07:53:15 sproingie, it's only the count if it's a counted string. 07:53:51 hm. i should rename it utf8-count then 07:54:08 is there an analogous word for setting the char at the address? 07:54:12 If your char size is set appropriately, COUNT will work. 07:54:46 tho setting creates all sorts of other happy fun insanity, like replacing a 3-byte char with a single byte 07:55:04 even utf-16 doesn't help, thanks to surrogates 07:55:20 sproingie, no counterpart for saving exists. What is your stack diagram for the counterpart? 07:55:28 Quartus: the whole point of utf8 is that there is no single character size 07:55:35 ummm 07:55:37 no 07:55:56 utf-8 has characters that are from 1 to 4 bytes long 07:56:02 the point to utf8 is to merge unishit and ascii 07:56:23 the point of it is to be backward compatible with low ascii, yes 07:56:46 it's a lousy encoding for chinese, but it seems to have taken over nonetheless 07:56:50 I certainly will need a converter, but I'm already planning for utf8 in files, and wchar_t in memory. 07:57:40 everyone bitches about their chinese or korean - it's old and tedious. 07:57:42 i also plan on a utf-16 and a ucs2 codec. ucs2 is easy, no surrogates, but it's BMP only 07:57:57 in korea only old people speak korean :p 07:58:36 I figure ascii rules, and forth is the "one ring" - so adding wchar_t in memory is about as polite as you can get. 07:58:39 I would think for sanity you'd want to pad out a utf8 character to four bytes regardless. 07:58:40 anyway, i gotta figure out some way to handle botched decoding before proceeding any further 07:58:58 Quartus: i can't very well require everyone who passes a ut8 string to "pad it out" 07:59:03 I mean internally. 07:59:05 the point of a codec is to read what you're given 07:59:05 On the stack. 07:59:16 Quartus: I just KNOW you don't mean in file - oh,nm 07:59:25 sproingie, yes, I'm faintly familiar with the point of encoding schemes. 07:59:25 Quartus: that's exactly what the codec does, it converts it to 32 bit ints one char at a time 08:00:07 Sadly, wchar_t and unishit sorta' ruin the idea of indexing forward and back nicely & neatly. 08:00:10 i'll probably also write a utf-8<->utf-16 codec as well 08:00:38 sproingie: luckily, C has wchar_t alreay ;-> 08:00:42 already, two 08:00:44 PoppaVic: blame the fact that bytes are only 8 bits. roman was never the only character set in the world 08:00:44 PoppaVic, you have to stop mangling names of things you don't like by making the last syllable 'shit'. It makes it very hard to take you seriously. 08:01:20 PoppaVic: string operations were *never* an easy problem in non-english locales. unicode ain't easy, but it's *vastly* easier than the mess that came before 08:01:42 strings are hard. ascii just happens to be a really simple degenerate subcase of string handling 08:01:43 Quartus: unifoo, then - whatever floats your boat. When you've got more restrictions and rules than working libs that are usuable, it's hard for me to worry much. 08:01:58 sproingie: exactly 08:02:23 There's a character on a show up here-- "Trailer Park Boys" -- the park supervisor, Lahey, does that, and it's hard not to think I'm hearing Lahey speak when you write like that. It's amusing, but it doesn't lend any credibility. 08:02:24 sproingie: the only "plus" I can see for wchar_t is that they support the whole schlock. 08:03:16 unicode isn't perfect. the initial versions totally botched the elegant encoding korean used to have. they're working on fixing that, so apparently korean will occupy two planes in unicode 08:03:19 Quartus: I'm not talking to an audience of academics It's hard for me to panic over it. And, I figure one or the other of us will die before it really matters. 08:03:24 which is going to make transcoding really goddam fun 08:03:51 sproingie: it always struck me as really silly issue. 08:04:09 i imagine they'll have a normalization well specced out. anyway, not my problem yet 08:04:16 PoppaVic: not if you write korean 08:04:16 right 08:04:27 PoppaVic, you may not be talking to an audience of academics, but you are talking to me, and I'm the one raising the issue. 08:04:28 * sproingie doesn't write korean, incidentally 08:04:37 I would suspect "writing korean" is mostly for prompts. 08:04:45 or koreans 08:05:08 Quartus: that's fine, yer easily offended and confused. I shall endeavor to keep it in mind. 08:05:20 PoppaVic: stop it 08:05:21 Ok, you respond with an insult. Nice. 08:06:44 PoppaVic: as for wchar_t, that's good for C, having types. forth has to have explicit conversions. and reading a wchar_t is still pretty complicated 08:07:33 Quartus: gee, I wasn't stating an insult, but a fact. goddamn yer touchy. 08:07:37 wchar_t is unspecified, 16 bits in older versions and 32 bits in newer so as to handle all the extended planes 08:08:18 PoppaVic: if you insist on drawing lines, i'm siding with quartus 08:08:30 sproingie: yeah, I know it's still a compiler/platform/cpu-specific "clusterfuck". I'd love a decent alternative, but I will try to work it anyway. 08:08:37 PoppaVic, ok, here's the thing. I'm not offended by your use of the word 'shit'. And I'm not confused about what you mean by 'unishit'. I just think it makes you sound laughable. 08:09:15 Quartus: understood, waay back above - and I accepted and admitted you were right. How long will we hammer it? 08:09:48 the only cpu-specific fuckup was failing to adequately define the behavior of the BOM 08:09:58 You mean up above where you brushed off my comment twice, and then insulted me? 08:09:58 "BOM"? 08:10:03 or even specify one. the BOM was a hack that got moved into standard usage 08:10:04 * PoppaVic sighs 08:10:15 .e just grovels and bows to Quartus 08:10:27 PoppaVic: byte order mark. if you're going to slag off unicode, you really ought to learn something about it 08:10:45 sproingie: I did, a few years ago - I screamed and ran 08:11:16 fear is not productive 08:12:02 sproingie: what I recall of all the "unicode-variants" was: they were trying to optimize size/space and compression, and lookup for glyphs/runes, etc - and all really BADLY 08:13:13 utf8 wasn't a standards effort, it was an overnight hack to plan9 by ken thompson and rob pike 08:13:16 I expect the problem may well be they never really tried to codify all their thoughts in a usable/demonstrative lib/object/api in a really "clean" way 08:14:01 sproingie: could be, all I know is that it DOES support old ASCII and it offers a way to handle - what? u-32? 08:15:21 utf-8 sucks for chinese because it makes it 50% bigger 08:15:45 Personally, I suspect unicode&friends is sorta' a Forelorn-Hope, unless they want to involve a pile of linguists and see english/american as glyphs/runes/phrases as well as all the asian lingos 08:16:02 well, goddamn sproingie! It can't be helped! 08:16:03 it's not a forlorn hope, it's an unqualified success 08:16:56 unicode is reality. living solely in ascii-land is simply broken, even within the confines of the US 08:17:18 english uses an alphabet, asian languages use glyphs: the glyphs mean multiple words. 08:17:37 unicode doesn't care what the meaning of a glyph is 08:17:39 sproingie: ok, ok: I surrender. 08:18:15 now a semantic unicode ... that'd be ambitious 08:18:36 probably impossible. tho neal stephenson explores it in his baroque novels 08:19:18 where the main character is attempting a catalogue and encoding of every thought in the world 08:19:18 They'd need to merge pronunciation with meaning and the lookup would make forth and C look trivial, approaching the OED 08:19:40 sproingie: I have only one of his books, methinks 08:19:51 i'm just reading the first, Quicksilver 08:19:53 "cyberpunk" genre? 08:20:01 yeah, that sounds right 08:20:01 naw, he's moved out of that 08:20:18 it's about the politics of science in the late 17th century 08:21:07 the main character is a sort of forrest gump, a fictional character inserted into the lives of scientists like newton and liebnitz 08:22:00 ahh. 08:22:20 I don't believe I've purchased a "new" book in at least a few years. 08:22:26 this is a library book :) 08:22:32 ok, i gotta shower and get going 08:22:36 later 08:22:43 oh, my: locally, we now have to PAY to use the lib 08:22:46 laters, sproingie 08:30:55 --- join: tathi (n=josh@pdpc/supporter/bronze/tathi) joined #forth 08:32:37 hmm, weather is going right down the shittube 08:33:39 fwiw I took a different approach to counted strings 08:33:52 ok? how? 08:33:54 instead of pointing at the count byte I point right at the data 08:34:07 and the count is just before that 08:34:08 yeah, I've considered it 08:34:24 but, how large is the ABI of the "count"? 08:34:42 current herkforth I have 32bits 08:34:50 in mist I'm doing 16 08:34:52 forever and always? 08:35:43 How do you store an int/cell or long-long/double? 08:36:08 it's my format for "data objacts" which includes strings and some raw binary data, and some more structured binary data such as hf source 08:36:21 format is: type | count | data... 08:36:29 Yah. We need better abstractions 08:36:36 in hf type and count are 32-bit values 08:36:52 in mist (hf rewrite for fovium) they will be 16bit 08:37:05 I hate to admit this, but... C++ "classes+methods" are really sensible for forth. 08:37:29 I'm not into oop 08:37:35 god, that hurt to admit 08:37:44 whatever dude 08:37:53 well. There are 2 ways to see "forth" 08:37:54 if you want it, write it 08:38:59 1) "I'm stupid, everything is a register-width and we can debate it"; 2) "We may use CELLs, but I am smart enough to doublecheck user-abuses" 08:39:40 I'm not saying yer wrong, but I think we'd benefit from string-as-struct/types+handlers. 08:40:16 As I mentioned, I still need to flog a strings-layer 08:41:25 I'm tempted to also consider objstacks and the utf8 (narrow) and wchar_t (wide) concepts. 08:42:49 I'm beginning to believe that "strings" are like headers, vocs, files, etc: actually higher-level "objects" 08:44:50 And, if that is true... Don't they then suggest we need a way to demand "compile inline/bytes" and some sorta' treatment (maybe) beyond that? 09:07:11 handlers/interpreters 09:18:44 --- join: docl_ (n=docl@67-138-198-11.bras01.mcl.id.frontiernet.net) joined #forth 09:20:39 --- quit: docl (Read error: 110 (Connection timed out)) 10:09:00 --- quit: PoppaVic (Read error: 110 (Connection timed out)) 10:20:29 --- join: PoppaVic (n=pete@0-1pool67-121.nas22.chicago4.il.us.da.qwest.net) joined #forth 10:21:34 ok, so much for chore #1 10:21:47 What was that? 10:22:47 Hmm? oh. we died here, I dealt with ##C, got dead, and then called around to put together a powder/primer/etc order from folks. 10:23:16 O_o 10:23:44 Gotta' call #2 son tonight, see what he wants/recommends, finish the order - call them in,and then run around next week. 10:24:27 aardvarx: remember, when I ain't programming, I'm cooking or reloading/shooting ;-) 10:24:51 The hobbies have multiple-intersections. 10:25:02 heh. 10:25:15 Plus, as "eldest" and "old fart", I get to "manage" more 10:26:14 I'd love to offload responsibilities, but I end up being the single "single" and most responsible of the lot. 10:26:50 oh, well - being married, I ain't "single" - but we have no (can can't have) kids. 10:27:03 can // 10:27:41 So, I look out for "the tribe (and Ma')"... Best I can. 10:30:04 Thank BOG I ain't the local "shaman" as well 10:47:03 aardvarx: intsead of commenting about my writing a book and such, perhaps yer "Q:" is better served with specific issues or questions? I'm not sure how to A: such stuff in ways other than those bordering on the rude. 10:49:03 I would definitely point out that ascii/utf8 "textfiles" are the bottom-line. 10:49:55 folks fighting ascii don't impress me; and utf8 is a tossoff "concession". 11:08:47 --- quit: PoppaVic ("Pulls the pin...") 11:37:56 --- nick: docl_ -> docl 11:49:15 Hey all. 11:49:37 Hey. 11:49:44 What's up? 11:50:49 Nothing to report presently. How about you? 11:52:04 I got an Alpha box delivered to my residence yesterday. No keyboard, mouse or even a POWER CORD :( 11:52:24 Who needs frivolities like that? :) 11:52:33 heh 11:52:50 I did re-do my Quartus Forth page, in the hopes of making it more informative for prospective buyers. 11:54:02 Good deal. 11:54:38 http://quartus.net/forth 11:55:25 loading... 11:56:35 O_O 11:56:50 You got a comment from PalmSource on your product??? 11:56:55 I did. 11:57:08 Whoa... 11:58:14 Here I was about to start shedding tears... only to realize you've been rolling with the Big Guns long before I ever had a PC!!! 11:59:39 :P 12:00:29 --- join: true-grue (i=xyyyyzy@ppp140.medlux.ru) joined #forth 12:01:29 Tears, eh? 12:02:21 Yeah! 12:02:57 I felt like you were barely making ends meet... 12:03:13 In fact it's not all that hard to get a PalmSource quote. I do want to improve sales. 12:03:13 and that you needed the extra money just to keep the electricity on... 12:04:02 Perhaps you needed the money to keep the heat on during the winter months, or something. 12:04:07 That's the ticket. :) 12:04:26 Don't do that. 12:04:34 Don't do what? 12:04:54 Don't go pulling peoples emotional strings like that. 12:06:35 I do need to step up sales, aardvarx, but certainly don't cry. :) 12:06:43 That quote is from a general press release: http://groups.google.ca/group/comp.sys.palmtops.pilot/msg/f72f3cbdfea3c6e9?hl=en& 12:08:24 That does not negate the importance of getting such a quote. 12:09:01 Perhaps it lends an air of credibility. 12:09:42 It's kinda like saying: "My video of my trip to Jacksonville recently received Two Thumbs Up... No biggie" 12:09:51 It still counts. 12:13:34 Well, I'm hurting for cash myself; perhaps I'd help when I'm doing better. 12:13:51 I have to get going to class; see you later! 12:13:57 --- quit: aardvarx ("Cheers!") 12:16:51 HEHE 12:16:59 you guys... 12:17:21 * Ray_work finally caught up from this mornings convo. 12:26:41 Hey Ray_work. 12:36:42 --- part: Quartus left #forth 12:36:44 --- join: Quartus (n=trailer@ansuz.pair.com) joined #forth 12:39:13 HI Quartus: wb. 12:40:27 * Ray_work thinks thinfu's new irc client for retroforth is just what he needs to get ChuckBot the Glyph Chess game as a two player with 'talk' mode. 12:42:28 What algorithm does your chess game use? 12:48:23 Raygorithm :) 12:48:29 give a sec working .... 12:52:24 --- quit: true-grue () 12:56:08 Quartus: how often do you sell a copy of quartus forth? 12:56:32 It varies considerably by season and climate, JasonWoof. 12:56:50 beautiful weather for coding! 12:56:58 you make much money off it? 12:57:01 I sell more in the colder months. 12:57:16 :) makes sense 12:57:30 I'm trying to make a go of it as a standalone business, and it's not quite where I'd like it to be. I blame this on marketing, and I'm trying to improve that. 12:58:05 you make almost enough to support yourself?? 12:58:35 Unfortunately almost, yes. I also do some independent contract work to bridge the gaps. 12:58:41 holy crap 12:58:49 well done 12:59:10 Thanks, but I won't feel self-congratulatory until I break the 'almost' barrier. :) 12:59:12 I didn't think there were that many forthers out there 12:59:33 I was guessing you sold a copy every month or two 12:59:36 that's great 12:59:55 Oh yes, there's a lot. The product gets 100x more downloads than it does registrations, of course -- but I would guess at least as many people use the evaluation version and never register, as those who do buy it. 13:00:12 right 13:00:18 I used the evaluation version for a while 13:00:29 No Palm anymore? 13:00:42 well, I have one, but it never leaves my desk 13:01:02 I just use it for the calendar and timer (bigclock) 13:01:23 I'm working hard to put myself in the mindset of a prospective customer, and add to the site what such a person might want to see. 13:01:46 I have in mind to create a video showing how easy it is to create a new app from scratch. 13:02:01 hehe 13:02:03 pov 13:02:21 pov? 13:03:06 sorry 13:03:08 point of view 13:03:22 movie shot from where your head would be 13:03:29 you can see the fingertips fly 13:03:41 the characters appear on the screen and are parsed/saved/executed 13:03:44 Ah, right -- only I won't be in it, per se -- I'll use the emulator to create the video, and then voice-over that. 13:04:02 yeah, sounds good 13:04:05 I'm just being silly 13:04:26 what's the program you make in the movie going to do? 13:04:55 That's up in the air presently. A "Hello World", then some graphics, and a button or two -- that's my current thinking. 13:09:40 What would you do? Would anything specific excite you as a prospective customer? 13:29:33 If you could think of something interactive 13:29:58 Maybe incrementing a displayed value with each press of a button? 13:30:17 yeah 13:30:28 or some cool calculation 13:30:56 hmmm 13:30:59 I am open to suggestions of what calculation might be cool :) 13:31:16 maybe you the incrementing 13:31:56 then (maybe in a seccond movie) add a thing that says if it's prime or not 13:32:15 or maybe you could go through the fibbinocci sequence 13:32:23 I just had that thought myself -- the prime one. 13:32:42 or maybe convert celcius to ferenheight 13:32:53 Ah, the old saw. :) 13:33:09 heh 13:33:17 well, it's so simple, and potentially useful 13:34:02 A bit more complex to code a field with numeric conversion, but not outside the realm of possibility. 14:01:48 --- quit: wossname ("zzz") 15:55:30 --- join: crc (i=crc@pool-70-16-153-19.phil.east.verizon.net) joined #forth 16:14:40 --- nick: nanstm -> Raystm2 17:31:56 --- join: crcx (i=crc@bespin.org) joined #forth 17:32:33 --- mode: ChanServ set +o crc 17:33:05 --- quit: crcx (Read error: 104 (Connection reset by peer)) 17:33:26 --- join: crcx (i=crc@bespin.org) joined #forth 17:33:59 --- quit: crcx (Read error: 104 (Connection reset by peer)) 17:58:35 --- quit: crc ("will also have to close down the socket, at least on windows") 17:58:45 --- join: crc (i=crc@pool-70-16-153-19.phil.east.verizon.net) joined #forth 17:59:57 Hey all. 18:00:24 --- join: crcx (i=crc@bespin.org) joined #forth 18:00:34 hi Quartus 18:00:43 Hey. What's new? 18:01:03 testing an irc client written in retroforth :) 18:01:10 Neat! 18:01:40 I'm trying to determine the best way to parse the raw input from the server currently 18:06:00 --- join: doclx (n=doclx@67-138-198-11.bras01.mcl.id.frontiernet.net) joined #forth 18:07:03 --- quit: doclx (Remote closed the connection) 19:31:44 --- quit: tathi ("'night all...") 20:05:41 --- join: snoopy_16 (i=snoopy_1@dsl-084-058-137-049.arcor-ip.net) joined #forth 20:22:21 --- quit: Snoopy42 (Read error: 110 (Connection timed out)) 20:22:45 --- nick: snoopy_16 -> Snoopy42 21:24:53 --- join: amca (n=plump@as-bri-3-125.ozonline.com.au) joined #forth 21:27:00 --- quit: sproingie (Remote closed the connection) 21:35:04 Hello 21:40:18 Hey. 21:40:33 How are ye? 21:41:09 Well, thanks. You? 21:41:32 A bit bah - Im indulging currently >.> 21:41:36 What have you been up to? 21:42:47 Working on making my web site more compelling. Hopefully drumming up business. :) 21:42:55 :) 21:43:08 What are you gonna do to it? Restyle it? 21:44:31 Perhaps eventually. For now I've edited it to focus more on what you can do with the product, rather than what the product itself can do. 21:44:49 And I'm trying to put myself in the mindset of a potential customer, to identify what I might usefully add. 21:44:53 Good idea 21:45:07 So you have been asking ciustomers what they use it for? 21:46:11 I'm not taking it to that level; too many possible uses. I'm focusing on "you can use it to write fast, native-code apps" rather than "it's a native-code optimizing compiler with lots of neat stuff." 21:46:51 Ah. So rewriting the sentences to put it from the customer POV rather than the product POV 21:46:56 Right. 21:47:22 I'm planning videos that show how easy it is to write an app from scratch. Trying to come up with a suitable example app. 21:48:11 Hmmm. Why videos? 21:49:01 Picture being worth a thousand words. It'd be a walk-through; you'd see how quickly it can be done. Reading a list of instructions & screenshots wouldn't convey that as effectively. 21:49:26 fair enough 21:49:52 Not a video in the 'sitting in front of a webcam' sense -- I'd use the Palm simulator to generate the animations, and narrate on top of that. 21:50:23 * amca nods. 21:50:51 I guessed it would be that - more of an animation with narration than "Biggle codes Quartus Forth" 21:51:07 If I can get Biggle, I may change my plan. 21:51:15 lol 21:51:23 What kind of demonstration app -- something simple -- would spark your interest as a potential customer? 21:51:29 I should have said Biggles 21:51:51 For me, showing how to code a simple game >.> 21:52:13 How simple? 21:53:38 Would hangman or such be to complex? Or guessing number game? Something with some simple pretty graphic demo too I suppose or such. 21:54:28 Hangman isn't too simple; I want something I can code up really easily. I had thought of some simple graphics. 21:54:39 * amca nods 21:54:58 Pong? :) 21:55:09 You'd want to double-buffer the animation. 21:55:30 If you wanted complexity, yes 21:55:40 Im not sure. 21:56:33 * amca 's brain isnt working too good today 21:56:39 :) 21:57:19 All the ideas I think of are simple graphical games, but when I think of the implementation , I realise they are too complex :) 21:59:27 Ive been playing around with rogue-type rpgs lately 21:59:30 JasonWoof suggested Fahrenheit <-> Celsius conversion. Maybe. It's been done, though, I think, here and there. :) 22:00:19 yep 22:11:45 how about a button that moves when you hit it? 22:12:57 Hmm. Just jumps out of the way? 22:13:10 * amca nods 22:13:16 trivial but fun 22:13:26 posx @ 10 + 100 % posx ! 22:13:37 amca: exactly what we're looking for 22:13:48 * amca nods 22:14:08 Quartus: can you move controls in a form easily? 22:14:27 Easily enough, but it's a bit cumbersome. Have to hide, reposition, and show. 22:14:49 And the technique wouldn't be useful in any conventional Palm software. 22:14:54 Doesnt sound that harfd 22:15:05 oh ok. 22:15:14 don't want to show anything cumbersome in the demo vid 22:15:34 It's several system calls, amca, and Palm OS calls alternate between taking object IDs, object indexes, and object pointers, for reasons that are unknown to me. 22:15:50 can you change the text that's displayed somewhere without doing that jazz? 22:15:59 Yes, you can draw text anywhere at any time. 22:16:24 how about a button that reveals more text each time you click it 22:16:43 you click it at "H" appears, then "e" the next time.. 22:17:02 Interesting. Again, not a very applicable trick, but it'd look neat. 22:17:28 applicable? 22:17:42 would it be confusing/complex to implement? 22:17:43 Not a technique that'd be likely to be used later. Most Palm OS buttons are static. 22:17:51 I don't think it'd be too hard, JasonWoof. 22:18:13 no, I don't mean change the button, just draw the next char of the message elsewhere on the form 22:18:23 | [clickme] 22:18:24 Oh, ok. Sure, that's easy. 22:18:26 22:18:33 | H [clickme] 22:18:36 22:18:39 | He [clickme] 22:18:48 22:18:51 | Hel [clickme] 22:19:00 |Help me! [clickme] 22:19:14 lol 22:21:29 well, I like this idea 22:21:37 It's not bad. 22:21:45 it's simple, fun, and the things you do technically seem useful (doing stuff when a button is pressed, and displaying text) 22:22:33 are you trying to sell forth? or just how easy it is to do palm stuff? 22:22:49 Forth. It's not easy to do Palm stuff; Quartus Forth makes it easier. 22:23:10 I think it is a good idea the clicking one 22:25:18 I converted the source to a custom Preferences panel today; the C version is 17 pages long. The Quartus Forth source is 40 lines. 22:25:47 O_O 22:25:54 cool 22:33:19 Ok, that's with HUGE blocked comments in the C source, so it's not quite fair. It's about 540 lines of C, uncommented. 22:35:36 Still a significant difference 22:35:38 The key difference is the way Quartus Forth manages events via EKEY. The traditional method is to establish handlers for your forms, set up an event handling loop, and laboriously walk each event through various system routines. With EKEY you just read the next event off the top, and act on it. 22:35:57 The system handles all the housekeeping for you, which is how it should be. 22:36:50 The Forth system, that is :) 22:37:49 very cool 22:38:36 Hmmm. So it would be possible to have an ekey struct for C and to do the same sort of thing if it was implemented? 22:38:50 It looks as though someone was extremely enamoured of an object-like system, and wrote the whole thing accordingly. When you unravel all that, it becomes very simple. 22:39:00 amca, yes, of course. 22:39:33 There's only ever one active event at a time; it can live in a static buffer. 22:39:46 They're queued. 22:40:08 ah 22:40:50 If you implemented all that for each project, you'd ramp up the number of lines of code, of course. 22:42:46 Another clanky Palm OS thing -- you design your forms as static resources, ahead of time. At run-time you establish a handler for your form, and ask it to be drawn. The OS sends a series of events to the handler -- FrmInit, FrmLoad, FrmDraw, as I recall; you respond to each of these exactly the same way in every app. 22:43:21 In Quartus Forth, it's: ShowForm ( formID -- ) 22:43:47 * amca nods 22:44:02 Would it be better to have the form in code rather than data? 22:44:26 There are calls in Palm OS3.5 and later that support dynamic UI creation. 22:44:40 It doesn't change the required sequence of actions for bringing up a form, though. 22:45:11 * amca nods 22:47:28 --- join: moreCowbell (n=moreCowb@ca-lapuente-cuda2-c1c-186.arcdca.adelphia.net) joined #forth 22:47:30 Hmm, maybe it replaces the FrmInit. It's been a long time since I did the unravelling and encapsulation of all of this nonsense. 22:47:36 hehe 22:48:03 Now I bring up a form with ShowForm. I read events with EKEY, and act on the events I want. 22:48:45 And for each event you could have a function lookup table if you wanted too 22:48:53 You could indeed. 22:49:11 If you're insane, you can establish callbacks and do it the old-fashioned way, just like in C. 22:49:33 callbacks? 22:49:37 like hooks? 22:50:07 Kind of. Function pointers from your own code, passed to the OS so it can 'call back'. 22:51:09 ah 22:51:29 Why is that a not as good way to do things? 22:52:13 It's astonishingly clumsy and extremely unnecessary, with very few exceptions. 22:53:35 What are those exceptions? 22:54:24 There's a GUI list object in the Palm OS. When you set it up you register a callback routine; the OS calls it so you can handle drawing of individual items yourself. 22:54:59 ah 22:55:21 That sort of thing. But registering a separate event-handling function for each form, when virtually everything that handler does is the same for every form -- that's what I unraveled. 22:56:44 you dont register a seperate event handler for each widget? 22:56:53 No. That's the point. 22:57:49 Using Quartus Forth, you don't have to. 22:58:17 --- quit: JasonWoof ("off to bed") 22:58:48 Dont each widget handle events differently? 22:59:05 (Doesnt) 22:59:40 Sure. The system gets the first swing at each event; it does the various things like highlighting a button when it's pressed, dropping down a menu, etc. 22:59:53 * amca nods 23:00:00 If you tap a button, though, it generates an event. If you choose a menu item, it generates an event. 23:00:10 If you press a key, it generates an event. 23:00:32 In Quartus Forth, those resulting events all appear sequentially on the stack, via EKEY. 23:00:58 but you would want each different event handed off to the function or word that deals with it wouldnt you? 23:01:05 If it's a ctlSelectEvent, a button was pushed; event-id queries the button ID, and you act on that. 23:02:32 I would have thought (naively perhaps) that you would have a specific word/function that handles each specific event from each specific widget 23:02:45 --- quit: moreCowbell ("That wasn't supposed to happen") 23:03:04 You're usually dealing with very few event types -- primarily control, and menu -- against a small handful of widgets. 23:03:36 My usual practice is to pass the event through one CASE statement, and call out to a 'do-menu' or 'do-button' accordingly. Those are both small CASE statements. 23:04:18 for example if I was programming a program, Id have a word/function that when a button labeled "Quit" was clicked, would do the necessary things to tidy up and leave the app 23:04:37 Palm apps aren't meant to have a Quit, in fact, so that's a bad example. :) 23:04:48 Fair enough 23:05:09 well perhaps a button labeled "blink" that makes all the labels on the app blink annoyingly :) 23:05:15 Sure. 23:05:34 it would then have a blinkevent word/function that gets called 23:05:39 Right. 23:06:04 isnt that the same as callbacks, except the case statement is handles by the OS? 23:06:35 as in the OS does "if this event, then do such and such a function" rather than the app 23:07:08 (handles = handled) 23:08:31 The net result is obviously the same, yes. But the callback method is far more complex to code for. And the Palm OS doesn't offer anything like a separate callback for each widget; it's a one per form, and then that routine has to CASE out each event. 23:09:16 shit 23:09:26 that is a silly implementation IMO 23:09:43 Right. 23:09:47 You wouldnt want it at the form level, Id say. You would want it at the app or widget level 23:10:18 Do you think if it was implemented at the widget level it would be practical? 23:10:25 I wouldn't want it. The model is linear; it's not a multitasking OS. 23:10:59 IC 23:11:34 Fair enough 23:13:17 So the OS just loads a program and lets it run? 23:13:25 No it doesnt 23:13:28 nm :) 23:14:21 Right, the app interacts with the OS on every event. When the OS requests that the app terminate, it does. 23:15:35 But only one app is active at a time? 23:15:51 the others are "sleeping" if opened? 23:16:08 Not sleeping; not running at all. Many apps save their exit state and restore it on entry, so it appears they never stopped. 23:17:01 Ah, cool 23:17:20 so, yes, I see why your implementation makes sense 23:18:08 In a particular app on a Palm you are unlikely to have two forms at once on screen unless one is modal, right? 23:20:55 I have yet to see an app with two on-screen forms at once; you can do it easily enough. In that case I'd still have no issues, as long as the objects on each form had different IDs. 23:21:25 If for some reason you insisted on using the same ID on two forms at the same time, you could query which form was active at the time and act accordingly. 23:22:50 So the event handling should definately be at the app, not form level. WTF were Palm thinking? 23:23:50 I don't know. As a result of the design, "Hello World" is at least two pages long in C. 23:24:06 O_O 23:24:08 geez 23:24:15 How long in Forth? 23:24:15 In Quartus Forth it's : go MainForm ." Hello, World!" begin key drop again ; 23:24:41 Ooooh! Complicated! 23:25:19 Let me amend that -- the "Hello World" I'm looking at in C also has a menu with one item (About) and an alert. So in Forth it'd run to maybe ten lines. 23:26:27 And I don't actually think the reduction in the number of lines is the most important part of the difference -- it's the conceptual simplicity of the Forth that makes it better. 23:27:02 * amca nods 23:27:03 yep 23:27:33 With no attention to indendation and brace-style, you could cram the C version onto one page; I just did. 23:27:40 er, indentation, that is. 23:27:46 Id hate to read it though 23:27:47 50 lines. 23:28:31 O_O 23:28:49 Well, yes. And you find PilotMain(), and it handles launchcodes conditionally (Quartus Forth does this for you). It passes control to StartApplication(). 23:29:25 In this app, StartApplication() does nothing, because "Hello World" is part of the static form. 23:29:26 launch codes? 23:30:02 Yes, the OS communicates with apps via launch codes. Normal Launch is what you think it is; there are other launch codes to ask an app to respond to a global search request, or to notify it if a database is deleted, etd.c 23:30:03 etc. 23:30:42 are launch codes similar to command lines? 23:31:15 No. Launch codes are (almost always) sent only by the OS itself to notify apps that certain conditions have occurred. 23:31:32 Ah 23:31:43 Notifying the app of the state of the palm as it launches 23:32:17 So control gets passed to EventLoop(), which loops waiting for events, and passes them through four routines -- three of those are OS routines, and one of them is a custom routine in the app. For various arcane reasons, the custom routine has to be the third one. 23:32:24 This is the same in *every* app. 23:32:52 O_o 23:33:52 And is it possible to do anything useful by modifying the startup? 23:34:31 The startup? 23:35:29 wait a bit I think OI confused myself 23:35:57 Is EventLoop written by the coder? 23:36:09 Yes. 23:36:27 So what happens if in the EventLoop the OS routines arent called? 23:36:43 None of the widgets work. 23:36:52 ah 23:37:10 Is it useful at all to replace the OS routines? 23:37:13 I'm not sure you can even coerce the next event out of the system if you haven't let it handle the previous one. 23:38:00 No. You could intercept events before the system gets them; that's the one occasion where you'd want to break into that, and it's not the normal case. You can do that in Quartus Forth too -- the factors of ekey are available. 23:38:03 :/ 23:39:00 * amca nods 23:42:26 To display a form, you ask the system to display it, and then wait for a frmLoad event, at which time you call FrmInitForm(), FrmSetActiveForm(), and FrmSetHandler() -- same every time. 23:42:38 (This is still in C, of course.) 23:43:23 Then the form handler routine that you specified in FrmSetHandler() is called by the OS whenever the eventloop passes an event to FrmHandleEvent(). It's an absurdly complex arrangement. 23:43:30 * amca nods 23:43:44 geez 23:43:51 Whoops, sorry -- FrmDispatchEvent(). I'm out of touch with this stuff, I've been using it encapsulated forever. 23:44:31 *then*, you handle widget events in the form handler. 23:44:45 If it was so much the same every time, KI would have thought you could just define the form and the eventhandler and it would get linked with the standard code 23:44:54 KI = I 23:44:55 Yet, here we are. 23:45:03 heh 23:45:04 weird 23:45:15 This is effectively what Quartus Forth does for you. 23:45:21 * amca nods 23:45:27 Thankfully :) 23:45:39 I think so, yes. And that's what I want to convey graphically with video. 23:46:29 hmm 23:46:48 well you could show how easy it is to do "Hello World" in one video 23:46:57 Right. 23:47:08 That would show explicitly the difference 23:47:12 immediately 23:47:15 That's two whole lines if you want to generate the stand-alone PRC. :) 23:47:24 Everyone knows "Hello World :) 23:47:58 "Oops! I accidentally farted out a Forth app" "Im still trying to push out my C app" 23:48:10 I don't think I'll turn to you for dialogue. 23:48:28 lol 23:48:32 good idea 23:48:53 "This is the canonical "Hello, world!" program. It is not the smallest possible Palm OS program, because that would take out all the infrastructure you'll need if you want to turn this into a real program. Still, it is quite a bit smaller than many other Hello world! programs I've seen." http://tangentsoft.net/palmfaq/examples/hello.html 23:49:20 If you're curious to see the C in its original horror. 23:51:21 * amca looks 23:51:30 .rcp is the form definition is it? 23:51:37 It is. 23:53:13 the if/then eventloop looks ugly 23:53:46 I agree. 23:54:09 Yeah, it looks more ugly than it would ned to be with a good interface 23:55:28 It's about as complicated as it can be. 23:56:25 I think they should have made it more complicated by having to register each widget with the OS at app startup ;) 23:56:35 So you can see why I wouldn't want that. 23:56:51 hehe 23:59:59 --- log: ended forth/05.09.22