00:00:00 --- log: started forth/20.04.16 00:14:52 --- join: dys joined #forth 00:16:44 c[] good afternoon Forthwrights :) 01:11:36 --- quit: reepca (Remote host closed the connection) 01:11:45 --- join: reepca joined #forth 01:52:36 tp: Dune? 01:52:47 rdrop-exit: good morning 01:53:54 veltas, San Worms ? 01:53:58 sand 01:54:07 Fiance and I spent the first part of lockdown eating richly, now we're over the hump of easter we're eating more conservatively 01:54:10 tp: Yes 01:54:20 Good sci-fi 01:55:43 --- quit: WickedShell (Remote host closed the connection) 01:59:24 veltas, I was kind of lukewarm about Dune, I'm just not into religious Bene-Jesuit psychobabble. I prefer 'dark star' etc 02:00:44 veltas, I love how Forth words work together also, there is a symmetry in Forth I love 02:02:05 I think I've said before, the only other time I've felt this kind of way about a language was learning Haskell 02:03:56 I think you have said that 02:04:10 I read a lot of Terry Pratchett when I was a teen 02:04:22 Not religiously but I did enjoy that kind of comedy fiction 02:04:44 --- join: dddddd joined #forth 02:05:38 Forth is special to me because I thought about learning it for 27 years before I actually did 02:05:59 I loved Terry Pratchett for a period also, not so much now 02:06:24 I read TONS of scifi, usually 1 hr every night 02:08:01 First heard of forth around 5 years ago or so, and had been interested by it but thought it was probably pointless and hard 02:08:42 I gave in and learned it because one day I didn't care if it was pointless or hard 02:09:12 looked like the right fit for the already pointless work I was doing in free time 02:09:30 i first saw it in use on a big project I was hired to do all the hardware for. I never forgot the massive enthuiasm the programmers had for this thing called Forth 02:10:57 Many of the most brilliant things explored by humanity would have looked pointless at the outset. 02:11:08 https://www.wxyz.com/news/coronavirus/police-department-reminds-residents-to-wear-pants-while-checking-mailbox heh... no need to click as the url says as much 02:11:13 so I wan't in a big hurry, Forth wasn't a priority, I even learned and used Basic on hardware first (uggh) 02:11:44 POKE 02:11:55 phadthai, what, people are wearing clothes outside now ? 02:11:59 "but I want people to keep their social distance!" 02:12:12 heh 02:13:17 veltas, I should write a book .. "How The Goto Ruined My Life" 02:14:04 goto is the girl who ruins your life because she got away and you spend the rest of your life thinking about her with other control statements 03:43:26 --- join: iyzsong joined #forth 03:59:00 phadthai: leaving your clothes at home is one way to encourage people to keep a distance from you 04:06:16 --- join: iyzsong- joined #forth 04:06:44 --- quit: iyzsong (Ping timeout: 256 seconds) 04:34:02 --- quit: reepca (Read error: Connection reset by peer) 04:34:21 --- join: reepca joined #forth 05:10:12 crest, yahoo, finally finished every XSLT parser mod I have to do for the new bluepill release 05:10:36 tp: great 05:11:03 how large is the generated code? 05:11:15 som mods I thought would be easy were really hard, some hard ones really easy as there is a fair bit of cruft in those programs now 05:11:40 that always depends on the peripheral choices 05:11:45 definitely smaller 05:12:42 I've abbreviated the memory access type designators to two CAP letters, "read-only" becomes "RO" 05:12:44 and so on 05:20:10 how about deduplicating stuff? 05:20:58 how much use do you make of create and does>? 05:22:01 none, I don't understand them well yet, and all my processing is done in XSLT, the MCU plays no part in svd2forth yet 05:22:40 hi guys 05:23:11 well I did once use create and does> and understood it to some degree ( I copied someone elses work) 05:23:28 hey rdrop-exit, all quiet on the whatever front ? 05:23:29 create does> leads to bad factoring 05:24:27 hi tp, was getting lost browsing through a almost 1000 book 05:25:08 crest, apart from the legend creations, eberything else calls a Word in my svd2forth 05:25:44 crest, and the legends are words themselves 05:26:18 in addition create does> is kludgy 05:26:32 do you have some svd2forth generated code for me to look at? 05:26:41 hmm, I suppose I could generate the legends from a formula ... hmm hadnt thought of that before 05:26:55 everywhere 05:27:11 rdrop-exit: i wanted to reduce the memory footprint of the code as much as possible 05:27:19 what do you want a memmap or a bitfield ? 05:27:26 both? 05:27:29 sure 05:27:48 i just want to see if there is something that could easily be factored out 05:28:03 to reduce the amount of duplicated code 05:28:44 because code generators tend to generate bloated code because it's easier for the code generator 05:30:50 You can get the same effect as create does> without the kludgyness 05:31:30 crest, memmap.fs: http://dpaste.com/1CENJCF 05:33:39 rdrop-exit: Is there a writeup on this? Re. create does>? 05:33:46 Would be interested 05:35:30 I can't recall one off the top of my head 05:35:42 I'm mostly interested in why it leads to 'bad' factoring 05:37:31 because it's combining into one word what should actually be two words 05:38:02 the "create" time part, and the "doing" part 05:39:01 things get simpler if you have them as separate words, each individually "tick-able" 05:40:14 one part is a specialized compiler, the other part is a specialized runtime 05:41:07 tp: that's not too bad for autogenerated code 05:41:56 it looks like a straight forward implementation a bored programmer would write 05:42:00 crest, I have ben working on it for a few years, but I'm always very keen to get any suggestions to make it better/more efficient 05:42:16 let me think about after work 05:42:21 I'm never bored, but Im a crap programmer 05:42:42 sometimes crap poor programmers look like bored real programmers 05:42:56 and measure different implementations by size before i make an ass of myself 05:43:21 hey, thats NOT a problem here, ALL ideas are welcome 05:43:57 I find the more confronting a concept here presented to me, the bigger the gains I make 05:45:09 rdrop-exit, took the time to (very tactfully) explain that I had nfi about stack pictures and thats resulted in massive changes to svd2forth :) 05:46:29 the pastebin wouldnt take a full bitfields.fs file and I noticed that I still have 1 or 2 incorrect stack pictures so I'll fix those first and pastebin a smaller sample 05:47:52 i suspect some nice tricks with create, does> and parse could get you shorted and more readable definitions 05:48:31 cool, please let me know and I'll see how they work 05:48:55 they will have to go in the XLST stuff 05:49:04 but it's easy enuf to test 05:51:57 one part is missing the "1b." 05:52:00 : b32loop. ( u -- ) \ print 32 bits in 1 bit groups with vertical bars 05:52:01 0 <# 05:52:01 31 0 DO 05:52:01 # 32 HOLD LOOP 05:52:01 # #> 05:52:02 TYPE ; 05:52:04 and 05:52:06 crest, sure, to be clear I'm just saying that there are cleaner ways to produce the same word as you would using create does> 05:52:20 : 1b. ( u -- ) cr \ 31-0, 1 bit groups generic legend 05:52:21 ." 3|3|2|2|2|2|2|2|2|2|2|2|1|1|1|1|1|1|1|1|1|1|" cr 05:52:21 ." 1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0 " cr 05:52:21 @ binary b32loop. decimal cr cr ; 05:52:33 i put it here for any to comment 05:52:58 the end result is this 05:53:28 or thousands of cariations 05:53:31 variations 05:53:34 GPIOA_CRL (read-write) $44444AA8 05:53:34 3|3|2|2|2|2|2|2|2|2|2|2|1|1|1|1|1|1|1|1|1|1| 05:53:34 1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0 05:53:34 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 05:54:44 .. I type the name of the register using a legit CMSIS-SVD name such as "GPIOA_CRL" and get the following real time print of the data in that register 05:55:35 there is no way to do without the legend so a bit value can be easily located 05:58:44 rdrop-exit: I'll have to have a think about that (re create/does>) 05:59:28 sure 05:59:46 veltas, when I used create/does> before, the result used a lot of code 06:00:07 used a lot of space I mean 06:00:37 hhah, of course I had it do a lot of stuff also 06:00:39 The 'obvious' implementation of create/does> on my forth will use more space than equivalents 06:00:58 But it does do things that I can't replicate right now in an obvious way 06:01:53 the point of a create does> word is that when you execute it, it produces a child word, and when that child word executes, it executes some code 06:02:10 yes 06:02:17 I have seen discussion of how cruft seems to get introduced into all forths to enable it as a feature 06:03:15 Well also it associates data with itself, that is the crufty bit as far as I can see 06:04:57 I will have a little think about it later 06:08:08 books often use CONSTANT as an example for create does> 06:08:41 but tellingly Forths hardly ever use create does> to implement CONSTANT 06:09:13 My CONSTANT is definitely better not being create does>, at least for the way I've been able to see implementing create/does> 06:09:57 in Mecrisp-Stellaris all Words are written assembly 06:10:17 so Ive never see the formation od the core system words in Forth 06:10:54 actually I should have said never, rather than hardly ever 06:11:36 I will do it if I can figure out how to remove the create/does> threading overhead 06:13:27 --- quit: iyzsong- (Quit: ZNC 1.7.1 - https://znc.in) 06:13:41 I think I see the attraction of create does>, but I dont have the terminology to explain it! 06:14:53 the attraction is to have a factory word that you can use to produce child words 06:15:23 a typical use case would be for writing an assembler for example 06:15:55 are you advocating factoryizing ? 06:16:01 :)) 06:17:39 there's nothing wrong with the objective of create does> I just think there are always cleaner ways to achieve the objective than using create does> 06:18:55 : constant ( x -- )( -- x ) header, lit, inline ; 06:22:26 here is a example from Mecrisp-Stellaris 06:22:30 : reg: ( "name" offset-addr -- ) @ or ; 06:22:44 not my code 06:23:45 i think this contributor uses it to create register fetch values ? 06:25:00 rdrop-exit, what does "name" mean in the stack comment ? 06:25:25 is that a ascii character(s) 06:25:48 it means the word reads a token from the input stream 06:26:07 so the use may do something like " gpioa $100000 reg: " ? 06:26:44 see the stack picture for CONSTANT as an example 06:26:45 or "reg: gpios $1000000" ? 06:26:58 constant ( x -- ) 06:27:12 then you use it thus 06:27:20 5 constant thingie 06:27:32 yes 06:27:41 thingie corresponds to the 06:27:48 yes 06:28:08 it's not actually coming from the stack, it's read in from the input stream 06:28:44 this is all i have for Mecrisp-Stellaris 06:28:50 constant name ( u|n - - ) Makes a single constant. 06:29:50 I guess that's his comment convention for showing that name comes from the input stream 06:30:12 yeah and he doesnt define "n" anywhere 06:30:23 I guess it means "name" ? 06:30:37 n is a signed integer 06:30:43 u is a unsigned integer 06:31:16 by u|n he means it doesn't matter it the cell is signed or not 06:31:32 most people use x to show that 06:31:51 x means a cell 06:32:05 but constant consumes two values ? 06:32:11 ahh! 06:32:17 no just one 06:32:34 from the stack, and a token from the input stream 06:32:40 AHH! 06:32:44 --- quit: mtsd (Quit: Leaving) 06:33:00 so input streams are not shown in the stack picture ? 06:33:30 it depends on the convention you're using, he seems to have his own convention 06:33:32 i guess not as theyre not on the stack ? 06:34:21 when you see something like ( x -- ) it usually means x comes from the stack and comes from input 06:34:23 I have a very poor understanding of how to deal with text perhaps this is one reason 06:34:55 is "name" equivalent to ? 06:35:14 if the string were coming from the stack it would probably be shown as ( a # -- ) 06:35:37 these are just conventions, some people use "name" some use 06:35:41 erk, yet # is used to represent decimal numbers in Forth 06:36:07 tp: lets take something like this trivial example https://pastebin.com/raw/H05EESfV 06:36:10 not all forths 06:36:41 the 0 @ drop is to make the compiler emit some useless code 06:38:00 if you haven't used before it works like this 06:38:39 tp, there should be a section in your Forth's documentation where he explains his comment notation 06:39:01 crest, I did once, but my understanding is poor, I know its used to build application words 06:39:23 rdrop-exit, there isnt, Ive been building that up as I understand it 06:39:37 foo consists of two parts the code to build a new words and the code to execute them 06:39:56 crest, yes, I understand that 06:40:10 crest yours is a programmers example :) 06:40:31 and each time you use foo it just creates a tiny word with just the data required by the does> part 06:40:33 crest try and explain this ? : reg: ( "name" offset-addr -- ) @ or ; 06:40:45 no problem 06:40:47 crest yes 06:41:13 the stack comment tells the users that this word consumes a name from the input stream 06:41:20 I think it's used like this "reg: porta $100000" ? 06:41:27 its not 06:41:42 use it like $100000 reg: porta 06:41:51 ahh! 06:41:53 of course 06:42:05 :) 06:42:06 than it stores a single cell from the stack in the new word with "," 06:42:34 to me, that stack description conveys no parameter order 06:43:11 at runtime that new word gets the address of the words "payload" on its stack and executes the code after does> 06:43:49 in this case it fetches the cell you stored there ($100000) and ors with the top of the datastack 06:45:04 so the porta defined by reg: does the same as : porta ( x1 -- x2 ) $10000 or ; 06:45:29 but it does this by splitting the code of from the parameters allowing the code to be reused 06:45:58 in such a trivial case : porta $10000 or inline 1-foldable ; is probably better 06:46:43 because the compiler can turn it into a single or with immediate (unless thumb can't encode $100000 as immediate) 06:47:04 it will from the user pov 06:47:17 but the machine code might be longer than expected 06:47:34 if the code after does> gets longer it becomes more useful 06:47:47 or if it contains a nice abstraction 06:48:04 not necessarily, if the code gets long it should be factored 06:49:16 what I mean is if it cant it will use a special method to get that $100000 as immediate 06:50:22 the bottom line is create does> is nice in principle, but rarely that useful in practice 06:52:59 I've never encountered a situation where I thought to myself I wish I could use create> does> for this 06:53:42 crest, Mecrisp-Stellaris does auto inlining 06:53:51 and I think auto folding 06:54:05 within reason 06:54:28 well if it doesnt, I cant add it manually 06:54:50 I know rdrop-exit doesnt like auto anything but at my stage of noob I think it helps 06:55:04 auto-folding is ok as long as you can switch it on and off, but I wouldn't want auto-inlining 06:56:17 in fact that's the combination I usually use 06:56:47 oc course ": reg: ( "name" offset-addr -- ) @ or ;" was written by a programmer with little cortex-m experience 06:57:49 My convention for input stream is to always put it at the end of the comment section e.g. 06:58:00 constant ( x -- ) 06:58:15 rather than constant ( x -- ) 06:58:45 I have no idea what the standard recommends 06:58:52 i've seen both 06:59:50 e.g. what I posted earlier today 06:59:51 : unrolled, ( # -- ) 06:59:51 ^ swap for dup compile, next drop ; 07:00:02 for a start every cortex-m peripheral can have 50+ registers 07:01:56 the reg: example is a bad example 07:02:06 yeah 07:02:19 it's in a contributor code 07:02:28 I would just use constants 07:02:42 which is what I do 07:03:08 people get carried away 07:03:18 and everything is created from data in a CMSIS-SVD file for the MCU model itself 07:03:49 with 413 registers in the lowly chip I use, there can be no manual typing 07:04:24 it's deja vu all over again 07:04:35 heh 07:05:25 you only write for the registers you use I know, but I generate a solution for everyone, and so it must handle *all* registers, flawlessly and without error 07:05:33 --- quit: jsoft (Ping timeout: 250 seconds) 07:05:40 it's not *all about rdrop-exit ;-) 07:06:37 I've never said "don't do that", I'm all for you doing as much XML stuff as makes you happy 07:07:05 I never claim my way is suited for anyone but me 07:08:16 and my system is awesome, I know because 2 out of the three people who have tried it said so .... ok one of them was me! 07:09:30 : this-amount-of-xml-makes-me-happy ( n -- flags ) 0 > 0= ; 07:10:29 veltas, don't you have NOT defined in your Forth :) 07:10:37 veltas, everyone I know said "XML UGGH it's the devils work, dont do it" but Ive found it to be incredibly handy 07:11:08 Fair enough ;) 07:11:44 veltas, you seem to often use 0= instead of NOT (aka INVERT) 07:12:03 me too 07:12:04 I saw someone do it 07:12:10 It's tp's fault 07:12:28 I use INVERT normally but I couldn't remember if it was INVERT or INVERSE and my reference is not out 07:12:53 traditionaly it's NOT 07:13:12 INVERT is just because the ANS guys can't come to an agreement 07:13:22 Hmmm a lot of forth seems to go that way 07:13:29 hahah, how is 0= equal to NOT ? 07:13:42 I was trying to make my forth partial standard, but I might give up with that because it's so mangled 07:13:45 5 0= vs 5 NOT 07:14:47 5 0= . 0 ok. 07:14:48 5 NOT . -6 ok. 07:14:50 ? 07:15:14 now try it with a well-formed flag (either -1 or 0) 07:15:19 Because 'true' is 0 NOT 07:15:23 that's why 07:16:18 If you know you have either -1 or 0 on the stack use NOT, since most CPUs have a one instruction NOT 07:16:49 while 0= may be a slower primitive 07:17:04 0= is probably faster on the z80 but code clarity is more important to me than speed 07:17:13 And they take up just as much room in the colon def 07:17:58 0= is faster than NOT on the Z80? 07:18:07 Yes 07:18:17 I don't remember that, but I've all but forgotten the Z80 07:18:20 Basically because 0= you OR two 8-bit registers 07:18:31 And NOT you have to NOT two 8-bit register separately 07:18:46 It's because there isn't a 16-bit NOT basically 07:19:25 Ill keep using 0= thanks, my world is very different to yours 07:19:48 I'll have to dig up some ancient Z80 source to refresh ny brain cells 07:21:38 this is why: http://dpaste.com/112SWR2 07:22:40 hmm, you might save a few cycles if you had an IF_= primitive in assembly 07:23:21 tp, as I said if what you have on your stack is either 0 or -1 then NOT will give you the same result as 0= 07:24:24 0= in Z80 would be something like LD A,L OR H JR NZ,_false DEC HL _false: LD HL, 0 07:25:49 NOT in Z80 would be someting like LD A,L CPL LD L,A LD A,H CPL LD H,A 07:31:22 cool 07:31:50 Depends on how you implement it, conventions etc, but 0= can sometimes be faster 07:32:13 I think it's actually slower in code above when it's not zero 07:32:31 Anyway, the point is that 8-bit registers are cumbersome :-) 07:32:55 Part of my motivation for using forth 07:33:33 veltas, I ended up making a pretty slick macro system for the 6502 to get around that 07:33:41 BYTE foo 07:33:43 WORD bar 07:33:56 veltas, don't you mean 'Part of my motivation for torturing myself using Forth on a 8 bit z80" ? 07:33:58 MOV.W foo,bar 07:34:14 MrMobius: Yeah 6502 far more tedious than Z80 07:34:15 It's probably worthwhile to check your code against some of the old z80 Forths 07:34:22 rdrop-exit: I will do eventually 07:34:24 the forth way (tm) "load shoot mrmobius" 07:34:58 the macro knows that foo is 8 bits and word is 16 bits so when it generates the assembly it knows to copy on the 8 bits then copy a zero into the high byte of bar. likewise copying a word to a byte only copies the low 8 bits. saves a ton of time 07:35:30 load mrmobius shoot :P 07:35:39 hahah 07:35:59 touche 07:36:04 veltas, heh, I doubt that :) 07:37:35 what would be useful is to define multiple words a once just like lisp macros 07:38:11 I would be surprised if NOT isn't more efficient than 0=, but I'm so out of touch with 8-bit that my gut could be totally off 07:38:13 e.g. define a read-write register once and you get the constant and pretty print word 07:39:03 but i have no idea if mecrisp stellaris does offer a way to this without resorting to assembler 07:40:52 crest, defining multiple words at once doesn't sound like a good idea to me 07:41:18 rdrop-exit: it does to me, but i've been exposed to lisp and similar languages 07:41:33 Forth is not lisp 07:41:37 i know 07:41:44 but the same advantages apply 07:41:58 you type just one defintion and the compiler does the rest for you 07:42:24 *definition 07:42:28 as opposed to factoring 07:42:41 this is factoring the compiler 07:42:46 crest, does the compiler use the latest remote mind reading equipment ? 07:42:57 tp: ? 07:44:20 I don't see how it's factoring 07:44:50 there is a reparative pattern to the code 07:45:22 you want to tell the compiler there is a 32bit read-write register at address $12345 07:45:22 crest, how does it know what to do from the one definition ? 07:45:57 you're confusing factoring with macros 07:46:48 $40023000 reg-rw-32: CRC_DR 07:46:56 sure 07:47:13 that would create a constant CRC_DR with the value $40023000 07:47:27 and a pretty printer named CRC_DR. 07:47:56 and yes in lisp you would use a macro for this 07:48:08 how is this factoring? 07:48:51 how would you call it? 07:49:33 No idea, but I wouldn't call it factoring 07:49:40 to me factoring is finding repeated code, giving it a name and replacing it with a call to the single copy 07:50:18 i get that from the XLST orocessing of the CMSIS-SVD tho ? 07:50:21 $48001400 constant GPIOF \ General-purpose I/Os 07:50:21 GPIOF $0 + constant GPIOF_MODER ( read-write ) \ GPIO port mode register 07:50:21 GPIOF $4 + constant GPIOF_OTYPER ( read-write ) \ GPIO port output type register 07:50:30 it comes out like that 07:50:48 along with the factory descriptions 07:52:01 crest, ok, where's your pretty print word? 07:52:34 you're creating tons of pretty print words, that's not factoring 07:54:04 that's what i have to find out 07:54:12 factoring reduces combinatorial explosion 07:54:19 because just lots of postpone isn't enough 07:56:09 combinatorial explosions are typically only at the primitives level (assembly level, machine instructions) 07:56:44 for high level words one of the reasons to factor is to avoid combinatorial explosions 07:57:36 --- quit: proteus-guy (Ping timeout: 264 seconds) 07:58:28 you factor so as to have words that you can use in phrases, rather than having an explosion of compound words 07:58:51 sure but do you want GPIO-A RW-REG32. or GPIOA. 07:59:38 I want option 1 07:59:43 the idea behind those svd2forth words is to make the hardware accessable 07:59:59 if tghe alternative is having option 2 x1000 08:00:07 if you have to know how each register is encoded you can just use $1234 hex. 08:00:12 $1234 @ HEX. 08:01:06 crest, the register encoding has to be supplied by the programmer for each use 08:01:48 you make constants for your registers, that's fine 08:01:48 lets say i want to get started with new chip and use svd2forth to define words for the chip 08:02:06 --- join: proteus-guy joined #forth 08:02:32 or i'm debugging some external hardware connected to the gpio pins 08:03:14 in that case its very useful to have easy to *use* words for interacting with the system 08:03:27 instead of easy to write words 08:04:03 yes, and you would normally write those words 08:04:34 but writing them by hand is tedious and error prone 08:06:09 thats why we use Forth 08:06:19 conside the C alternative ? 08:06:49 you have to read the datasheet, plan your code, write it, compile, flash and test 08:07:06 with Forth you hack up a quick real time test 08:07:11 like spacex 08:07:22 crest, factoring is not about automatic generation of tons of words 08:07:31 correct 08:08:06 to you its dealing with the combinatorial explosion by splitting at the points of divergence 08:08:32 instead of n x m words you have n + m words that can be concatinated 08:08:55 --- join: merkc0 joined #forth 08:09:07 --- quit: merkc0 (Client Quit) 08:09:10 yes, that's definitely one reason to factor 08:10:16 probably the most important reason 08:11:21 and by doing that you gain a deeper understanding of the problem space 08:11:30 exactly 08:13:11 and the areas were that partitioning is problematic bring to light the edge cases 08:14:06 wow, you guys are heavy duty! 08:14:22 that you'll need to analyze on a case by case basis, to discover if you've missed some important insight into the problem 08:16:07 IIRC there's a Chuck quote in Thinking Forth related to this 08:16:57 at least one, maybe more 08:17:42 gotta make a call and check on how my mother's doing under confinement 08:17:53 catch you all later, stay healthy 08:18:00 --- quit: rdrop-exit (Quit: Lost terminal) 08:18:17 --- join: nonlinear joined #forth 08:18:32 --- quit: nonlinear1 (Read error: Connection reset by peer) 08:19:47 cya ! 08:27:38 oh shit it's possible but as far as i can tell only with evaluate *shudder* 08:28:16 or maybe with tsource an (create) ? 08:33:18 --- quit: dave0 (Quit: dave's not here) 08:42:42 --- join: Zarutian_HTC joined #forth 08:51:13 --- join: TCZ joined #forth 08:52:59 --- quit: TCZ (Client Quit) 08:53:19 --- join: TCZ joined #forth 09:16:19 has anyone of you used source/setsource and >in ? 09:16:49 i want to redirect parse to use something else than the normal input buffer 09:33:08 --- quit: TCZ (Quit: Leaving) 10:03:57 --- join: rpcope joined #forth 10:29:12 --- quit: dys (Ping timeout: 258 seconds) 12:42:57 --- join: TCZ joined #forth 12:45:22 --- join: jsoft joined #forth 13:35:44 --- join: WickedShell joined #forth 13:48:07 --- quit: xek (Ping timeout: 250 seconds) 14:55:18 crest, not me 14:55:53 tp i to the source buffer changed as part of a nicer higher order function 14:56:02 but that's not enough for my purposes 14:56:15 the compiler detects that i'm trying to trick it 14:56:30 and tells me that the stack isn't balanced 14:56:42 yeah I get that occasionally 14:56:53 i suspect that's a false positive because my code is crazy 14:57:17 after all you're not supposed to change the source, reset >in and call : 14:57:32 mine are always positive positives :) 14:57:58 it works unless i attempt to compile literals into the new definition 14:58:19 I'll probably never be able to 'trick' Mecrisp-Stellaris as part of Matthias brain lives in every kernel 14:58:21 i can define something like "+ ." 14:58:42 the compiler caught me as i got to cocky 14:58:52 it would work with evaluate 14:59:05 but i want to avoid generating source code only to compile it again 14:59:09 hahah 14:59:16 but it works! 14:59:42 but i would prefer to use lots of postpone 14:59:58 matthias isn't active on irc or is he? 15:00:16 I remember a smart russian found he could create a ram based array from flash using evaluate, but it needs a reboot to use it and by then the ram is reset 15:00:24 oh and i just fetched a longan nano from the mail 15:00:40 no, hes been on #mecrisp maybe twice 15:00:40 there is no need to reset 15:00:58 oh, youll love the documentation ;-) 15:01:13 there is documentation ?!? 15:01:20 kind off 15:01:45 how much worse than the stm documentation is it? 15:01:48 https://sourceforge.net/projects/mecrisp/files/Target%20literature%20package%20for%20GD32VF103.tar.gz/download 15:02:08 the STMicro doc is awesome in comparison 15:02:24 Im actually a STMicro doc fan 15:03:28 when I started with STM32 and XML everyone said "STM doc is terrible, all over the place, innacurate etc, and XML is a horror, dont do it" Ive found neither to be true 15:04:03 * boru coughs. 15:04:54 the main problem with the GD32VF103 doc is it looks like they just pasted from the STM32F103 and forgot to edit it in a few very important places! 15:04:58 i finally got my 4k screen from work for the home office 15:05:03 boru, !!!! 15:05:10 Evening, old chap. 15:05:24 I was actually about to clock out, but not before getting a jab at ST. 15:05:35 boru: shoot 15:06:15 I was lamenting on the days in ##embedded cursing ST's documentation with tp. 15:06:15 crest this is the famous boru who single handily caused me to switch from Linux to FreeBSD 15:06:23 * boru chuckles. 15:06:34 boru: good work 15:06:40 Well, it was the logical choice you'd probably have made eventually. 15:06:53 hahaha, those were the days, I was exceedingly young and stupid then, now I'm old 15:07:18 It was always entertaining. 15:07:19 i was supprised to see mecrisp work on freebsd in userspace :-P 15:07:39 it simplifies debugging code 15:07:40 boru, this is an official "thank you" for influencing me to switch! 15:07:54 I can't drink "thank you" -- what good is it!" 15:08:36 But on a serious note, I figured you'd probably stick with it, given the philosophy. 15:08:43 hahah, I have a bottle of Kahlua with coffee coming today, I'll drink 60 mils to your health! 15:08:57 --- quit: gravicappa (Ping timeout: 256 seconds) 15:09:05 I'll have to export some decent Irish whiskey down there to you. You can't go on like that. 15:09:19 boru: in which timezone are you? 15:09:22 hahaah, oh I do like the Baileys 15:09:28 CEST at the moment. 15:09:31 crest same as you 15:09:51 i prefer a nice smokey islay whisky 15:10:06 "Scotch" is Irish for "toilet cleaner". 15:10:59 boru: most irish whiskey is just not peaty enough for my taste 15:11:11 boru, so I ended up with ZFS and jails, just love it. Have a snapshot every 15 mins the last 2 years compliments of zfstools 15:11:39 Fair enough. I could never get the taste for the heavily peated stuff, personally, but I've a bias, being from Ireland. There are some Speysides I like, and a few Islay and Highlands, also. 15:11:39 most are smooth and interesting, but that's not all i want from a whiskey 15:12:14 boru, it's understandable but Im a bit concerned about 12.2 coming out with Lua as the boot manager 15:12:15 boru: maybe 14y oban is a gateway drug for you 15:12:20 tp; have you played around with capsicum yet? 15:12:57 Well, Caol Ila, or Aberloud Abunadh would be Scotches I'd consider buying a bottle of. 15:13:01 boru: capsicum is nice in theory, but pain in the ass if you have to port a large code base 15:13:05 boru, no, my ex wife used to feed me capsicum because she new I had a stomach ulcer 15:13:25 But for the likes of Bunabainn etc, not my thing. 15:13:39 boru: in that case oban could be something you enjoy 15:13:53 Perhaps, but I don't think I'll stop drinking Irish any time soon./ 15:14:07 why should you?!? 15:14:18 Indeed, you're right. 15:14:29 irish has good stuff to offer as well it's just not my normal taste 15:14:40 Redbreast is my go-to. Single pot stills in general. 15:15:54 boru, Id not even heard of capsicum, I'll look into it thanks 15:16:17 Cool idea, but as crest said, a bit of a pita for portability. 15:16:34 ah 15:16:49 writing new code with capsicum isn't (much) harder than using the normal abi 15:16:59 and it forces you to get it right 15:17:05 In any case, I should really clock out. Work beckons in the morning, and I got a bit carried away with hobbies this evening. 15:17:11 boru, I dont hang around on #embedded anymore, I lead a solitary Forth life 15:17:16 because you can't abuse the ambient authority to do things out of order 15:17:28 Yeah, I don't either. A lot of big egos in that channel. 15:17:33 boru, fantastic to chat! stay well old friend! 15:17:46 Sound. I'll catch up with you fellas again tomorrow. 15:17:49 * boru absconds. 15:17:52 awesome 15:18:34 crest, yeah boru is right, too many C loving egos there for me 15:19:17 and at my age I no longer have the interest to engage in pointless flame wars 15:20:37 crest, I never do much on FreeBSD anyway, I'm just a user 15:21:10 i'm a freebsd sysadmin who likes to break things to see what happens 15:21:21 at the moment i'm playing with the pot jail manager 15:21:28 oh nice! 15:21:44 and already broke the poor developer by accident 15:21:51 I was a Linux refugee to FreeBSD in 2016 15:22:06 will the developer recover ? 15:22:08 i just braindumped all over him and now he's implementing the missing features 15:22:11 yes 15:22:15 awesome 15:22:36 it's a honour to meet a FreeBSD sysadmin! 15:23:07 and i'm writing my own ipsec keyexchange daemon as a hobby project because IKEv1 and v2 are just insane 15:23:37 I recall observing youre a bit security focused 15:23:59 yes and no 15:24:45 Im not, it's all too complex for me 15:25:27 but i did replace the freebsd init system because wanted to see what happens 15:25:41 along the way i found damn good reasons for it 15:25:59 but most people don't want to touch init and rc systems with a 10ft pole 15:26:00 crest, couple of small bugs to go and Im ready to put that damn blue pill diag together 15:26:17 hahah, I like them as they are 15:26:37 i did look at NOSH but ran away screaming 15:26:57 have you looked at the older approaches? 15:27:01 and of course when systemd came anywhere near me I shot it 15:27:03 daemontools, runit? 15:27:18 I think openrc looked sensible 15:27:37 no I havent loked at them 15:27:49 openrc isn't much of an improvement on the existing init system from a technical point of view 15:27:55 yes it has some eye candy 15:28:19 but ill leave init changes to the experts and if I ever see systemd anywhere near FreeBSD I'll jump to openbsd or openindiana 15:28:28 but the existing freebsd rc system isn't bad even if some script have grown far too large *cough* netif *cough* 15:28:42 agree totally 15:28:51 i really like s6 and s6-rc 15:29:23 I actually really liked openindiana but Id be compiling for months to try and get the apps I wanted, plus it seems to be dying slowly ? 15:29:25 i gave a talk at eurobsdcon 2018 on the subject, but that year the video crew bailed 15:29:39 damn 15:30:09 i never saw any eye candy with openrc, and I abhor bling myself 15:30:31 stuff like colored output and ascii art animations during boot 15:30:37 I've run icewm for about 20 years I think, no icons 15:30:41 ahh 15:30:45 I never ran it 15:31:07 s6 has really clean and simple design it does one thing and does it well 15:31:13 it is *only* a process supervisor 15:31:36 the only time I was interested in ascii art was when I was trying to get some insight into analysing the stack 15:31:36 it starts long running processes in a clean enviroment and expects them to stay direct child processes (no double forking) 15:32:10 if the proceses die they are restarted and the error logged and a hook can handle it 15:32:37 the init process is a finite state machine with no runtime resource allocations 15:32:55 it can't fail or (dead)block by design 15:33:04 sounds good 15:33:09 that limits it to simple things 15:33:28 c.d is fine here, I never have any problems and this box runs 24/7 15:33:30 all it does is scan a directory for symlinks to directories at startup 15:33:34 rc.d I mean 15:34:03 the problem with rc.d is that it has to do a lot of work to workaround problems that shouldn't be possible 15:34:24 a daemon shouldn't start live a a child process of your shell 15:34:38 yeah, it's a bit ancient I know and as a sysadmin Id expect system init stuff to be very important to you 15:34:59 instead your shell start a small tool that tells the proper daemon to reload its configuration 15:35:02 any idea where FreeBSD is heading with that ? 15:35:25 theyve been debating it for ages now 15:35:28 nowhere because rc.d is good enough and you'll never reach agreement on this 15:36:01 it would start with bike shedding and could end in total war 15:36:15 nobody wants to risk a hard fork over this 15:36:23 and there is no reason to do it 15:36:29 so what do you use on your FreeBSD machines at work ? 15:36:30 because it can be done as a port 15:36:39 exactly 15:36:53 and yes i should update my s6 and s6-rc ports 15:36:55 why force people, let them make up their own mind 15:37:23 the only way i can see this work out is to show that a different init can work 15:38:20 blood will run .... 15:38:44 ill be updating this to 12.1 soon 15:39:03 dunno I want the lua boot manager of 12.2 15:39:12 don't worry about it 15:39:32 it was an ugly forth system anyway 15:39:35 not that I've found the Forth bootmanager very reliable standalone, but seems ok as a boot manager 15:39:49 yeah it was a horrible Forth 15:39:57 *is* a horrible Forth 15:40:03 yes but nobody wanted to work on it 15:40:09 I dont blame them 15:40:15 no one does Forth anyway 15:40:20 thats what they said 15:40:47 I should be glad it's not a python boot manager ;-) 15:41:00 the bootcode had a bus factor of one or two 15:41:11 what does that mena ? 15:41:14 mean 15:41:37 bus factor = number of people have to be hit by a bus to kill something e.g. an opensource project 15:41:43 hahahah 15:42:04 first time Ive heard that 15:42:38 but as lua is gigantic compared to Forth I wonder if it will fit as a boot manager ? 15:42:48 don't worry about it 15:43:07 the bootcode includes a readonly zfs and ufs implementation 15:43:21 yes they had to improve it because it didn't fit in 640k anymore 15:43:38 at least not on all mainboards 15:43:55 some bios vendors like to claim most of the lower 640k 15:44:01 readonly! so I cant get a terminal on it and do the things I never did with Forth ? 15:44:19 and having zfs, ufs and encryption support in the bootloader is really useful 15:44:48 ill never use anything but zfs again anyway 15:45:09 you running 12.2 15:45:15 ? 15:45:46 12.1 15:45:53 at the moment 15:45:56 FORTH BOOTLOADER 15:46:05 oops sorry caps! 15:46:17 calm down 15:46:23 i've used the lua bootloader for a while and it just works 15:46:36 --- join: dave0 joined #forth 15:47:05 finally i can keep my kernel and userland in the same dataset of an encrypted zfs pool 15:47:29 yes it was neat that the old bootloader was written in forth 15:47:47 but freebsd needs a working bootloader with certain features 15:48:09 and because nobody stepped up to maintain the existing forth code the project switched to a new bootloader in lua 15:48:10 I dont actually care, I just thought it was nice until I looked at the Forth code 15:48:22 the code is nasty 15:48:30 yeah, I gathered, which is perfectly understandable 15:48:39 yeah, as you said 'ugly' 15:49:49 I only care about Forth on embedded, thats where it works for me 15:50:30 I have been using Perl on FreeBSD for my stuff and never thought Id consider Forth on a PC until I looked at CRC's Retro 15:50:51 now I'm really tempted 15:52:40 crest, execline looks interesting and it seems I know the maintainer 15:52:52 heliocat? 15:53:08 crest@rlwinm.de ? 15:53:17 :-P 15:53:26 thought that may be you ? 15:53:34 --- quit: jsoft (Remote host closed the connection) 15:53:41 correct 15:53:49 awesome 15:54:43 should I stop using SH for all my pc-embedded glue and use execline instead ? 15:56:59 --- join: jsoft joined #forth 15:57:48 crest, hmm are you also skarnet.org ? 15:58:15 no that's laurent bercot 15:59:10 interesting name, reminds me of the "skodenriders" from "A fire in the deep" by ‎Vernor Vinge 15:59:41 ahh 16:04:05 --- join: X-Scale` joined #forth 16:05:04 --- quit: X-Scale (Ping timeout: 265 seconds) 16:05:06 --- nick: X-Scale` -> X-Scale 16:09:47 --- quit: TCZ (Quit: Leaving) 16:13:22 rdrop-exit isn't here 16:13:33 But tp is 16:13:43 Remember we were talking about DOES> earlier? 16:15:28 veltas, I'm the embedded guy not the DOES> guy :) 16:18:14 veltas: yes 16:18:36 i got even crazier while you were gone 16:18:58 I said I would go away and think about it 16:19:13 and used setsource and >in to trick the compiler to defien new words 16:19:27 to use postpone etc. 16:20:06 but only the most trivial test cases worked that way 16:20:22 i couldn't get it to compile literals from the datastack 16:20:38 of course (ab-)using evaluate would work 16:20:55 but it don't want go generate *source* code 16:21:03 i would prefer to generate code directly 16:21:29 --- quit: tolja (Ping timeout: 256 seconds) 16:54:21 Anyway I think I understand the overhead a bit better now 16:55:06 I think the overhead is acceptable for my forth, and usecases 16:55:27 But when most stuff doesn't have additional 'overhead' I can see why rdrop questions its value 17:15:33 --- join: TCZ joined #forth 17:26:02 hey guys 17:26:18 hey tabemann 17:27:02 tabemann, how goes Zeptoforth ? 17:27:16 been duplicating matthias's code wholesale 17:27:24 specifically his math code 17:27:48 also, my new mouse came from amazon 17:27:57 to replace the one which would randomly double-click 17:28:03 and you? 17:28:07 dont blame you re the math, he *loves* math 17:28:44 just a couple of bugs left in my latest bluepill dev update to fix 17:29:00 XSLT bugs 17:29:31 Forth programmers use DOES> to make their words, I use XSLT ;-) 17:31:00 lol 17:35:11 okay, I'm gonna have dinner - bbl 17:35:31 cya 17:56:09 --- join: iyzsong joined #forth 18:16:29 i am hacking away on a long division and multiplication for ARM :-) 18:23:46 64 bit arm ? 18:24:55 32 bit cortex-M4 18:25:15 oh! 18:25:33 you dont like the inbuilt div and multiply ? 18:25:53 i found an ARM simulator that runs in the browser 18:26:04 thats cool 18:26:14 written in JS ? 18:26:45 i think so 18:26:52 https://cpulator.01xz.net/?sys=arm 18:27:09 bit of a dodgy url 18:27:24 i don't even have an arm cpu :-) 18:27:36 hahah, oh 18:28:13 i'd imagine it would be easy to port the 32 bit stuff to 64 bit? 18:28:30 I couldnt say 18:28:42 ah ok 18:28:46 first i'll get this working 18:28:55 I imagine tabemann may appreciate your simulator find! 18:29:12 Im a tech not a programmer, thats why I can't say 18:29:18 I have no idea 18:29:43 back 18:29:54 tp: ah no worries 18:29:56 hi tabemann 18:30:14 i'm trying to port my amd64 divide code to arm32 18:30:38 hey tabemann dave0 found a browser based M4 simulator 18:30:48 https://cpulator.01xz.net/?sys=arm 18:31:28 cool 18:31:45 it looks ok 18:39:06 --- join: boru` joined #forth 18:39:09 --- quit: boru (Disconnected by services) 18:39:12 --- nick: boru` -> boru 19:01:36 --- quit: reepca (Read error: Connection reset by peer) 19:02:01 --- join: reepca joined #forth 19:04:16 --- quit: dddddd (Ping timeout: 240 seconds) 19:16:19 it works! https://termbin.com/d006 19:17:50 tabemann: i ported my multiply and divide functions from amd64 to your arm32 19:18:17 not sure if it would be easy to port to arm64 19:19:29 nice 19:20:12 it's my first arm assembly code :-) 19:23:11 actually, I'm using Thumb-2, and sorry to say this, but in Thumb-2 only registers r0-r7 are easy to use, and I've already got registers r6 and r7 allocated 19:23:30 personally I prefer to use just r0-r3 because these registers are caller-saved 19:23:36 in the standard ABI 19:24:05 i don't know any calling sequences, i just did what made sense to me 19:24:17 oh it's a good first ry 19:24:19 *try 19:24:32 ehehe thanks :-) 19:37:10 dave0, nice neat code! 19:37:38 dave0, you did that on the webpage assembler/sim ? 19:39:14 tp: yeppers 19:40:07 i don't have any arm emulators or anything so i searched for a web browser thing 19:40:35 it worked out nicely i think! 19:41:36 that web page thing has a decent feel about it 19:41:49 nice find! 19:51:50 back 19:52:35 I probably would have used your code, with modifications of course, were it not for my shamelessly stealing Matthias's code :) 19:53:34 dave0, assembly wiz! 19:54:21 to is very happy, his delivery of food from the supermarket came today :) 19:54:29 to = tp 19:55:49 the Australian govt has been saying "Australia produced 3/4 more food than we eat, so no food shortage" but a lot of the more quality items are oddly 'out of stock' on the supermarket website ... hmm 19:56:51 --- quit: TCZ (Quit: Leaving) 19:57:01 maybe the govt actually wrote "Australia produces 3/4 more hardtack biscuits than we eat, so no hardtack biscuits shortage" 19:57:03 ? 19:57:37 I'm just annoyed that the grocery stores here are out of the root beer I like 19:58:21 it's the little things we miss 20:00:56 I managed to but two 1kg bags of frozen Barramundi fish fillets which are really nice, (real fish), and they have been out of stock since I got them 20:01:01 but = buy 20:07:53 --- join: proteus-dude joined #forth 20:09:16 --- quit: proteus-guy (Ping timeout: 240 seconds) 20:24:56 tabemann: i forgot to check for traps in my divide function 20:25:17 divide by zero or oveflow 20:25:23 hmm 20:30:34 --- join: Zarutian_HTC| joined #forth 20:30:34 --- quit: Zarutian_HTC (Read error: Connection reset by peer) 20:30:36 the code I'm using doesn't either 20:33:20 tabemann: what do you think? should it check for divide by zero? 20:34:01 it's extra complexity, and it's an exceptional condition anyways 20:34:27 hmm 20:34:28 in my code I don't test for div zero, and rather just let the MCU handle a processor exception 20:35:42 --- join: tolja joined #forth 20:35:47 yeah i'm not sure how to raise an exception 20:39:55 until you find yourself in a situation where every cycle counts, division ops should always check for div/0. Saves you a LOT of headaches. 20:43:38 my divide also fails if the quotient doesn't fit in a cell 20:44:39 dave0, you don't have to worry, the cpu will detect it and raise a exception all by itself I think 20:45:44 dave0, arm cpus raise exceptions for most things I think 20:46:24 hmm 20:46:32 10 0 / ok. . 0 ok. 20:46:47 heh 20:47:13 gforth catches divide by 0 20:47:37 gforth is a monster 20:47:55 this is a 29kB Forth 20:47:59 20kB 21:05:04 35,37 C 21:05:05 95,78 F gahh, hurry up ausie winter! 21:17:51 --- quit: proteus-dude (Ping timeout: 256 seconds) 22:33:27 --- quit: MrMobius (Read error: Connection reset by peer) 22:50:19 --- join: gravicappa joined #forth 23:20:30 --- join: mtsd joined #forth 23:37:18 --- join: xek joined #forth 23:41:30 --- join: dys joined #forth 23:59:59 --- log: ended forth/20.04.16