<tp> mark4, youre a serious dude, dude :)
<tp> mark4, I'm a old dude also, I think we have spoken before as I just do embedded forth, Im a tech not a systems writer
<tp> veltas, Microchip it the company that makes "PIC" mcus, and PIC's are pretty old now. They also now own AVR which was a breakaway group of Microchip engineers initially I think
<veltas> This is why capital letters help
<veltas> tp: Have you watched Tiger King?
<tp> I think theyre a capital idea old chap
<tp> veltas, no
<veltas> capital
<mark4> :)
<mark4> im a heretic and know it :)
<mark4> tp no actually the AVR was developed by 2 uni sutdents in norwawy
<mark4> oslo?
<mark4> when they got out of uni they started the AVR corporation
<mark4> avr is whats in arduino
<tp> mark4, I agree with everything you have said, tho I did use the PIC in a product I made in the late 90's, just a small run of a custom instrument
<mark4> Microchip has been trying for YEARS to buy tuenm
<mark4> err Atmel not AVR
<mark4> AVR is the chip, Atmel is who made it
<tp> mark4, oh ok, I know about the norway connection ... but I guess I'm confused about the breakaways
<tp> mark4, I know ATMEL all too well sadly
<tp> I hate the dam things
<mark4> which things? avr or microchip?
<mark4> atmel also made 8051s
<tp> AVR, mega16 and 32 mainly
<mark4> i like avrs, way better than PIC
<tp> apart from making a programmer for 8051's Ive never like them much either
<mark4> i wrote a very nice avr assembler too :)
<mark4> 8051 was the first assembler i ever wrote :)
<tp> I had to make 20 Mega32 units a day for about a year, too flakey for me
<mark4> the sources to that assembler are in the x4 repo too but there is a small bug i never fixed
<mark4> i like the 32u4
<tp> thats why Im not a AVR fan
<mark4> dream to code for
<mark4> anything PIC is horrible to develop for
<tp> I'm all stm32 and MSP430 now
<mark4> once you get above 8k of code space, any change in module A will have a random unexplainable affect in module b, so fixing b will affect c... ad infinitum
<tp> oh I agree there
<mark4> msp430 was developed by TI to do power metering
<tp> microchips support always sucked
<tp> I ranted and raved about that for decades
<mark4> lol
<mark4> if you like arm cores you should check out my T4 forth compiler
<mark4> thumb2 asm for linux arm
<tp> Im happy with cortex-m and MSP430 now, I dont need to look any further
<tp> mark4, Im all into Mecrisp-Stellaris Forth for cortex-m and MSP430
<tp> mark4, this is me:https://mecrisp-stellaris-folkdoc.sourceforge.io/index.html
<mark4> cortex-m IS thumb2 :)
<tp> mark4, no, not the variant I use, it's thumb1 only
<tp> cortex-m0 namely
<mark4> ewwww i think thumb1 is a poor design, in fect i think all arm instuction sets are over engineered and badly designed EXCEPT thumb2 lol
<tp> in any event, I'm a tech not a real programmer, which makes me a "USER"
<tp> mark4, software people have opinions like that :)
WickedShell has quit [Remote host closed the connection]
<tp> mark4, I couldnt care less about all that, I just use em to make stuff
<mark4> :)
<tp> mark4, as long as my tools are adequate, Im happy
<mark4> github.com/mark4th has both x4 and t4 compilers of mine
<mark4> i was working on a64 (arm 64) but got too much on my plate right now
<mark4> so im just keeping it simple
<mark4> pick that up later
<tp> yes I know, we have spoken about them before :)
<tp> I'm either a chip hosted Forth user (cortex-m) or a tethered Forth user (msp430)
<tp> if I do any assembly I'll do it with a tethered forth, lol
<mark4> well its a bit hard to fit both the forht kernel and all its headders AND an assembler on a hosted embedded forth lol
<mark4> thats only really viable with a tethered forth
<mark4> all creating words are on the host
<tp> sure, but Mecrisp-Stellaris does have a forth-> machine code compiler on the chip of course
<tp> it just leases out the assembly stage, assemblers are for humans
<tp> I do remember the incredible joy of my first assembler, I was so sick of writing machine code on a hex keypad
WickedShell has joined #forth
<mark4> lol
rdrop-exit has joined #forth
merkc1 has joined #forth
<rdrop-exit> (-_-)zzz c[] good morning Forth connoisseurs
<tp> morning Zen Forth Guru !
<rdrop-exit> hi Forth Master Tech (tm)
<tabemann> hey guys
<rdrop-exit> hi tabemann
merkc1 has quit [Ping timeout: 265 seconds]
<tp> hey tabemann
<tabemann> tp: where's that script of yours which shows how to use screen from within a shell?
<tabemann> I know you sent it to me a while back
<tp> tabemann, I'll pastebin it
<tabemann> because I'm thinking what I could do is make a script to generate a full binary for a given platform
<tabemann> generating one for all platforms is not feasible
<tp> yeah
<tabemann> but now that I have codeload3.py doing them for one platform at a time should be within reach
<tabemann> and far less error-prone than what I had been doing manually
mark4 has quit [Read error: No route to host]
cox has joined #forth
<tp> tabemann, is this the one ? http://dpaste.com/1S7TDV0
<tabemann> that might be it
<tp> tabemann or this one ? http://dpaste.com/1FGXRM4
<tp> tabemann, in either case, both those scripts are auto generated by other scripts :)
<tp> it's scripts all the way down!
<tabemann> heh
boru has quit [Ping timeout: 258 seconds]
<tabemann> stupid question
<tabemann> how do you tell screen to disconnect from the command line
<tp> actually all the questions around here are quite complex
<tabemann> because, let's say, I want to run codeload3.py again
<tp> the only way I know is to quit from screen
<tp> which I have on a hotkey, but I rarely use it
<tp> :quit
<tabemann> lol - just figured that one out a sec ago
<tp> screen is very stubborn Ive found ;-)
<tabemann> question
<tabemann> how the fuck do I create a screen session that is connected to the serial port but not to the terminal emulator?
<tp> easy
<tabemann> and
<tp> sorry just buying some masks on like atm
<tp> online
<tp> tabemann, I only know how to remotely connect to a session first established by a terminal connection
<Zarutian_HTC> tp;
<tp> Zarutian_HTC, :)
<Zarutian_HTC> tp: does cat come anywhere into the picture?
<tp> Zarutian_HTC, which picture ?
<rdrop-exit> cat pictures
<tp> meeow
<Zarutian_HTC> of getting a serial link to work with screen
<tp> Zarutian_HTC, no, no felines are involved there
<Zarutian_HTC> and I meant the command cat not felines
<tp> Zarutian_HTC, thats why screen is cool, it has inbuilt remote serial connection facility
<Zarutian_HTC> you jus give it the path to the serial device or?
<tp> Zarutian_HTC, unlike the japanese copy which has zero serial facilities
<rdrop-exit> just use Forth
<tp> Zarutian_HTC, here I send a command to a serial device screen -p $PROJECT -X stuff "reset\n"
<tp> $PROJECT is the name of the connection
<tp> Zarutian_HTC, here I upload a file to the serial connection, part one, save the file to a screen "register" screen -p $PROJECT -X readreg x myfile.forth
<tp> part 2: 'paste the file to the terminal screen" screen -p $PROJECT -X paste x
<tp> in this case the register is "x" and there are 26 registers, a - z
<Zarutian_HTC> how do you get that screen window/session up and going in the first place?
<tp> Zarutian_HTC, http://dpaste.com/2BM6W55
<tp> Zarutian_HTC, thats for a screen connection, 460800 baud, hardware handshaking etc
<Zarutian_HTC> simple as: screen <pathToSerialDevice> <bpsAndOtherSuchSettings>
<tp> yeah
<tp> in this case the script establishes a session using the directory name
<Zarutian_HTC> and does so in an xterm window
<tp> which means that for me I dont need any special config for that script as my projects are all the same name as the directory name
<tp> yes
<tp> it also provides some info in the top bar of the xterm
<tp> which I need as I may have more than one screen session open
<Zarutian_HTC> hmm handy to know how to do this then
<tp> :)
<tp> it took me about 3 years to get to that point after trying every terminal in existence
<tp> the alternative is to 1) write your own terminal, not for me, I'm a tech
<Zarutian_HTC> what if I need to pipe the output of that connection to another program?
<tp> 2) use unix utils that allow this kind of thing
<tp> you can use tee I imagine
<tp> but screen allows one sub program to be run as well
<tp> and thats the last line of my script
<Zarutian_HTC> ahh, tee it into a fifo, I see
<tp> error-bell.sh
<tp> PROJECT=`basename $PWD`
<tp> screen -p $PROJECT -X exec :sed -nr 's/.*compile-only.*|.*Create.*|.*found.*|.*flow.*|.*balanced.*|.*Redefine.*/\007\033[31;1;4mERR\033[0m/p'
<Zarutian_HTC> dings at you if these error occur I see
<tp> what that does is parse the incoming data to screen and look for error messages
<tp> yeah
<tp> but it also INSERTS a RED "ERR" message into the receive stream
<tp> which I also log
<tp> so when I hear a bell I can either scroll screen data up with the mouse or look in the log
<tp> in the former I'll see the big RED marker
<tp> in the latter I have to search for "ERR"
<tp> now I may be uploading 10kB of Forth source, and at 460800 baud, it's way to fast to see, so I need the bell
<tp> in fact if I didnt have the bell, I'd go back to C
<tp> but I DO have the bell, and C will never see my smiling face again ...
<Zarutian_HTC> myself would have just written an interfacer in tcl/tk giving me the option to stop the upload and also visualize telemetric data if needed
<tp> thats because youre a programmer
<tp> and you know tcl/tk
<tp> and you know how to cook polar bear
<tp> I dont know any of those things
<tp> but all considered, the bell is all I need
<Zarutian_HTC> programmer and electronics tech. I just find it easier to throw such together in tcltk than do bash and other unix utils
<tp> my first method was to hack Mecrisp-Stellaris source and make a error drop CTS, then the upload would freeze on the error
<tp> but maintaining a patch for that is a pain and I found doing it at the PC level was tons easier
<Zarutian_HTC> cook a polar bear? why would i want to do that? the poor creaters are contamination concentrators as they are the apex predator of that food web
<tp> as in coronabear virus ?
<Zarutian_HTC> lame!
<Zarutian_HTC> ;þ
jsoft has joined #forth
<tp> Zarutian_HTC, learning tcl/tk is on my list
<Zarutian_HTC> it is rather friendly, you can try things and the error messages are descriptive
<tp> i have started learning and working thru a tutorial, seems ok and I love the widgets
<tp> I was writing GTK2-Perl before that and had no problem
boru has joined #forth
<tabemann> back
<tabemann> got my build script working, but with the downside that there cannot be any other screen sessions in the system
<tp> how come ?
<tp> I usually have 2 -3 running at the same time
<tabemann> because it doesn't use -p
<tp> ?
<tabemann> well -p tells it which session to use
dave0 has quit [Quit: dave's not here]
<tp> oh yeah <doh>
<tabemann> okay, I'm falling asleep, so g'night
<tp> g'night tabemann
<rdrop-exit> back
<tp> welcome back!
<rdrop-exit> thanks c[]
jsoft has quit [Ping timeout: 256 seconds]
reepca has joined #forth
jsoft has joined #forth
cox has quit [Quit: Leaving]
Keshl has quit [Read error: Connection reset by peer]
Keshl has joined #forth
Keshl has quit [Read error: Connection reset by peer]
Keshl_ has joined #forth
<rdrop-exit> I'm thinking of renaming my shift-or ops, to something more visual, anyone want to give me feedback?
<rdrop-exit> _| ( x1 x2 # -- x2<<#|x1 )
<rdrop-exit> |_ ( x1 x2 # -- x1<<#|x2 )
<rdrop-exit> the reason I want them more visual is I keep forgetting which is which
<rdrop-exit> (the old names are shorx \shorx )
<tp> lshift1 and lshift2 ?
<tp> or a picture of a cat and dog ?
<rdrop-exit> brb phone call
<rdrop-exit> back, the underscore is meant to show me where x2 ends up
<MrMobius> you could go the APL route
merkc1 has joined #forth
rdrop-exit has quit [Ping timeout: 256 seconds]
rdrop-exit has joined #forth
<rdrop-exit> sorry lost my connection, some of my posts got lost:
<rdrop-exit> $ 123 $ 45 8 |_ gives $ 12345
<rdrop-exit> $ 45 $ 123 8 _| gives $ 12345
<rdrop-exit> oops, wife summoning me for lunch
Keshl_ is now known as Keshl
<rdrop-exit> catch you in a bit, stay healthy
rdrop-exit has quit [Client Quit]
Croran has quit [Remote host closed the connection]
dddddd has quit [Ping timeout: 256 seconds]
gravicappa has joined #forth
mtsd has joined #forth
merkc1 has quit [Ping timeout: 258 seconds]
WickedShell has quit [Remote host closed the connection]
xek has joined #forth
mtsd_ has joined #forth
mtsd has quit [Ping timeout: 250 seconds]
reepca has quit [Remote host closed the connection]
reepca has joined #forth
dys has joined #forth
reepca has quit [Read error: Connection reset by peer]
reepca has joined #forth
tp has quit [Read error: Connection reset by peer]
tp__ has joined #forth
tp__ is now known as tp
merkc1 has joined #forth
jsoft has quit [Ping timeout: 256 seconds]
mtsd has joined #forth
mtsd_ has quit [Ping timeout: 265 seconds]
jsoft has joined #forth
proteus-guy has quit [Ping timeout: 265 seconds]
proteus-guy has joined #forth
rdrop-exit has joined #forth
<rdrop-exit> c[]
<mtsd> c[]
<mtsd> Cheers!
<rdrop-exit> cheers mtsd!
<mtsd> Are you alright? In this day and age?
<tp> mtsd, :)
<rdrop-exit> yes, confined but ok, yourself?
<mtsd> Fine here too
<mtsd> Not much in the way of confinement here, but working from home
<tp> mtsd, glad to hear it. As you know there are only 42 Forth users in the world and we cannot afford to lose ONLY ONE!
<mtsd> Exactly. We are needed to restart and rebuild things later :)
<rdrop-exit> 42 sounds a bit high
<tp> yes, hunting for old calculators amid the smoking ruins of our cities, then trying to find power to run "endoftheworldforth" on them
<tp> rdrop-exit, hahah
<mtsd> Minimalism in Forth. Applies to the number of users too :)
<tp> well a world wide sensus was taken and it revealed that in the whole world, only 42 people have the "forth mindset', all the rest are convinced Forth is some 'write only language'
<rdrop-exit> The secret of success is to know something nobody else knows.
<rdrop-exit> -- Aristotle Onassis
<tp> rdrop-exit, I know something you dont know ....
<tp> but I'm not telling!'
<mtsd> Success is imminent then
<tp> heheh
<tp> mtsd, know anyone with the Coronavirus ?
<mtsd> No confirmed cases
<mtsd> But some suspected
<tp> hard to know in most cases
<tp> that darn Tricorder is overdue!
<tp> I mean we have warp engines already and photon torpedoes already right ?
<mtsd> Not many people are tested here, only the ones admitted to hospital, more or less. No mass testing programme
<tp> same here atm
<mtsd> Work is quite calm now. Reading "Starting Forth" again
<rdrop-exit> Cool, which edition?
<mtsd> Let me see..
<rdrop-exit> The 1st edition follows the 79 standard, the 2nd edition follows the 83 standard
<rdrop-exit> then there's a online edition that supposedly follows the ANS standard
<mtsd> Seems to be the first edition then. Forth-79 standard in an appendix. No mention of Forth-83
<rdrop-exit> I have read the ANS one, I assume it has less coverage of internals since the ANS standard is more opaque
<mtsd> I bought a used copy, years ago
<rdrop-exit> * I haven't read the ANS one
<rdrop-exit> the 2nd edition is copyright 1987
<mtsd> Mine is copyright 1981
<rdrop-exit> IIRC some of the main differences between the 79 and 83 standards were the address returned by '
<rdrop-exit> and floored division
<tp> I bought a usd copy in 2014 also
<tp> used
<mtsd> I was 6 years old in 1981. The book waited for me :)
<rdrop-exit> I recommend the 87 edition over the 81
<mtsd> Would be interesting to read that one too
<rdrop-exit> it has footnotes on the differences between Forths
<tp> how about the free online edition ?
<tp> I never read the book now, frankly I never liked it much anyway
<rdrop-exit> there are a few different free online editions, one of them is an "update" of the book to reflect ANS
<tp> I the guy who buys "unix for the impatient" because I've read the 'unix for dummies' in a day and Im bored
<rdrop-exit> The problem with Forth books is that they mostly assume indirect treaded code
<rdrop-exit> * threaded
<tp> I dont need two headed "swap dragons" to enjoy learning Forth
<rdrop-exit> To me the best Forth book is Thinking Forth
<tp> rdrop-exit, agree, I do love that book
<rdrop-exit> There were a couple of other Forth Tutorial books that were popular
<mtsd> I have Thinking Forth too. Like it very much
<tp> incidentally did you know there is a a German 'Swap Dragon' statue and it's loaned to a outstanding Forth person every year ?
<tp> the author of Mecrisp-Stellaris has it at the moment
<rdrop-exit> Forth: A Text and Reference by Kelly & Spies might be more to your liking
<mtsd> haha, did not know that. The swap dragons!
<tp> Search Results
<tp> Featured snippet from the web
<tp> The Swap Dragon Award. Every year the Forth Society e.V. honours an outstanding personality for his/her Forth activities. Started in 1986 as a plastic toy trophy, the SWAP-Dragon has been reborn in 1997 as a beautiful bronze sculpture.May 12, 2017
<rdrop-exit> It has more depth than Starting Forth
<rdrop-exit> cool
<tp> yeah, thinking Forth is awesome Ive read it twice so far
<mtsd> I'll look for the book, thanks rdrop-exit
<tp> I pick up things each time
<rdrop-exit> cool!
<tp> due to the Coronavirus, this is how we will all be celebrating birthdays in future
<rdrop-exit> It always surprises me how even experienced Forthers do the opposite of what is discussed in the "Tips" sections of Thinking Forth
<tp> forthers are the most obdurate, stubborn, clear thinking people Ive ever known
<rdrop-exit> "Generality usually involves complexity. Don't generalize your solution any more than will be required; instead, keep it changeable" -- excerpt from Thinking Forth
<rdrop-exit> "Factor at the point comments seem necessary" -- Thinking Forth
<tp> written by someone who has NEVER used cortex-m
<rdrop-exit> "Be sure you can name what you factor" -- Thinking Forth
<tp> one has to remember when TF was written, things were simpler then, the Z80 manual was only 1" thick
<rdrop-exit> "Within each component, implement only the commands needed for the current iteration. (But don't preclude further additions)."
<rdrop-exit> -- TF
<rdrop-exit> "Don't decide, calculate." -- TF
<mtsd> Some good lessons there. Things have moved far away from simplicity, in so many ways
<rdrop-exit> "You don't understand a problem until you can simplify it." -- TF
<rdrop-exit> mtsd, true, that's why I value Forth more than ever as a secret weapon
<rdrop-exit> The more complexity, the more Forth's philosophy of Total Interactive Control helps cut through that complexity
<mtsd> Almost the only thing you have a chance of understanding, from top to bottom
<mtsd> Most others languages, frameworks etc turn into black boxes. Big and complex
<rdrop-exit> Not only that, Forth helps you to grok whatever you're interfacing with
<tp> rdrop-exit, absolutely !
<tp> mtsd, so true
<tp> I like that there is no complexity a Forth user cannot tackle
<tp> because we break a massively complex task down into many simple pieces
<mtsd> And we understand our tool completely. The energy and focus can be directed at the problem instead
<rdrop-exit> I will repeat what I said earlier on the topic:
<rdrop-exit> A product or component involves a set of "given" or "fixed" technologies (hardware, devices, protocols, specs, layers, interfaces, etc...), that are externally specified by standards or the market.
<tp> thats really relevant
<rdrop-exit> I see a Forth's role as providing unfettered interactive control of these "fixed" aspects, bottom to top, so you can build up a specific solution with minimal fuss or bloat. In effect a Forth rolls the typical remaining layers and tools (device drivers, debug monitor, OS, shell, assembler, compiler, interpreter, etc...) into a single very tightly-wound no-frills minimalistic platform/framework.
<mtsd> A simple tool can be trusted, completely
<rdrop-exit> Forth is the one aspect of the product that needn't conform to an external specification or standard, which is what allows it to remain small, nimble, and totally customizable. I don't really see Forth as a language, but as accumulated lore on the design and implementation of such (real or virtual) stack machines, and the programming of solutions on/with them.
<merkc1> what does this mean? "Within each component, implement only the commands needed for the current iteration. (But don't preclude further additions)." any example?
<rdrop-exit> It means don't get ahead of yourself
<rdrop-exit> Don't try to over-anticipate
<merkc1> just make the simple version of the component ?
<merkc1> ok
<tp> Forth is about factoring the problem unlike C which is usually about learning all the C rules
<rdrop-exit> Many of the ideas that were later esposed by extreme programming and similar fads were first expressed by Chuck 20 years earlier
<rdrop-exit> * espoused
<tp> and as rdrop-exit says, "forth tells you if your design is FOOBAR"
<tp> although it may take a while to learn the signs
<rdrop-exit> The funny thing is people today start out with bloated implementations, and consider simplification to be optimization
<tp> lol, if your code is full of pick and dups, Forth is telling you to start all over
<tp> i had to learn that and rdrop-exit galvanised the concept in what passes for my mind
<tp> I remember spending a late night-early morning writing Forth code, and it just wouldnt work well
<mtsd> So far, Forth has been fun to learn. Challenging, but fun
<rdrop-exit> Thou shall never PICK or ROLL
<rdrop-exit> I'm paraphrasing Chuck
<tp> i webt to bed, woke up had a look at the code and it was full of pics and dups! it was FUGLY, so I deleted the lot and in a hour has beautiful code running bug free
<rdrop-exit> kudos tp!
<tp> mtsd, how long now for you with Forth ?
<tp> rdrop-exit, Ive learned to be ready to wipe everything and start again with forth, in fact I already know that it takes me three attempts to get anything to the standard I approve, be it a Forth program, a pcb design, a hardware enclosure
<tp> I see the first two attempts as the 'learning about the problem' part now
<rdrop-exit> Exactly, Forth forces you to really grok the problem
<mtsd> tp, I have been messing about with Forth for around 3 years, maybe?
<rdrop-exit> You can't get away with superciality with Forth
<rdrop-exit> * superficiality
<mtsd> Not very long, I know. But I like it a lot
<mtsd> Has been more fun to learn than any other language I have tried
<tp> mtsd, what ??? you havent read "SAM's, LEARN FORTH IN 24 HRS" ?
<mtsd> Wow.. have I missed that? Shit... I have spent 3 years when I could have gotten away with 24 Hrs..
<rdrop-exit> While most languages seem to be geared to enbling superficiality
<tp> '-)
<tp> yeah
<rdrop-exit> * enabling
<tp> mtsd, Ive been at Forth almost every day for 6 years myself
<mtsd> Still fun, I assume?
<rdrop-exit> Making bad programmers productive is a step backwards
<rdrop-exit> in quality
<mtsd> rdrop-exit, that is an important point, I think
<tp> mtsd, and rdrop-exit started learning Forth from Da Vinci, back in 1515
<rdrop-exit> :))
<merkc1> :D
<mtsd> Most frameworks and tools in use seem to allow people to outrun their own capabilities
<tp> mtsd, understatement of the century
<rdrop-exit> exactly, no deep thought required
<merkc1> and that is very dangerous
<mtsd> You import something, follow the tutorial and have things to show in no time.
<rdrop-exit> dinner time, stay healthy my friends
<tp> no problemo
rdrop-exit has quit [Quit: Lost terminal]
<mtsd> Then, one day, problems strike. And you have no idea how this thing you put together works. Even less how to solve the problem
<tp> mtsd, I follow some electronics forums for entertainment and I have to say, I dont grok that world
<tp> mtsd, agreed, and this is not a new problem
<mtsd> So there you are. Googling desperately, looking frantically at StackOverflow, trying to find a way out
<tp> mtsd, remember "visual basic" of 25 years ago ?
<mtsd> yes. vividly
<mtsd> ;)
<tp> people loved it, many groups made large projects quickly and easily only to stumble onto a bug they couldnt find or fix, which killed the project
<tp> only needs ONE bug to foobar a project
<mtsd> Delphi fell into similar problems
<tp> then along came the "visual basic" of electronics, Arduino
<tp> mtsd, ahh of course
<mtsd> I once maintained a big Delphi application. Old code, messy beyond belief
<tp> up until arduino, embedded ws considered too hard
<tp> for novices
<tp> eww
<mtsd> In the long run, I think the 'harder' tools are more honest. They don't let you move further along than you are capable of, at any given time
<tp> mainly as to get a raw MCU up and running one had to understand all the hardware, or at least, most of it
<mtsd> And some things are simply hard, at first
<tp> I love this saying
<tp> "easy start, hard finish or hard start, easy finish"
<mtsd> so true
<mtsd> And when you start hard and notice it gets easier, you know you have learned something. Evolved.
<tp> tho sometimes Ive experienced hard start and hard finish, but NEVER easy start and easy finish, which is what all the modern crap promises
<mtsd> You can feel proud over that
<tp> and you should, for you have grown, you can do more
<mtsd> That is the real achievement
<tp> yes
<tp> something that cant be lost
<tp> tho I once went 3 weeks without any Forth and I began to feel I was losing something, it felt great to get back into it again
<mtsd> Seems like things are not allowed to be hard these days. Everything should be easy. Is supposed to be "including", or something
<tp> I agree
<tp> my pet hate is the 'time' argument
<tp> someone may say, "how can I use the systick on stm32" and I say read the specs and the application note, and they reply "I dont have the time"
<tp> or someone may say, I just made my first blinky and when asked how long, the reply of "a week" is met with derisive snorts of "why so long?"
<tp> "I had my first blinky going in 3o seconds on Arduino" another will answer
dddddd has joined #forth
<mtsd> That is annoying..
<mtsd> The point is not to get the blinky going in 30 secs, or whatever..
<mtsd> The point is learning how it works
<tp> to you and I perhaps
<mtsd> Yes, true. Forth people..
<tp> but the time metric seems very common thesedays for young people
<tp> even when they have planty of time
<tp> plenty
<tp> the time they save will be spent watching tv or some useless waste of time I fear
<tp> I'm watching a thread about " non blocking stepper motor driver" atm
<mtsd> I have always wondered about the "saving time" argument
<tp> it's been hilarious especially as the OP was using a arduino driving a stepper driver board that only required a step and directions signal
<tp> me too
<mtsd> You can only spend time. More or less time, yes.
<mtsd> But you can not save time now and the pick it out later, should you need to
<mtsd> It's more about spending different amounts of time and plan your day
<tp> yes
<tp> and when it comes to skill, time is irrelevant imho
<tp> you either acquire a skill, or you dont
<tp> schools probablly dont help with their time limited tests
<mtsd> Probably not
<tp> I guess schools arent very good places to learn anyway
<mtsd> My oldest son is in the first school year
<tp> wow
<tp> thats not going to be easy on dad I guess ?
<mtsd> No, it is difficult
<mtsd> Trying my best to support him, give him help at home.
<mtsd> Too few teachers and not very peaceful all the times at school
<tp> my eldest child is 43
<mtsd> Wow, about my age then. I turn 45 later this year
* tp shudders
<tp> I hated school from the first day
<mtsd> I did not do very well either
<tp> I wondered why I was being punished by being sent to the hell hole
<tp> definitely a bad fit for me
<tp> but in those days a kid went to school and learned to survive it
<mtsd> The key word is "survive". Was for me, at least
<tp> lol, I dont ever remember doing any homework, when a teacher asked where was it, I just shrugged, didnt care
<tp> I could see it wasnt important, I could see they knew it wasnt important, that the doing and not the result was what they wanted, and I refused to pay that game
<tp> so I never did any, the world didnt end, and no one really cared anyway
<tp> instead I followed my obsession with electronics until I was set free of school
<tp> mtsd, yet these days kids love school ?
<tp> or rather my kids did
<tp> well most of them
<tp> my eldest son didnt like it much either, hes very practical and can make anything
<mtsd> My son likes it better now, it was harder for him at first
<mtsd> Getting better
<tp> ah well, he must suffer it either way
<tp> i think of school as day care
<tp> I guess when students vs teachers exceeded 2:1, schools became day care
<mtsd> I look forward to when they are going to start learning computers.
<mtsd> Kids are supposed to learn programming. I'll help him hand in assignments in Forth or Lisp, and see what the teacher makes of it :)
<tp> hahahha
<tp> they will come home and tell you theyre learning programming and it's called microsoft excel
<mtsd> I went to a parent-teacher meeting once where the maths teacher spent the entire evening promoting his youtube channel
<mtsd> High quality tutoring...
<tp> I see you and I are on the same page
<mtsd> Poor kids.
<tp> yeah, luckily they have you
<tp> I taught mine may things, mostly practical
<tp> many
<mtsd> Thanks, I try my best
<tp> all that matters in the end if the quality of the parents
<tp> if = is
<mtsd> I am glad I am not young these days. It was hard enough when I grew up, before there was social media, smartphones and such things
<tp> a lucky child gets a wise parent
<tp> I cant imagine it myself
<tp> tho you know we'd have adapted
<mtsd> Humans do adapt to almost anything, over time
<tp> we do
<tp> if we had to work everyday in a metal cage taking batteries apart and were never let out, I'd be "hey mtsd hows it going dude"
<tp> and youd be 'good, got a curious battery here'
TCZ has joined #forth
<mtsd> haha, yes, most likely
<tp> :)
<mtsd> Well, time to go and get son from school :)
<mtsd> Have a nice day/ evening/ night, everyone!
mtsd has quit [Quit: Leaving]
TCZ has quit [Quit: Leaving]
<merkc1> How to define a word patch:
<merkc1> patch: 03 00 00 00 05 :patch
<merkc1> ?
<merkc1> 03 C, 00 C, 00 C, 05 C,
<merkc1> that does this:
TCZ has joined #forth
<merkc1> BL WORD 5 \ now how to execute the parsed 5 ?
<merkc1> \ so that it puts 5 on the stack ?
<merkc1> COUNT EVALUATE , is one way.. any better way?
<DKordic> IMHO the best answer to such questions is to study and refactor your favourite Forth implementation.
<merkc1> yes, I am reading jonesforth and other forths
<DKordic> Excellent.
<DKordic> Is ""patch:"" an implementation of Array?
<DKordic> Take a look at ' ," .
iyzsong has quit [Quit: ZNC 1.7.1 - https://znc.in]
<DKordic> merkc1: patch: Var @ :patch
<merkc1> patch: would need to individually parse each hex bye (they are separated by spaces ) until ;patch http://galileo.phys.virginia.edu/classes/551.jvn.fall01/primer.htm I'll try a variation of CASE: from this tutorial
<merkc1> : PATCH: \ patches all bytes till ;PATCH
<merkc1> HEX BEGIN BL WORD FIND \ .S CR
<merkc1> ELSE ['] ;PATCH = THEN
<merkc1> 0= IF COUNT EVALUATE C, 0
<merkc1> UNTIL DECIMAL ;
<merkc1>
<merkc1> : ;PATCH] ; \ do-nothing word
<merkc1> : [PATCH: \ patches all bytes till ;PATCH
<merkc1> HEX BEGIN BL WORD FIND \ .S CR
<merkc1> 0= IF COUNT EVALUATE POSTPONE C, 0
<merkc1> ELSE ['] ;PATCH] = THEN
<merkc1> UNTIL DECIMAL ; IMMEDIATE
<merkc1> is there a way to make PATCH: smart enough to work both in interpretation and compilation modes ? or I need a separate version [PATCH: for compilation mode
TCZ has quit [Quit: Leaving]
kmstout has joined #forth
kmstout has left #forth [#forth]
kmstout has joined #forth
<DKordic> IMHO ""mode flag"" is a terrible idea.
<DKordic> Your exercise is also a terrible idea, except if it is an exercise in a bad idea :) . It's so terrible it's like ""ANS Forth"".
<DKordic> For example ""swap"" is only slightly less local variable than local variables of ""swap"".
Zarutian_HTC has quit [Ping timeout: 256 seconds]
TCZ has joined #forth
X-Scale has quit [Ping timeout: 265 seconds]
[X-Scale] has joined #forth
[X-Scale] is now known as X-Scale
<merkc1> DKordic so what's a not so terrible solution to the problem of compiling a HEX string
jsoft has quit [Ping timeout: 258 seconds]
TCZ has quit [Quit: Leaving]
<veltas> tp: I got really annoyed by the pictures in Learn You a Haskell but I did stick with it and it was good
<veltas> I did use Starting FORTH as a jump start and enjoyed it, as a historical piece, and I know I would have found it as patronisingly annoying if I read it back in the day
reepca has quit [Read error: Connection reset by peer]
<DKordic> merkc1: Parse the ""hex string"" into bytes. gforth has "" s\" \x1F\x2F" dump "".
reepca has joined #forth
<veltas> That's Forth 2012 (and maybe older standard has it as well?)
<merkc1> DKordic , how to parse it without having to manually add \x before each byte
<merkc1> from a hexeditor when you copy the hex string it's without \x
<DKordic> Loop over the ""string"" digit by digit. Assuming ASCII encoding, digit can be parsed with a few bit-wise operations.
dys has quit [Ping timeout: 246 seconds]
benjamin-l has joined #forth
Zarutian_HTC has joined #forth
<merkc1> DKordic: ok, sounds nice;
<merkc1> please guide me, which word should I check out to learn how to do looping over the string , digit by digit
<veltas> merkc1: Is this something like what you want? https://ideone.com/wPrJGp
<veltas> Sorry lads had to stretch my Forth muscles, I write very little actual forth, even when doing my forth
<merkc1> veltas: yes
<veltas> I don't know *what* the fuck ideone did to syntax highlighting there but try reading in a good editor I guess
<merkc1> DKordic & veltas: thank you for the insights
<veltas> Someone please tell me if there is a nicer way of writing that https://ideone.com/wPrJGp
<veltas> I mean in conventional Forth
<veltas> Or any style/comment tips appreciated too
<merkc1> to make it work in compilation mode I'd have to define another IMMEDIATE version of it, with POSTPONE before C, , right?
<veltas> merkc1: Just realised my code was broken, 2DROP 2DROP instead of 2DROP DROP was needed
<merkc1> ok
<veltas> Yes merkc1
<merkc1> for some reason the IMMEDIATE version doesn't work https://ideone.com/wmPCEL
WickedShell has joined #forth
tangentstorm has joined #forth
kmstout has quit [Quit: leaving]
dys has joined #forth
<veltas> merkc1: You're putting the parsed number onto the stack, and then leaving it there, as far as I can tell
<veltas> And then doing a POSTPONE C,
<veltas> merkc1: Try LITERAL
<veltas> Also ideone will generate output for you don't copy it in :S
xek has quit [Ping timeout: 250 seconds]
cantstanya has quit [Remote host closed the connection]
<merkc1> tried LITERAL after D>S , still not working
<veltas> Why do you think that might be?
cantstanya has joined #forth
<merkc1> Exception #-2005 at: tm.f:30:7:
<merkc1> ^ -2005 REPEAT without BEGIN
<merkc1> REPEAT
reepca has quit [Ping timeout: 264 seconds]
<merkc1> veltas: I don't know
<veltas> Show me your code
<veltas> I'm assuming you have a corresponding BEGIN ?
dave0 has joined #forth
<merkc1> ok
<merkc1> this is the code https://ideone.com/tcwZ5x
<merkc1> iHEX doesn't work, even with LITERAL
<merkc1> prog.4th:29: expected dest
<merkc1> >>>REPEAT<<<
* veltas is thinking
<merkc1> :)
<veltas> LITERAL takes a parameter from the stack at compile-time, you don't have the number until runtime
<veltas> So LITERAL is not what you want on its own
<veltas> When I say 'runtime' I am talking about compile-time ... of the def that iHEX,{ is used in, but that is the *runtime* of iHEX,{
<merkc1> but iHEX is immediate
<merkc1> oh
<veltas> So what you want ... dare I say, is POSTPONE LITERAL ?
<merkc1> tried that too
<veltas> Not sure let me think about it (or try it)
<merkc1> what's interesting, is that this code works :
<merkc1> : ;PATCH] ; \ do-nothing word
<merkc1> HEX BEGIN BL WORD FIND \ .S CR
<merkc1> : [PATCH: \ patches all bytes till ;PATCH]
<merkc1> UNTIL DECIMAL ; IMMEDIATE
<merkc1> ELSE ['] ;PATCH] = THEN
<merkc1> 0= IF COUNT EVALUATE POSTPONE C, 0
<merkc1> so I would expert IHEX to work as well but for some reason it doesn't
<veltas> merkc1: What error do you get with POSTPONE on LITERAL?
<merkc1> stack underflow
<veltas> Well that's a different error at least
<veltas> This is, by the way, a very bloated approach
<veltas> merkc1: Can I see that code?
<veltas> Forth is not a trivial language is it?
<merkc1> :)
<veltas> iHEX,{ is trying to build a sequence like 10 C, 0 C, 0 C, ... etc into the defs where you use it
<veltas> But with HEX,{ all that is left when all is said and done is the array
<veltas> I feel like the proper iHEX,{ would at least bake the array in leave behind the runtime semantics to C, that array
<merkc1> looks like on gforth it runs fine? https://ideone.com/FwGvuK
<veltas> There is probably still an issue
<veltas> gforth lets you get away with some state-sensitive shenadigans
<veltas> Let's try and fix this
<veltas> merkc1: Does that look right to you?
<merkc1> yes
<merkc1> it put those 3 0 0 0 5 0 0 0 bytes in 'w'
<veltas> I must admit I don't understand your test
<merkc1> I just dump 10 bytes
<merkc1> I only injected 8
<merkc1> we can just ignore the last 2
<merkc1> from the dump output
<veltas> merkc1: But that's before you use iHEX,{ ?
<merkc1> mypatcher uses it
<merkc1> on spf-forth I get this :
<merkc1> PTION! CODE:C0000005 ADDRESS:00566828 WORD: EXC:-1073741819 <?WordByAddr exce
<merkc1> ption>
<merkc1> RETURN STACK:
<merkc1> STACK: (5) 7FFD4000 75ABEF6C 00366774 00000001 00366774 00000001 [45524548]
<merkc1> USER DATA: 003607D4 THREAD ID: 00001BC8 HANDLER: 0012EEFC
<veltas> DUMP is used before mypatcher
<merkc1> 0012EED4 : 0056695F EXC:-1073741819
<merkc1> 0012EED8 : 00566991 EXC:-1073741819
<merkc1> 0012EEDC : 00566A72 EXC:-1073741819
<merkc1> 0012EEE0 : 80000001 EXC:-1073741819
<merkc1> 0012EEE4 : 7FC9DA41 EXC:-1073741819
<merkc1> 0012EEE8 : 00566AC0 EXC:-1073741819
<merkc1> 0012EEEC : 00567C26 EXC:-1073741819
<merkc1> 0012EEF0 : 00567CE2 EXC:-1073741819
<merkc1> 0012EEF4 : 00568371 EXC:-1073741819
<merkc1> 0012EEF8 : 0055516C EXC:-1073741819
<merkc1> 0012EEFC : 0012EF3C EXC:-1073741819
<merkc1> 0012EF00 : 0012FF88 EXC:-1073741819
<merkc1> 0012EF04 : 0056819B EXC:-1073741819
<merkc1> 0012EF08 : 00366774 EXC:-1073741819
<merkc1> 0012EF0C : 00000006 EXC:-1073741819
<merkc1> 0012EF10 : 00000000 EXC:-1073741819
<merkc1> 0012EF14 : 00000005 EXC:-1073741819
<merkc1> 0012EF18 : 001D1F55 EXC:-1073741819
<merkc1> 0012EF1C : 00000005 EXC:-1073741819
<merkc1> 0012EF20 : FFFFFFFF EXC:-1073741819
<merkc1> 0012EF24 : 00000000 EXC:-1073741819
<merkc1> 0012EF28 : 005681EF EXC:-1073741819
<merkc1> 0012EF2C : 005683AF EXC:-1073741819
<merkc1> 0012EF30 : 0000001C EXC:-1073741819
<merkc1> [...]
<merkc1> 0012EF68 : 0012FF80 EXC:-1073741819
<merkc1> 0012EF6C : 00567A79 EXC:-1073741819
<merkc1> the first DUMP is to text HEX,
<merkc1> *to test
<merkc1> then we have .TEST2 which tests mypatcher
<merkc1> (dumps 'w' )
<veltas> merkc1: At a glance it looks like that would overwrite other dictionary entries
<veltas> Maybe ALLOC some space after w?
<merkc1> I simplified the code https://ideone.com/5YkgBO
<merkc1> ok
<veltas> Do you see why?
<merkc1> it works now
<merkc1> after ALLOTing
<veltas> Yes sorry ALLOT
<merkc1> it patches itself
<merkc1> right?
<veltas> Do you understand why you need to ALLOT ?
<merkc1> mypatcher patches itself otherwise
<veltas> I'm not sure what you're trying to say but mypatcher seems to assume that there is 8 bytes of writeable space at w
<merkc1> yeah
<merkc1> and if happens that mypatcher is defined right after w
<veltas> So it would need to be at least 8 bytes ALLOTed to be portable (and avoid potential crashes)
<merkc1> *it happens
<merkc1> so without ALLOTing, mypather will replace bytes in mypather itself
<merkc1> does that make sense?
<merkc1> :) :)
<merkc1> thanks for the help!
<veltas> You're welcome
<veltas> I think a more idiomatic test might be to just bake iHEX,{ into a word and then use that word after a CREATE
<veltas> But please tell me you're not going to put a large number of bytes into a iHEX,{ as it is now?
<veltas> Because as I said before it will unroll that into a massive colon definition, maybe it's the 48K programmer in me but it seems bad :)
<merkc1> yes it's bad
<merkc1> right now I don't put a large number
<merkc1> but it would be good to have an optimized version
<merkc1> can it be optimized??
gravicappa has quit [Ping timeout: 258 seconds]
<veltas> merkc1: Absolutely
<veltas> Not sure how in standard forth though
<veltas> merkc1: Find your implementation's S" and see what it does in compile state because that will probably bake the string itself into the definition, rather than something else
<veltas> So that might help you see how to do it on your forth
<merkc1> ok!
<veltas> I'm looking for an x86-32 forth with some similarity to the standard, actively developed
merkc1 has quit [Ping timeout: 258 seconds]
<tangentstorm> sadly http://git.savannah.gnu.org/cgit/gforth.git/log/ had its last commit 9 hours ago... basically abandonware. :(
<crc> how frequently updated is really needed?
<tangentstorm> oh hey, crc. sorry, i was being dramatic and silly. :D