00:00:00 --- log: started forth/18.09.16 01:29:15 --- join: ncv (~neceve@2a02:c7d:c5c9:a900:6eaf:6ef7:3b81:d5f6) joined #forth 01:29:15 --- quit: ncv (Changing host) 01:29:15 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 02:04:37 --- quit: ashirase (Ping timeout: 252 seconds) 02:09:31 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:21:47 --- quit: dys (Ping timeout: 246 seconds) 02:31:54 --- join: dys (~dys@tmo-103-134.customers.d1-online.com) joined #forth 02:32:58 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 03:37:01 --- quit: cobax (Ping timeout: 252 seconds) 03:45:51 --- join: kamog (~user@95.73.55.177) joined #forth 04:21:55 --- quit: ncv (Ping timeout: 252 seconds) 06:34:24 --- join: ncv (~neceve@2a02:c7d:c5c9:a900:6eaf:6ef7:3b81:d5f6) joined #forth 06:34:24 --- quit: ncv (Changing host) 06:34:24 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 07:06:18 --- quit: pierpal (Quit: Poof) 07:06:39 --- join: pierpal (~pierpal@host102-235-dynamic.181-80-r.retail.telecomitalia.it) joined #forth 07:07:21 --- quit: pierpal (Client Quit) 07:07:59 --- join: pierpal (~pierpal@host102-235-dynamic.181-80-r.retail.telecomitalia.it) joined #forth 07:36:17 --- join: mark4 (~mark4@cpe-2606-A000-8096-FE00-39C2-EF2F-ACCB-DD00.dyn6.twc.com) joined #forth 09:12:12 --- join: h4shc4t (~h4shc4t@39.52.246.156) joined #forth 09:12:39 --- join: gravicappa (~gravicapp@ppp83-237-171-87.pppoe.mtu-net.ru) joined #forth 09:15:25 --- quit: h4shc4t (Remote host closed the connection) 09:16:12 --- quit: mark4 (Ping timeout: 250 seconds) 09:28:47 --- join: mark4 (~mark4@cpe-2606-A000-8096-FE00-5A94-6BFF-FEA6-29D4.dyn6.twc.com) joined #forth 10:10:07 --- quit: mark4 (Quit: Leaving) 10:38:55 --- quit: dave9 (Quit: one love) 11:34:13 --- quit: pierpal (Read error: Connection reset by peer) 11:47:00 --- quit: dys (Ping timeout: 250 seconds) 11:47:19 --- join: pierpal (~pierpal@host102-235-dynamic.181-80-r.retail.telecomitalia.it) joined #forth 12:09:20 --- join: KipIngram (~kipingram@185.149.90.58) joined #forth 12:09:20 --- mode: ChanServ set +v KipIngram 12:09:49 Hey guys, anyone know how to define a counted string in GNU assembler, using a macro such that the macro figures the string length out? 12:10:11 I've got it defining a string, padded with zeros to a fixed 16-byte buffer length. 12:10:15 But that has no count byte. 12:10:36 I can determine the length after I've used .ascii to lay down the string, but it's too late then - the .org directive won't let me "back up." 12:10:58 I do NOT want to have to pass in all of the lengths manually. :-( 12:11:29 The nasm assembler has a length function that can be applied to the argument inside the macro, before you lay down the string. 12:11:49 --- quit: ncv (Remote host closed the connection) 12:12:18 join #gnu 12:12:22 ooops 12:17:16 sure 12:18:26 .macro STRING text 12:18:26 .short sl2\@ - sl1\@ - 1 12:18:26 sl1\@: .asciz "\text" 12:18:26 sl2\@: 12:18:26 .align 4, 0 12:18:29 .endm 12:18:33 KipIngram, ^ 12:19:02 if you don't want a null terminator, lose the "- 1" and use .ascii instread of .asciz 12:21:20 Ah, BLESS YOU. I'm tearing my hair out over here. 12:21:28 The .short is the length field? 12:21:33 yes 12:21:33 I can make that .byte if I want to? 12:21:37 sure 12:21:45 How is that working exactly? 12:21:49 and you don't have to align if you don't want to 12:21:56 and there's probably a better way to make those labels unique 12:21:59 What's the magic in sl2\@ - ssl1\@? 12:22:15 \@ expands to the number of macros that have executed 12:22:39 sl1 and sl2 are just arbitrary prefixes I chose for "string length" 12:23:10 Oh - I see. You're referring to labels that don't exist yet. 12:23:14 yes 12:23:16 Ok - that makes sense. 12:23:20 Perfect - thank you! 12:23:36 I figured someone here would know, since Forth likes counted strings. :-) 12:26:56 BEAUTIFUL. I wound up with this: 12:26:58 9 .macro symbol name 12:27:00 10 .equ LEN, sl2\@ - sl1\@ 12:27:02 11 .byte LEN 12:27:04 12 sl1\@: .ascii "\name" 12:27:06 13 sl2\@: .zero 16-LEN-1 12:27:08 14 .endm 12:37:51 why LEN-1? 12:37:58 The count byte. 12:38:19 Count byte is one, string is LEN, 16-LEN-1 takes it on to 16. 12:38:27 oh yeah 12:38:59 I looked at it in the listing - it's doing just right. 12:39:32 This is about porting to that little ARM board. 12:39:47 I took my MacOS nasm file and ripped out all of the machine code (but kept all of the labels). 12:39:59 I'm working through that now getting it "gnu assembler happy." 12:40:17 Then when it assembles without error and looks right, I'll start putting in ARM instructions. 12:40:35 So all of my Forth definitions, headers, symbol table, etc. will already be there and good. 13:01:41 you can use .align 16 btw to do what you're doing with .zero 13:02:15 .align 16, 0 is probably what you want 13:02:40 Oh, ok. That seems slightly clener. 13:02:42 cleaner 13:03:05 without the ", 0" part, if it's in a text section then it'll encode a jump to the next aligned address 13:03:15 This is going pretty well. Got the symbol table and the headers all straight now, I think - moving on into the definitions, which mostly will involve switching dd to .int 13:09:49 --- quit: dddddd (Remote host closed the connection) 13:20:39 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 13:21:52 Got it - it assembles now. 13:53:20 zy]x[yz: Ok, another question. I have this line: 13:53:22 immed_d: .int latest-o, hcell-o, minus-o, dload-o, p8lit-o, 0x80000000, 0x0 13:53:42 In the listing it only p icks up the first five items - it doesn't include the 0x80000000 nd 0x0. 13:53:55 Do constants need some special treatment? 14:02:19 Well, if I move the numbers to their own line it works. 14:02:30 That seems... kind of strange and sloppy. 14:03:00 Also, I've been poking around in the gnu toolchain docs today, and apparently various aspects of the syntax for the assembler DEPEND ON THE TARGET. 14:03:09 Even allowed COMMENT specs depend on the target. 14:03:42 That tells me that this thing is a mash-up of assemblers from various sources and no one bothered to really "integrate" them - they're just loosly woven together "as are." 14:03:50 loosely 14:20:20 --- quit: gravicappa (Ping timeout: 272 seconds) 14:31:21 Ok, it seems it's only willing to do FIVE items on one .int line. 14:31:26 Wow. 14:32:24 Sure enough - that's it. Every single line I have with more than five is chopped short. Every line of five or less is rendered correctly. 14:32:39 That's... well - it's pathetic. 14:32:58 At least I know how to fix it without shooting in the dark. 14:34:09 Also, it seems to write 32-bit numbers in the listing with the 16-bit cells in big-endian order, but the nibbles within those cells in little endian. Took me a while to figure that out - I couldn't make heads or tails of the "linkage" of everything. 14:34:16 But it all looks correct under that assumption. 14:36:42 yeah gas kind of sucks 14:37:01 and I have no clue why your .int only takes five at a time 14:37:19 I've never had a problem with it. maybe it's a weird arm thing 14:37:47 Yeah - it looks to me like they just scooped up target assemblers wherever they could get them and put a wrapper around them. 14:37:59 So it could easily just have been a design limitation of that one assembler. 14:38:14 Really blew my mind that the comment methods vary from target to target. 14:38:44 tbh that's actually how I got into forth - I wanted to get away from gnu bullshit, and as I started looking for alternatives I decided it would be more fun to roll my own 14:39:15 and here I am two years later and still with something that only half works. oh well, it's been a fun time killer I guess 14:39:38 That's precisely why I like Forth so much - you can know it top to bottom. 14:39:44 Don't have to scratch your head over things. 14:40:40 I think all of my past Forths hve been toys, but I hve rather high hopes for this one. I think if I can just get it a little further down the road (which I'm NOT doing while I focus on porting what I've got to another platform), I might be able to start making it a real working tool day-to-day. 14:41:18 But I do want a "project version" that I can run on stuff I build myself, so the port energy isn't totally wasted. 14:41:56 --- quit: ashirase (Ping timeout: 244 seconds) 14:42:56 I hang out on another IRC channel; not a "topic" one - it's just a little cadre of guys that shoot the shit about more or less everything. I'm on there because I met the guy that owns the channel here in #forth a few years ago. 14:43:19 That channel pretty much qualifies as my most significant "social group," so I guess I have Forth to thank for that. 14:44:55 Outside of work and family those are pretty much the only people I communicate / socialize with on any sort of a regular basis. 14:45:16 Definintely not the most "well-circulated" guy around, that's for sure. 14:46:24 It's at least a little interesting, though, because that group is from all over. Not quite as much as it used to be - used to be there were several guys living in Europe in there. 14:46:30 They've mostly fallen away, though. 14:46:39 Now it's more "all over North America." 14:52:47 i just shitpost in #lua 14:53:23 that's about the extent of my social life 14:53:42 Uh, yeah - that's pretty much exactly what I'm talkling about. :-) 14:53:50 i have a cat that i'm pretty good pals with though 14:54:17 It's ok, though - I'm really big on family. I've got five daughters from 13 to 25, and they keep life really lively. 14:55:04 i have a cat 14:56:25 Ugh. This re-arranging my address lists so that I have five per line isn't exactly the most uplifting task in the world. 15:04:13 --- quit: kamog (Quit: ERC (IRC client for Emacs 26.1)) 15:11:57 that's dumb 15:16:28 Wow, I sure seem to have a lot of definitions that are seven cells long. 15:17:11 --- join: dys (~dys@tmo-103-134.customers.d1-online.com) joined #forth 15:43:12 KipIngram: you using assembly patterns like: ROT: .int TO_R, SWAP, R_FROM, SWAP, EXIT 15:44:19 I forget exactly how I implemented rot. I think I did it with three xchg instruction. 15:44:55 I probably could do more with macros, but I pretty much just wrote each primitive as its own little thing. 15:45:01 Whatever seemed like the best way there at the time. 15:45:19 no, I mean using ROT as an example of a colon word 15:45:46 Oh, well, I made rot a primitive, but yes, I have lines like 15:46:02 dot_d: dd pdot-o, space-o, dosem-o 15:46:12 : . (.) SPACE ; 15:46:24 Hand compiled version of what the compiler would make. 15:46:45 The -o is for the relocation stuff the MACHO format demands. 15:47:08 you based your forth of jonesforth or eForth or some other forth? 15:47:52 I just wrote it, from scratch. It's probably similar in some ways to FIG, but it's got a lot of differences too. 15:48:04 I didn't have a guide of any kind beside me. 15:48:33 or any listing? or even just glossary? 15:49:22 For a couple of words I used an older Forth of mine as a guide, and for that one I imagine I used Forth Fundamentals volume 2 glossary. 15:49:27 But for the most part I just wrote it. 15:50:17 Like my number conversion stuff? I just decided how I wanted that to work and start in on it, trying to keep it well-factored and so on. 15:50:32 Wound up with about 27 one-short-line defs hiding underneath NUMBER. 15:51:01 The very first programming experience I ever had was on my HP-41CV calculator in college - a stack system. 15:51:18 I've gotten pretty comfortable with "imagining stack flows" over the years. 15:51:18 how do you do such hiding? That is if one doesnt want to 'polute' the dictionary 15:51:45 Oh, yes. Well, when I'm hand compiling it's easy - I just include a CFA/PFA pair but don't link it into the header list. 15:51:55 For the real system, though, I plan to have words :: and ::WIPE. 15:52:10 :: will work just like :, but will put the word on a temporary list. 15:52:13 ::WIPE will empty it. 15:52:35 The CFA/PFA will stick around, of course, but the rest will go away. 15:52:58 I wanted something good on that front, because yes - they encourage you to factor, but you really don't want all of that in the dict. 15:52:58 one idea I had was to allow nesting of : ... ; inside each other 15:53:18 Yeah, that would work too. This just seemed easier to implement to me. 15:53:52 The way I do vocabularies will let you do some hiding too, but those words aren't really GONE. 15:53:55 They're just out of scope. 15:53:58 havent gotten it working with 'split' dictionary (where the name strings NAs are kept seperate) 15:54:17 That's what this one is. I have a "symbol table" that has the name strings, with usage counts. 15:54:22 I mean for that to be system wide. 15:54:30 It's purpsoe is just to map names onto unique integers. 15:54:54 Then each process has its own dictionary, that links to the central core dictionary, and where a traditional dictionary would have name these have indices. 15:55:12 When I first started that out my goal was to emulate Chuck Moore's "lightning fast compile." 15:55:35 But as I got into it I started to decide that you couldn't do that and have multiple processes and vocabularies. 15:55:39 arent those just a bit like those Scheme enviroments? 15:55:57 Either of those things let you have the same word mean different things in different contexts, and that seemed incompatible with his fast stuff. 15:56:08 I'm not familiar with Scheme. 15:56:27 that is, using indicies into that kind of structures 15:56:50 This will speed up my compile some, because I'll store the integer indices in source code, not the name strings, and my "name compares" as I search a dictionary will just be a single integer compare. 15:56:54 well, I am a bit of a polyglot regarding programming languages. 15:57:04 and I'll still be able to get all of the source compression benefits that Moore has. 15:57:15 :-) 15:57:16 --- quit: pierpal (Ping timeout: 264 seconds) 15:57:24 I am too in some arenas. Interested in tons of things. 15:57:43 I've worked up a compression scheme for the source storage. 15:57:59 I'll be able to represent the 127 m ost frequently used words in the source as single bytes. 15:58:12 And pretty much everything else, up to 8k words, sa two bytes. 15:58:33 right, a bit like E (of erights.org) or Waterken wholenums 15:58:54 Moore doesn't format his source these days, but I wanted to - I added the ability to encode multiple spaces / line feeds in a compact format too. 15:59:15 Other than implementing the symbol table I havent even begun on that part yet. 15:59:16 of if you are more familiar with msgpack it is like how you encode positive integers. 15:59:36 One of you guys pointed me at msgpack a couple of months ago - I think it will be great for streaming data between my processes. 15:59:48 I actually plan to roll msgpack and this source compression into a layered scheme. 16:00:03 I.e., the source compression has a way to call out a msgpack. 16:00:18 btw, is it strange that I even sketched out an gamepad entry method for forth? 16:00:27 I also plan to store comments remotely from the source, and have a way to control whether they're rendered in the editor or not. 16:00:40 I tend to undercomment, because I hate to "clutter up my code." 16:00:55 This is an attempt to do better - maybe if I can turn them off they won't bother me so much. 16:01:14 No, I don't think that's strange at all. 16:01:15 :-) 16:02:45 so, you know how in Chrono Trigger and other JRPG-esque games or even password to level to save kind of games you have an up-down scrollable alphanumeric 'wheel' at each character? 16:05:10 Yes. 16:05:16 the idea is that one starts with say "a" and before you move the cursor to next character the system has looked up last word defined that starts with an 'a' 16:06:10 Ok. 16:06:20 and outfills that in. On next character one has a choice to change it from the default fill in. 16:06:44 this narrows the search further and one can continue so on 16:07:11 an space (0x20) at the end is always part of the 'guess'. 16:08:12 That sounds pretty interesting. 16:09:36 so one does not have to input the words char by char painstakenly but use the 'guess' if its correct by just pressing -> until the cursor is off the guessed word to confirm it. 16:10:46 Right. 16:10:47 with some inteligence or more statefullness one could make it so that words like : and ." suppress this behaviour 16:11:20 It also has some aspects of a help system - you don't even have to remember the whole word. 16:11:23 (for : it would be for the next word only, for ." until " is reached) 16:12:40 yes, it does. Hadnt thought of that. 16:13:48 the idea sprang up from using something like SNES gamepad or CHIP8 esque hexdecimal-pad for entry. 16:15:40 for the latter I thought of also giving the option of mapping 3x4 part of it to standard phone-pad and use the same old entry method as used on Nokia 3210 or 5110 16:18:19 btw, I wanted to ask, what is peoples opinion of writing octals like 0o777 ? 16:18:55 I guess it's as good as any. I rarely use octals. 16:19:17 My system supports arbitrary base, with non-decimal bases given as part of the number. 16:19:28 : 16:19:50 I allow b: for binary and x: for hex, so I guess o: would be easy too. 16:20:11 I have in my NUMBER to decode 0x0000 as hex, 0b0000 as binary 0q0123 as quads (mainly as an Trekkie injoke), 0x777 as octals and rest as decimals (if that is the mode) 16:20:14 For outputting in other bases I can do that using my formatted output stuff. 16:20:21 You can put a base in the format string. 16:23:37 what I like quite a bit about Forth is how flexible and unprescripive it is. Though I make a point to look at other Forths and possibly have ANSI compatibility mode/whatever 16:23:59 Yes, absolutely. 16:24:08 "unprescriptive" - I like that word. 16:24:13 It's exactly right. 16:25:02 but as the saying goes, You can write Fortran in any language thus making your code unreadable. 16:25:14 :-) Right. 16:25:23 I've written some REALLY bad Forth over the years. 16:25:38 I'm trying hard to keep this one really clean, and so far I'm happy with how it's going. 16:26:24 what I have noticed is that I am now more prone to factor functions, procedures and routines into smaller parts. 16:26:45 sometimes one-liners following each other 16:28:14 Yes, I've just refused to let myself "not do that" on this one. 16:28:33 I put the Forth over the assembly as a comment, and my longest Forth definition is maybe 60 characters long. 16:28:52 I don't really plan for my editor to be the traditional 16x64, but I'm kind of using that as a criterion just the same. 16:32:58 another programming language dear to me is Tcl (and its subset picol) which has resulted in me finally writing the first few 'list'/string manipulation and index-into words the other day 16:33:45 Ah. I'm not familiar at all with TCL. Is their a good "nutshell" that expresses its uniqueness? 16:33:53 damn how ( char_addr count ) is handy to work with instead of C's null terminated strings 16:34:24 well, 'everything is a command' and 'everything is a string' basically 16:36:40 and it is, like the inventor/author of Scheme, Guy Steele Jr. puts it "a growable language" 16:37:34 there are twelf quoting and substitution rules and that is it. 16:38:53 with 'lists' what one has is whitespace seperated items but due to nestable curly braces those items can have whitespaces and other curly brace pairs inside them 16:39:24 Hmmm. I like things with a simple set of rules that extends. 16:40:39 besides, Tcl/Tk exists on nearly all platforms I know of. Makes it pretty handy to throw together some rudementary scripts with GUI in a short while 16:41:13 (or /Ttk nowdays for Theamed Tool Kit) 16:42:50 very nice too when many tools in my profession are natively scriptable with it (my profession is electronics technician, which is like electronic engineering but much more hands on and less mathy and theoritical) 16:43:47 what I like about Forth is how easy it is to bring up on a new device and use it as an onboard debugger and hw tester 16:43:51 Got that line splitting done. :-| 16:44:01 yes - I love that about Forth. 16:44:11 Got to run to the drug store with my daughter - back shortly. 16:54:59 so you do drugs with your kids eh 17:14:27 lmao :-) 17:14:33 Yeah, that's me... 17:14:37 You caught me. 17:14:50 I'm afraid we didn't get anything even remotely that entertaining. 17:14:57 The closest I came was some melatonin. 17:30:56 --- join: pierpal (~pierpal@host102-235-dynamic.181-80-r.retail.telecomitalia.it) joined #forth 17:37:48 So everything I've checked so far in this listing looks right numerically. 17:37:57 The layouts, the linkages, etc. 17:38:09 Right now all of my code symbols have the same value - they're just stacke in there with no code. 17:38:27 And they're stored as "offset from beginning of code," but with no code those are all zero. 17:38:33 So every CFA field is zero. 17:38:41 But the PFAs seem to be pointing to the right places. 17:56:40 --- quit: dddddd (Remote host closed the connection) 18:05:16 james cameron used to make good movies 18:07:14 He did make some good ones. 18:07:18 You watching one? 18:08:56 Zarutian: you were asking about my use of references while I've written this stuff. I've added enough "non-standard" words to this, that get involved in the nitty-gritty of solutions, that I sort of have to write it from scratch; with those words I can do control structures and so on that a traditional Forth can't. 18:16:58 i just watched terminator 18:17:07 Ah, nice. 18:17:09 First one? 18:17:13 yeah 18:17:16 I always liked watching 1 and 2 together. 18:17:32 usually I watch the second one. I think I've been underrating the first one all this time 18:17:34 Those two and "Alien" + "Aliens" - both are really nice double features. 18:17:45 yes 18:17:48 And in both cases none that came after came even close to being as good. 18:17:55 yes 18:19:17 --- join: dave9 (~dave@90.20.215.218.dyn.iprimus.net.au) joined #forth 18:19:25 hi 18:19:32 Hi Dave. 18:19:42 hi KipIngram 18:29:24 alien wasn't cameron though 18:30:07 --- quit: epony (Quit: QUIT) 18:30:56 Yeah. Just my other "favorite double header." 18:38:08 blade runner actually qualifies as one now too 18:38:23 one of the few modern sequels that came out good 18:44:02 --- quit: pierpal (Quit: Poof) 18:44:20 --- join: pierpal (~pierpal@host102-235-dynamic.181-80-r.retail.telecomitalia.it) joined #forth 18:47:59 Yes, the sequel was pretty good, that's true. 19:21:56 --- quit: pierpal (Read error: Connection reset by peer) 20:10:45 --- quit: dave9 (Quit: one love) 21:02:54 --- quit: phadthai (Remote host closed the connection) 21:05:48 --- join: phadthai (mmondor@ginseng.pulsar-zone.net) joined #forth 21:09:18 --- quit: phadthai (Remote host closed the connection) 21:11:21 --- join: phadthai (mmondor@ginseng.pulsar-zone.net) joined #forth 23:59:40 --- join: epony (~epony@unaffiliated/epony) joined #forth 23:59:59 --- log: ended forth/18.09.16