00:00:00 --- log: started forth/20.04.23 00:13:42 --- quit: merkc1 (Ping timeout: 258 seconds) 00:13:52 --- quit: WickedShell (Remote host closed the connection) 00:28:10 --- join: xek joined #forth 01:08:49 --- join: mtsd_ joined #forth 01:11:17 --- quit: mtsd (Ping timeout: 250 seconds) 01:12:44 --- quit: reepca (Remote host closed the connection) 01:12:53 --- join: reepca joined #forth 01:13:42 --- join: dys joined #forth 01:13:42 --- quit: reepca (Read error: Connection reset by peer) 01:15:33 --- join: reepca joined #forth 01:25:48 --- quit: tp (Read error: Connection reset by peer) 01:27:45 --- join: tp__ joined #forth 01:29:32 --- nick: tp__ -> tp 01:35:10 --- join: merkc1 joined #forth 01:45:30 --- quit: jsoft (Ping timeout: 256 seconds) 01:57:50 --- join: mtsd joined #forth 01:59:09 --- quit: mtsd_ (Ping timeout: 265 seconds) 02:00:07 --- join: jsoft joined #forth 03:43:04 --- quit: proteus-guy (Ping timeout: 265 seconds) 03:44:33 --- join: proteus-guy joined #forth 04:03:19 --- join: rdrop-exit joined #forth 04:04:50 c[] 04:11:24 c[] 04:11:29 Cheers! 04:11:47 cheers mtsd! 04:12:17 Are you alright? In this day and age? 04:12:28 mtsd, :) 04:12:51 yes, confined but ok, yourself? 04:13:19 Fine here too 04:13:40 Not much in the way of confinement here, but working from home 04:13:59 mtsd, glad to hear it. As you know there are only 42 Forth users in the world and we cannot afford to lose ONLY ONE! 04:14:38 Exactly. We are needed to restart and rebuild things later :) 04:19:03 42 sounds a bit high 04:19:50 yes, hunting for old calculators amid the smoking ruins of our cities, then trying to find power to run "endoftheworldforth" on them 04:20:01 rdrop-exit, hahah 04:21:56 Minimalism in Forth. Applies to the number of users too :) 04:23:13 well a world wide sensus was taken and it revealed that in the whole world, only 42 people have the "forth mindset', all the rest are convinced Forth is some 'write only language' 04:23:29 The secret of success is to know something nobody else knows. 04:23:29 -- Aristotle Onassis 04:24:39 rdrop-exit, I know something you dont know .... 04:25:03 but I'm not telling!' 04:25:09 Success is imminent then 04:25:30 heheh 04:25:47 mtsd, know anyone with the Coronavirus ? 04:26:05 No confirmed cases 04:26:14 But some suspected 04:26:51 hard to know in most cases 04:27:19 that darn Tricorder is overdue! 04:28:01 I mean we have warp engines already and photon torpedoes already right ? 04:28:42 Not many people are tested here, only the ones admitted to hospital, more or less. No mass testing programme 04:29:08 same here atm 04:30:48 Work is quite calm now. Reading "Starting Forth" again 04:31:12 Cool, which edition? 04:31:54 Let me see.. 04:32:31 The 1st edition follows the 79 standard, the 2nd edition follows the 83 standard 04:32:52 then there's a online edition that supposedly follows the ANS standard 04:33:37 Seems to be the first edition then. Forth-79 standard in an appendix. No mention of Forth-83 04:33:50 I have read the ANS one, I assume it has less coverage of internals since the ANS standard is more opaque 04:33:56 I bought a used copy, years ago 04:33:59 * I haven't read the ANS one 04:34:38 the 2nd edition is copyright 1987 04:34:51 Mine is copyright 1981 04:35:58 IIRC some of the main differences between the 79 and 83 standards were the address returned by ' 04:36:04 and floored division 04:36:10 I bought a usd copy in 2014 also 04:36:17 used 04:36:22 I was 6 years old in 1981. The book waited for me :) 04:36:34 I recommend the 87 edition over the 81 04:37:27 Would be interesting to read that one too 04:37:32 it has footnotes on the differences between Forths 04:38:05 how about the free online edition ? 04:38:32 I never read the book now, frankly I never liked it much anyway 04:39:02 there are a few different free online editions, one of them is an "update" of the book to reflect ANS 04:39:26 I the guy who buys "unix for the impatient" because I've read the 'unix for dummies' in a day and Im bored 04:40:06 The problem with Forth books is that they mostly assume indirect treaded code 04:40:12 * threaded 04:41:09 I dont need two headed "swap dragons" to enjoy learning Forth 04:41:09 To me the best Forth book is Thinking Forth 04:41:20 rdrop-exit, agree, I do love that book 04:42:37 There were a couple of other Forth Tutorial books that were popular 04:42:49 I have Thinking Forth too. Like it very much 04:42:53 incidentally did you know there is a a German 'Swap Dragon' statue and it's loaned to a outstanding Forth person every year ? 04:43:22 the author of Mecrisp-Stellaris has it at the moment 04:43:37 Forth: A Text and Reference by Kelly & Spies might be more to your liking 04:43:46 haha, did not know that. The swap dragons! 04:44:03 Search Results 04:44:04 Featured snippet from the web 04:44:04 The Swap Dragon Award. Every year the Forth Society e.V. honours an outstanding personality for his/her Forth activities. Started in 1986 as a plastic toy trophy, the SWAP-Dragon has been reborn in 1997 as a beautiful bronze sculpture.May 12, 2017 04:44:05 It has more depth than Starting Forth 04:44:36 cool 04:44:45 yeah, thinking Forth is awesome Ive read it twice so far 04:44:56 I'll look for the book, thanks rdrop-exit 04:44:57 I pick up things each time 04:46:02 https://wiki.forth-ev.de/doku.php/en:infos:drachenpreis 04:46:53 cool! 04:47:23 due to the Coronavirus, this is how we will all be celebrating birthdays in future 04:47:27 http://ozdoc.mine.nu/party/ZoomParty.mp4 04:48:08 It always surprises me how even experienced Forthers do the opposite of what is discussed in the "Tips" sections of Thinking Forth 04:48:49 forthers are the most obdurate, stubborn, clear thinking people Ive ever known 04:50:13 "Generality usually involves complexity. Don't generalize your solution any more than will be required; instead, keep it changeable" -- excerpt from Thinking Forth 04:52:23 "Factor at the point comments seem necessary" -- Thinking Forth 04:52:47 written by someone who has NEVER used cortex-m 04:53:02 "Be sure you can name what you factor" -- Thinking Forth 04:54:09 one has to remember when TF was written, things were simpler then, the Z80 manual was only 1" thick 04:56:11 "Within each component, implement only the commands needed for the current iteration. (But don't preclude further additions)." 04:57:08 -- TF 04:58:09 "Don't decide, calculate." -- TF 04:58:25 Some good lessons there. Things have moved far away from simplicity, in so many ways 04:59:28 "You don't understand a problem until you can simplify it." -- TF 05:05:21 mtsd, true, that's why I value Forth more than ever as a secret weapon 05:08:30 The more complexity, the more Forth's philosophy of Total Interactive Control helps cut through that complexity 05:08:55 Almost the only thing you have a chance of understanding, from top to bottom 05:09:23 Most others languages, frameworks etc turn into black boxes. Big and complex 05:10:17 Not only that, Forth helps you to grok whatever you're interfacing with 05:10:30 rdrop-exit, absolutely ! 05:10:53 mtsd, so true 05:11:20 I like that there is no complexity a Forth user cannot tackle 05:11:58 because we break a massively complex task down into many simple pieces 05:13:30 And we understand our tool completely. The energy and focus can be directed at the problem instead 05:13:49 I will repeat what I said earlier on the topic: 05:13:51 A product or component involves a set of "given" or "fixed" technologies (hardware, devices, protocols, specs, layers, interfaces, etc...), that are externally specified by standards or the market. 05:13:51 thats really relevant 05:13:55 I see a Forth's role as providing unfettered interactive control of these "fixed" aspects, bottom to top, so you can build up a specific solution with minimal fuss or bloat. In effect a Forth rolls the typical remaining layers and tools (device drivers, debug monitor, OS, shell, assembler, compiler, interpreter, etc...) into a single very tightly-wound no-frills minimalistic platform/framework. 05:13:59 A simple tool can be trusted, completely 05:14:01 Forth is the one aspect of the product that needn't conform to an external specification or standard, which is what allows it to remain small, nimble, and totally customizable. I don't really see Forth as a language, but as accumulated lore on the design and implementation of such (real or virtual) stack machines, and the programming of solutions on/with them. 05:14:45 what does this mean? "Within each component, implement only the commands needed for the current iteration. (But don't preclude further additions)." any example? 05:16:35 It means don't get ahead of yourself 05:17:30 Don't try to over-anticipate 05:17:31 just make the simple version of the component ? 05:17:32 ok 05:18:23 Forth is about factoring the problem unlike C which is usually about learning all the C rules 05:21:54 Many of the ideas that were later esposed by extreme programming and similar fads were first expressed by Chuck 20 years earlier 05:22:00 * espoused 05:23:22 and as rdrop-exit says, "forth tells you if your design is FOOBAR" 05:23:52 although it may take a while to learn the signs 05:24:22 The funny thing is people today start out with bloated implementations, and consider simplification to be optimization 05:24:30 lol, if your code is full of pick and dups, Forth is telling you to start all over 05:24:58 i had to learn that and rdrop-exit galvanised the concept in what passes for my mind 05:25:49 I remember spending a late night-early morning writing Forth code, and it just wouldnt work well 05:25:53 So far, Forth has been fun to learn. Challenging, but fun 05:26:11 Thou shall never PICK or ROLL 05:26:26 I'm paraphrasing Chuck 05:26:44 i webt to bed, woke up had a look at the code and it was full of pics and dups! it was FUGLY, so I deleted the lot and in a hour has beautiful code running bug free 05:26:58 kudos tp! 05:27:22 mtsd, how long now for you with Forth ? 05:28:40 rdrop-exit, Ive learned to be ready to wipe everything and start again with forth, in fact I already know that it takes me three attempts to get anything to the standard I approve, be it a Forth program, a pcb design, a hardware enclosure 05:29:21 I see the first two attempts as the 'learning about the problem' part now 05:30:06 Exactly, Forth forces you to really grok the problem 05:30:34 tp, I have been messing about with Forth for around 3 years, maybe? 05:30:39 You can't get away with superciality with Forth 05:30:47 * superficiality 05:30:48 Not very long, I know. But I like it a lot 05:31:13 Has been more fun to learn than any other language I have tried 05:31:41 mtsd, what ??? you havent read "SAM's, LEARN FORTH IN 24 HRS" ? 05:32:13 Wow.. have I missed that? Shit... I have spent 3 years when I could have gotten away with 24 Hrs.. 05:32:17 While most languages seem to be geared to enbling superficiality 05:32:18 '-) 05:32:26 yeah 05:32:26 * enabling 05:32:51 mtsd, Ive been at Forth almost every day for 6 years myself 05:33:03 Still fun, I assume? 05:33:05 Making bad programmers productive is a step backwards 05:33:23 in quality 05:33:50 rdrop-exit, that is an important point, I think 05:33:54 mtsd, and rdrop-exit started learning Forth from Da Vinci, back in 1515 05:34:15 :)) 05:34:21 :D 05:34:26 Most frameworks and tools in use seem to allow people to outrun their own capabilities 05:34:42 mtsd, understatement of the century 05:34:43 exactly, no deep thought required 05:34:48 and that is very dangerous 05:34:50 You import something, follow the tutorial and have things to show in no time. 05:35:03 dinner time, stay healthy my friends 05:35:08 no problemo 05:35:09 --- quit: rdrop-exit (Quit: Lost terminal) 05:35:21 Then, one day, problems strike. And you have no idea how this thing you put together works. Even less how to solve the problem 05:35:55 mtsd, I follow some electronics forums for entertainment and I have to say, I dont grok that world 05:36:13 mtsd, agreed, and this is not a new problem 05:36:17 So there you are. Googling desperately, looking frantically at StackOverflow, trying to find a way out 05:36:44 mtsd, remember "visual basic" of 25 years ago ? 05:36:52 yes. vividly 05:36:56 ;) 05:37:40 people loved it, many groups made large projects quickly and easily only to stumble onto a bug they couldnt find or fix, which killed the project 05:38:05 only needs ONE bug to foobar a project 05:38:40 Delphi fell into similar problems 05:38:45 then along came the "visual basic" of electronics, Arduino 05:38:54 mtsd, ahh of course 05:39:05 I once maintained a big Delphi application. Old code, messy beyond belief 05:39:17 up until arduino, embedded ws considered too hard 05:39:24 for novices 05:39:32 eww 05:40:21 In the long run, I think the 'harder' tools are more honest. They don't let you move further along than you are capable of, at any given time 05:40:22 mainly as to get a raw MCU up and running one had to understand all the hardware, or at least, most of it 05:40:33 And some things are simply hard, at first 05:40:45 I love this saying 05:41:05 "easy start, hard finish or hard start, easy finish" 05:41:14 so true 05:41:43 And when you start hard and notice it gets easier, you know you have learned something. Evolved. 05:41:49 tho sometimes Ive experienced hard start and hard finish, but NEVER easy start and easy finish, which is what all the modern crap promises 05:41:56 You can feel proud over that 05:42:20 and you should, for you have grown, you can do more 05:42:37 That is the real achievement 05:42:41 yes 05:42:51 something that cant be lost 05:44:10 tho I once went 3 weeks without any Forth and I began to feel I was losing something, it felt great to get back into it again 05:44:22 Seems like things are not allowed to be hard these days. Everything should be easy. Is supposed to be "including", or something 05:44:39 I agree 05:44:53 my pet hate is the 'time' argument 05:45:55 someone may say, "how can I use the systick on stm32" and I say read the specs and the application note, and they reply "I dont have the time" 05:47:03 or someone may say, I just made my first blinky and when asked how long, the reply of "a week" is met with derisive snorts of "why so long?" 05:47:55 "I had my first blinky going in 3o seconds on Arduino" another will answer 05:48:01 --- join: dddddd joined #forth 05:51:12 That is annoying.. 05:51:40 The point is not to get the blinky going in 30 secs, or whatever.. 05:51:56 The point is learning how it works 05:52:05 to you and I perhaps 05:52:31 Yes, true. Forth people.. 05:52:45 but the time metric seems very common thesedays for young people 05:53:02 even when they have planty of time 05:53:07 plenty 05:53:52 the time they save will be spent watching tv or some useless waste of time I fear 05:54:56 I'm watching a thread about " non blocking stepper motor driver" atm 05:55:46 I have always wondered about the "saving time" argument 05:55:54 it's been hilarious especially as the OP was using a arduino driving a stepper driver board that only required a step and directions signal 05:56:06 me too 05:56:07 You can only spend time. More or less time, yes. 05:56:35 But you can not save time now and the pick it out later, should you need to 05:56:55 It's more about spending different amounts of time and plan your day 05:57:00 yes 05:57:21 and when it comes to skill, time is irrelevant imho 05:57:35 you either acquire a skill, or you dont 05:58:18 schools probablly dont help with their time limited tests 05:58:33 Probably not 05:59:08 I guess schools arent very good places to learn anyway 06:01:39 My oldest son is in the first school year 06:01:52 wow 06:02:24 thats not going to be easy on dad I guess ? 06:02:39 No, it is difficult 06:02:59 Trying my best to support him, give him help at home. 06:03:20 Too few teachers and not very peaceful all the times at school 06:03:20 my eldest child is 43 06:03:38 Wow, about my age then. I turn 45 later this year 06:03:44 * tp shudders 06:04:08 I hated school from the first day 06:04:28 I did not do very well either 06:04:48 I wondered why I was being punished by being sent to the hell hole 06:05:17 definitely a bad fit for me 06:05:35 but in those days a kid went to school and learned to survive it 06:06:14 The key word is "survive". Was for me, at least 06:06:21 lol, I dont ever remember doing any homework, when a teacher asked where was it, I just shrugged, didnt care 06:07:14 I could see it wasnt important, I could see they knew it wasnt important, that the doing and not the result was what they wanted, and I refused to pay that game 06:07:46 so I never did any, the world didnt end, and no one really cared anyway 06:08:27 instead I followed my obsession with electronics until I was set free of school 06:09:00 mtsd, yet these days kids love school ? 06:09:07 or rather my kids did 06:09:25 well most of them 06:09:47 my eldest son didnt like it much either, hes very practical and can make anything 06:10:22 My son likes it better now, it was harder for him at first 06:10:28 Getting better 06:10:56 ah well, he must suffer it either way 06:11:18 i think of school as day care 06:12:08 I guess when students vs teachers exceeded 2:1, schools became day care 06:15:41 I look forward to when they are going to start learning computers. 06:16:34 Kids are supposed to learn programming. I'll help him hand in assignments in Forth or Lisp, and see what the teacher makes of it :) 06:16:42 hahahha 06:17:10 they will come home and tell you theyre learning programming and it's called microsoft excel 06:18:00 I went to a parent-teacher meeting once where the maths teacher spent the entire evening promoting his youtube channel 06:18:27 High quality tutoring... 06:21:20 I see you and I are on the same page 06:22:35 Poor kids. 06:23:05 yeah, luckily they have you 06:23:19 I taught mine may things, mostly practical 06:23:23 many 06:23:40 Thanks, I try my best 06:23:48 all that matters in the end if the quality of the parents 06:23:53 if = is 06:24:21 I am glad I am not young these days. It was hard enough when I grew up, before there was social media, smartphones and such things 06:24:23 a lucky child gets a wise parent 06:24:36 I cant imagine it myself 06:24:45 tho you know we'd have adapted 06:25:15 Humans do adapt to almost anything, over time 06:25:21 we do 06:26:24 if we had to work everyday in a metal cage taking batteries apart and were never let out, I'd be "hey mtsd hows it going dude" 06:26:45 and youd be 'good, got a curious battery here' 06:27:07 --- join: TCZ joined #forth 06:29:17 haha, yes, most likely 06:30:54 :) 06:37:03 Well, time to go and get son from school :) 06:37:26 Have a nice day/ evening/ night, everyone! 06:38:34 --- quit: mtsd (Quit: Leaving) 06:45:33 --- quit: TCZ (Quit: Leaving) 07:11:48 How to define a word patch: 07:11:48 patch: 03 00 00 00 05 :patch 07:11:48 that does this: 07:11:48 03 C, 00 C, 00 C, 05 C, 07:11:48 ? 07:12:58 --- join: TCZ joined #forth 07:20:15 BL WORD 5 \ now how to execute the parsed 5 ? 07:20:28 \ so that it puts 5 on the stack ? 07:26:52 COUNT EVALUATE , is one way.. any better way? 07:30:22 IMHO the best answer to such questions is to study and refactor your favourite Forth implementation. 07:31:11 yes, I am reading jonesforth and other forths 07:31:19 Excellent. 07:32:04 Is ""patch:"" an implementation of Array? 07:32:44 Take a look at ' ," . 07:33:33 --- quit: iyzsong (Quit: ZNC 1.7.1 - https://znc.in) 07:38:08 merkc1: patch: Var @ :patch 07:39:52 patch: would need to individually parse each hex bye (they are separated by spaces ) until ;patch http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm I'll try a variation of CASE: from this tutorial 08:19:58 : PATCH: \ patches all bytes till ;PATCH 08:19:58 HEX BEGIN BL WORD FIND \ .S CR 08:19:58 0= IF COUNT EVALUATE C, 0 08:19:58 ELSE ['] ;PATCH = THEN 08:19:58 UNTIL DECIMAL ; 08:19:59 08:20:01 : ;PATCH] ; \ do-nothing word 08:20:03 : [PATCH: \ patches all bytes till ;PATCH 08:20:05 HEX BEGIN BL WORD FIND \ .S CR 08:20:07 0= IF COUNT EVALUATE POSTPONE C, 0 08:20:09 ELSE ['] ;PATCH] = THEN 08:20:11 UNTIL DECIMAL ; IMMEDIATE 08:20:33 is there a way to make PATCH: smart enough to work both in interpretation and compilation modes ? or I need a separate version [PATCH: for compilation mode 08:22:13 --- quit: TCZ (Quit: Leaving) 08:27:31 --- join: kmstout joined #forth 08:27:50 --- part: kmstout left #forth 08:28:36 --- join: kmstout joined #forth 08:34:26 IMHO ""mode flag"" is a terrible idea. 08:36:57 Your exercise is also a terrible idea, except if it is an exercise in a bad idea :) . It's so terrible it's like ""ANS Forth"". 08:39:47 For example ""swap"" is only slightly less local variable than local variables of ""swap"". 08:45:11 --- quit: Zarutian_HTC (Ping timeout: 256 seconds) 09:10:40 --- join: TCZ joined #forth 09:15:36 --- quit: X-Scale (Ping timeout: 265 seconds) 09:17:35 --- join: [X-Scale] joined #forth 09:17:51 --- nick: [X-Scale] -> X-Scale 09:25:08 DKordic so what's a not so terrible solution to the problem of compiling a HEX string 09:28:01 --- quit: jsoft (Ping timeout: 258 seconds) 09:33:28 --- quit: TCZ (Quit: Leaving) 09:59:50 tp: I got really annoyed by the pictures in Learn You a Haskell but I did stick with it and it was good 10:00:29 I did use Starting FORTH as a jump start and enjoyed it, as a historical piece, and I know I would have found it as patronisingly annoying if I read it back in the day 10:02:51 --- quit: reepca (Read error: Connection reset by peer) 10:02:54 merkc1: Parse the ""hex string"" into bytes. gforth has "" s\" \x1F\x2F" dump "". 10:03:07 --- join: reepca joined #forth 10:03:29 That's Forth 2012 (and maybe older standard has it as well?) 10:09:25 DKordic , how to parse it without having to manually add \x before each byte 10:10:11 from a hexeditor when you copy the hex string it's without \x 10:22:56 Loop over the ""string"" digit by digit. Assuming ASCII encoding, digit can be parsed with a few bit-wise operations. 10:25:01 --- quit: dys (Ping timeout: 246 seconds) 10:34:50 --- join: benjamin-l joined #forth 10:40:56 --- join: Zarutian_HTC joined #forth 11:10:21 DKordic: ok, sounds nice; 11:12:39 please guide me, which word should I check out to learn how to do looping over the string , digit by digit 11:16:00 https://github.com/rufig/spf/blob/master/devel/%7Eygrek/lib/neilbawd/toolbelt.f#L125 looked at ," here but it am still confused 11:30:12 merkc1: Is this something like what you want? https://ideone.com/wPrJGp 11:30:31 Sorry lads had to stretch my Forth muscles, I write very little actual forth, even when doing my forth 11:31:36 veltas: yes 11:32:08 I don't know *what* the fuck ideone did to syntax highlighting there but try reading in a good editor I guess 11:32:13 DKordic & veltas: thank you for the insights 11:39:09 Someone please tell me if there is a nicer way of writing that https://ideone.com/wPrJGp 11:39:21 I mean in conventional Forth 11:39:31 Or any style/comment tips appreciated too 11:51:11 to make it work in compilation mode I'd have to define another IMMEDIATE version of it, with POSTPONE before C, , right? 11:51:32 merkc1: Just realised my code was broken, 2DROP 2DROP instead of 2DROP DROP was needed 11:51:47 ok 11:52:23 Yes merkc1 12:08:49 for some reason the IMMEDIATE version doesn't work https://ideone.com/wmPCEL 12:25:44 --- join: WickedShell joined #forth 12:29:28 --- join: tangentstorm joined #forth 12:40:44 --- quit: kmstout (Quit: leaving) 12:50:50 --- join: dys joined #forth 13:00:13 merkc1: You're putting the parsed number onto the stack, and then leaving it there, as far as I can tell 13:00:32 And then doing a POSTPONE C, 13:01:25 merkc1: Try LITERAL 13:18:52 Also ideone will generate output for you don't copy it in :S 13:30:33 --- quit: xek (Ping timeout: 250 seconds) 13:47:13 --- quit: cantstanya (Remote host closed the connection) 13:49:35 tried LITERAL after D>S , still not working 13:50:29 Why do you think that might be? 13:50:38 --- join: cantstanya joined #forth 13:51:08 Exception #-2005 at: tm.f:30:7: 13:51:08 REPEAT 13:51:08 ^ -2005 REPEAT without BEGIN 13:53:24 --- quit: reepca (Ping timeout: 264 seconds) 13:59:31 veltas: I don't know 13:59:34 Show me your code 13:59:59 I'm assuming you have a corresponding BEGIN ? 14:02:44 --- join: dave0 joined #forth 14:03:12 ok 14:04:17 this is the code https://ideone.com/tcwZ5x 14:04:42 iHEX doesn't work, even with LITERAL 14:05:14 prog.4th:29: expected dest 14:05:14 >>>REPEAT<<< 14:07:02 * veltas is thinking 14:07:08 :) 14:07:27 LITERAL takes a parameter from the stack at compile-time, you don't have the number until runtime 14:07:55 So LITERAL is not what you want on its own 14:08:30 When I say 'runtime' I am talking about compile-time ... of the def that iHEX,{ is used in, but that is the *runtime* of iHEX,{ 14:08:47 but iHEX is immediate 14:09:25 oh 14:09:58 So what you want ... dare I say, is POSTPONE LITERAL ? 14:10:10 tried that too 14:10:10 Not sure let me think about it (or try it) 14:10:44 what's interesting, is that this code works : 14:10:44 : ;PATCH] ; \ do-nothing word 14:10:44 : [PATCH: \ patches all bytes till ;PATCH] 14:10:44 HEX BEGIN BL WORD FIND \ .S CR 14:10:44 0= IF COUNT EVALUATE POSTPONE C, 0 14:10:44 ELSE ['] ;PATCH] = THEN 14:10:45 UNTIL DECIMAL ; IMMEDIATE 14:10:59 so I would expert IHEX to work as well but for some reason it doesn't 14:16:00 merkc1: What error do you get with POSTPONE on LITERAL? 14:17:09 stack underflow 14:17:17 Well that's a different error at least 14:17:21 This is, by the way, a very bloated approach 14:18:00 merkc1: Can I see that code? 14:18:11 Forth is not a trivial language is it? 14:18:20 :) 14:18:56 iHEX,{ is trying to build a sequence like 10 C, 0 C, 0 C, ... etc into the defs where you use it 14:19:10 But with HEX,{ all that is left when all is said and done is the array 14:20:23 I feel like the proper iHEX,{ would at least bake the array in leave behind the runtime semantics to C, that array 14:21:28 looks like on gforth it runs fine? https://ideone.com/FwGvuK 14:21:41 There is probably still an issue 14:22:00 gforth lets you get away with some state-sensitive shenadigans 14:22:20 Let's try and fix this 14:23:08 here https://ideone.com/5YkgBO 14:23:56 merkc1: Does that look right to you? 14:24:33 yes 14:24:47 it put those 3 0 0 0 5 0 0 0 bytes in 'w' 14:24:53 I must admit I don't understand your test 14:25:12 I just dump 10 bytes 14:25:22 I only injected 8 14:25:29 we can just ignore the last 2 14:25:33 from the dump output 14:26:26 merkc1: But that's before you use iHEX,{ ? 14:27:13 mypatcher uses it 14:27:28 on spf-forth I get this : 14:27:29 PTION! CODE:C0000005 ADDRESS:00566828 WORD: EXC:-1073741819 ption> 14:27:29 USER DATA: 003607D4 THREAD ID: 00001BC8 HANDLER: 0012EEFC 14:27:29 STACK: (5) 7FFD4000 75ABEF6C 00366774 00000001 00366774 00000001 [45524548] 14:27:29 RETURN STACK: 14:27:31 DUMP is used before mypatcher 14:27:31 0012EED4 : 0056695F EXC:-1073741819 14:27:33 0012EED8 : 00566991 EXC:-1073741819 14:27:35 0012EEDC : 00566A72 EXC:-1073741819 14:27:39 0012EEE0 : 80000001 EXC:-1073741819 14:27:41 0012EEE4 : 7FC9DA41 EXC:-1073741819 14:27:43 0012EEE8 : 00566AC0 EXC:-1073741819 14:27:45 0012EEEC : 00567C26 EXC:-1073741819 14:27:49 0012EEF0 : 00567CE2 EXC:-1073741819 14:27:49 0012EEF4 : 00568371 EXC:-1073741819 14:27:51 0012EEF8 : 0055516C EXC:-1073741819 14:27:53 0012EEFC : 0012EF3C EXC:-1073741819 14:27:55 0012EF00 : 0012FF88 EXC:-1073741819 14:27:57 0012EF04 : 0056819B EXC:-1073741819 14:27:59 0012EF08 : 00366774 EXC:-1073741819 14:28:01 0012EF0C : 00000006 EXC:-1073741819 14:28:03 0012EF10 : 00000000 EXC:-1073741819 14:28:05 0012EF14 : 00000005 EXC:-1073741819 14:28:09 0012EF18 : 001D1F55 EXC:-1073741819 14:28:11 0012EF1C : 00000005 EXC:-1073741819 14:28:13 0012EF20 : FFFFFFFF EXC:-1073741819 14:28:15 0012EF24 : 00000000 EXC:-1073741819 14:28:17 0012EF28 : 005681EF EXC:-1073741819 14:28:19 0012EF2C : 005683AF EXC:-1073741819 14:28:23 0012EF30 : 0000001C EXC:-1073741819 14:28:23 [...] 14:28:25 0012EF68 : 0012FF80 EXC:-1073741819 14:28:27 0012EF6C : 00567A79 EXC:-1073741819 14:28:29 the first DUMP is to text HEX, 14:28:34 *to test 14:28:40 then we have .TEST2 which tests mypatcher 14:28:50 (dumps 'w' ) 14:30:20 merkc1: At a glance it looks like that would overwrite other dictionary entries 14:30:30 Maybe ALLOC some space after w? 14:30:32 I simplified the code https://ideone.com/5YkgBO 14:30:58 ok 14:31:30 Do you see why? 14:31:46 it works now 14:31:51 after ALLOTing 14:31:58 Yes sorry ALLOT 14:32:03 it patches itself 14:32:07 right? 14:32:09 Do you understand why you need to ALLOT ? 14:32:17 mypatcher patches itself otherwise 14:32:52 I'm not sure what you're trying to say but mypatcher seems to assume that there is 8 bytes of writeable space at w 14:33:00 yeah 14:33:13 and if happens that mypatcher is defined right after w 14:33:15 So it would need to be at least 8 bytes ALLOTed to be portable (and avoid potential crashes) 14:33:22 *it happens 14:33:57 so without ALLOTing, mypather will replace bytes in mypather itself 14:34:23 does that make sense? 14:34:26 :) :) 14:34:30 thanks for the help! 14:34:37 You're welcome 14:35:38 I think a more idiomatic test might be to just bake iHEX,{ into a word and then use that word after a CREATE 14:36:06 But please tell me you're not going to put a large number of bytes into a iHEX,{ as it is now? 14:36:41 Because as I said before it will unroll that into a massive colon definition, maybe it's the 48K programmer in me but it seems bad :) 14:37:06 yes it's bad 14:37:13 right now I don't put a large number 14:37:21 but it would be good to have an optimized version 14:37:40 can it be optimized?? 14:43:52 --- quit: gravicappa (Ping timeout: 258 seconds) 14:44:19 merkc1: Absolutely 14:47:23 Not sure how in standard forth though 14:52:26 merkc1: Find your implementation's S" and see what it does in compile state because that will probably bake the string itself into the definition, rather than something else 14:52:47 So that might help you see how to do it on your forth 14:57:37 ok! 15:07:51 I'm looking for an x86-32 forth with some similarity to the standard, actively developed 15:54:47 --- quit: merkc1 (Ping timeout: 258 seconds) 16:40:07 sadly http://git.savannah.gnu.org/cgit/gforth.git/log/ had its last commit 9 hours ago... basically abandonware. :( 16:55:55 how frequently updated is really needed? 16:59:56 oh hey, crc. sorry, i was being dramatic and silly. :D 17:02:25 yes, but the question is valid 17:02:58 veltas: for which os? 17:05:01 --- quit: cantstanya (Remote host closed the connection) 17:07:20 --- join: cantstanya joined #forth 17:21:50 hey guys 17:22:05 hey tabemann 17:25:11 oh, if I didn't tell you, I got my automatic zeptoforth_full binary generator working 17:25:52 all you need to do is physically attach a USB cord/programmer to the board, give it a version, platform, and device, and let'er rip 17:26:12 nice work 17:26:39 the only thing, though, is that downloading the ihex from the stm32f407 board takes almost 35 seconds 17:26:46 should make binary releases a bit easier ? 17:26:52 oh certainly 17:27:07 because I've made mistakes in the past when doing so manually 17:27:13 yeah, it's can be a slow process 17:27:32 yeah, manually sucks because of the potential for mistakes 17:28:04 thats why I went full automatic on binary generation 17:28:36 tabemann, you can probably do it a LOT faster with QEMU tho 17:28:49 like 0.1 second 17:28:51 --- join: jsoft joined #forth 17:29:08 I highly doubt it can emulate all the peripherals with QEMU 17:29:28 it doesnt need to 17:29:52 I mean things as simple as USARTs and like 17:30:00 still doesnt 17:30:02 :) 17:30:14 this is only to produce the binary 17:30:44 it needs to load the code via serial 17:30:56 I made my ihex when I couldnt run qemu on FreeBSD 17:31:09 sure 17:31:57 and it implements serial with its peripherals 17:32:11 if you look in the Mecrisp-Stellaris release at the 'thumbulator' stuff you will see how mathias uses it to produce complete binaries also 17:32:59 but then you're changing the binary, and remember that the kernel binary is baked into the full binary along with the other stuff 17:33:43 okay, I'm gonna have dinner now, bbl 17:34:16 yeah 17:34:34 thats how matthias produces a binary with the dissasembler etc 17:34:39 cya 18:00:19 --- join: rdrop-exit joined #forth 18:09:18 good evening rdrop-exit 18:09:57 good morning crc (-_-)zzz c[] 18:09:57 good evening crc and rdrop-exit 18:10:07 good morning tp 18:10:47 rdrop-exit: that makes 132 cups of coffee 18:10:49 * tp adds the final, final, final touches to his updated bluepill 'developer' binary release 18:11:06 my eyelids are struggling 18:13:15 never say final ;-) 18:13:54 crc, I found md2html.awk @ https://bitbucket.org/yiyus/ which does a nice job of making a html page from my fossil *.md 'home' page 18:14:32 rdrop-exit, why not, I've been saying it the last couple of weeks! 18:15:52 I have a soft spot for awk 18:16:27 awwww ... k 18:21:01 --- join: merkc1 joined #forth 18:21:22 back 18:21:35 welcome back! 18:21:38 and forth 18:22:29 --- join: reepca joined #forth 18:22:39 tp, your final reminds me of the Mark Twain quote 18:23:06 tabemann have a look in mecrisp-stellaris-2.5.3/stm32f051-ra/precompiled and what do you see ? "mecrisp-stellaris-stm32f051-with-disassembler-m0.bin" 18:23:17 Giving up smoking is the easiest thing in the world. 18:23:17 I know because I've done it thousands of times. -- Mark Twain 18:23:26 hahah, yeah, clasic 18:24:10 sadly the phrase "back and forth" supplies a few million extra hits when googling "forth" 18:24:17 now that I have my special build script, I don't know what to do with zeptoforth 18:24:44 sell it to Bill Gates for $1000000 ? 18:25:11 lol 18:26:42 tabemann, Ive found that releasing a Forth binary results in hundreds of times more downloads as most embedded people interested in Forth just cant be bothered dl one and then locating all the deps to make it useful 18:26:59 intrested = curious 18:27:15 so I do a binary for all releases now 18:27:33 why do you need a "special build script"? 18:28:08 plus my binary release tarball also includes all the sources in one file, and a readme.html 18:28:56 rdrop-exit, to suck the machine code out of the mcu to make a binary file release 18:29:44 rdrop-exit: to make a binary containing the kernel and all the compiled Forth code one wants in one step 18:30:06 rather than manually, which is lengthy and error-prone 18:32:03 the script erases the flash on the MCU, uploads the kernel to the MCU, uploads the Forth code to be compiled to the MCU and compiles it, uploads ihex.fs to the MCU, uses ihex.fs to spit out the entire contents of the flash as ihex data which is then saved to a file, uses sed to edit that file to remove te extra crap, then converts it to a binary 18:38:26 wow, so roundabout 18:39:04 many complex 18:40:08 --- quit: dddddd (Ping timeout: 265 seconds) 18:40:17 but yeah, it is roundabout, which makes doing it manually a pain 18:52:56 --- join: boru` joined #forth 18:52:59 --- quit: boru (Disconnected by services) 18:53:02 --- nick: boru` -> boru 18:53:31 rdrop-exit, it's something most resident mcu forths dont do 18:54:57 --- quit: merkc1 (Ping timeout: 258 seconds) 18:55:15 tp: no license on that file :( 18:56:11 crc, true and the original authors homepage is defunct 19:00:36 makes using it questionable 19:01:04 does it ? 19:01:29 the author has no contact info iirc ? 19:01:35 and it's on a public site 19:01:49 potentially. from a legal perspective, there's nothing giving any rights to use or modify 19:02:29 I'm not a lawyer so I cant add anything useful 19:03:05 (my system gets used in a business environment; we do have a lawyer who is concerned about such things) 19:03:45 it would also introduce another external dependency (awk) 19:04:26 for sure a Retro program to do this would be better 19:04:39 but every unix system has awk ? 19:05:12 does this work on all awk implantations? 19:05:23 I dont know 19:05:54 crc, do you know a fossil command that returns the short form hash of the current checkout ? 19:05:58 that would be a concern. I dislike things outside my control 19:06:07 understand 19:09:56 bbiab 19:13:04 crc: regarding 'legal perspectives': is that what these LICENSE textfiles are about? and do lawyers really belieave 'AS IS' clauses give any kind of defense against liability? 19:19:42 fossil timeline -n 1 | grep CURRENT | cut -c 11-20 19:20:30 Zarutian_HTC: I think it's more about ensuring we have permission to modify and/or redistribute if necessary 19:21:11 tp: I'm not sure if there's a better way to get this 19:22:20 crc, thats fine, thank you, it's great 19:27:59 crc, possibly the only other way is to look it up in the repo sqlite database, but your solution is perfect 19:32:26 fossil info | grep current | cut -c 15-24 19:32:35 a bit shorter 19:33:03 cool 19:33:28 I don't see anything else without delving into sql 19:33:46 it's only used in a script at the end of a project anyway, so efficiency isnt important to me 19:34:16 ok, this should be fine then 19:34:32 absolutely, thanks for your time :) 19:34:43 no problem 19:45:29 back 19:45:41 welcome back! 19:45:57 thanks :) 19:50:55 it's another lovely 30C day here ... 19:51:01 roll on winter! 19:52:05 33C atm here, expecting a high of 36C 19:52:44 ouch! 19:53:43 expecting 29C but I'm always a bit hotter here: 30,18 C / 86,44 F 19:54:01 too hot :( 19:54:23 it's 6C here 19:54:32 less that 36C tho :) 19:54:48 6C, my teeth chatter just thinking about it 19:54:55 crc, unusually cold for your time of year ? 19:55:29 rdrop-exit, we could use a 4 dimensional heat pipe to crc ? 19:55:32 yeah. it'll get into the 30's in another month or so 19:55:44 it's a bit cooler than normal 19:55:56 where are you at crc? 19:56:13 Pennsylvania, usa 19:56:15 I rarely see 6C here except maybe a couple of days in the middle of winter 19:57:15 crc, I was born in Bryn Mawr 19:57:31 I'd normally expect it to be around 18C on average at this point 19:58:31 I live about 20 miles from Bryn Mawr 19:58:40 small world 19:59:09 yes it is 19:59:55 In the 80s when we were living in San Francisco, my wife introduced me to her new coworker 20:00:19 we got talking, and it turns out we were both born in Bryn Mawr 20:00:34 so you guys are a Welsh ? 20:00:37 same year, same day, same hospital 20:00:37 -a 20:01:08 imagine the coincidence 20:01:36 that's a lot of coincidence 20:01:55 our mothers were in the maternity ward at the same time 20:02:17 blew my mind 20:03:34 law of connected things, they reassociate whenever 20:04:48 tp, https://en.wikipedia.org/wiki/Bryn_Mawr%2C_Pennsylvania 20:05:00 rdrop-exit, I looked 20:05:06 named after an estate near Dolgellau in Wales 20:05:09 the name was a welsh giveaway 20:05:15 right :) 20:05:33 I believe my last name is of Welsh origin 20:05:34 except I initially though it needed more "G" s 20:10:35 tp: ya ken þat nam har som saga? 20:12:20 Zarutian_HTC, nei ég vissi ekki! 20:13:59 tp: wait Google Translate came up with something sensible from what I wrote? It wasnt Icelandic btw but my guess on psuedo welsh 20:16:03 Zarutian_HTC, GT thinks it's Icelandic 20:16:08 in more usual english: you know that name has some saga (behind it)? 20:16:35 GT "know that it took her story?" 20:17:11 Zarutian_HTC, only what a brief scan of the wikipedia article said 20:19:18 try this: "lentu ok tóku söl, ei voru aðrar góðar nytjar" 20:20:52 "landed and made sales, there were no other good uses" 20:20:55 hehe 20:21:09 too hard, Forth is easier! 20:21:19 --- quit: rdrop-exit (Quit: Lost terminal) 20:21:51 --- join: rdrop-exit joined #forth 20:23:07 so close but the "made sales" is crap, should been "took " 20:25:28 thats the problem with translating languages, not so easy 20:25:39 vikings knew about c vitamin deficency desease called skyrbjúgur 20:25:50 you should see the trouble I have translating C to Forth ;-) 20:28:05 best not to 20:28:51 reverse engineer the C to a spec first 20:29:31 then meet the spec with Forth flair 20:29:34 ;-) 20:29:52 this is the best way 20:29:58 rdrop-exit, I have to use C programs to learn how certain hardware is used, from time to time 20:30:34 sure 20:30:36 I'm after hardware understanding only, I couldnt care less about C 20:31:03 it's just that *everyone* uses C now, it's a plague 20:33:05 that's fine, use the C to understand the hardware if necessary, just don't attempt transliteration of C to Forth, that way lies madness 20:33:25 oh no, I never do that, in a tech 20:33:31 in = I'm 20:34:46 I've seen a few embedded C users trying Forth, and it often doesnt end well 20:36:25 I imagine so 20:36:28 mainly as they are used to the C way of cramming every register bitfield into the one statement 20:36:50 I usually skip the C examples in datasheets and go directly to the assembler examples 20:37:10 better 20:37:25 me too, sadly examples have been in C ONLY for quite a while and even that is getting worse 20:37:52 STMicro almost always give their examples IN C 20:38:11 such code is usually better than any c compiler targetting the thing spits out 20:38:21 and lately they have begun giving them in MBED or some ghastly GUI thing with NO CODE 20:38:37 Zarutian_HTC, I agree 100% 20:40:45 once I came across output that was using simulated arithmic shift to implement bit rotate operation. The kicker? the code for the arithmic shift used the invuilr bit rotate instruction! 20:41:25 hahahh 20:41:31 inbuilt* 20:41:47 the mind boggles 20:42:00 sometimes ya just gotta wonder ... 20:45:55 in a forum today I read a oldish but very experienced Windows guy state that " when learning C there is more to life than blinking a LED in a while loop" 20:46:02 and C isnt that well specified either 20:46:46 I felt that just blinking a led can keep someone occupied for months 20:47:29 it's typical for a C programmer to think that all LEDS blink in a while loop, but of course there are many diverse ways a LED may blink 20:48:23 was it a blocking or non blocking loop ?, RTOS, multitasking, did it use interrupts, did it use a inbuilt hardware timer etc 20:48:49 some ways are timer interrupt driven (used to see if there are any interrupt stormsl 20:49:08 s/sl/s)/ 20:49:10 sure 20:49:47 is it morsing out an error message? 20:50:09 only in a toyota camry EMU ;-) 20:50:42 or some stuff made by an ham operator I know 20:51:15 hehe 20:51:27 finished I think, how cool is this ? 20:51:30 tp@gronk:~/mecrisp-stellaris/f103-developer-image/imageclones% tree 20:51:30 . 20:51:30 ├── f103-developer-image.c9ebc3e9d6.DELETE.sh 20:51:30 ├── f103-developer-image.c9ebc3e9d6.README.html 20:51:30 ├── f103-developer-image.c9ebc3e9d6.bin 20:51:31 ├── f103-developer-image.c9ebc3e9d6.source+.fs 20:51:32 ├── f103-developer-image.c9ebc3e9d6.source-.fs 20:51:34 ├── f103-developer-image.c9ebc3e9d6.words4.txt 20:51:40 cccombo breaker 20:52:13 f103-developer-image is the project name 20:52:15 damn not quick enough 20:52:48 c9ebc3e9d6 is the SCM hash 20:53:00 (thanks CRC) 20:53:35 there is a full source file used to build the Forth binary, one with comments, one without 20:54:31 a HTML readme converted from my markdown readme and a full dictionary list 20:54:58 and then it's all turned into a tarball ready to publish. The entire process is automated 20:56:30 kudos 20:56:59 it's pretty slick! 20:57:57 the whole think is 93kB, no Eclipse or Java required :) 20:58:03 -k+g 20:58:10 one funny thing I came across when taking a look at failing electronics device a customer wanted a repair quote on: those warranty void stickers on some of the casing screws 20:58:24 Zarutian_HTC, and ? 20:58:29 neat, tp! 20:59:31 and here it is https://sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/f103-developer-image.tar.gz/download 20:59:40 in the user manual it said that by removing or destroying the stickers the warranty on the stickers would be void 20:59:42 for anyone with a "Blue Pill" 21:00:07 crest, you have the odd one or 2 Blue Pills :) 21:00:22 Zarutian_HTC, yeah 21:00:25 not on the electronics device but the warranty on the stickers 21:00:28 as they do 21:00:36 hahah 21:00:47 I totally missed that! 21:01:14 bizarre 21:01:16 it was manly an 'user repair' deterrant 21:01:34 mainly* 21:02:51 deterring "manly" user repairs makes sense :) 21:02:51 I hated warranty claims because here in Australia falsely claiming warranty is considered fair game 21:03:41 id get wifi units full of water and the owner would swear there was no water involved 21:03:58 and if someone called the manifacturer about the statement in the user manual they would get 'oh you actually read the manual! congrats!' response 21:03:59 so Id have to send them a pic of their unit full of rust and mold etc 21:04:17 Tim the Tool Guy attempting "manly" repairs 21:04:28 Zarutian_HTC, maybe send them a prize ? 21:08:34 another manual gem: "There are two reasons why you are reading this manual. The first one is that you are reading it, we hope, before using the product. The second, which is more likely, you did something and now you got an error condition. Troubleshooting is on page" 21:09:34 some good manuals! 21:10:13 or a very pessimistic technical writers 21:55:51 --- join: gravicappa joined #forth 22:15:01 --- quit: dys (Ping timeout: 256 seconds) 22:57:25 --- quit: _whitelogger (Remote host closed the connection) 23:00:27 --- join: _whitelogger joined #forth 23:25:01 --- join: mtsd joined #forth 23:49:57 --- quit: mtsd (Quit: mtsd) 23:50:22 --- join: mtsd joined #forth 23:50:32 --- quit: mtsd (Read error: Connection reset by peer) 23:52:52 --- join: mtsd joined #forth 23:59:59 --- log: ended forth/20.04.23