00:00:00 --- log: started forth/20.05.21 01:00:29 --- join: xek joined #forth 02:05:05 --- join: X-Scale` joined #forth 02:07:03 --- quit: X-Scale (Ping timeout: 256 seconds) 02:07:04 --- nick: X-Scale` -> X-Scale 03:09:14 --- quit: proteusguy (Ping timeout: 256 seconds) 03:22:46 --- join: proteusguy joined #forth 03:22:46 --- mode: ChanServ set +v proteusguy 03:40:08 --- quit: dave0 (Read error: Connection reset by peer) 03:42:04 --- join: iyzsong joined #forth 03:45:26 --- join: dave0 joined #forth 04:13:28 --- join: dddddd joined #forth 04:56:54 --- join: TCZ joined #forth 04:57:46 --- quit: dave0 (Quit: dave's not here) 05:06:37 --- quit: TCZ (Quit: Leaving) 05:06:52 --- quit: rdrop-exit (Quit: Lost terminal) 05:26:42 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 06:22:53 --- join: xek_ joined #forth 06:23:46 --- quit: X-Scale (Ping timeout: 258 seconds) 06:23:56 --- quit: xek (Ping timeout: 246 seconds) 06:25:13 --- join: X-Scale` joined #forth 06:25:39 --- nick: X-Scale` -> X-Scale 06:38:30 --- join: xek__ joined #forth 06:39:00 --- join: TCZ joined #forth 06:41:10 --- quit: xek_ (Ping timeout: 256 seconds) 06:45:56 --- quit: Chobbes (Changing host) 06:45:56 --- join: Chobbes joined #forth 07:00:08 --- quit: TCZ (Quit: Leaving) 07:18:36 --- quit: gravicappa (Ping timeout: 240 seconds) 07:21:14 --- join: TCZ joined #forth 07:24:20 --- join: Labu joined #forth 08:03:21 --- quit: TCZ (Quit: Leaving) 08:11:36 --- join: gravicappa joined #forth 08:39:55 --- join: antaoiseach joined #forth 09:06:59 --- quit: cantstanya (Remote host closed the connection) 09:09:20 --- join: cantstanya joined #forth 09:17:38 Just curious - why does gforth not have "forget"? I tried reading up on markers in the gforth documentation, but couldn't make much sense of it. 09:22:11 https://stackoverflow.com/questions/18077306/deallocate-memory-previously-allocated-to-a-variable-using-create <-- I think this shows the use 09:30:49 dzho: Thanks! That actually looks quite promising 09:32:37 So basically, wherever we put a marker, that is a point-in-time marker, and when we invoke the given name, it resets to that point-in-time ... is this correct/ 09:32:41 ? 09:39:30 antaoiseach: It can be used for temporary scope, freeing up memory, or before recompiling some source. Since the dictionary is linear it's one of the 'obvious' operations to support. 09:40:24 That example on Stack Overflow uses the current, more portable, standard forth version of 'forget'. 09:40:29 But it works much the same way 09:41:05 --- nick: cantstanya -> frank 09:41:26 --- nick: frank -> cantstanya 09:43:45 The reason it is more portable is because the assumption the dictionary is in a simple linear layout is not always true, some forths have more complicated layouts, so the word MARKER is introduced to give the forth environment an explicit opportunity to save any state that might be needed to 'restore' the dictionary in more involved ways 09:48:27 veltas: Thank you very much! I think I get the broad picture now 09:49:36 So using this, inside of scripts, I could potentially define some variables, use them, and then discard them - sort of simulating scope as you mentioned? 09:50:34 --- quit: Labu (Quit: Leaving.) 09:50:57 It is one way you can do that, yes 09:51:55 Unfortunately this is not a totally flexible method (after all, you might want some scoped variables within words that will be executed during compilation, well obviously that is not possible). 09:53:01 veltas: Haha ... I came to that same realisation after I wrote it! 09:53:05 yes, you're right 09:53:22 That sounds promising antaoiseach 09:53:44 Forth is like this, we get a lot of really simple tools and it is kind of our job to understand a bit about how they work and therefore when they won't work 09:55:36 --- quit: Zarutian_HTC (Ping timeout: 260 seconds) 09:56:08 veltas: Indeed! I'm an absolute beginner, but I'm slowly beginning to appreciate it as much more than a barebones RPN calculator (which most tutorials seem to focus on) - I am actually working on "The Complete Forth", and I love the book so far. It's making a whole more sense than "Starting Forth" (which I found a bit tedious) 09:56:25 lol it seems there are two kinds of people 09:56:49 I will say it's not unique to Forth, all languages have these considerations. Try explaining to a new C programmer why a const variable's value is not considered a 'constant' when the initialisation is already visible and 99% of modern compilers would not have a hard time retrieving it there and then. 09:57:41 Hehe ... fair point 09:59:09 What do you think of more modern languages like Rust and Zig, which do enforce much stricter constraints? 09:59:38 I haven't used either of those but there are always dumb holes in languages, hard to not do. 10:00:05 Oh, absolutely. 10:00:09 In Forth it's actually less of a "dumb hole" and more like a big walkthrough of how the compiler and interpreter is generally guaranteed to work 10:00:23 and then you *know* without being told where the 'holes' are 10:00:38 You have to guess a bit with higher level languages because they will present the highest level view they can 10:01:25 What actually makes me a bit uneasy is how flexible the system appears to be ... I presume the standard defines some basic words, but then there appear to be many ways of doing I/O, for instance 10:01:44 I had been working through "Starting Forth" and the chapters on disk access (?) did not work at all 10:01:55 How does one deal with such issues? 10:03:31 I mean ... Forth seems to be nothing and everything at the same time ... not sure if I can put it better 10:04:23 Right now I'm sticking to gforth and trying to learn by sticking to the standard, but the real benefits of Forth seem to be specific to systems? 10:06:59 I 'learned' by reading Starting FORTH, the gforth tutorial, a bit of the gforth manual, and trying stuff out with Forth 2012 to hand. 10:08:56 --- join: jsoft joined #forth 10:11:02 I think there is an innate benefit shared by most forths that they have a relatively simple and open approach to interpretation and compilation 10:11:52 And generally they can be pretty small too, which is useful in certain applications, but also it means inherently that they are very *factored* 10:14:21 Hmmm 10:15:19 So, from experience, how much does actually carry forth between systems? Is it mostly the experience of having worked with a Forth? Substantially more? less? 10:23:47 for me, I don't carry forth code between systems. (this is probably due at least in part to the deviations my forth makes from the standards) 10:24:59 You can choose to write standard forth, and then your forth will work on many forth systems, and more with a few shims. 10:27:01 I can't bring myself to use a standard forth anymore outside of occasional tests 10:29:45 --- join: Zarutian_HTC joined #forth 10:30:16 two very different and interesting perspectives! 10:31:03 +crc: does that mean though that you have to relearn a substantial part from scratch? 10:31:28 (I presume that basic stuff like loops, conditionals are more or less standard across forths?) 10:33:59 my conditionals, loops, and such are all non-traditional (I use quotations, anonymous nestable code blocks, for them) 10:34:48 I do really like those 10:38:05 Oh. That's interesting! 10:40:03 antaoiseach: you can see some of my code at http://forth.works/examples 10:46:52 antaoiseach: re: relearning, I don't see this as a big issue. I deviate from the standards, but it's not so f 10:47:16 different that existing skills can't be reused 10:48:19 my word names are sometimes different, and my string words are completely different, but it's not overly difficult to adapt at least smaller programs to run on my forth 10:50:29 I will agree with that assessment of retro, as an '''impartial''' observer, a lot of it seems to just be making things more consistent than what you get in a normal forth 10:50:57 And choosing a more consistent naming scheme 10:57:01 +crc: whoa ... that looks so very different! Is it your custom Forth? 10:57:45 veltas: Thanks for that observation - it can be quite intimidating for a beginner like myself! :-) 10:59:20 What is the point of AHEAD? 10:59:33 Maybe this is a stupid question, but how fast can you guys read your own Forth code? For my rudimentary programs, I find that composing *some* viable solution seems fast enough, but reading it back, even with meticulous stack notation and comments seems quite a bit slow, especially since I try to mentally keep track of the stack state 11:00:05 That, in fact, seems to be my biggest problem right now - feeling like the stack myself :D 11:01:07 I am very new, I find it easy to read *my* code because I have conventions for making it a bit easier to track the stack 11:01:55 veltas: Hmmm... maybe I need to finish the basics and start writing more code! :-) 11:01:57 Every time I change the stack layout, except inside one line, I will put a comment like ( a b c ) to quickly describe what's on the stack 11:02:03 On the next line 11:02:09 Interesting! 11:02:23 I can see how that would help indeed 11:02:27 And I don't bother if the word is very short, which words probably should be in general 11:02:45 People tend to add extra spaces on a line to indicate grouping 11:03:05 i.e. 2 spaces between two distinct logical parts of a calculation 11:03:48 veltas: Hmmm... right now I tend to put them on different lines, but that sounds like a good idea as well .. 11:04:12 Just curious - which Forth are you using and for which system? I mean, a specific controller? 11:06:22 I mostly used gforth 11:06:25 +crc: Also, I found this - http://forth.works/retro-unix.c. This your Forth implementation, right? Should be fun studying it 11:06:45 Right now I am writing a forth for the ZX Spectrum 11:06:46 veltas: Oh, nice! I was also planning on doing some small projects using only gforth till I get settled in! :-) 11:06:56 In Forth? 11:07:33 I'm writing it in assembly and raw colon definition codes 11:07:51 Ah, right... 11:08:15 So the bare minimum words would be in assembly, and then build up on those in Forth itself, right? 11:08:20 I'm also writing most of the colon defs in Forth alongside the raw code, hopefully I can actually convert most of this code to forth instead 11:08:29 Yes bare minimum and anything that requires being fast 11:08:34 or anything that works nicer in assembly 11:08:43 is it online anywhere? 11:09:03 Yes, the current state is at https://github.com/Veltas/zenv 11:09:29 words.asm is where the magic happens 11:10:01 veltas: Thanks! Will keep an eye on it ... should be useful for me later on 11:10:16 Why is that? 11:10:30 And I presume this should run fine on an emulator, right? 11:10:54 Yes 11:11:31 I'm developing it on an emulator right now, I'm lockdowned away from my actual Spectrum :( 11:11:32 veltas: I would like to write a Forth from scratch myself! :D .. .maybe not for the same machine exactly, but this should be handy as a reference! 11:11:52 veltas: haha... yeah, this whole lockdown has been terrible. 11:11:57 Are you familiar with the spectrum? 11:12:24 veltas: not much - just as part of some history of the models from that era .. 11:12:43 Worth reading this series of papers if you want to write a forth http://www.bradrodriguez.com/papers/moving1.htm 11:12:50 The machine I would love to have is the Lisp Machine, but I don't think I can afford that! 11:13:21 veltas: Hey, thanks for the link! 11:13:55 Very nice ... I never did fully understand what "threading" meant in this context 11:14:38 Aha ... some direct and indirect basically refer to the level of indirection ... like single vs double pointers, yeah? 11:14:53 I think it is a physical analogy, like how you sew one forth word's definition onto the next one 11:15:02 Yes 11:15:50 That reference list at the bottom also looks potentially useful... 11:16:19 All right, have to go now, but it's been very edificational ... I should come here more often! :-) 11:16:41 I don't think a ton of research needs to be done in advance of writing your forth 11:16:42 Thanks +crc, and thanks, veltas ... this whole convo taught me more than I expected! 11:16:52 No problem 11:17:08 veltas: Haha, yes .. but I do like to go deep understanding some topics I find fascinating! 11:17:15 Cheers, and see you guys next time! 11:17:22 --- part: antaoiseach left #forth 12:00:58 --- quit: Zarutian_HTC (Ping timeout: 272 seconds) 12:19:58 --- quit: jsoft (Ping timeout: 272 seconds) 12:33:09 What is the point of AHEAD? 13:28:13 --- nick: reepca` -> reepca 13:46:34 --- quit: cantstanya (Remote host closed the connection) 13:49:11 --- join: cantstanya joined #forth 14:09:08 veltas, i've been away for a while. can you remind me what it does? i want to say it's a loop control flow word 14:21:20 --- quit: gravicappa (Ping timeout: 246 seconds) 14:24:24 --- join: TCZ joined #forth 14:25:58 cmtptr: https://forth-standard.org/standard/tools/AHEAD 14:26:48 It pushes a forward reference to control stack, and runtime behaviour is to unconditionally jump to that reference 14:26:53 So it just skips code 14:27:40 Hmmm I guess you could use it to fit some data into the colon def, that would make more sense. 14:27:57 I think I got it by explaining it to you lol 14:28:06 Thank you trusty rubber duck 14:28:23 also to break from a loop? 14:28:52 i do think you're right though, i vaguely remember stuff about jumping of inlined data 14:29:01 s/jumping of/jumping over/ 14:30:21 cmtptr: It wouldn't let you break from a loop unless you manipulated the control stack, maybe though. It's something gforth supports 14:31:22 --- quit: proteusguy (Ping timeout: 265 seconds) 14:32:07 I could use it to implement quotations in my forth, and really any forth that has a simple linear, non-hashed dictionary 14:43:57 --- join: proteusguy joined #forth 14:43:57 --- mode: ChanServ set +v proteusguy 15:04:47 --- join: dave0 joined #forth 15:17:42 --- quit: TCZ (Quit: Leaving) 15:26:06 --- join: Zarutian_HTC joined #forth 16:08:47 --- quit: xek__ (Ping timeout: 246 seconds) 16:28:50 --- join: xek joined #forth 16:40:03 --- quit: tabemann (Remote host closed the connection) 16:40:18 --- join: tabemann joined #forth 17:09:23 --- quit: dave0 (Quit: dave's not here) 17:24:40 --- join: rdrop-exit joined #forth 17:26:17 --- quit: cp- (Quit: Disappeared in a puff of smoke) 17:26:27 good morning Forthwrights c[] 17:27:11 --- join: cp- joined #forth 18:37:51 --- quit: pareidolia (Ping timeout: 258 seconds) 18:41:07 --- join: pareidolia joined #forth 19:06:44 --- quit: Zarutian_HTC (Read error: Connection reset by peer) 19:06:46 --- join: Zarutian_HTC| joined #forth 19:32:47 hey guys 19:33:17 hi tabemann 19:36:15 hey Forthings, greetings from Embeddedville 19:36:58 greetings tp 19:37:17 hey rdrop-exit, tp 19:38:55 hey tabemann, I got stuck on backporting changes and have just got back to the bit testing doc, then I'll be testing your Zeptoforth dissasembler to GAS with the aim of adding RTS handshaking to the F407 disco 19:40:04 cool 19:40:38 I haven't actually tested my gas mode yet against a real live assembler 19:41:24 tabemann, I'll definitely be doing that and documenting how I go 19:42:29 tabemann, if you have a minute, check out my "Forth Project Tarball" style of project release, your chance to tell me what could be improved ? 19:42:37 https://sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/STM32F0-Discovery-TouchSensor-377b5b56c2.tar.gz 19:43:08 tabemann, or just flame me with 'thats sucky d00d3" 19:43:52 lol 19:45:35 tabemann, 6 years of Forth use and this is the general purpose format Ive arrived at. Theoretically any Mecrisp-Stellaris user can develop with it no matter what system they use 19:46:25 tabemann, it's all created automatically from a working target by running one shell script 19:49:07 one typo: under License "Licensealong" should be "License along" 19:49:42 oops, fixed :) 21:10:22 "ANS Forth is, to the extent possible, a syntactic specification" -- Jack Woehr 21:13:55 This in nutshell is why so many Forthers ignore the standard. 21:25:04 --- quit: reepca (Read error: Connection reset by peer) 21:25:39 --- join: reepca joined #forth 21:42:24 --- quit: _whitelogger (Remote host closed the connection) 21:43:24 --- join: jsoft joined #forth 21:45:27 --- join: _whitelogger joined #forth 21:48:34 --- join: xek_ joined #forth 21:51:11 --- quit: xek (Ping timeout: 265 seconds) 22:04:44 --- quit: dddddd (Ping timeout: 265 seconds) 22:19:00 --- join: gravicappa joined #forth 23:09:38 --- join: dave0 joined #forth 23:48:11 --- join: dys joined #forth 23:51:57 --- join: boru joined #forth 23:59:59 --- log: ended forth/20.05.21