00:00:00 --- log: started forth/20.04.12 00:00:04 My preference for SRT/NC isn't only for speed, it's also the simplest threading mode, applicable whether you're on a real chip or on a VM "chip" 00:00:08 hi tp 00:00:13 heya 00:00:20 * threading model 00:00:25 hows that rooftop view ? 00:00:44 too sonny to go on the rooftop these days 00:00:48 sunny 00:03:32 Ive havent been out of the compound for 3 weeks myself 00:03:46 but Im a ground floor dweller 00:05:21 --- quit: rdrop-exit (Ping timeout: 260 seconds) 00:05:54 --- join: rdrop-exit joined #forth 00:05:59 lost my connection 00:06:39 I've been walking the dogs on our living room balcony, they like sniffing around the plants 00:06:41 oh oh 00:06:55 stay healthy, KipIngram 00:07:01 wifi connection ? 00:07:25 yup, my wife's tablet screwed it up somehow 00:07:51 do the other residents suspect that sniffing around the plants isnt the only things your dogs like doing ? 00:08:05 (around the plants) 00:08:35 maybe a bit of saltpeter is good for plants ? 00:08:52 they wouldn't know, they don't have a view into our balcony 00:16:50 heh 00:17:55 I've decided to fire up my tethered Forth in a week or so, update the code try out the new features 00:18:05 and make a small hardware project 00:18:12 excellent! 00:19:19 as it's all pretty much exactly the same Forth I use now the chageover is barely noticeable 00:19:30 but it's a bit of a mind bender 00:20:11 after using it for a few days I become convinved it's a 'normal' on chip Forth 00:20:44 as it uses exactly the same IDE I made for my on chip Forth stuff, it's just a fair bit faster 00:21:13 which is a mind bender because a on chip MSP430 Forth is actually slower than a on chip cortex-m Forth 00:22:17 some other odd behaviour is when I do a "free" on the MSP430 it reports 64kB, not bad for a chip with 2kB of flash 00:22:35 heh 00:23:13 i run my svd2forth on the chip exactly as I do for cortex-m 00:23:38 except it's the ti hardware descriptions converted to CMSIS-SVD 00:24:36 Once you get used to a tethered setup you might have a hard time going back to a single Forth setup. 00:24:40 by some vary handy Rust programmers 00:25:04 nah, the MSP430 is expensive and lacks a LOT of peripherals 00:25:28 plus I have 478 STM32F051's left to use :) 00:25:53 the MSP430 is also a bit slow. has only a 10 bit ADC etc 00:26:16 Perhaps he'll eventually make a tethered Forth for your ARM chip 00:26:19 if I had a cortex-m tether then Id have a problem going back 00:26:38 no, he hates cortex-m, he assures me it will never happen 00:27:16 too bad 00:27:38 he used a ti cortex-m4 as the tethered host as it needs plenty of speed 00:28:04 even then the speed of the emulated MSP430 is about 20x slower than the real thing 00:28:48 which isnt a problem when developing, one just works around it 00:29:00 I wonder why he didn't just use a PC or RPi based Forth for the host side of the target, makes more sense 00:29:19 even a 16Mhz MSP430 slowed by 20x is still pretty fast 00:29:31 hardware 00:29:34 * host side of the tether (not "of the target") 00:29:49 he said the MSP430 JTAG timing was critical 00:30:21 I understand wht you mean 00:31:49 JTAG timing shouldn't be an issue, he can use an FTDI cable 00:34:31 does the ftdi cable relieve the pc of the requirement for realtime ? 00:35:16 pc timing has always been a hardware issue for external hardware 00:35:29 Ive had to deal with it on occasions 00:36:05 yes, it has a chip that interacts with the JTAG and buffers on both sides 00:36:15 ah cool! 00:37:17 hopefully the USN FTDI would work under QEMU ? 00:37:23 -N+B 00:37:52 No idea, I guess so 00:38:26 the downside of FTDI is talking to their chip through a closed source library 00:38:27 but at least I have the MSP430 tether, which frankly the MSP430 needs 00:38:36 oh yeah, hed hate that 00:38:47 tp: "dmesg(1)" shows for my FT232R a buffer of 64 Bytes. 00:39:13 cortex-m dont *need* a tether, they have tons of resources anyway 00:39:57 DKordic, is that all, I thought they had more based on my XON/XOFF fail 00:40:57 as the Forth on buth systems is the same, Im ok with a tether for a very flash limited msp430 and a on board Forth for a cortex-m 00:41:27 I might be wrong. There might also be buffering in the libs. 00:42:22 The one I'm speaking of is a FTDI C232HM USB 2.0 Hi-Speed to MPSSE Cable 00:44:06 the secret sause is their MPSSE thingie 00:45:06 What might possibly interesting about it? 00:45:13 Multi-Protocol Synchronous Serial Engine 00:45:35 Snakeoil, as expected from FTDI. 00:48:32 perhaps but it's handy if you're on a PC with USB wanting to talk to JTAG 00:49:10 The USB-MPSSE cable is capable of providing a USB to SPI, I2C or JTAG interface. This is accomplished by the MPSSE within the FT232H device which has the ability to emulate synchronous serial protocols while handling all the USB signalling and protocols. 00:51:02 what matthias did was to write a jtag interface in Mecrisp-Stellaris Forth that runs on the ti Tiva board, and write a msp430 cross compiler for that and use it all in the tethered host 00:52:48 It little less convenient than running a PC Forth as your tether host, but very nice nonetheless 00:53:13 I'm sure 02:18:27 --- join: dddddd joined #forth 02:51:42 --- quit: jedb_ (Remote host closed the connection) 02:52:00 --- join: jedb joined #forth 04:10:05 --- quit: rdrop-exit (Quit: Lost terminal) 04:50:20 Zarutian_HTC: You're right that rant page of tp's is gold 04:50:48 hahaha, whats gold a gram thesedays :) 04:50:56 microgram ? 04:51:04 nanogram ? 04:51:16 Gold is more a gram than it usually is right now, I know that much 04:52:51 makes sense, but a bit silly Ive always thought, the Incas wondered what the Spanish addiction for the "yellow metal" was because you couldn't eat it or make useful weapons or tools out of it ... 04:53:20 Pffft weird how people don't trust our currency when we keep giving everyone money while economy is hugely slowed down, and printing money to pay the national bills 04:53:29 I wonder what the Incas would have thought of the Bank of England 04:53:42 yeah, a Iced Coffee will cost $500 soon 04:54:04 I wonder what the Incas would have thought of Iced Coffees 04:55:05 they had cocoa already so I guess they would have loved the IC, probably sacrificed the Bank of England execs hobing the gods could use their hearts ? 04:55:14 The more I think about this the less I care what the Incas thought about anything 04:55:17 hoping 04:55:26 ok, fair comment 04:55:58 it is after all a Forth channel 04:58:04 tp: See, the trick with gold, is not to know what it is actually worth. It's being able to predict how most people trading it will think it's worth in the near future. 04:59:12 ahh, that may explain why I have none :) 04:59:49 The worrying thing about the markets are its forces are determined by the same morons that thought the pound was worth less because our PM went to hospital. 05:10:28 --- join: iyzsong- joined #forth 05:11:44 --- quit: iyzsong (Ping timeout: 256 seconds) 05:11:58 --- join: reepca joined #forth 05:38:12 tp: D1+! 05:38:19 What does that word do? 05:39:23 beats me, where is it from ? 05:39:42 I came up with it 05:40:13 +! adds to a number 05:40:27 So 1+! increments a number 05:40:30 whats the D for ? 05:40:38 And D1+! increments a double-integer 05:41:07 I'll admit I might be going too far with that scheme 05:41:22 Maybe D+! is good enough? Just do 1. D+! ? 05:42:26 it's a hard one 05:43:05 I have this "+! ( u|n a-addr - - ) Plus Store, use to increment a variable, register etc" 05:43:22 Well the thing is I'm trying to save space, and 1. is very badly optimised for me, but alas it is a 32-bit number so what can I do 05:43:48 i have no answer, the naming in this case isnt easy 05:43:53 Hmmm 05:44:04 D+! seems ok tho 05:44:07 D+! I think is a good name for incrementing a double variable 05:44:09 Yeah 05:44:13 now you have explained it 05:44:44 But D1+! is going too far I think, I just like having an "increment 1" operator because I'm used to C ;) 05:45:30 a stack comment will help ? 05:46:13 D1+! ( D -- D + 1 ) ? 05:47:20 Yes but I kind of want my words to be mostly 'obvious' from the name, if you are familiar with conventional forth 05:47:30 Like how Mecrisp seems to do it 05:47:46 I'm not used to too many CAPS, we normaly use lower case with Mecrisp-Stellaris because we are really lazy 05:47:56 Although I was a little lost at CTYPE but now I know it's COUNT TYPE it's at least easy to remember 05:48:34 in Mecrisp-Stellaris it would be " d1+ ( d -- d + 1 ) 05:48:40 I think lower case looks better, I have gotten in a habit of caps from Starting FORTH 05:48:53 yes, it does vary between forths 05:49:07 tp: That would add 1 to a number on the stack 05:49:41 I cant help but type them sometimes but I always convert all my sourcecode to lower case sooner or later 05:49:51 So really I should have a stack comment for you: ( addr -- ) \ adds 1 to 2VARIABLE addr 05:49:59 ah yes! 05:50:06 Because it is not doing what you think it is 05:50:41 it's a complex one, the simple ones are the hardest 05:53:07 D+! is definitely the right compromise 05:53:51 id say just use it until more insight comes 05:54:12 one has to feel things out first, sleep on them etc 05:54:27 I will not further optimise because frankly I would hope people don't use 32-bit too much on my 8-bit forth 05:55:03 I find when I think I'm definitely right, I have insufficient information 05:57:04 I find when I'm humble and assume I'm not right I tend to regret doing that, without sounding really arrogant that's just my experience. 05:57:08 plus it's YOUR Forth, so you get to decide anyway 05:57:22 And it's really not arrogant, I still do this even though it always burns me 05:57:29 hahah 05:57:44 I think in my case humility is a kind of mental hangup 05:58:32 It's not because I'm "always right", I think it's more to do with the fact that other people than me are quite happy to give advice and then aren't really accountable if it was ill considered or if it goes wrong 05:58:56 I'm more of a Confucius type myself 05:59:06 Or there is a lot of advice where conventionally it's 'free' to give advice on, like saying to "play it safe" you don't tend to get told off if you lose out because it always 'seems' correct 05:59:44 tp: Explain it to me like I have no idea about Confucius 05:59:47 Because I don't 06:00:11 i think it's pretty simple. you asked me what it was and I had no clue, you had to explain it and only then did I know what it was 06:00:33 so it's meaningful if you already know, and not if you dont 06:01:05 but as it has only three characters it's ability to explain itself is limited 06:01:13 it's not alone tho 06:01:26 Well I asked you because you are an experienced forther, so if you don't immediately get it from looking at the name then I have failed to produce something "self-evident" 06:01:53 tell me what this Word does ? movwmovt, 06:02:23 that has nearly 3 times the characters and youll have no clue 06:02:29 nor would I 06:02:34 I assume it compiles an assembly instruction to do some kind of mov instruction, but not sure. 06:02:49 But yes it's not "self-evident" 06:03:15 many Words are not self evident, hence the need for a "stack comment". This allows you to incread eteh information a lot 06:03:36 Assembly rarely is though, not every word needs to be, but I think that basic Forth operations I plan to use need to be self-evident or I should just write it with conventional Forth words 06:03:48 If that makes any sense 06:03:53 I think with a clever stack comment it's function would be evident 06:04:03 Yes but you need to look up the stack comment 06:04:09 --- quit: iyzsong- (Read error: Connection reset by peer) 06:04:14 true 06:04:18 I want a situation where you can just read the definition the word is used in and understand 06:04:21 when viabe 06:04:23 viable* 06:04:24 Im still a Forth beginner, dont be fooled 06:04:49 See this is me talking like a programmer, I am concerned with readable, maintainable code. Even on my 8-bit forth 06:04:58 It is still important to me 06:05:22 And it is not a religious contention, I think it is actually useful even here 06:05:27 I think you have the best available name, but it's still not self evident to me, but ask some others, rdrop-exit IS a Forth guru he may have a solution 06:05:43 Hmm maybe 06:05:55 i learn heaps every time he and I talk 06:06:17 I learn from talking to you as well, even if you are not a "forth guru" ;-) 06:06:31 and you can only ask that question once because after one knows, it is self evident 06:06:50 whats the 'forgetability' score ? 06:07:02 movwmovt, ( x Register - - ) Generate a movw/movt-Sequence to get x into any given Register. M3/M4 only 06:07:50 I was actually right with my guess but I don't know that kind of M3/M4 assembly intimately 06:07:51 i'd never remember movwmovt, after reading the description, but ID remember d+! increments a double 06:07:59 Hmm 06:09:47 so where are we, it it obvious at first reading of name only ? perhaps not, but once the description is read it will be obvious and easily remembered imho 06:10:08 I think it's hard to beat in 3 chars 06:10:24 Yes that is better than being hard to remember as well 06:10:29 And this is important in maintainability 06:10:32 absolutely 06:10:50 Makes it better to *write* with as well if you extend the code later 06:11:01 but you must have a Word list with stack pictures and comments for a new user to read 06:11:08 Certainly 06:11:41 and that solves any immediate understanding problem 06:12:05 is it ambiguous ? Id say no 06:13:28 I give d+! a 'good as one can do' score :) 06:13:45 Me too 06:14:04 but check with rdrop-exit, he has a knack of enlarging ones Forth outlook 06:14:43 the problem no one has solved is making the stack picture obvious on every single line of code like it is in C 06:14:44 and goodnight, it's 11pm here, time for some zzzz for me 06:14:54 ive thought about that a lot. doesnt seem to be a good answer yet 06:15:18 good night! 06:15:20 MrMobius, whats obvious in C ? 06:15:49 is that a joke MrMobius as one cant access the C stack ? 06:15:51 Forth: foo bar baz 06:16:02 C: foo=bar(baz); 06:16:09 or the 10+ other things that could be going on 06:16:16 bar=foo(baz); 06:16:25 bar(); foo(); baz(); 06:17:15 Everything is either part of a maths-style expression, or named 06:17:39 In Forth all the above is on a stack, with limited support for named locals if you want and it's available 06:17:43 there's no way to get the stack pictures for foo, bar, and baz into one comment every time theyre used whereas in C there is no way to write the code where it's not obvious what's happening 06:18:35 im just saying you have to look up the stack picture for those if it exists whereas C and most other languages solve the ambiguity problem 06:18:47 (other complaints about C not withstanding) 06:19:08 It's certainly a problem I know I will tackle head-on at some point and fail 06:19:41 I have been toying with trying to give explicit syntax for this relationship, and seeing if it fits into forth nicely 06:20:42 how about this one ? void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_TIxExternalCLKSource,uint16_t TIM_ICPolarity, uint16_t ICFilter); 06:20:59 hows that float your stack picture ? 06:21:08 one thing you could do that is still not ideal is have the environment show you the definition in a little window when your cursor hits a word 06:21:16 tp: How would that work in Forth though? 06:21:36 veltas, it doesnt, it's just some hard to grock C 06:22:04 just in case you think your Forth methods are hard to read 06:22:09 tp, looks great. I have 4 arguments on the stack plus whatever locals there are. although that deinfition is not necessarily better than the Forth equivalent since the stack picture would give the same info 06:23:04 the problem is when you call the function. you dont know what it's taking off the stack in Forth whereas in C I know it's working with 4 values and I can see what is being passed at a glance. not so in Forth 06:23:07 MrMobius, it's far from great, it's full of ambiguity to me 06:23:07 I just know I will have better input to this debate after trying 'real' code with Forth 06:23:30 MrMobius, which timer does this apply to ? 06:23:35 You can write bad code in either but there are problems which seem to me, right now, to be easier to tackle in C than Forth 06:23:48 we have sereral canidates and they have many differences 06:23:56 several 06:24:08 tp, how would you formulate Forth code that makes it any clearer what timer it applies to? 06:24:25 MrMobius, Im glad you asked :) 06:26:05 I am also interested 06:26:14 MrMobius, I do it this way 06:26:16 : TIM1_DIER_TDE ( -- x addr ) 14 bit TIM1_DIER ; \ TIM1_DIER_TDE, Trigger DMA request enable 06:26:17 : TIM1_DIER_COMDE ( -- x addr ) 13 bit TIM1_DIER ; \ TIM1_DIER_COMDE, COM DMA request enable 06:26:17 : TIM1_DIER_CC4DE ( -- x addr ) 12 bit TIM1_DIER ; \ TIM1_DIER_CC4DE, Capture/Compare 4 DMA request enable 06:26:55 This is definitely less to do with language and more to do with the programmer 06:27:04 and that replaces TIM_TIxExternalClockConfig? 06:27:04 now thats not what the C mess above does, I dont have the bitfields for that exact chip handy right now, but I can generate them in 5 minutes 06:27:40 no, I configure every bitfield separately 06:27:56 it the same way as my example code above 06:28:33 so you would have 4 words you use instead of a call to TIM_TIxExternalClockConfig with 4 arguments? 06:28:39 that C code just tries to configure all the bitfields at once and it's a nightmare 06:28:53 I feel like you could overcomplicate it just as much in Forth but potentially make something that tp would appreciate 06:29:00 mine would have as many lines as BITFIELDS 06:29:02 ya this is not a criticism of C 06:29:20 it's meant to be :) 06:29:35 I dont grok how it's not 06:29:42 You try telling him MrMobius, I already had this discussion yesterday lol 06:30:15 I'm not humble like you, I'll just steamroller over mrmorbius ;-) 06:30:18 youve written the Forth in a different way than they wrote the C function but it sounds like you could write C code the same way youre writing this Forth code 06:30:29 steamroll away :) 06:30:37 MrMobius, :) 06:30:55 Im only bringing this up because I think there might be a better way to improve readability in Forth 06:30:58 plese demonstrate it then ? 06:31:02 not to prove C is better 06:31:34 MrMobius, hey, I adore people who disagree with me, it's a unbridled learning opportunity for me! 06:31:55 youre a forther, I personally have no complaints 06:32:01 if I understand you right, each word sets up part of the timer configuration and you need multiple words to configure one timer, right? 06:32:10 I've been trying to improve this same aspect 06:32:19 correct 06:32:43 so what's stopping you from making four different functions in C? 06:32:49 terminology is important here as well 06:33:06 or making them flags that are ORed together and passed to a function? 06:33:30 we have 'peripherals' which can have any number of 'registers'. Each register can have up to 32 'bitfields' 06:34:02 a STM32F7xx has 17,000+ bitfields 06:34:22 my humble stm32f051 has 3300 bitfields 06:34:29 and each one has a word? 06:34:35 yes 06:34:45 and a description from the factory 06:34:59 so how is 3300 words better than 3300 functions or 3300 contants and one function? 06:35:13 and a technical explanation of each bitfield in the tech manual 06:35:54 my bitfield words contain the same abbreviated description that the factory tech manual does 06:36:08 the C word is meaningless to a tech 06:36:41 what if I changed the name of all the functions to the names youve given the words? 06:36:42 what that leant towards is understanding and maintennance 06:37:05 theyd all be in the one function without descriptions 06:37:33 my aim is to make sure my source tells the reader all the information they need 06:37:40 not if I made a function for each owrd or more likely made a constant for each word with the exact same name 06:37:47 this is where programmers and techs differ 06:38:02 sure, you could do that 06:38:08 but NO ONE DOES 06:38:13 this is the problem. the source doesnt tell you that and Forth tells you even less than C 06:38:28 ? 06:38:41 Forth tells you *everything* 06:39:12 how san you claim Forth tells you less when it clearly has more information ? 06:39:23 ok I see that but you writing great Forth code that is better than poor C code doesnt mean Forth is more readable. the real thing to discuss is great Forth vs great C or poor Forth vs poor C 06:39:30 does that C code have a tech summary for every bitfield ? 06:39:47 thats true 06:40:13 I'm a tech a forth beginner, I write poor Forth, we can all be honest 06:40:26 of course if I rename it to what you renamed it. this is ciriticizing the manufacturer. this is not relevant to C specifically. Forth would be just as bad if you let the write it 06:40:26 you guys would write great Forth 06:40:47 here is what I mean: foo bar baz 06:41:14 now tell me please what is being passed to which word and which ones are words and which ones are variables 06:41:25 well, Forth gets 2/3 of that right, foobar 06:41:45 thats just a programming question ? 06:41:59 no, it's an inherent flaw of the language 06:42:10 to answer your question, I have no idea 06:42:21 I know instantly when I glance at C code. I never know in Forth unless I hunt down the delcaration for all 3 06:42:32 right. you have no idea. you always have an exact idea in C 06:42:33 ok, I agree with that 06:42:49 well no, you dont, didnt I show that above ? 06:43:06 when it comes to *embedded* C is a utter mess 06:43:45 no you didnt. you may not know what those long descriptions in C mean but you know which one is the function and which are arguments. you also know exactly how many arguments and you know that every single time you call the function. that's only available in the delcaration in Forth 06:43:52 for pire simple programming C is fine, I used it for a long time in a completely amateur way 06:44:20 maybe it is a mess but that is not a criticism of C. at least when it comes to the stack and argument passing, C is more clear than Forth 06:45:12 youre a excellent debater, nd I'm a good steamroller, but we have a chasm we cant cross here 06:45:48 the one point im advocating here is the argument passing. would you at least concede that? the other shortcomings of C are a different matter 06:46:06 to me Forth is highly accurate, all the information I need to review and maintain my code is in the source 06:46:16 it is in the source but it 06:46:44 it's not repeated every time it's invoked which means you have to have all the stack pictures of all the words in your head at once or constantly refer back to the declaration 06:46:48 well I'd hate to step outside my competency, that would only be a insult to you 06:47:20 Im a tech, NOT a programmer, tho I hack my way thru things 06:48:02 to answer your question, no I dont have to have all the stack pictures in mh head 06:48:21 and I do constantly refer to my code 06:48:44 Im not a 'scary brain hacker' like some I've seen who COULD hold it all in their head 06:49:12 I use a simple GVIM editor, no pop up suggestions like in ECLIPSE 06:49:22 they would drive me nuts 06:49:53 when I develop Forth I do a small bit at a time, each Word becomes higher level, I dont care whats below them 06:50:05 no one can hold 3,300 timer words in their head 06:50:11 once they are tested and work, that bit is finished 06:50:28 well I sure cant 06:50:40 thats what people say but thats not how programming actually works. people have to go back and adjust things all the time 06:50:40 and I dont need to either 06:50:47 sure 06:51:04 especialy while developing with hardware 06:51:24 adjustment is everything in embeded 06:51:44 and the adjustments are done via those bitfields 06:52:00 now rdrop-exit does not like my method 06:52:51 but hes yet to actuall add any hardware to his embeded Forth builder and I think he is in for some surprises 06:52:59 thats true. I meant more adjustments to the code once the hardware is finished 06:53:29 what platform is it for? 06:53:32 well in a MCU like a STM32, most of the hardware is finished, and it's all in the tech manual 06:53:50 it's a tethered Forth designed to work with any hardware 06:54:10 which uses JTAG 06:54:28 i dont know much more than that 06:55:34 for instance my 'touch sensor' project required only one external capacitor and a piece of pcb as the touch sensor 06:55:50 everything else was source just like above 06:56:38 here is the project the main code is at the bottom 06:56:40 https://mecrisp-stellaris-folkdoc.sourceforge.io/touch-sensor.html?highlight=touch 06:57:09 the \config block is a perfect example of my current technique 06:58:10 it even has the STM example C code, which is incomplete 06:58:14 https://mecrisp-stellaris-folkdoc.sourceforge.io/touch-sensor.html?highlight=touch#stmicro-c-tsc-code-example 07:00:31 while far from ideal, every piece of my code can be used to search the STM tech manual and confirm each step 07:00:58 that was my main aim, code verification with hardware 07:03:09 I guess if youre just using Forth for initializing hardware and not writing any substantive code then you don't have a very deep stack or many arguments so there might not be much ambiguity there 07:04:38 thats probably true 07:05:17 when you say "just using Forth for initializing hardware" just doing that is substantive 07:06:23 if you dont build mcu gear you may think it's trivial, sometimes yes, but many peripherals are very complex 07:11:12 right that is substantive 07:12:14 there's just not a lot of program structure or loops or words calling words calling words calling words like you have once you have the hardware running and develop the firmware 07:12:15 it will be a minor project when I add LCD and touch button so it logs my exercise lap times and circuit numbers 07:12:52 oh nice. I thought about building one of those but never did. which mcu? 07:12:55 no, and that code isnt complete, it's just demoing the touch code itself 07:13:22 stm32f051, I have 478 left :) 07:15:18 a nokis 5110 display $1 07:15:29 a 9v battery 07:15:32 maybe you can make a spare then too :) 07:15:35 the toch buttons 07:15:53 Ill put it up with all details as a project 07:18:14 I bought one of those 5110 displays a while ago but havent hooked it up yet 07:18:53 theyre so easy to drive 07:19:03 the nokia 1202 ones are cool too and slightly better resolution 07:19:10 did you see my 5110 YouTube rant ? 07:19:13 lol 07:19:21 hehe no 07:19:35 I heard a bunch of them you get have loose metal casings and dont display right 07:19:53 https://www.youtube.com/watch?v=Y7BjuqQnCH8 07:20:30 wait why does your voice sound so strange? 07:20:34 jk 07:21:08 it's ozstralian! 07:21:11 hehe 07:21:51 kiwistan 07:22:03 what! 07:22:10 youre a kiwi ? 07:22:19 no american 07:22:26 ahh 07:22:39 new zealand is a ocean away from me 07:22:44 I heard someone say Canuckistan for Canada once 07:22:45 different country 07:22:49 hahah 07:22:54 right 07:23:20 I used to know a kiwi guy and we would always ask him if its hot in australia and what its like there just to wind him up 07:23:43 hahah 07:23:50 theyre great people 07:23:57 I had a kifi gf once 07:24:02 kiwi 07:24:23 nice 07:25:02 it was one of my first, I used a nokia phone for audio 07:25:10 pretty horrible sound 07:25:30 a kiwi dude told me some funny name they had for island women but I forget 07:25:35 something to do with the food they eat there 07:25:44 maybe hoe-conut or something like that 07:26:05 hahah 07:26:10 they didnt tell me 07:26:16 https://mecrisp-stellaris-folkdoc.sourceforge.io/nokia-5110.html?highlight=nokia 07:26:42 thats my initial 5110 project, sorry I dont have a C version for you ... 07:26:44 ;-) 07:26:53 heh I didnt know they were all recycles 07:27:24 yeah 07:27:43 that phone finished in 2000 07:27:54 the name 5110 is the name of a phoone 07:28:27 ya I think the LCD in the nokia 1202 is a hx1230 or something like that 07:28:33 the clever little kung-fu folks strip out the display and solder it to the board you get 07:29:00 all my displays are scratched 07:29:36 it's not a big problem, but a brand new cool blue oled Oled display is only $5 now 07:29:59 those things are really cool 07:30:06 so the 5110 is ok, but should be cheaper, maybe $0.50 07:30:12 they sire are 07:30:14 thats another thing I bought from china for very little money and is still on my desk :P 07:30:24 ya 07:30:32 I use a bit banged SPI in that demo 07:30:35 so easy 07:30:53 the advantage to me is just that you can run the LCD and an mcu on a coin cell 07:31:15 whereas the oled takes a lot more current but technically still should run I think 07:31:29 oh neat. is that before you got the peripheral stuff going? 07:32:00 i havent used the STM32 peripheral 07:32:08 bit banging is far easier 07:32:55 here is my flowchart for the LMT01 temperature sensor. Have to use flow charts because I dont use C ;-) 07:32:59 https://mecrisp-stellaris-folkdoc.sourceforge.io/project.3temp.sensors.html?highlight=flowchart#software-flowchart 07:33:07 how trivial does that look ? 07:33:45 0_0 07:33:54 heheh 07:35:57 I do everything from scratch referring to the datasheet and my scope/logic analyser. it's just much faster than trying to use C projects which ALWAYS lack the complete info 07:37:25 MrMobius, in fact if you get a STM32F0 Discovery board the code to run that 5110 is there for download at the bottom of the page 07:37:35 those boards are about $10 07:37:45 oh nice 07:38:12 I got one of those little ones for free in a giveaway and one of the ones with 8mb dram and lcd with an stm32f427 in 2014 or so 07:38:19 oops thats the temp sensor! 07:38:28 lets see if the lcd code is there 07:38:40 I think the big one has a temp sensor though 07:39:12 yesh the lcd code is there 07:39:39 no schematic as it's just serveral pins connecting lcd to Disco board 07:39:59 but I sense youd probably ratehr discover it all for yourself 07:40:10 Forth people are like that 07:40:24 if you offer to help, you may get shot 07:40:41 I do agree with that part. sometimes other people's code works but if anything goes wrong it's hard to know if it's the hardware or bad code 07:40:46 I like that "ill do it my way pal' attitude anyway 07:41:05 sure, it's no substitute for your own project 07:41:22 who wants to copy ? 07:41:24 so for LCDs and stuff they are usually "simple" enough to get going if you can find the datasheet and or startup commands 07:41:43 um, not really 07:42:04 hmm, ive gotten 4-5 to work that way 07:42:26 I often look around for C examples but theyre usually all the same copies and incomplete 07:42:37 as long as you have the commands and what order they go in and the timing between them 07:42:53 oh sure, me too, but IM getting lazy in my old age 07:43:24 hehe 07:43:36 MrMobius, some of this stuff is so complicated that you only understand the datasheet AFTER you have the device running 07:44:23 ya you just get lucky if they give you some pseudo code which datasheets occasionally do 07:44:42 not me usually 07:45:08 my implimentation of the LMT01 is totally different to any projects youll find on the net 07:45:29 the Ti reference sucked 07:45:55 that was one project I had to do 100% on my own 07:46:23 the lmt01 was new to me, Id never run up a LCD before 07:46:26 oops 07:46:34 the 5110 was new to me, Id never run up a LCD before 07:47:04 but I learnt a lot from a online c project aknowledged in the project 07:47:54 my 5110 has a lot more code. that part just displayed the LCD self test 07:48:17 thats pretty far though. the worst is when you send commands and nothing at all happens :P 07:48:32 I later set up character display using a font array 07:48:47 yeah, the selt test comes first 07:49:07 ok gotta get going 07:49:10 nice talking to you 07:49:16 it's agreat display, and very low power as you say 07:49:28 okies, same here, thanks for the chat 07:49:46 you too. cya 07:49:56 I may argue, but every word you typed will be examined in my mind for a few days at least 07:52:13 tp: i improved my forth uploading scripts a little more 07:52:32 now they check a marker word for each file before uploading all the missing files in loop 07:52:59 this avoids the problem of multiple make targets fighting for a lock file uploading code in an undefined order 07:53:09 eww 07:53:49 what defines the upload order ? 07:54:00 the order of the command line arguments 07:54:40 send [ ]* 07:55:09 you dont have them inside all files ? 07:55:28 "them"? 07:55:58 dependency uploading ? 07:56:10 nested dependency uploading ? 07:56:23 not yet but it's possible 07:56:56 what HAVE you been doing with your time ??????? 07:57:03 07:57:04 other things 07:57:34 the easterhegg 2020 had to be converted to an online event 07:57:46 it's awesome to see the forth diversity here of late 07:57:56 ahh, work! 07:58:02 i cooked beef and pineapple enchiladas 07:58:06 stuff like that 07:58:08 in that everyone hs a different solution 07:58:13 yum! 07:58:29 tp: https://www.budgetbytes.com/beef-pineapple-enchiladas/ 07:58:29 youre doing a serial uploader 07:58:57 i really want to handle compile errors before including even more code even faster 07:59:00 I do a serial concatenator 08:00:01 sure i could run the poor forth through the c preprocessor 08:00:10 nive 08:00:14 nice! 08:00:37 ? 08:00:43 seems hard 08:00:57 why not just strip comments and concatenate ? 08:02:45 usage rcas.sh 08:02:56 sed 's/\\.*$//g' < $1 | sed '/^\s*$/d' | sed 's/([^)]*)//g' > $1.rcas.fs 08:03:10 cat all the files and feet them into that 08:03:23 thats what my make button does 08:04:15 that way I get 2 files, one with all the comments for distribution and one with no comments for uploading 08:04:37 all files are then in the one file and the right order 08:05:08 I'm still working on your release btw 08:05:52 lates improvement is not generating pretty print register files for "write-only" registers 08:06:20 which will read $0 until the heat death of the universe 08:07:39 --- quit: Zarutian_HTC (Ping timeout: 250 seconds) 08:17:51 why not use cpp -P to combine all source files? 08:18:12 gcc and clang support #import "file.txt" 08:19:18 MrMobius: in my system, I could write something like that as `( baz ) bar !foo` which isn't much different than `foo=bar(baz);` in C 08:20:33 (not that I see any need to make forth more c like, learning the words for your system and application takes a bit of time, but it's not that bad) 08:21:18 btw this is the output from stm32flash: https://pastebin.com/raw/xwYs5BxC 08:22:03 so the chip admits to having a 128kiB flash 08:22:48 it does 08:22:58 but the rest is easily fooled 08:23:21 it's probably some chinese fake 08:23:25 it's just reading the chip registers 08:23:29 but it works (for now) 08:23:39 you can find out if you load my latest diagnostic 08:23:52 what is the correct baudrate to talk to your diagnostic? 08:24:18 um 08:24:20 er 08:24:30 460800 I think 08:24:46 but it doesnt matter 08:24:56 it tlks thru the usb port 08:24:59 talks 08:25:20 it's USB virtual comms 08:26:11 just hit the the menu keys, enter not needed 08:32:53 night all! 08:33:02 the external markings claim to be a STM32F103C8 08:33:13 yet it reports 128kiB flash 08:33:14 yeah they all do 08:33:27 and it did pass your flash test 08:33:51 yet it reported 128kb before my test ? 08:33:57 or after 08:33:59 before 08:34:24 i have to define "free" without the factor two 08:34:40 Night tp 08:34:58 tp: get some sleep :-P 08:34:59 then it's a stm32F103CB rebadged to a STM32F103C8 ? 08:35:09 Came on to see tp go to sleep :( 08:35:26 the STM32F103C8 has 128kB but says 64kB 08:35:32 hahah 08:35:54 you Forthers are too interesting for me to get any sleep 08:35:57 Do you get like 4 hours of sleep a night? 08:36:20 yeah, but I also sleep 4 hrs during the day atm 08:36:21 I don't mean to IRC sleep patrol you but I've noticed it's not a lot of contiguous sleep 08:36:24 Right 08:36:41 it because of the ausie summer 08:36:46 Right 08:37:05 in winter i try and revert to 8+ hrs a night 08:37:23 contiguous sleep is really important I knpw 08:37:29 Is it? 08:37:38 crest, so it's a odd one 08:37:42 it is for me 08:38:01 so much needs the whole sleep. muscles etc 08:38:02 or i missidentified the markings in these less than optimal light conditions 08:38:07 because they are scratched 08:38:22 it's possible 08:38:37 STM32F103C8 and STM32F103CB look so similar 08:38:46 I have a 9-5 so I do actually sleep once a day 08:39:04 yeah, and I'm retired 08:39:07 If I worked for myself god knows, I'd probably just constantly be out of phase 08:39:16 so i get to do what suits me 08:39:26 --- join: Zarutian_HTC joined #forth 08:39:31 I slept regulary before I retired 08:39:31 Sounds good, shame I'll never be allowed to retire :D 08:39:47 yeh, we need slaves now more than ever 08:40:00 To pay your pensions yes yes I know 08:40:04 back to the pit for me 08:40:12 well not ours as I'm in Australia 08:40:48 okm I'm really gone now 09:40:16 --- quit: X-Scale (Ping timeout: 240 seconds) 09:41:44 --- join: X-Scale` joined #forth 09:42:31 --- nick: X-Scale` -> X-Scale 10:07:19 --- join: rdrop-exit joined #forth 10:09:53 --- quit: reepca (Remote host closed the connection) 10:10:03 --- join: reepca joined #forth 10:30:00 --- quit: reepca (Read error: Connection reset by peer) 10:45:30 --- quit: jsoft (Ping timeout: 256 seconds) 11:05:18 Ok, this is off topic, but too good not to share. Allegedly its an original 1964 ad from when WD 40 was first introduced: 11:05:19 https://imgur.com/a/q9MiyUT 11:27:14 back 11:27:16 hey guys 11:27:56 KipIngram: I don't know what to believe anymore 11:29:45 somehow I reported myself on hackday 11:29:48 veltas - I'm guessing that's probably fake, but... still fun. 11:29:57 It is fun :-) 11:31:02 We've got a new "community page" on Facebook - apparently squabbling kept breaking out on our "Residents of CCR" page, so someone went and created "Thickskinned Residents of CCR." It's been a steady stream of funny. 11:35:05 That is such a good idea 11:35:08 These community pages are literally all boring posts and then the occasional interesting topic comes up and then the death threats and swattings start and everyone gets banned 11:35:29 So it's nice you have one with a bit of restraint 11:46:36 I'm just happy to see that there actually are quite a few neighbors around with a real sense of humor. So many of them you run into a lot are stiff and uptight beyond belief. 11:46:47 Nice 11:54:29 --- quit: rdrop-exit (Quit: Lost terminal) 12:01:16 back 12:10:52 tabemann: you reported yourself? 12:19:35 somehow 12:19:40 I don't remember doing it 12:19:53 but my mouse has been kinda funky lately (just ordered a new one today) 12:20:20 and I would have thought that reporting someone would require hitting okay on a modal, but maybe not 14:15:57 --- quit: gravicappa (Ping timeout: 265 seconds) 14:25:12 --- join: dave0 joined #forth 15:22:04 --- quit: X-Scale (Quit: HydraIRC -> http://www.hydrairc.com <- Organize your IRC) 15:47:00 --- join: X-Scale joined #forth 16:57:55 tabemann, hahahahahah and I'll bet you're ONLY person ever to do that!!! 16:58:51 KipIngram, that WD40 advert is probably real, 1964 was a totally different era. Women would laugh at that. 16:59:15 I was 10 years old in 1964 17:08:56 tp: the thing is they should have designed it so that it at least shows a modal to the user that the user has to confirm 17:09:32 yeah, hackaday is crap 17:10:23 it's clever adverts disguised as arduino porn 17:12:06 'new 600 MHz 'GIMPIE' Arduino compatible released by 3flying.geese.com!' 17:13:17 regardless, I'm using it to advertise zeptoforth, since no one's even gonna see it if it's just on github 17:14:15 of course 17:15:27 https://www.usc.edu.au/explore/usc-news/news-archive/2019/november/from-new-coders-to-internet-inventors-in-13-weeks - lololololol 17:15:54 other places to advertise are reddit and comp.lang.forth on usenet 17:16:42 I'll also add you in my list of 'other forths' 17:17:57 “They used two coding languages – Python and Arduino Scratch" 17:18:08 wow, maybe we should try them ? 17:18:43 MrMobius, I have an answer to your question "foo bar blah" 17:19:51 I'm sure that Python and Arduino Scratch are the new super dooper Forth replacements! 17:21:55 If you only knew how bad it really is 17:22:11 heheh, I try everything 17:22:13 back 17:22:35 I have python, lua, elisp tests on my doc page 17:22:45 the key sign is that they're using Raspberry Pi 17:22:51 of course 17:23:01 you know something isn't a real MCU project if it's using a Raspberry Pi 17:23:18 it's like Arduino for people who can't even use an actual MCU 17:23:21 that walking stick for the blind includes a trolley for the battery that it needs 17:23:40 lol 17:23:53 Im very familiar with the rpi as I have about 4 of them 17:24:14 I own one Raspberry Pi which I haven't even opened the packaging for 17:24:51 I shudder to think about the internet of things walking stick 17:25:07 the one I use now and again had a LED and a push button. when I want to turn it off, I press the button and the sustem is shut down properly, the LED turns off just before the shutdown so I know it's safe to pull the power 17:25:32 I use C to turn the LED on and off 17:25:42 and scan the push button 17:25:58 veltas: yeah, like why on earth would a walking stick need to be an IoT device??? 17:26:09 I personally think that IoT is a disaster 17:26:25 so many machines waiting to be compromised, which'll never, ever receive security updates 17:26:31 they make a great Linux host for thinks like a ethernet connected terminal etc 17:26:46 which'll ultimately become botnet node zombies 17:27:09 These IoT devices make great Linux hosts for the people that hack your toaster 17:27:35 BRB sshing into neighbour's lightbulb 17:27:38 :-) 17:27:39 I can think of a great reasons for a walking stick to need wireless, just not wifi 17:27:41 lol 17:27:53 lol 17:28:22 https://www.youtube.com/watch?v=1BB6wj6RyKo 17:28:27 Don't watch this video 17:28:42 ok 17:28:51 Especially you tp 17:29:10 I'm into wireless such as zigbee and lora, but not wifi for embedded 17:29:43 veltas, I wont, Im never tempted to do things because someone says dont 17:30:13 tp somehow I actually know that is the case with you, you contrarian 17:30:23 hehe it is 17:30:27 Have a look at the title though at least you tease 17:30:37 ok 17:31:43 * tabemann watched that video and is horrified 17:31:59 anything wifi is easily disassociated with another wifi AP anyway 17:32:01 just how can a reasonable human being actually reset one of those bumbs 17:32:22 and just why would one want a lightbulb that uses wifi? 17:32:36 So you can control lightbulbs remotely 17:32:37 I've dissociated wifi clients from miles away many times 17:32:52 without screwing them in and out of socket 17:33:07 Luckily my house came with these weird plastic things I can use to cut the electricity 17:33:17 on walls and in convenient places 17:33:24 veltas: wouldn't it make more sense to go and put some kind of base on the lightbulb rather than putting the firmware in the lightbulb itself? 17:33:34 once the client is disassociated from it's AP, it begins the key auth process which you log 17:33:43 and so on 17:34:29 veltas, ahh you mean a "switch" ??? ;-) 17:34:50 Yes, if you want to use that old outdated term 17:34:53 tabemann, and so you can, thats what I have 17:35:03 tabemann, mine is X10 17:35:42 I have a X10 controller plugged into the mains and it controls various devices by signalling over the mains wires themselves 17:35:54 yep 17:36:03 no wireless needed 17:36:13 and much more secure too 17:36:17 exctly 17:36:19 tabemann: The other thing about this is I think I know why they didn't just put a reset button on the bulb and it will upset you 17:36:43 veltas, extra hardware and point of failure 17:36:47 Nope 17:37:10 does the bulb get hot ? 17:37:10 Health and safety, it's a button on a bulb that goes in a lethal electrical socket 17:37:25 The bulb is probably an LED bulb that gets warm 17:37:28 but toasters have buttons 17:37:41 tp you know it doesn't need to make actual sense 17:37:43 my led bulbs get really hot 17:37:49 all kinds of things attached to wall current have buttons 17:37:56 for it to be the reason they did this 17:38:38 It could be hottitude but I think it is a bizarre concern about someone suing them because their husband died resetting firmware with wet hands 17:38:50 safety is always a factor, things like not being able to reach the button, burn fingers, heat damaging the button and extra cost of manufacturing would be higher up the food chain I expect 17:39:04 veltas, yeah, very little makes sense to me these days 17:39:53 the logic of Forth makes perfect sense to me however 17:41:51 I think health and safety went downhill some point between airbags and this 3 minute video 17:59:18 back 18:02:57 tabemann, how goes zeptoforth ? 18:03:37 improved POSTPONE to do inlining 18:03:49 and added accessor words for accessing word header fields 18:04:10 nice touches! 18:04:20 tabemann: i wanted "smart" light bulbs to control brightness and color temperature 18:04:34 earlier I added 1+, 1-, 2+, 2-, 4+, 4-, 2*, 2/, 4*, and 4/ 18:04:56 because as dedicated words I realized that I could make them far less expensive, especially with inlining 18:04:59 most of the time i control them through other microcontrollers via zigbee 18:05:16 crest and hook them up to a ECG hat so when your gf is arguing with you the lights all go red ? 18:05:34 because those all literally are one 16-bit instruction 18:05:46 she would probably laught about that (afterward) 18:06:11 but i have just one rgb bulb 18:06:31 i did use the python bindings to turn it into visual bell 18:06:45 so it was worth it to make dedicated words for all of those 18:06:46 hahah 18:07:14 tabemann, but youre just filling your dictionary with simple stuff with the last lot ? 18:07:39 tp: the key thing is that 1 + is far, far more expensive, in both space and processing time, than 1+ 18:07:41 anyone who needs a 2+ should be using python instead ;-) 18:08:37 and I'm not going to implement a peephole optimizer as that'll way complicate the compilation process, especially with regard to flash 18:08:56 see 1+ 18:08:57 00002016: 3601 adds r6 #1 18:08:57 00002018: 4770 bx lr 18:08:57 Bytes: 4 ok. 18:08:57 : oneplus 1 + ; ok. 18:08:58 see oneplus 18:09:00 20000426: 3601 adds r6 #1 18:09:01 20000428: 4770 bx lr 18:09:03 Bytes: 4 ok. 18:09:25 tabemann: do you generate position independend code? 18:09:30 --- join: rdrop-exit joined #forth 18:09:41 far more expensive ? maybe on zeptoforth ;-) 18:10:08 crest: individual words are internally position independent, as are short-distance calls between words 18:10:30 because if you do you could just generate the code in ram and move the code in ; 18:10:30 long-distance calls between words, e.g. between flash and RAM, are not position independent 18:10:47 crest, yes and tabemanns code also disinfects all traces of Coronavirus from the bits 18:10:49 Good morning Forthwrights c[] :) 18:10:56 hey rdrop-exit 18:11:05 rdrop-exit, Zen Forth Guru ! 18:11:06 hi tabemann 18:11:11 hi tp 18:12:18 (-_-)zzz c[] 18:14:02 tp: i played with the code for your "free" word because it looked more complex than it should be and came up with this: https://pastebin.com/raw/yLh5XUMG 18:14:15 how badly did i mess it up? 18:15:36 hahah, you know you didnt mess it up at all, it's excellent 18:16:23 I'm delighted to see you fixed up my crappy code! 18:16:49 I wish more of my crappy code was fixed 18:17:41 is the structure of mecrisp dictionary headers documented somewhere? 18:17:57 i would like to write word list all words containing a substring 18:18:23 now the big question, does your code work ? 18:18:45 yes 18:18:49 crest, yeah, it's in my doc page 18:18:59 in the dictionary page 18:20:07 under "Word Header Fields"? 18:20:16 crest, yes 18:20:26 because that lacks explicit sizes, offsets and alignments 18:20:38 are all fields 32 bit aligned a 32 bit long? 18:20:50 I had to ask the author for the answers to my questions about the headers 18:21:03 he would say "its all in the source" 18:21:05 --- join: jsoft joined #forth 18:21:26 crest, your code appears to be for the F103 only ? 18:22:00 crest, another issue is that if you load that word it wont work after a reset 18:22:33 tp: correct 18:23:02 just the flash-size constant has to change 18:23:11 my shitty code is designed to work on any mcu and work after a reset 18:23:22 hence it's parameter driven 18:23:37 it wasn't 18:23:49 oj, it is thesedays 18:23:57 it just contained a bunch of cases in comments 18:24:19 and i picked the one that matched my chip 18:24:48 http://dpaste.com/16VM9VX.txt 18:24:50 : free ( -- ) 8 1 $1FFFF7CC memstats ; 18:25:24 yeah, theyre a example of how to use it 18:25:41 the above is how I use it for a stm32f051 18:26:04 but all that changes is how the flash size is calculated 18:26:27 *all* ? 18:26:42 it's parameter driven, no need to hack the source 18:26:42 i read it a few times and i'm pretty sure 18:27:04 but there is no reason to carry that parameter along on the stack 18:27:16 it's not like the flash size changes at runtime 18:27:23 thats true 18:27:39 but the stack doesnt care 18:27:49 thats a programmer itch 18:27:50 the human reader did 18:28:31 in reality not hacking the source is much better, all my utilities are now parameter driven 18:29:03 I came from a hardwired free calculatio 18:29:06 +n 18:29:48 wether the stack is full of zeroes or $1FFFF7C, it doesnt care 18:30:10 GIGO :) 18:30:41 this in no way detracts from your beautifuly neat source however 18:33:16 crcm re comment from earlier, what do the parenthesis do on ( baz ) in the example? 18:34:24 MrMobius: nothing, other than provide a visual clue 18:35:17 thats neat 18:35:41 MrMobius, I have an answer for your "foo bar baz" question. I couldnt even grok it last night 18:36:01 "last night?" 18:36:07 oh forgot, youre upside down :P 18:36:10 MrMobius, but my subconsious was working on it while I was asleep 18:36:22 back 18:36:29 * tabemann is reading the I Hate Forth article 18:36:44 yeah, the weight of my brain makes this part of the world hang at the bottom ;-) 18:36:57 crc, what do you think about repurposing , also as an optional marker? 18:37:03 hehe 18:37:13 MrMobius, here is my answer " fill wash drain " 18:37:49 so because they are verbs we can assume they are all words? 18:37:55 I wasnt able to answer 'foo bar blah" because it's totally abstract and I dont think that way 18:38:18 they do what they say for a english speaker 18:38:34 youre over complicating your analysis 18:38:47 this is why I use Forth 18:39:08 what are we filling and how many? is that on the stack before "fill wash drain"? how many of those things are consumed by fill and how many are left behind? 18:39:14 MrMobius, that could be done; a nice thing with forth is that everything is easy to change 18:39:46 about I came from a hardwired free calculatio what you do is make your forth have a word that returns the flash size for the device it was compiled for 18:39:54 MrMobius, it's the same as the labels on your washing machine 18:40:34 MrMobius, to examine what happens with 'fill' one simply looks in the fill Word 18:40:47 tp, I dont think Im over complicating. I think that example is over simplified compared to the real world. it wont always be the case that you have 3 words with no input or output 18:41:11 thats true, they are low level words 18:41:22 right at the top will be "start" 18:41:41 I had to begin with low level words for a C user ;-) 18:41:43 what is the question? I haven't had enough coffee to understand what you guys are on about 18:42:21 rdrop-exit, I dont recall the question but I know the answer is 42 18:42:31 ah ok :) 18:43:07 06:15:51 Forth: foo bar baz 18:43:07 06:16:02 C: foo=bar(baz); 18:43:07 06:16:09 or the 10+ other things that could be going on 18:43:07 06:16:16 bar=foo(baz); 18:43:07 rdrop-exit, basically how to make Forth more readable. you dont know a word consumes or leaves behind on the stack the same way you do in C. just wondering what you could do to improve that, so not awrguing C is superior in all ways 18:43:08 06:16:25 bar(); foo(); baz(); 18:43:15 lest I be flamed 18:43:16 MrMobius, I didnt understand your abstract only question, and you dont understand my real world application answer 18:43:25 (from earlier today in the logs) 18:43:32 --- join: boru` joined #forth 18:43:35 --- quit: boru (Disconnected by services) 18:43:38 --- nick: boru` -> boru 18:44:14 MrMobius, no one here will ever flame you (except the occasional fake Forth using troll) 18:44:34 tp, what do you mean I dont understand? what would you have inside of fill for example that expects something on the stack and leaves something behind? 18:44:55 MrMobius, simply put, whatever is needed 18:45:30 MrMobius, but I answered your initial question in a proper Forth manner, is this a second question ? 18:45:31 I know but Im asking for an example if you think I dont understand 18:46:00 MrMobius, obviously it's Words all the way down 18:46:33 my original question is about words that consume or add things on the stack so I dont think "fill wash drain" applies but of course I dont know which is kind of the point 18:46:45 right at the bottom ae the hardware configuration words, thats where it all ends, or begins depending on your pov 18:46:54 back 18:47:22 MrMobius, no, your original question was "foo bar baz" ? 18:48:09 no question expansion is acceptable ... :) 18:48:54 a C coder says "foo bar baz " to which a Forth user responds " fill wash drain" 18:49:05 right but I think you assuming that "foo bar baz" are three words the same way "fill wash drain" are three words is getting to the core of the problem. what if foo and bar are variables and baz consumes them? what if bar consumes foo but leaves something behind which baz expects? there are a lot of things that could be happening 18:49:15 you have to keep a mental picture of the stack state are as you read the code 18:50:09 MrMobius, your questions are awesome btw, you bring a refreshing view, clearly put 18:51:43 MrMobius, yes, there may be inputs and outputs associated with many words, Forth can take unlimited paramaters and supply unlimited outputs, we have a system that tells us all of this 18:51:53 the best ive figured out is to hunt down the stack picture for the word and copy it into the word calling that word. non ideal but better than nothing 18:52:02 in my system, I use consistent naming conventions for variables, constants, words, etc as well as token prefixes, so my code provides a degree of semantic information 18:52:05 MrMobius, none of this is a mystery to me 18:52:37 tp, what is the system? how do I tell what happens to the stack without looking up the stack picture for each word? 18:52:46 crc, ya I think that goes a long way 18:52:57 MrMobius, when I started learning forth for few years it was a mystery to me however 18:53:07 doesn't help with indicating values consumed/left, but that's where other tools (e.g., in the editor) can help 18:53:32 I don't see the problem 18:53:54 MrMobius, thats a odd question, how do I follow a C program without looking at the source code ? 18:54:04 crc, like a window that shows the declaration when your curcsor is on the word? 18:54:26 MrMobius, each word should have a stack picture, thats part of the Forth code 18:54:45 some Forths have VIEW 18:55:13 MrMobius, and it's only been about a week since I realised that most of my stack pictures are crap (thanks rdrop-exit!) 18:55:38 MrMobius: that's one way 18:55:48 tp, its instantly obvious what is put on the stack, what comes off, what is expected, and what is passed in C. whatever permutation you do: foo(); bar(); baz();, foo(bar(),baz());, foo(bar(baz()));, foo(bar); baz(); etc you know what's happening. no way to tell that from "foo bar baz" in forth without the stack picture in the declaration 18:56:30 * crc has numerous specialized editors for his code, exploring different ideas 18:56:53 MrMobius, I disagree, "wash spin drain" needs no further elaboration 18:57:01 rdrop-exit, so VIEW would provide the comments from the declaration too? 18:57:27 VIEW shows you the source 18:57:32 MrMobius, theer is NO "foo bar baz" in any Forth program. 18:57:41 tp, yes for that very simple example. not so for words that take things off the stack or leave things on, which is much more common 18:57:57 well, `foo bar baz` shouldn't have foo consuming values from bar and baz since those would be evaluated after foo 18:58:13 if one cannot understand "spin wash drain" they must be a russian only speaker/reader 18:58:21 it's the RUSSIANS! 18:58:32 crc, ya the ones where foo uses ' to call bar and baz are probably less common 18:59:28 crc, what have you done in your editors? 18:59:38 MrMobius: that's not doable in my system; you'd have to pass data on the stack; I don't provide a forward parser 19:00:28 using ' to call a word is bad practice 19:00:46 using ' to capture a word so it can be, say, postponed is another matter 19:00:52 MrMobius: I have a few that look up stack comments and descriptions from a database as code is entered/edited, and one in which my browable glossary is available in a pane 19:01:07 Mr. Mobius, you're mixing the what with the how 19:01:15 tabemann, true but maybe using it to capture a variable is more common 19:01:24 tabemann: no ' in mine at all 19:02:30 MrMobius, re the stack, it took me ages to understand that a forther MUST be able to read the stack to understand whats happening, the 'invisibility' of the stack was a problem for me for quite a while 19:02:32 I use "token" in zeptoforth frequently to grab a name off what is being compiled, so it can have something named by it, but I practically never use ' within a word to grab a name when it is executed 19:02:56 for instance, when I defined VARIABLE I used TOKEN 19:03:08 TOKEN itself only grabs a string, nothing more 19:03:12 The word wash does the washing, if you want details you look at the docs or source 19:03:30 with no ' you still have at least 6 different things that could be happening 19:04:07 the only case I use ' is for turning names into xts at the REPL 19:04:16 within a word I use ['] to do the same 19:04:27 rdrop-exit, exactly :) 19:04:46 rdrop-exit, right but wash is tp's example which im saying is oversimplified. if you looked inside wash you would probably end up finding a word that uses the stack to pass data to another word. when you find that, it's probably not obvious what it takes from the stack and leaves on until you look up the delcaration 19:04:50 ask a housepersibling what 'wash' means they will know :) 19:05:22 MrMobius, youre right of course, it's Words ALL THE WAY DOWN 19:06:04 MrMobius, but why would you assume that underneath those three primitive words, things suddenly become obtuse and unclear ? 19:06:08 how evil are words with input dependend stack effects? 19:06:12 That's the point MrMobius, the stack is implicit, that's what makes the code readable, I can change the interface between WASH and SPIN 19:06:33 tp, I think youre missing the point. its obvious "wash spin dry" is three words that leave nothing on the stack. can you give an example where info is passed between words? 19:06:36 crest, no more evil than C functions that expect parameters 19:07:10 MrMobius, why? this is a clasic case of Forths superior 'information hiding' :) 19:07:16 rdrop-exit, given tp's example, what is the interface between WASH and SPIN? 19:07:24 words that return 1 (false) or 3 (addr len true) results depending of if they found a match 19:07:51 MrMobius, you dont need to know, al you need to know is that wash washes, spin spins, and drain drains 19:07:53 that's the point, the interface can change 19:08:06 its tempting, but i'm afraid future me will stumble over it 19:08:09 but you still have WASH SPIN 19:08:13 yes, i was pretty astounded in Starting Forth when I read the phrase "information hiding" and the author meant that it was a good thing :P 19:08:52 MrMobius, it is at the higher levels, you dot need to know how the words interact at that level 19:08:52 crest: just document it and refer back in the future if you run into issues 19:09:05 notthing is hidden in Forth 19:09:37 --- quit: dave0 (Quit: dave's not here) 19:09:44 crest, you sure will, but Forth won't generally let you. If you omit a parameter you'll usually get a 'stack underflow' error 19:09:53 I suppose you could write WASH SPIN in some way then never change the interface in which case it doesnt matter what the pass and how but if I had to modify or improve WASH SPIN, how would I know what's on the stack? there's no real way other than looking up the stack picture. my point is if there was a way to provide that info like you always have in C, Forth would be much more readable 19:10:39 rdrop-exit, it's hidden if I have to hunt through a bunch of files to find it 19:10:43 I don't think Forth would be more readable that way, it would be more cluttered 19:10:48 MrMobius, please dont feel that rdrop-exit and I are ganging up on you, I cant speak for rdrop-exit but my only motivation is to find a way to explain this to you in a way that will make sense to YOU 19:11:04 tp, no its fine. this is interesting 19:11:25 MrMobius: how is this any different from any other language - if I'm programming in Java, and I have a function I'm calling, the only thing different about it is that IntelliJ will look up the signature for me 19:11:28 you only have to hunt through files if that's the way you coded your Forth 19:11:29 MrMobius, consider this "wash() spin() drain()" 19:11:41 MrMobius, consider this "wash(); spin()' drain();" 19:11:46 oopes 19:11:52 you know what I mean 19:11:55 rdrop-exit, as opposed to putting everything in a huge file? 19:12:11 and I bet someone could create a Forth IDE which would look up the signature for me too 19:12:24 has opposed to haviung yout editor do whatever you need it to 19:12:24 look how complex those three simple functions have become 19:12:25 but Forth users typically aren't the sort to bother with IDEs 19:12:52 I disagree tabemann, a Forth is by definition an IDE 19:13:07 tabemann, I use a IDE according to the definition 19:13:13 tabemann, its different because you dont need the signature in Java to know what is going onto and coming off the stack. foo(bar,baz) tells you right there whats going where. you could easily modify that, which you cant do without looking through files and trying to figure out what those 3 things are 19:13:14 hahah, SNAP 19:13:24 rdrop-exit, I think he means graphical IDEs. 19:13:40 KipIngram, mine is a GUI IDE 19:13:43 I mean like Eclipse, IntelliJ, Visual Studio, Visual Studio Code, and like 19:13:44 doesn't matter if it's graphical or not 19:14:22 you can setup your Forth so that pressing a key combination shows you whatever you want 19:14:59 Forth has always been a customizable IDE 19:15:20 It's not just a "language", it's an environment 19:15:49 You have however many tools you want at your disposal 19:15:54 exactly 19:16:01 as many tools as you want 19:16:03 I agree with you - I do consider Forth an IDE. 19:16:10 It's kind of "one stop shopping." 19:16:10 ya interactivity is nice 19:16:41 I have a question - when is the last time you used Eclipse or IntelliJ 19:16:42 of course unlike C users, Forth users BUILD their own IDE's and no two are alike in my experience 19:16:56 The mainstream languages and OS's have gotten things so that "writing code" is an entirely different "arena" from "navigating the OS." 19:16:59 that's one of the reasons you can keep your code less cluttered 19:17:04 me- never, perish the thought 19:17:06 In Forth they're seamlessly connected. 19:17:21 It's CLEARLY a superior paradigm. 19:17:23 exactly 19:17:30 I've seen Eclipse, slow, horrible 19:18:10 My forths are not command line driven, I process every keystroke 19:18:26 lol, I installed "Atollic Studio" on a Intel NUC for fun. it downloaded GB of stuff, and took about a hour 19:18:26 because when I think of the term "IDE", I think of an environment where the editor parses your source code for you, displays errors before you even compile, allows you to see signatures by just mouseovering function names, allows you to jump to function definitions by control-clicking on their names, and so on 19:18:37 ok here's an example: does the amount of time you SPIN depend on the amount of time you WASH in this code: WASH SPIN DRY? consider the same question which these two alternatives "wash(); spin(); dry();" vs "time=wash(); spin(time); dry();" 19:18:56 an environment that tries to do everything for you, and is big and bloated as a result 19:20:12 Tabemann, your thinking of particular implementations of the IDE concept, the concept has been around forever 19:20:15 MrMobius, excellent questions :) and easily answered. To find the answer you look in each lower level Word, everything will be there, and if not, you follow the Words until you find it 19:20:18 * you're 19:21:07 MrMobius customize your tools, rather than cluttering the source 19:21:18 tp, that's correct but that is a real pain whereas it only takes as long as I need to read the line of code in C 19:21:42 MrMobius, when you get to the bottom of my code, youl find all the low level stuff and thats it. Everything you need to know will be clearly explained tho you may (understandably) wonder WTF is going on if you cant follow the stack operations 19:22:03 MrMobius, that's not correct, I showed you why last night 19:22:06 any good Forth code will have stack signature comments 19:22:27 MrMobius, but you pay for that information being in the c code at the surface level by having much more cluttered C source 19:22:32 NO one can follow all C lines of code, thats utterly preposterous 19:22:42 tp, thats right. this is the core of the question. why should I have to look up words that call words that call words and hunt this down which takes time when you could instantly answer that question for yourself in C. im trying to think of a way to make that info also instantly available in Forth 19:23:20 take my example of last night "void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_TIxExternalCLKSource, uint16_t TIM_ICPolarity, uint16_t ICFilter); 19:23:37 tabemann, yes but only for the declaration. if you have 5 words on a line, you dont recopy the stack signature comment for all five onto the line and do that for every word 19:23:48 you dont understand that, I dont understand that 19:23:51 ah! my eyes =8-O 19:23:57 which timer is it ? 19:24:12 rdrop-exit, ya I could see having much more ambiguous code that is difficult to read if it reduces the clutter. I guess its the trade off 19:24:33 tp, I understand what is happening to that stack 19:24:41 Eclipse is awful. 19:24:44 it's totally FOOBAR, and there is the answer to your "foo bar baz" question ;0-) 19:25:01 but it's not more difficult to read, you're definition of readability is off 19:25:01 I have a more general definition of IDE. 19:25:06 tp, thanks for trying but thats not an answer :) 19:25:14 And IDE is any environment you can both develop and execute in. 19:25:28 rdrop-exit, so maybe more readable but less information available at a glance? 19:25:39 yes 19:25:40 MrMobius, you dont have a clue what is happening, you only think you do. Please prove wrong. answer this ... whicg timer is it ? 19:26:14 KipIngram, my definition of Forth is Total Interactive Control :) 19:26:25 I cant see which timer it is, can ANYONE HERE ? 19:26:27 tp, thats beside the point. im talking about what goes on an off the stack. that is easy to see every time someone calls that C function 19:26:45 MrMobius, it's *exactly* the point to me 19:27:05 tp, maybe that is a different question which is important to you which is fine but that is separate question to the one I asked 19:27:07 the timers are different, they have different configs 19:27:18 although no objections to changing the subject if thats what youre going for :) 19:27:34 I asked this question :) 19:27:52 the subject was "foo bar baz" 19:27:56 In a very high level word what goes on on the stack is an implementation detail 19:27:59 this is part of my answer 19:28:14 rdrop-exit, is right 19:28:37 the stack details are easily understood by a Forth programmer 19:29:04 tp, I dont know which timer it is and you wouldnt know either if the forth words were named the same as the C in your example. if you have a more clear way of naming things in Forth, thats not a Forth advantage. you could also rename those things in C 19:29:11 when programming in Forth I very rarely need to go back and look up the signatures 19:29:15 just as how your button is wired up behind the scenes in a radio is an implementation detail 19:29:18 in the same way (apparently) that MrMobius understand the C function above that made rdrop-exit eyes bleed 19:29:53 tp, tell me this, how many things go on the stack and how many come off in that C function? and yes it is ugly 0_0 19:29:55 and almost always I follow very well-defined conventions as to how arguments on the stack are organized 19:30:13 MrMobius, yes, no one knows, no one offered to explain that line of C from the STM factory std peripheral library 19:30:41 tp, void means nothing goes onto the stack and the four arguments mean four things go onto the stack 19:30:46 MrMobius, that C line isnt ugly, it contains NO USEFUL INFORMATION 19:30:47 MrMobius: how simple is C code where there are pointer arguments that are both inputs and outputs 19:30:56 at least it behaves that way even if the values are in reality held in registers 19:30:59 some pointer arguments are inputs, some are outputs, some are both 19:31:08 how easy is that? 19:31:20 rdrop-exit, I can get behind that definition as well. 19:31:40 MrMobius, I understand that C code, I know what it's doing. Thats why I know it's useless 19:31:53 It's just so completely different from anything else out there, you'd think it would get more attention than it does. 19:32:01 tabemann, I havent seen that often but that would be annoying. its separate issue though from what gets passed and returned, ie not arguing C is good just that its easier to tell whats coming and going 19:32:07 Never mind "better or worse" - just because it's *different*. 19:32:16 Of course, I think it's better. 19:32:57 MrMobius, do you think I could write Forth code if I didnt understand what parameters are expected and passed ? 19:33:18 rdrop-exit, its interesting that you prefer the readability. do you find yourself modifying words very often in practice and does that ever slow you down? 19:33:22 MrMobius, or anyone else here ? 19:33:45 Readability is a big deal. 19:33:54 readability is everything 19:34:03 Well-written Forth reads almost like English documentation of the application process. 19:34:11 And believe me - it takes some work to get that done WELL. 19:34:20 I modify words whenever a better way to do something occurs to me 19:34:22 ie "wash spin fill" 19:34:25 It's as easy to write trash Forth as it is to write trash anything else. 19:35:07 yes. Forth is a code multiplier, bad Forth is disgusting, good Forth is beautiful 19:35:09 In Thinking Forth, they talk about the application development process as the process of developing a lexicon related to your app. 19:35:16 Makes TOTAL sense to me. 19:35:17 I dont think trash Forth is the issue. even the best Forth doesnt tell you whats going on and off the stack without comments 19:35:33 Well, that's true. 19:35:38 agreed 19:35:53 Understanding the general flow of the problem solving is a different kind of understanding from full stack knowledge. 19:36:06 a lack of comments for ANY programming language makes it unreadable 19:36:06 Those are two different "hats." 19:36:27 Well, the very BEST Forth has the source code read almost like the comments. 19:36:34 To some degree, the source documents itself. 19:36:41 But like I said above, that is HARD. 19:36:47 And if you don't achieve it, you should comment. 19:36:53 rdrop-exit, I mean maybe this annoying situation I get in where im looking up words that call words that call words and have to get to the bottom to figure out the stack picture before I can change anything doesnt happen that much in what you do or its not that big of a deal 19:36:56 getting stuck in the detail of a stack, when examining a tested word is kinda useless if youre just following the program flow 19:37:17 The stack picture is best understood from the bottom up. 19:37:34 The top down analysis should be about the abstract problem solving. 19:37:46 tp, ya if youre just skimming to see whats going on but if you need to jump in and interrupt that flow to improve something you need those details 19:37:47 does mecrisp stellaris include tail call optimization? 19:37:54 KipIngram, " the source documents itself" is only true for the best forth, never for C 19:38:04 Top down, you don't care HOW it's being done - you care about WHAT'S being done. 19:38:19 I agree, crest. 19:38:28 It's impossible in C, and damn rare in Forth. 19:38:35 It's kind of an "idealization." 19:38:59 MrMobius, and all those details are there, even if hard to see for someone expert in C and not so much in Forth 19:39:15 KipIngram, absolutely agree 19:39:33 hehe, "hard to see" is a good way to put it :P 19:40:10 MrMobius, I sure spent YEARS understanding that the secret to understanding Forth code is the stack 19:40:35 --- join: iyzsong joined #forth 19:40:35 I wrote various 'helper' stuff to try and get there 19:41:08 I came from C (simple embedded C) and it was hard for me 19:41:30 I knew assembler, machine code, pascal etc 19:42:29 what happens on the stack can be a utter mystery, so time must be spent deconstructing it 19:42:35 IF you achieve a truly graceful and optimum Forth solution, then writing comments should feel like repeating yourself. 19:42:39 at least at my level 19:42:56 I really don't want to understate the difficulty of doing that. 19:43:11 KipIngram, true, but it's IMPOSSIBLE in embedded 19:43:32 Well, certainly documentation of the layout of registers and so on is required. 19:43:38 I think you're right. 19:43:43 KipIngram, consider this ": RCC_AHBENR_TSCEN ( -- x addr ) 24 bit RCC_AHBENR ; \ RCC_AHBENR_TSCEN, Touch sensing controller clock enable" 19:44:06 Well, I might quibble over word names. 19:44:13 But yes - I think we're on the same page here. 19:44:21 thats automatically generated from the ARM CMSIS-SVD after some XSLT processing 19:44:22 The hardware has to be documented too, and there's no source for it. 19:44:52 KipIngram, if you change the word name, then you cant search the factory technical PDF 19:45:06 You could imagine extending Forth so that the syntax of the language defined those reg layouts, but most Forth's don't go there and I think it would come at an efficiency cost. 19:45:16 that's my 1:1 correspondence of code to factort tech manual 19:45:36 it's the lowest level of all my code 19:46:30 and of course it soon gets upped to smarter words, but one can trace everything back to the peripleral_register_bitfield in the tech manual 19:47:15 MrMobius, read top down for a general understanding of the application, read bottom up for a detailed understanding of the implementation 19:47:24 and then copy and paste the word name into a tech manual to find the exact technical descrtion of that bitfield 19:48:02 rdrop-exit, well said, better than I could put it 19:50:02 rdrop-exit, tho mine is the reverse in the literal sense, in that the top of a file is read first and must contain the lowest level and ugliest words. The bottom of the file is read last and contains all the high level words, like "fill wash spin drain" 19:52:27 yes, code is written bottom up, although you can sometimes have stubs for some of the high level words you intend to build up to 19:53:54 rdrop-exit, describing forth code methods styles is hard, but it's utterly difffernt to C 19:54:02 as all forthers know 19:54:20 I often write the high level stubs first 19:54:44 and then write and TEST the low level stuff and test it 19:54:54 and they meet in the middle 19:55:25 Yeah - design top down, write (and test, damn it) bottom up. 19:55:36 a high level stub " : wash ." I'm washing " cr ; " 19:56:51 C code tends to be more cluttered than Forth code 19:57:09 Forth forces you to put your lowest-level code first 19:57:22 whereas in C you can bury it wherever 19:57:23 then 'wash' may include words like "full?", "speed?", "timeup?" 19:57:45 I do that even in C, that's more of a style issue, than something imposed by C 19:57:46 One might argue that's an advantage, but yes - it does, unless you're dealing with some strange multi-pass Forth. 19:57:51 and each will be tested seperately 19:58:02 My architecture is such that it's trivially easy for me to re-define words. 19:58:04 I could write 19:58:08 : FOO ; 19:58:25 "up there somewhere." Then write a bunch of stuff that uses FOO. 19:58:29 The later I could say 19:58:31 I don't think there's such a thing as a multi-pass Forth 19:58:37 : FOO ...implementation... ; 19:58:41 And it would work. 19:58:53 tabemann, there is a multi pass Forth 19:58:56 The cost would be one extra header. 19:59:14 that doesn't work for me because words always refer to what comes before them 19:59:17 tabemann, it's called 'a tethered Forth 19:59:20 All that's required is that you separate headers and bodies, then it becomes simple. 19:59:32 * tabemann hasn't even defined DEFER yet 19:59:39 tabemann, mecrisp-across is multi pass 20:00:25 : dispatcher ( -- ? ) dummy ; compiled 20:00:34 : ] ( -- ) [^] dispatcher invokes compiler ; 20:00:41 : [ { -- } [^] dispatcher invokes interpreter ; directive 20:00:59 [^] is similar to ['] 20:01:17 but it gets the compile-time xt 20:01:21 I have mine set up so DEFER isn't required. 20:01:37 me too, see above 20:01:40 The default action is to redefine an existing word. 20:02:00 Yeah - it's flowing by pretty fast tonight, and I'm juggling family activities. :-) 20:02:07 : xdummy () " Dummy Placeholder Word Invoked" alert ; compiled 20:02:16 : dummy () raise xdummy ; compiled 20:02:48 I think it's fun when we start comparing notes on how we've achieved "feature X." 20:03:05 The really beautiful thing about Forth is that it lets you do stuff like that, in myriad ways. 20:03:10 Just so damn flexible. 20:03:24 me too, I enjoy such comparisons, good food for thought 20:03:51 Absolutely. 20:04:54 need more c[] coffee, brb 20:06:02 tp, re: the factory PDF, only the definition that is extant when the system comes up and is waiting for you input is important. 20:06:10 * tabemann is trying to figure out how to even implement DEFER/DEFER!/IS in zeptoforth 20:06:14 If someone used that name for something else during system implementation, the so be it. 20:06:25 because it has to be able to do so in flash 20:06:38 But in my system redefining a system word would break the system - all the internal uses of that word would then target the new defiintion. 20:06:48 Unless I'm in a different vocabulary, which I am. 20:06:57 On start-up, the user gets a clean vocab. 20:07:09 And is therefore unable to change those internal usages of words. 20:07:23 But they still can redefine the word for their own purposes if the want to. 20:08:34 Definitions only get revised if the existing definition is in CURRENT, where the new definition is going. 20:11:23 c[] back 20:11:42 Going back to the earlier discussion of comments vs. self-documenting code, I do think that stack effect doc is always important. For exactly the reason we discussed earlier - the code might express the problem solving algorithm well, but that's just different from the nitty-gritty definition of each and every word. 20:12:07 So I don't really think "no comments" is feasible - I think a case could be made that a "great" Forth program could only have stack effect comments. 20:12:40 I agree, every definition should have a stack comment 20:13:13 And that comment can be used for interesting purposes. I've got plans for a compile time local variable system that would use those comments. 20:13:32 You may remember that I have words to fetch and store the top several entries of the stack frame. 20:13:42 1@, 2!, etc. 20:14:10 A compile time only locals system could let you refer to those data by name; the compiler would substitute the appropriate frame access word. 20:14:47 Generally speaking, I'm fairly tolerant of compile time effort, but pretty much absolutely intolerant of run-time overhead. 20:18:05 I don't do locals 20:18:49 I'm only open to them if the cost is strictly compile time only. 20:19:01 I haven't actually implemented that yet - just thought about it. 20:19:31 KipIngram> tp, re: the factory PDF, only the definition that is extant when the system comes up and is waiting for you input is important. ???? 20:19:35 And yes, I do understand that it's a mechanism that could be abused. 20:19:50 If you get too carried away with it, it can be a route to sloppy code. 20:19:51 KipIngram, I dont understand your comment 20:20:16 The stack on my PC host is not in addressable RAM 20:20:23 tp: My system has headers separate from bodies. 20:20:41 And, my system is indirect threaded. 20:21:04 If I redefine a word that already exists in the CURRENT vocabulary, I overwrite the header PFA pointer with the new value. 20:21:26 So not only have I redefined the word for future use - I've redefined the code that will execute when any prior use of the word runs as well. 20:21:34 KipIngram, no Forth will have all those bitfields in it's definitions 20:21:36 That extra level of indirection makes that possible. 20:22:08 Uh oh - I'm not sure we're on the same page. 20:22:15 Calibrate me a bit more on what you're wondering about? 20:22:31 KipIngram, possibly, my pages are small, like a childs blackboard 20:22:56 KipIngram, you mentioned 'factory pdf's' 20:23:10 Oh. Someone else mentioned that before me. 20:23:30 My interpretation of it was that the OP was looking for a definition of all words used within the factory implementation. 20:23:44 And if you can re-define words, that gets harder and more involved. 20:23:45 My PC host Forth doesn't separate it's own headers, but I usually have separated headers on the host Forth for target words 20:24:08 That makes sense, rdrop-exit. 20:24:12 Feels right. 20:24:21 But I only have the one level - I'm not tethered. 20:24:45 When I've learned stuff about your tethered implementation in the past, I've generally felt that you made super good decisions. 20:25:14 thanks 20:25:19 KipIngram, in my world the factory PDF's define all peripheral, register and bitfield names, and if any are changed, the factort technical pdf becomes useless 20:25:59 KipIngram, this happens in many forths where authors just ake up their own names, making their code impossible to follow 20:26:12 and it happen in a lot of C code 20:26:28 it's a frigging disaster of epic proportions 20:27:02 those items cannot have their names changed in any way 20:31:26 I don't mind as long the correspondence is documented in a comment 20:32:03 tp that makes sense. But my system does't REQUIRE that you redefine any words. And since you get a fresh vocab from the first prompt, you can't redefine a system word unless you jump through special hoops to do so. 20:32:23 The factory PDF can be kept righteous. 20:32:42 KipIngram, I see, you have vcabs or the like ? 20:33:52 rdrop-exit, fair enough, will the 17,000+ comments clog up your shadow pages do you think ? 20:35:49 Only the day I'm actually using all 17000 for something 20:36:12 :) 20:37:05 back 20:37:23 I only add words to my Forths as I need them 20:37:47 redefining words that are in flash isn't even feasible without a mass erase in zeptoforth 20:38:11 because once they're written, they're written 20:38:21 WHAT!! I want my money back! 20:38:22 and once words refer to them, they're referred to 20:39:08 like I just implemented DEFER and DEFER! 20:39:24 once a word is set in flash with DEFER!, it isn't going to change 20:39:35 tabemann, Mecrisp-Stellaris is exactly the same, but you can redefine them, however previous words using them wont change 20:39:42 exactly 20:40:03 you can redefine them, but that doesn't change what already refers to them 20:40:13 I actually rely on that in initialization 20:40:16 tabemann, which is usless to me in most cases, so when I change any code it all gets reuploaded to ram 20:40:48 tabemann, yeah, Im going to use that 'feature' in my new bluepill developer edition 20:42:02 what I mean is that each bunch of code defines an init word 20:42:08 and each of those calls the previous init word 20:42:26 so each init word calls the next all the way down 20:43:02 this wouldn't be feasible of redefining init replaced the previous implementation 20:43:08 *if 20:44:30 sure 20:45:57 my binary releases include a init word to get everything going but I think I can inform users that they can make a new init word that must include a init before it to initialise my init word in the release 20:46:15 DEFER isn't worth the trouble on an SRT/NC Forth target 20:46:36 if they want to make some code additions permanent 20:46:53 variable 'foo 20:47:04 : foo ( -- ) 'foo perform ; 20:47:12 which they can then remove using a preset corrnerstone 20:47:16 tp: I hear what you're saying, but I think I've addressed the issue. 20:48:01 My system (currently, though it would be easy to change) WOULD allow you to redefine system words. But that's not the default behavior - you have to go to some degree of trouble to do so. 20:48:03 KipIngram, Im still working on everything and value all comments inc those that disagree, it's all good, how would I improve otherwise ? 20:48:17 You'd have to make the system vocabulary CURRENT. 20:48:25 Otherwise it will never happen. 20:48:33 back 20:48:43 So, you'd have to WANT it, and in that case, more power to you - try to know what you're doing. 20:49:13 KipIngram, whay would you want to change system words in regard to mcu peripherals/registers/bitfields ? 20:49:50 those are all additions to my definitions in every project 20:49:54 You usually wouldn't. So don't. 20:49:59 exactly 20:50:12 You're not going to do it by accident. 20:50:37 my system words never change, I wouldnt know how as i didnt design Mecrisp-Stellaris it's well beyond my current ability 20:50:49 Im just a Forth user 20:50:50 On the other hand, if you DO want to redefine (KEY) and/or (EMIT), you CAN. 20:50:58 KNOW WHAT YOU ARE DOING. 20:50:58 I dont! 20:51:08 I don't believe in system protecting me from myself. 20:51:20 everything is changeable in Forth 20:51:25 ^ 20:51:49 the standard release is 99% fine for me, I do modify the USART to add RTS handshaking however 20:52:12 and I have the usual 3 tons of addons 20:52:25 metric tons? 20:52:28 yes 20:54:09 i have the usual 1ee99 development files but rather than a system of #includes and nesting etc, I just cat them all into one file, strip all comments and upload it asap to the target 20:54:22 simple and fast 20:54:59 all proven files get uploaded at the start of the project into flash where they generally stay until the end of the project 20:55:22 all development files go into ram and get reuploaded every change 20:56:09 it's as fast a resident target Forth as I can make 20:56:23 my tethered Forth uses exactly the same methods 20:56:47 tp: I'm pretty hard ore about wanting the system to give me flexibility and not try to control what I'm doing. You're tastes on that front may vary, and another great thing about Forth is that it lets us each have what we want. 20:56:58 what is the airspeed velocity of an unladen forth? 20:57:03 heheh 20:57:13 460800 bps of course! 20:57:20 :) 20:57:22 KipIngram, agree 100% 20:57:55 s/You're/Your/ 20:58:23 KipIngram, I'm only describing what I do, I know that forthers are totally independent thinkers and do what they want, thats how Forth is 20:58:46 yes, we reserve the right to be wrong each in our own unique way :) 20:58:52 if they did all the same stuff theyd be C users ;-) 21:01:11 KipIngram, I'm here to help new Forth *embedded* users and learn from people like rdrop-exit and yourself 21:01:27 I have nothing to offer to PC Forth users 21:02:10 KipIngram, Im a electronics technician, not a Forth system implimenter 21:19:42 Cool - it's all good. You're bringing up very worthwhile issues. 21:19:53 Hope we're able to help you along. 21:20:22 I'm 57 currently, and discovered Forth spring semester of my freshman year, so I've been at it for almost 40 years. 21:20:50 Forth itself has changed a good bit over that time. 21:21:06 So I tend to have affinity for the more old-fashioned concepts. 21:27:51 tp - one of the modern concepts that threw me for a while (not that I didn't understand it - I just wasn't *putting the pieces together in my head*) was the core-local cahces in modern CPUs. I worked out a whole system for mutli-threading, but it turned out to be bogus because it involved core N doing some of the work, then passing data structures core N+1 to get more work done, and so on. 21:28:05 But once N passes the data to N+1, N+1 has to fetch it into its own cache. 21:28:27 Guy at work said they'd tried our product's application that way, and that issue kills the performance. 21:28:54 When I first formed my Forth expertise, we had single-core CPUs with no cache. 21:29:02 And the rules in that situation are just different. 21:30:30 "Understanding" the new rules is fairly easy - getting them driven down into your gray matter so that following them becomes instinctive is not nearly so easy. 21:31:06 I think the only real way to do that is to work on problems in the area. 21:31:24 You make mistakes, you understand why they were mistakes, you fix them. And you do that over and over and new instincts form. 21:33:50 Unfortunately for me (well, or fortunately, depending on how you look at it) I moved into management right around the time multi-core was becoming common. I still got my hands dirty, but not in the same way a guy that did it all day every day would. 21:33:59 So I was kind of deprived of that "training." 21:36:37 --- join: webchat9 joined #forth 21:53:12 KipIngram, I'm at the really low end of embedded, single core only. Even a old z80 would probably do most of the things I need, but a STM32 also has all the peripherals built in 21:54:12 KipIngram, I think Im more of a Forth traditionalist, I have no desire to change forth, but I need speed in my IDE so I've designed for that 21:57:59 The great thing about life back in those days was that the absence of cache memories made the execution time of instructions fixed cycle count. 21:58:34 So you could analyze EXACTLY how much time your code was going to take to run, which is kind of a godsend for "tight" real-time programming. 21:58:57 Technically this is still possible, but there are so mny variables involved now that it's not very practically possible. 21:59:04 well the great thing about these days is the mcu's are so fast, cycle count doesnt matter much 21:59:15 Oh, it could. 21:59:20 Depends on your application. 21:59:31 sure, but not in my world 21:59:49 I'm mostly human interface and electro mechanical 22:00:04 That's fine - it wasn't always that way in my world either. 22:00:11 sure 22:00:19 But it was comforting to know that it was slam dunk easy to know your execution speed. 22:00:36 generally tho if you need 200Mhz response, a fpga gets involved I believe ? 22:01:32 Still important when predictability and consistency is required rather than average speed. 22:02:03 Well, the same concepts applied to those. Yes - you shift to FPGA when you need more speed. But they have a speed limit too, and knowing exactly what was within reach was useful. 22:02:10 frankly I never cared much, industrial, instrumentation, electromechanical are all usually dead slow 22:02:21 All you need is a "the faster the better" application, and your boss will be asking you how fast it can go. 22:02:35 you guys are definitely programmers :) 22:03:27 it's a crazy age, numbers sell, speed sells, bosses are MBA clueless 22:03:31 predictability and consistency is very much a safety critical concern 22:03:34 I'm not. I'm a hardware guy, by training. I've done a fair bit of "solo" programming in my time, but the early part of my career was hardware design and the latter part was managing engineering teams. 22:04:07 KipIngram, wow, Ive always been the guy who builds the gear for the engineer, I'm a tech 22:04:16 I wouldn't try to stack myself up against a quality computer science dude on the software side. 22:05:20 a java CS guy ? 22:05:26 a C CS guy ? 22:06:53 rdrop-exit, safety critical systems are regulated by law, I dont do any of that 22:07:21 no flight controllers here, no fuel rod positioners 22:09:10 sure, I'm just saying that predictable cycle times are not just a "programmer" thing 22:11:37 time-triggered systems are all about the predictability of the exact point in time code will run, and minimizing interrupts to achieve that predictability 22:12:52 i.e. the focus in on predictability and consistency rather than bursts of speed at their expense 22:15:34 this is also related to what KipIngram was saying about the effects of cache on predictability 22:15:36 sure, in 1987 I was designing embedded gear that relied on 10 nanosecond reliability for correct operation 22:16:05 The best CS guys I've known in my time have been damn good. It's a different profession - has its own place. 22:16:10 techs are not strangers to precise timing 22:16:20 There's a lot more to it than just slinging code. 22:17:05 exactly tp 22:17:25 tp - Exactly. 22:17:33 You could do that then, in a fairly straightforward way. 22:18:01 KipIngram, agree, times have changed 22:18:17 The progress in CPU performance have fairly well blown that out of the water. Not "theoretically," but practically. 22:18:35 KipIngram, but my stm32f051 cache is turned off by default, still not a issue for me 22:18:45 You'd have to track damn near everything going on in your pgram in order to have the info you needed to decide if a variable was or wasn't in the cache, in a general way. 22:19:04 s/pgram/program/ 22:19:26 tp That's great - one less complexity for you. 22:19:37 and anyway, I dont need 10ns repeatability now, the peripherals I use are allready sorted inside the chip 22:19:54 KipIngram, yes, I only select the things that meet my needs 22:20:13 :-) Smart man. 22:20:16 Ive made my world suit me for quite a while 22:20:25 it's important to be selective :) 22:20:59 I decided I didnt want windows in august 1997, I havent had it on a PC since then 22:21:16 it was Linux for about the next 18 years then FreeBSD 22:21:55 my only regret is that I took so long to get around to Forth (2014) 22:22:45 but better late than never, Forth has taken my embedded fun level back to what it was in the 70's 22:23:06 cool 22:24:28 I reached the point with Perl after about 12 years that I knew I could use it to do anything, I definitely have that feeling with Forth now for embedded 22:25:01 there is still heaps I dont know about Forth but I know enough now to be useful 22:25:20 at least to myself 22:26:35 my 'blue pill diagnistics' Forth binary has now been downloaded 228 times as of today 22:26:48 lunch is on the table, catch you later, stay healthy 22:26:51 not one single fault report yet 22:26:54 --- quit: rdrop-exit (Quit: Lost terminal) 22:26:55 cya 22:38:49 --- join: gravicappa joined #forth 23:11:04 --- quit: dddddd (Remote host closed the connection) 23:35:55 --- join: reepca joined #forth 23:59:59 --- log: ended forth/20.04.12