00:00:00 --- log: started forth/18.10.20 00:27:26 --- quit: Zarutian (Ping timeout: 246 seconds) 00:29:53 siraben: this looks very interesting: https://www.ticalc.org/pub/text/z80/z80_reference.txt 00:44:52 --- join: rdrop-exit (~markwilli@112.201.162.180) joined #forth 00:45:11 --- quit: rdrop-exit (Client Quit) 00:46:00 --- join: rdrop-exit (~markwilli@112.201.162.180) joined #forth 01:13:24 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 01:34:44 --- quit: dave0 (Quit: dave's not here) 01:34:47 --- quit: verisimilitude (Remote host closed the connection) 02:03:36 --- quit: ashirase (Ping timeout: 272 seconds) 02:07:00 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:42:28 --- quit: ncv (Ping timeout: 252 seconds) 02:42:34 --- join: ncv_ (~neceve@unaffiliated/neceve) joined #forth 02:50:33 --- quit: ncv_ (Remote host closed the connection) 02:50:55 --- join: ncv_ (~neceve@2a02:c7d:c5c9:a900:6eaf:6ef7:3b81:d5f6) joined #forth 02:50:55 --- quit: ncv_ (Changing host) 02:50:55 --- join: ncv_ (~neceve@unaffiliated/neceve) joined #forth 03:06:49 --- join: dave0 (~dave@90.20.215.218.dyn.iprimus.net.au) joined #forth 03:07:11 re 03:08:03 --- quit: ncv_ (Remote host closed the connection) 03:08:22 --- join: ncv_ (~neceve@2a02:c7d:c5c9:a900:1ec6:932f:1b02:d27e) joined #forth 03:08:22 --- quit: ncv_ (Changing host) 03:08:22 --- join: ncv_ (~neceve@unaffiliated/neceve) joined #forth 03:10:33 --- quit: ncv_ (Remote host closed the connection) 03:10:54 --- join: ncv_ (~neceve@2a02:c7d:c5c9:a900:6eaf:6ef7:3b81:d5f6) joined #forth 03:10:54 --- quit: ncv_ (Changing host) 03:10:54 --- join: ncv_ (~neceve@unaffiliated/neceve) joined #forth 03:46:18 --- join: wa5qjh (~quassel@175.158.225.213) joined #forth 03:46:18 --- quit: wa5qjh (Changing host) 03:46:18 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 03:53:38 moony: parsing the next word in the input stream is canonical Forth, but new-wave Forth-likes (ColorForth and Retro for examples) shun the inconsistency 03:55:47 dave0: I need to write a program to give me those counts as well, so I can profile faster. 03:56:38 Hm. Perhaps it's strangely fortuitous that my calculator OS is not working, because I could attempt to flash my own. 03:56:53 i.e. go all the way to the bare metal 03:57:10 dave0: Thanks for that resource. 03:57:13 I think exposing the parsing mechanism to the user is good, but words included with a system shouldn't use em 03:57:50 unneeded complexity 03:58:00 Playing with parsing would be fun. Not only extend the language syntax but also add more "types" 03:58:04 My outer interpreter is word at a time, rather than line at a time. 03:58:29 Similar to how LaForth did it. 03:58:35 Mine copies into a buffer, then does each word at a time. If we hit the end of the buffer, we copy more from the current stream. 03:59:07 It's somewhat broken in that you don't have full control of the mechanism, so I can LOAD files from the REPL but not LOAD within a LOAD. 03:59:37 Copies what into a buffer? 03:59:45 so can you parse the next word in the input stream from within a program? 04:00:01 e.g. typing "LOAD FOO1 LOAD BAR1" at the REPL will only load FOO1 as "LOAD BAR1" is never read because the buffer is overwritten with FOO1's constants 04:00:01 Or do you have the syntax ` VARIABLE` 04:00:14 weird 04:00:22 rdrop-exit: Copies as many non-zero characters (up to 128) into a memory region. 04:00:42 Then WORD comes along and reads from this memory region and copies it into its own "word buffer" 04:01:12 ^copies n characters from the current "stream" 04:01:31 Although that's not technically correct because I don't have streams yet, just pointers pointing things around. 04:01:45 It's one part of my implementation that I don't like 04:03:50 I read up to a TIB full of bytes into TIB, I don’t have a word buffer, just use HERE. 04:06:41 BTW, Leoliger’s Threaded Interpretive Languages book describes a Z80 ITC Forth. 04:07:46 … or more accurately it describes his own very quirky ITC Forth dialect. 04:08:34 *Loeliger 04:09:19 Might interest you since your doing an ITC Z80 implementation IIRC 04:11:14 Yes, is NEXT fast? 04:11:21 Well, currently it's DTC but I need to switch to ITC. 04:12:27 You should be able to find a scan of the book online, Byte Books, 1981 04:12:49 I got a copy of Lib Gen 04:13:10 off* 04:13:13 LOAD should just take a string, and the string should be an argument, s" FOO1" LOAD 04:13:32 I think words like LOAD being prefix is absolutely weird 04:14:11 LOAD isn’t prefix 04:14:55 it takes a block number 04:15:18 Ah, not standard conforming :) 04:15:23 with siraben's example theirs is prefixed to it's argument 04:15:24 I don't have blocks, yet. 04:15:45 sorry, I hadn't scrolled down 04:16:03 didn't realise we'd moved on 04:16:11 I just thought it would be easier to read "LOAD FOO" 04:16:42 My host Forth is block based. 04:17:00 I think Forth doesn't need blocks per se - but it would be interesting to see a virtual filesystem that exposes text files as blocks, or something 04:17:27 Actually, Forth doesn’t need files :) 04:17:35 that way, a classic style Forth can run on a modern system 04:17:39 To me, I find the block paradigm a little unnatural, considering the environment I'm in. 04:17:50 siraben: exactly my point 04:18:11 My blocks are in memory. 04:18:38 Similar to what Chuck’s. 04:18:46 siraben: this is what i came up with for z80 next: https://ideone.com/6lHhHH 04:18:58 gonna grab some mcdonalds, come home, install OpenBSD, then install my preferred Forths. Peace 04:19:10 rdrop-exit: Why is it called threaded interpretive languages? 04:19:14 Is it just Forth? 04:19:38 oh ideone mangled the urls 04:19:55 Has anybody thought about embedding Lisp? 04:20:15 dave0 (IRC): Yeah, see, that NEXT is slower than mine. 04:20:19 Probably the other was afraid of Forth Inc. at the time. 04:20:25 62 cycles vs 47 04:20:28 And I lose TOS 04:21:05 Embedding Lisp where? 04:21:10 I'll try to see if I can still stay direct threaded. 04:21:33 DKordic: Depends on your lisp. IMO lisp suffers at the embedded level unless you have a really good compating GC 04:21:36 compacting 04:21:40 In Forth through a reasonable definition of ` (' and ` )' instead of Stack Shuffling. 04:21:57 I meant to say ‘author’ not ‘other' 04:22:21 DKordic: You can do it. I have a horrible, horrible example I can msg you if you want, it recursively adds in braces 04:22:40 it doesn't nest though, I was just proving the concept 04:22:58 So you want to write ( + 2 3) 04:23:02 : 04:23:04 ? 04:23:04 S( + 1 2 3 )S gives 6 for example 04:23:11 Lisp has been done, so has Prolog. I don’t really see the point of Lisp if I already have Forth. 04:23:23 Embedding a prefix language in a postfix language is really weird. 04:23:28 rdrop-exit: Prolog? Where? 04:23:32 I'm going to write that out in Lina later, namespacing words to give them arity 04:23:35 Currently experimenting with backtracking myself. 04:24:34 Louis Odette, he wrote some FORML and JFAR papers, and published the book « Intelligent Embedded Systems » 04:24:55 He wrote a PROLOG in Forth? 04:25:03 Prolog, even 04:25:10 siraben: this is better paste https://ideone.com/HCmZMF 04:25:15 Yes, a Prolog variant for embedded systems 04:25:23 very cool 04:25:40 siraben: you can have TOS in a register cos the next uses IX instead of DE 04:25:45 but it's slow 04:25:47 Currying is closer to Forth than VarArgs: ` ( = ' ( ( f a1 ) a2 ) ' ( f a1 a2 ) )'. 04:27:24 3 ( - 2 ) -1 = ;) 04:29:54 BRB, going to get the book off my shelf 04:30:08 --- quit: tabemann (Remote host closed the connection) 04:30:22 --- join: tabemann (~tabemann@2602:30a:c0d3:1890:d004:a860:b5ff:7c1c) joined #forth 04:40:03 A Forth based Prolog interpreter/VM was used for NASA’s Spacelab experiments 04:41:07 There’s a writeup on it in one of the FORML proceedings 04:42:14 Dinner’s ready, see you later 04:43:22 you are in a strange part of the world, eating dinner at 7:40 am 04:45:27 Manila :-) 05:19:08 Bangkok 05:19:37 Oh cool. I'm actually going to Manila in a couple of weeks. 05:27:53 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 05:33:12 --- quit: wa5qjh (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) 06:22:59 --- join: Zarutian (~zarutian@173-133-17-89.fiber.hringdu.is) joined #forth 06:39:06 --- join: kumool (~kumool@adsl-64-237-236-117.prtc.net) joined #forth 06:46:19 --- quit: Labu (Ping timeout: 252 seconds) 06:49:50 --- join: Labu (~Labu@obs92-6-88-179-3-123.fbx.proxad.net) joined #forth 06:55:16 --- quit: Labu (Ping timeout: 252 seconds) 06:58:05 --- join: Labu (~Labu@obs92-6-88-179-3-123.fbx.proxad.net) joined #forth 07:32:07 --- quit: Labu (Ping timeout: 252 seconds) 07:35:19 --- join: Labu (~Labu@obs92-6-88-179-3-123.fbx.proxad.net) joined #forth 08:32:48 --- quit: ncv_ (Remote host closed the connection) 08:34:17 --- join: ncv (~neceve@2a02:c7d:c5c9:a900:6eaf:6ef7:3b81:d5f6) joined #forth 08:34:17 --- quit: ncv (Changing host) 08:34:17 --- join: ncv (~neceve@unaffiliated/neceve) joined #forth 09:25:04 --- quit: kumool (Ping timeout: 252 seconds) 09:29:08 --- join: kumool (~kumool@adsl-64-237-236-117.prtc.net) joined #forth 10:15:52 --- quit: ncv (Remote host closed the connection) 11:52:25 --- quit: tabemann (Ping timeout: 250 seconds) 11:55:11 --- quit: dys (Ping timeout: 246 seconds) 12:37:30 --- part: rdrop-exit left #forth 13:00:09 --- quit: ashirase (Read error: Connection reset by peer) 13:04:37 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 13:41:30 --- quit: zy]x[yz (Quit: leaving) 13:43:11 --- join: zy]x[yz (~corey@unaffiliated/cmtptr) joined #forth 13:47:00 --- join: Labmik (~Labu@labu.pck.nerim.net) joined #forth 13:47:56 --- quit: Labmik (Client Quit) 13:49:35 --- quit: Labu (Ping timeout: 245 seconds) 14:23:40 --- join: Labu (~Labu@labu.pck.nerim.net) joined #forth 15:21:34 Writing C is a pain! I end up thinking how I could solve the problem Forth-ily, instead 15:21:58 and it's usually quite simple. 15:30:10 writing c is unbelievably natural to me 15:30:41 I think in terms of how I want to fill out structs, and then I write simple apis that manipulate those structs 15:31:04 it's especially nice since c99 added named initializers 15:31:38 so much of my code now looks like struct foo f = { .thing1 = 1, .thing2 = 2, }; doit(&f); 15:50:07 Oh,that is kind of nice. 15:50:21 I didn't know about that - that looks like a good addition. 15:51:04 I don't have that sort of "blood connection" to C, but I know exactly what you're talking about from experience in other areas. 15:51:13 It's almost like the toolset is "part of you." 15:51:22 It's really pleasant working with something you know that well. 15:51:44 It's like you don't have to think about the mechanics - you just think about the solution. 15:51:47 Very powerful mode to be in. 15:51:51 zy]x[yz: I did not know C had such a feature, I just remember the item order 15:52:33 But yeah, I don't struggle with it, and I enjoy it - but there are times I wish I had a C with Forth syntax. Or a codebase where I could seamlessly switch between the two. 15:53:16 you can also build nice jump tables now with like int (*funcs)(int, void *, size_t) = { [AN_ENUM] = handle_an_enum, [ANOTHER_ENUM] = handle_another_enum, }; return funcs[e](fd, buf, count); 15:53:17 I like to write code with minimal state and maximal struct pointers 15:53:53 I'm actually going to look up that jump table syntax 15:54:46 it's just an array of function pointers initialized with named initializers (i think that's what they called it if i remember right) 15:57:14 I just use the one lifted from Wikipedia, `typedef void (*Handler)(void); Handler jump_table[3] = {f, g, h};` something almost exactly like that 15:57:56 yeah, so it's that except you can specify the indices of f, g, and h so it doesn't break if the enum order ever changes 15:58:43 Very nice. I'm familiarwith doing things like that in Python. Maybe not exactly that, but, say, named parameters. 15:59:14 Somewhat unrelated, but I really do like Python's ability to have optional parameters that will get a default value if you don't pass one in. 15:59:21 named parameters are way better because you can leave the crap out 15:59:30 ^ Exactly. 15:59:45 Makes it oh so easy to have "special cases" in a function. 15:59:50 There was a fork of C by a schizophrenic programmer called HolyC, one of the good upgrades was optional and default params 16:00:26 That feels so much like a total win to me that I think it ought to be in pretty much every language. 16:00:38 so `void f(int = 4, int = 3, int = 2)` could be called `f(,,8)` 16:00:57 well, with c's named initializers anything you don't specify is set to zero. but yeah, there are some cases where zero might be valid input, so there's no way to know it isn't set except to pass a bitmask or something 16:01:30 but i miss that kind of stuff with forth. working with struct-ie memory is very tedious in my experience 16:01:43 pForth has a C-like implementation of structs. 16:01:58 i should check it out 16:02:09 Yes, yes you should 16:02:48 It's not the fastest Forth in the world, but it's written in as-portable-as-you-can-really-get C 16:03:30 I wrote a thing like this: : (foo struct { : bar) cell field ; : baz ) 2 cells field ; } ; 16:04:10 that defines a prefix (foo with words bar) and baz) for doing field arithmetic 16:04:48 so you might do 123 f @ (foo baz) ! to writr 123 to tbe first cell of baz 16:05:15 but that's tedious, like i said, and the two-word syntax of it prevents you for using postone or ['] 16:06:08 If you remember the field order, Retro's sets are kinda like structs. 16:06:48 and they have the really nice syntax `{ item1 item2 item3 }` 16:08:25 --- join: [1]MrMobius (~default@c-73-134-82-217.hsd1.va.comcast.net) joined #forth 16:08:35 Surely a CREATE DOES> can create a struct-like construct? 16:11:15 --- quit: MrMobius (Ping timeout: 245 seconds) 16:11:15 --- nick: [1]MrMobius -> MrMobius 16:12:00 yeah I usually use that in conjunction with my syntax above 16:12:51 a create/does> word will construct a thing, and the (foo bar) words are used to seek to specific offsets in that memory 16:13:30 http://www.ultratechnology.com/structs.htm 16:16:24 is this the one where he says "the forth way is don't use structs" 16:17:18 ... no comment 16:17:28 lol 16:17:35 yeah it is, but it's more like, "stop writing C in Forth" 16:18:05 I think the number one piece of advice I've gleaned from chuck and jeff is "write code to solve your problem, not the abstract of your problem" 16:18:57 I think I'd only use struct-likes if I were writing a game in Forth, because I'll be damned if I'm using objects 16:19:09 yeah i just can't bring myself to do that 16:19:27 (solve the problem and not the abstract) 16:22:15 I liken it to an anecdote about UNIX 16:23:02 (From one of the Multics guys) We went to lunch afterward, and I remarked to Dennis that easily half the code I was writing in Multics was error recovery code. He said, "We left all that stuff out. If there's an error, we have this routine called panic, and when it is called, the machine crashes, and you holler down the hall, 'Hey, reboot it.'" 16:24:31 "Dennis" being Dennis Richie 16:29:18 lol 16:36:01 --- quit: FatalNIX (Changing host) 16:36:01 --- join: FatalNIX (~FatalNIX@unaffiliated/fatalnix) joined #forth 16:44:06 :-) 16:44:25 I do get a mildly bad taste in my mouth when I see error handling dominating a code. 16:44:39 I'm not AGAINST error handling, but it shouldn't have to be "the point." 16:45:06 That's why I like microkernels, and Erlang 16:45:15 it broke? just reboot it 16:45:29 Yes, ukernels are a good thing. 16:48:57 --- join: tabemann (~tabemann@rrcs-162-155-170-75.central.biz.rr.com) joined #forth 17:20:09 KipIngram: what kind of error handling? The old C style return value one or CATCH and THROW ? 17:21:11 I guess I'm talking more about stuff like input validation and so on. 17:22:39 well, most input validation I have done is check digit calculation for certain id numbers 17:23:23 that is for stuff actually inputted. For media and comms I havent done any nor had to. 17:25:32 I'll confess that most of the time when I code I'm writing some sort of utility for my own use. 17:25:49 So if I foul something up, all that matters is that it doesn't destroy anything valuable. 17:25:59 "Hey, reboot it!" is just fine in most such situations. 17:27:18 well, I have had to make non brittle UI/UX but for operators and not all and sundry 17:30:04 WilhelmVonWeiner: I also have http://forthworks.com/retro/s/example/defstruct.forth for structures. Provides creation of accessors for the fields and allocation of space. 17:32:30 KipIngram: most of the input validation happens there. For instance an entry field that accepted only numbers wont even take in any other character. 17:34:04 KipIngram: I do something similiar with externally provided files when parsing and just flat out error out but with very descriptive error message. 17:36:49 KipIngram: I have built control systems that can seriously injure people. So I am not a fan of constant flawless vigilance (see https://capability.party/memes/2017/09/11/constant-flawless-vigilance.html ) for safety/security. 17:39:28 I just hacked together a feature I really like in Attoforth 17:39:45 tabemann: can you describe it for us? 17:40:06 I can turn on and off tracing, so if something's crashing, I can have trace off right up until the point where it fails, and then turn trace on to see what word on which it is crashing 17:40:53 I used to have tracing on either all the time or none of the time, and it was impractical because I'd need to recompile to turn it on or off 17:41:51 also, the tracer displays the top of the stack as it traces 17:43:06 --- join: wa5qjh (~quassel@175.158.225.213) joined #forth 17:43:06 --- quit: wa5qjh (Changing host) 17:43:06 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 17:44:19 it's slower than not having it - it can be commented out altogether - but it is so convenient 17:47:52 Zarutian: Yes, when lives are at stake the game totally changes, for sure. 17:48:21 We supported programming of devices back at BP Micro that were used in airbag controllers; we had an extra level of testing we applied to those. 17:50:38 KipIngram: hmm... I think it is a good habit of not making too damn brittle software. Hey even I sometimes forget. 17:51:07 Well, like I said, I don't really do too much programming that's for general distribution. 17:51:20 So I wind up basing my "compromise decisions" on that. 17:51:45 heck I use the analogy of half built devices on an electronics bench. They dont have an enclosure yet and you are not sure it is completely finished yet. 17:52:09 :-) 17:52:35 Yeah. Most of my hardware experience was aimed at "formal projects," though - so generally I'd do a complete schematic and wind up with a complete prototype. 17:52:46 hence I dont give it out to anyone without having ?stoppers? in place. That is something blatant that prevents it from running 17:55:12 heck I once made the equiv of 'waranty void' sticker software wise on one utility I was asked to make. 17:55:31 you know these 'waranty void' stickers on some electronics? 17:56:06 Yes. 17:56:55 the waranty that gets voided when those get broken is just on the sticker itself. It is to discourage people who do not know what they are doing. 17:57:37 a bit like those Y shaped head screwdrivers that some manifacturers use 17:58:19 you can buy them in electronics shops but only from a technician who will ask before hand what exactly you are going to do with it. 17:59:34 if he hears that you sound like you know what you are doing he will sell it to you, otherwise he will admonish you and tell you to return in fifteen minutes. 17:59:52 --- quit: tabemann (Ping timeout: 252 seconds) 18:00:06 cuts down on "my newphew tryed to fix it first" 18:17:35 --- quit: wa5qjh (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) 18:18:14 --- join: wa5qjh (~quassel@175.158.225.213) joined #forth 18:18:15 --- quit: wa5qjh (Changing host) 18:18:15 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 18:38:53 I typically don't worry much about protecting people from themselves. 19:00:39 KipIngram: The bare metal is barer than I thought 19:01:32 --- quit: dave0 (Quit: dave's not here) 19:04:12 :-) 19:04:15 How so, exactly? 19:04:28 What were you expecting to have done for you that's not there? 19:26:05 --- quit: kumool (Quit: Leaving) 19:46:09 --- join: tabemann (~tabemann@2602:30a:c0d3:1890:d004:a860:b5ff:7c1c) joined #forth 21:02:45 Key input 21:03:19 I just have to figure out every thing from power on to power off. 21:33:15 --- join: leaverite (~quassel@175.158.225.213) joined #forth 21:33:15 --- quit: leaverite (Changing host) 21:33:15 --- join: leaverite (~quassel@freebsd/user/wa5qjh) joined #forth 21:35:49 --- quit: wa5qjh (Ping timeout: 264 seconds) 21:43:26 --- join: verisimilitude (~user@2604:180:2:725::698a) joined #forth 22:34:35 --- quit: leaverite (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) 22:36:19 --- join: wa5qjh (~quassel@175.158.225.213) joined #forth 22:36:20 --- quit: wa5qjh (Changing host) 22:36:20 --- join: wa5qjh (~quassel@freebsd/user/wa5qjh) joined #forth 23:15:05 --- quit: dddddd (Remote host closed the connection) 23:24:01 --- join: dlyund (~marksmith@78-23-60-22.access.telenet.be) joined #forth 23:59:59 --- log: ended forth/18.10.20