00:00:00 --- log: started forth/19.08.14 00:15:07 --- join: dys (~dys@2003:5b:203b:100:a64c:c8ff:fef4:13a6) joined #forth 00:32:39 --- quit: MrMobius (Read error: Connection reset by peer) 01:15:42 yeah but you gotta be able to execute syscalls 01:15:58 Lina does that, idk about gforth 01:25:16 --- join: tpbsd (~Terry@2001:44b8:314b:a800::10) joined #forth 01:25:16 --- quit: tpbsd (Changing host) 01:25:16 --- join: tpbsd (~Terry@mecrisp/staff/tp) joined #forth 01:26:39 --- quit: tp (Read error: Connection reset by peer) 01:29:05 hmm 01:29:19 syscalls? 01:29:30 --- nick: tpbsd -> tp 01:33:52 obvious troll answer: if you do everything that unix/socket.fs does, you obviously don't need unix/socket.fs anymore 01:36:14 hmm 01:36:36 I just wanna do a simple tcp connection :P 01:36:46 nothing more 01:37:35 whats simple about a tcp connection ? 01:38:09 to connect to "google.com:80", write success and close 01:38:11 that's it 01:40:16 but without including external libraries 01:41:38 Matthias Koch and Bernd Paysan developed a Ethernet driver for the tm4c1294 and it's 1114 lines of Forth. It was anything but simple I was told. 01:42:08 it's for mecrisp-stellaris and the source is in the release 01:43:50 I've used it and it's pretty nice, worked perfectly including using the leds on the tm4c1294 'tiva connected launchpad' as ethernet connectivity indicators 01:44:29 the error filled Ti documentation for the tm4c1294 didn't help either 01:45:51 nullnullnull: ok, on which platform? linux+gforth? 01:47:50 gforth yes on ubuntu 01:47:58 linux yes 01:51:08 ok, then what WilhelmVonWeiner and i said applies. 01:51:58 syscalls (= system calls) are like function calls, but they go into the kernel instead of into a library 01:52:16 you can use the tool 'strace' to figure out which syscalls a program does 01:52:43 they are also documented in the manpages, but in a C-oriented notation 01:53:00 you can wrap the syscalls in forth, if you figure out how 01:53:47 socket, bind, connect, send/write, recv/read, shutdown, close are the relevant syscalls in this case 01:53:49 Lina Forth has a couple words, XOS and XOS5, for syscalls 01:54:03 and you just leave your data on the stack 01:54:11 it handles the syscall execution 01:54:51 hmm 01:55:25 sounds like a complicated thing to do 01:55:52 nah 01:56:07 I played with it a couple months ago 01:56:22 never got anything done because of my job 01:56:50 cuz I'm new to Forth :P but I will try 01:56:51 http://ix.io/1RCM 01:57:10 oh if you're new to Forth that might be a bit weird 01:57:45 you can see it's unfinished because the definition of (BIND) is unfinished 01:57:57 yeah 02:03:37 I did bind a socket and do something though, what that something is, I have no idea 02:04:01 ok thanks mate :) I will check 05:04:11 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 05:12:01 --- quit: gravicappa (Ping timeout: 268 seconds) 05:12:37 --- join: gravicappa (~gravicapp@h109-187-16-242.dyn.bashtel.ru) joined #forth 06:05:17 --- join: john_metcalf (~digital_w@host86-173-73-232.range86-173.btcentralplus.com) joined #forth 06:26:59 --- quit: chunkypuffs (Remote host closed the connection) 06:33:35 --- join: MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 06:59:55 --- join: chunkypuffs (~chunkypuf@static.203.112.216.95.clients.your-server.de) joined #forth 07:17:59 --- quit: dave0 (Quit: dave's not here) 08:11:25 --- join: wildtrees (~wildtrees@unaffiliated/wildtrees) joined #forth 08:55:32 guys, is there a way to make unix/socket.fs work without libtool? cuz libtool is an external library 08:56:05 unlikely 08:56:19 gforth needs libtool for C ffi 08:56:34 oh 08:56:50 but why they separated the package? 08:57:05 split 08:58:26 Because it is obviously not speciffic to gforth. 08:59:16 hmm ok so no other way around, without libtool 08:59:19 I will install it 08:59:37 thanks guys ;) 08:59:44 nullnullnull: GForth :: NYH2P 08:59:59 im using gforth yeah 09:03:15 btw do you know how can I add a max-timeout to this: s" google.com" 1234 open-socket 09:03:25 or should I just use an async thread 09:09:51 I would bet on "epoll" :3 . 09:25:07 gonna check ;) thanks mate! 10:06:44 hmm didnt find something with epoll but i found this page: https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Threading-Words.html#Threading-Words 10:06:49 gonna see 10:07:24 i mean this: https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Threading.html#Threading 10:07:33 threading 10:15:49 --- quit: dys (Ping timeout: 250 seconds) 10:26:54 --- join: dys (~dys@tmo-080-151.customers.d1-online.com) joined #forth 10:44:32 dam, cant get that thread thing to work 12:15:38 do you guys ever read the Forth google group 12:15:44 what the hell are these people smoking 12:18:49 WilhelmVonWeiner: Link to examples= 12:18:51 ? 12:22:01 https://groups.google.com/forum/#!forum/comp.lang.forth 12:22:09 FORTH from NIGERIA, PRINCE JUERGEN PINTANGULUNGU 12:22:17 Amazon will pay to me 2 million U$S in royalties from the clicks 12:22:17 generated on free forth websites, and 2 pounds in diamondsbitcoins 12:22:17 (I earned as employee of the month), but first 12:22:17 I need to sell at last 5 books of Forth till next week. 12:36:10 --- join: mtsd (~mtsd@94-137-100-130.customers.ownit.se) joined #forth 12:42:11 Hi guys. So - Flow-based programming. I've been all enthused over that, and have plans for making my Forth well-suited for it. But a guy at work made a comment yesterday that gave me cause for concern. 12:42:27 We have a software system that we'll be moving from single-threaded to multi-threaded in the future. 12:42:43 I suggested an approach to that that would leave large parts of the system unchanged. 12:42:46 is the Morrison's fbp 12:43:04 Basically it would involve letting one core handle this subsystem, one core handle that subsystem, etc. 12:43:17 In other words, something a lot like Flow-Based. 12:43:43 He said that they tried that on a past project, and it was terrible. He said it's crucial that one core own the entire process, end-to-end. 12:44:03 ??? 12:44:12 Which means that all of the subsystems have to be accessible to all the cores. 12:44:24 what was terrible about it? 12:44:58 I assume the problem was that when a task changes cores there's a cache-related cost to be paid. 12:45:04 poor performance. 12:45:26 If one core handles the whole task, it can keep info related to that task in its cache the whole time. 12:45:47 So they want to have all the cores be "the same," so to speak, and the system designed to be "used" by several cores. 12:45:55 Rather than split the functionality across cores. 12:46:04 you know what they say, to assume makes an ass out of u and me 12:46:13 It's like slicing the work at 90 degrees to the other way. 12:46:45 Yes, they do - I was just thinking of why passing work from core to core would hurt performance. 12:46:50 That's one possible way. 12:47:26 what's the program doing, might I ask? 12:51:33 WilhelmVonWeiner, comp.lang.forth is a Usenet group, it was around long before Google existed and was traditionally accessed with a "news Reader" application. Google just made up some interface to it. 12:52:03 I didn't realise usenet was still a thing 12:52:11 and thought they all just moved over to google groups 12:52:41 WilhelmVonWeiner, comp.lang.forth is also where some of the Forth heavy hitters still post responses, people like Elizabeth D Rather (Forth.inc) 12:53:12 I mean she's canonically a heavy hitter but doesn't D/ still escape Forth Inc 12:53:45 WilhelmVonWeiner, nah, comp.lang.forth is still very active, and sadly like all usenet groups and even here on this ch has some persistent idiot trolls 12:54:21 isn't it funny how the Forth community killed Forth 12:54:31 with the standards wars and that 12:54:36 but comp.lang.forth rarely gets into embedded, so I don't read it any more 12:54:53 funny ? no, predictable yes ? 12:55:04 how does one kill forth? 12:55:30 Chuck hated the 'standards bodies' getting all over Forth and I see his point 12:55:46 you mean i can't use forth anymore?? 12:55:56 ANSI Forth is ANTI Forth by Jeff Fox is a good read 12:56:06 not a good "read", his prose is solid walls of text 12:56:16 but it's good 12:56:24 zy]x[yz: you know what I mean 12:56:41 I think chuck had to invent the GA-144 so that it was so complex the standards people couldnt understand it and 'standardise" it ? 12:56:54 GA144 is so simple 12:57:04 have you read the documentation for the F18x 12:57:10 Yeah, I have Mr Fox's article on my website 12:57:13 i don't, though. i see the same thing in #lua: every so often someone new joins and talks about adding kitchen sink features to lua, because they're concerned about lua dying. it still seems to work for me, i don't get what the concern is 12:57:23 no, it's too complicated for me 12:57:49 http://www.greenarraychips.com/home/documents/greg/DB001-171107-F18A.pdf 12:57:54 Im happy with only one cpu and 33 peripherals, it's all I need. Im a user not a programmer 12:58:50 just specializing in ARM Cortex-M0 is plenty for me 13:02:30 --- quit: dys (Ping timeout: 245 seconds) 13:12:04 --- quit: gravicappa (Ping timeout: 245 seconds) 13:30:05 --- join: dys (~dys@tmo-096-250.customers.d1-online.com) joined #forth 13:58:57 --- quit: mtsd (Quit: Leaving) 14:00:37 WilhelmVonWeiner: I've enjoyed most Jeff Fox stuff I've read. 14:00:52 He doesn't really "explain the secrets," but if you read between the lines you can figure a good bit out. 14:16:54 so guys is there a way to use threads (async) with gforth? 14:41:19 nullnullnull: http://www.forth.org/svfig/kk/11-2018-Harbold.pdf 14:50:23 hmm 14:50:54 nice presentation 15:13:33 john_cephalopoda, do you have a small code example? I wanna run a parallel thread 15:20:29 I haven't tried it out myself, that presentation is just the first result when I looked for it online. 15:33:22 ok thanks mate :) I will see 15:53:43 --- join: ryke (~Thunderbi@71-9-169-152.dhcp.jcsn.tn.charter.com) joined #forth 16:03:51 --- join: wigbig (~syd@cpc95880-hart11-2-0-cust675.11-3.cable.virginm.net) joined #forth 16:17:23 how to exit 0 or 1? (success/failure) 16:31:01 --- quit: john_cephalopoda (Ping timeout: 264 seconds) 16:43:49 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 16:52:35 --- quit: dys (Ping timeout: 244 seconds) 17:01:50 --- join: rdrop-exit (~markwilli@112.201.162.86) joined #forth 17:21:15 --- join: tabemann (~tabemann@rrcs-162-155-170-75.central.biz.rr.com) joined #forth 17:26:08 --- quit: wildtrees (Quit: Leaving) 17:49:33 Hi all :) Is it acceptable to ask for comments on code here? 17:51:29 --- join: dave0 (~dave0@069.d.003.ncl.iprimus.net.au) joined #forth 17:53:05 wigbig: Yes 17:53:32 --- quit: ryke (Ping timeout: 246 seconds) 17:58:55 --- quit: tabemann (Remote host closed the connection) 17:59:12 Good morning Forthwrights 18:00:09 pointfree: thank you 18:00:37 https://github.com/dys-bigwig/Forth-6502-parse/blob/master/asm.fs 18:02:17 --- quit: wigbig (Quit: Leaving.) 18:02:40 --- join: wigbig (~syd@cpc95880-hart11-2-0-cust675.11-3.cable.virginm.net) joined #forth 18:03:33 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 18:03:43 I couldn't work out how to use the stack to juggle addressing modes due to them being indistinguishable from numbers. If every instruction took a mode this would be fine, but some are implied, and so it's not guaranteed in that case that there would be a mode flag on top of the stack. 18:05:25 --- quit: nullnullnull (Ping timeout: 245 seconds) 18:06:28 --- quit: MrMobius (Ping timeout: 244 seconds) 18:06:28 --- nick: [1]MrMobius -> MrMobius 18:08:48 I can't help on the 6502 side, haven't done any since I was a teenager 18:10:42 As far as your code, I wouldn't use a case statement, I would set a word to point to the behavior 18:12:05 Depending on the Forth your using that would mean using either PERFORM, @EXECUTE, or DEFER 18:12:15 *you're using 18:12:21 Aaah, so have the addressing-mode words set the ADDR-MODE constant to an execution token or something? 18:12:29 *variable 18:12:30 yes 18:13:20 See the advice in Thinking Forth "Don't set a flag, set the function" IIRC 18:13:37 Considering I'm a schemer at heart, I should be at least a little ashamed of myself for not using (what I naively sort of consider to be) Forth's equivalent of higher-order functions ;) 18:13:44 thanks for the advice, much appreciated. 18:13:54 My pleasure 18:17:23 I would use flags/masks when the behavior depends on a complex combination of conditions. 18:18:13 In that case the combined mask serves as the index of the function. 18:18:40 (in a function table) 18:23:17 --- quit: cp (Quit: Disappeared in a puff of smoke) 18:23:45 I think I used the same approach for a joypad-button handler in assembly. You could handle combinations of buttons by AND/OR-ing them - each button being represented as a bit in a byte - and then using that as the offset a jump table. 18:24:01 *offset into a jump table 18:24:24 Exactly 18:24:33 --- join: cp (~cp@b157153.ppp.asahi-net.or.jp) joined #forth 18:25:45 If it's the logic is straightforward set the function, if it depends on a combination set a mask and use it as an index into a jump table. 18:26:23 * delete "it's" 18:29:10 If there's a combinatorial explosion, refactor :) 18:29:45 Rather, rethink and refactor :) 18:39:21 The above assumes the frequencies and costs of checking the conditions are fairly uniform, if you need to prioritize the checking of conditions then early exits are more appropriate. 19:14:25 I'm trying to write an INIT function which sets the ADDR-MODE variable to a specific execution token, but I keep getting "attempt to use zero-length name as a string". Any idea why? I'm using gforth. 19:14:43 the code I'm using to test is just: ": FOOBAR 40 2 + ;" followed by ": INIT FOOBAR + ADDR-MODE ! ;". If I run the variable-setting code manually in the interpreter, it works 19:17:37 apologies, I needed to use ['] 19:26:40 Sorry I was away. 19:31:26 I use the word references for this, e.g., 19:31:30 : ] () 'dispatch references compiler ; 19:32:20 It's just syntactic sugar for "['] compiler 'dispatch !" 19:32:33 IIRC some Forths use IS for this 19:34:07 no worries, thanks for answering. I'm afraid that went a bit over my head though, haha. 19:34:17 Is the behaviour of that different from just replacing ' with ['] in the source as I have? 19:35:02 It's a common Forth convention to name a "function pointer" 'FOO 19:35:23 e.g. 19:36:47 variable 'foo 19:37:00 : foo ( -- ) 'foo perform ; 19:38:44 Some Forths use the DEFER IS mechanism instead, I prefer not to. 19:39:28 To initialize 'foo to I do: 19:39:53 : foo0 ( -- ) 'foo references foobar ; 19:43:31 If it's a function table, I do something like this: 19:44:40 #foo cells buffer fooers 19:45:40 : 'foo ( # -- a ) cells fooers + ; 19:46:25 : foo ( # -- ? ) 'foo perform ; 19:46:46 or one of many variations on that thme 19:47:41 (if you're using Gforth, I believe you'd need to use "buffer:" instead of my "buffer" 19:48:16 In the first case, 'foo is the name of the function pointer, and foo0 is the word which sets 'foo to a specific function's address? Sorry if I'm a bit slow picking this up, hope you don't mind explaining. 19:49:09 foo0 is the word that initializes 'foo I use words ending in 0 to mean initialize or reset. 19:50:08 Think of it as foo-init 19:50:55 thank you, that makes sense. Is foobar a way of indexing into the references table to get a specific function's address? 19:51:52 foobar in that example is word 'foo will point to when initialized 19:52:11 * is the word 'foo will... 19:52:29 or re-initialized 19:56:42 does the word "references" set a function pointer to the following word? So references takes 'foo, grabs the next token in the input stream (foobar) and sets 'foo to the execution token (of foobar)? Apologies again, I think I'm really struggling with this for some reason haha. 19:56:55 --- join: rdrop-ex1t (~markwilli@112.201.162.86) joined #forth 19:57:02 --- quit: rdrop-ex1t (Client Quit) 19:57:06 --- quit: rdrop-exit (Read error: Connection reset by peer) 19:57:47 --- join: rdrop-exit (~markwilli@112.201.162.86) joined #forth 19:57:56 lost my connection for a while 19:58:33 Yes 19:58:46 'foo references foobar 19:58:54 in my Forth is equivalent to 19:59:06 ['] foobar 'foo ! 19:59:37 It's just syntactic sugar 20:00:42 Aha! So I've just been doing that manually (maybe gforth has an equivalent of references). It was the ": ] () '" and "compiler" stuff that went right over my head. 20:01:51 thanks for going through that with me. 20:02:25 I don't use GForth, but I would assume it uses the words DEFER and IS instead of the way I do it. 20:02:45 No problem 20:03:28 My approach is more basic 20:05:19 The DEFER approach uses a "smart" FOO instead of more rudimentary 'FOO and FOO 20:06:12 * the more rudimentary 20:07:25 I prefer the more basic way of doing "function pointers" 20:11:36 If you don't mind helping me out with something else, is there a way to create arrays of specific elements in the source code? Essentially using "VARIABLE LDA-MODES 6 CELLS ALLOT" and setting each of the cells to a fixed value is what I'm attempting to do. 20:13:02 the plan is to have each opcode-word push the address of an array containing its codes for each mode, which the pointed-to functions then pull a specific element from. 20:15:24 --- quit: rdrop-exit (Ping timeout: 245 seconds) 20:20:07 --- quit: dddddd (Remote host closed the connection) 20:34:49 --- quit: dave0 (Quit: dave's not here) 20:58:29 I think I've worked out a way to do it, kludgey or not: mimicking what CONSTANT does, but with 7 values enclosed in the dictionary instead and leaving the address on top of the stack (aka an empty DOES>). This is fun! :) 20:59:03 --- join: rdrop-exit (~markwilli@112.201.162.86) joined #forth 20:59:32 Lost freenode again, argh 21:00:02 wb :) 21:00:18 thanks :) 21:00:27 Do you mean this? ... 21:01:33 create lda-moves ' this , ' that , ' the-other , (etc...) 21:01:44 * lda-modes 21:02:38 or if you just want integers... 21:02:52 create lda-modes 123 , 456 , etc... 21:05:40 Yes, I think so - : CON CREATE , , , , , , , DOES> ; 21:05:46 and then: $B1 $A1 $B9 $BD $AD $B5 $A5 $A9 CON LDA 21:06:01 CON was a placeholder, forgot to change before pasting, sorry. 21:06:34 In that case I would do: 21:07:18 create lda $B1 b, $A1 b, 21:08:10 (you might have to replace b, with whatever's appropriate for laying down single bytes in your Forth, probably c, 21:08:29 Sorry 21:08:49 create lda-codes $b1 b, etc... 21:09:27 : lda-code ( # -- b ) lda-code + b@ ; 21:09:54 * : lda-code ( # -- b ) lda-codes + b@ ; 21:10:58 oops, you wanted it called "lda" 21:11:12 : lda ( # -- b ) lda-codes + b@ ; 21:11:46 can I ask what the + is for? Sorry, this is my first day coding Forth so I can't parse things fast at all, haha. 21:12:31 A word that is define with CREATE returns the address of its data 21:12:48 aah, it's for indexing. 21:12:49 So lda-codes in effect returns the address where 21:12:58 the $b1 is located 21:13:00 yes 21:14:53 there's no need to load up the stack with the codes since you can just lay them down one by one in the create 21:15:00 line 21:16:35 Mind that's just how I would do it, there's really no common Forth style for this kind of thing 21:17:28 Every Forther has his idiosynchracies 21:17:31 I'm overjoyed I have a basic understanding of what create and does> do now. I think this is a gateway drug of some sort, haha. 21:17:40 * indiosyncrasies 21:18:04 --- join: gravicappa (~gravicapp@h109-187-16-242.dyn.bashtel.ru) joined #forth 21:18:40 thanks :) 21:18:42 Cool, I never use DOES> I don't the lack of factoring 21:18:54 * like the lack ... 21:21:00 Have you read Starting Forth? 21:21:54 I was going to say, perhaps it would make sense to use DOES> to perform the function pointed to by ADDR-MODE. Either that, or have separate words for the opcode modes (storing the bytes) and the opcode word itself, which would simply push the address of its modes and perform the aforementioned function. 21:23:03 I've skimmed it several times in the past, but I felt like this time I should actually code whilst reading it to have the knowledge sink in. I got carried away coding this, haha. 21:23:55 Experiment with the different styles, so you get a feel of the tradeoffs, and find the one that best fits you 21:24:19 Forth is the Burger King of languages 21:24:56 The more you program in Forth the more you develop a personal dialect and style best suited to you 21:26:52 (but hopefully not undecipherable to others) 21:27:43 I'm normally drawn to trying to do everything in the most "idiomatic" way, so this could be a nice change of mindset. Can't remember who said it, but that line about how "learning a language being useless if it doesn't change the way you think" comes to mind. 21:28:18 Forth is definitely "out there" compared to most languages :) 21:29:08 I wouldn't even call it a language 21:29:30 Lunch is served, catch you later. Keep on Forthin' :) 21:29:54 --- quit: rdrop-exit (Quit: Lost terminal) 22:02:42 --- join: dys (~dys@tmo-096-250.customers.d1-online.com) joined #forth 22:10:49 --- quit: wigbig (Ping timeout: 248 seconds) 22:12:21 --- quit: Keshl (Read error: Connection reset by peer) 22:12:35 --- join: Keshl (~Purple@207.44.70.214.res-cmts.gld.ptd.net) joined #forth 23:59:59 --- log: ended forth/19.08.14