<veltas>
Is how long a 32-bit counter takes to overflow at 50Hz
<veltas>
tp: "COVID-19" is "VOID-C19" rearranged; they're trying to tell us something
rdrop-exit has joined #forth
<Zarutian_HTC>
veltas: that C version 19 is crap?
<Zarutian_HTC>
btw, why are people still using Windows '10? Shouldnt they have upgraded to the 2020 version already instead of clutching onto the 2010 version?
<Zarutian_HTC>
tp: well I have come across break out boards that are basically dip socket compatible. Quite handy.
<Zarutian_HTC>
for security related stuff use a proper hardened secure element. And if the .hex or .srec file isnt available then when the chip fails it will be hard to replace
<Zarutian_HTC>
s/chip/MCU/
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
iyzsong has joined #forth
<Zarutian_HTC>
tp: I have a similar attitude as that chinese engineer with one exception, dont use the sane maker logo or brand as the original manifacturer
<Zarutian_HTC>
and please note that ALL FTDI chips are fake regradless if from original manifacturer or copycat
<Zarutian_HTC>
tp: if you are paying 4.525 USD for STM32F103RBT6 in a lot of 100 then somebody is ripping you off. I would expect 2.5 USD max in that size of a lot.
dave0 has quit [Quit: dave's not here]
<Zarutian_HTC>
tp: but this rant page of yours is pretty entertaining
<tabemann>
back
<tp>
Zarutian_HTC, wow, glad you like it, just place for me to vent about some things that bug me :)
<Zarutian_HTC>
regarding C code, note that C started out as a crappy replacement of pdp11 assembler
<tp>
yeah, Ive been told that
<Zarutian_HTC>
though I do often look at arduino language (purpoted to be c++ code but no c++ ever is) code examples for inspiration
<tp>
what kind of inspiration ?
<tp>
hardware projects ?
<Zarutian_HTC>
for projects
<tp>
I have looked at plenty of it as well, always when trying to get a STM32 peripheral I'm not familiar with to work, but it's very frustrating for a number of reasons
<Zarutian_HTC>
what kind of peripheral?
<tp>
I have noticed that most of them are copies of copies complete with the same spelling mistakes
<Zarutian_HTC>
ah, the dreaded copypasta
<tabemann>
wait - I thoguht arduino is plain C
<tabemann>
*thought
<Zarutian_HTC>
what does the datasheet say?
<tp>
yeah, it abounds with arduino
<Zarutian_HTC>
nope arduino is some sort of restricted c++ afaict
<Zarutian_HTC>
deserves its own language tag on help sites
<tp>
Zarutian_HTC, a good example is not a STM32 peripheral (as arduino tried to wrap around STM32 fairly recently in geological time), but a external temperature sensor, the Ti LMT01
<tp>
for this device, there is no Arduino libraries and only two projects I could google, both in C naturally
<Zarutian_HTC>
havent heard of it but knowing Ti it might be 1wire basef
<Zarutian_HTC>
based*
<tp>
this is it: 29,56 C
<tp>
85,09 F
<Zarutian_HTC>
that is, how do you interface to it
<tp>
Ti released a datasheet for it and both the C projects are carbon copies of that reference, but they suck badly, why ?
<tp>
the LMT01 outputs a burst of pulses which represent the temperature, abd you count them
<Zarutian_HTC>
because the c code was thrown together to tick a box
<tp>
it's not any protocol
<Zarutian_HTC>
how many pulses? at what interval?
<tp>
the high and low of the pulses are a constant currents
<Zarutian_HTC>
so, it is like pulse dialing by a rotary phone but with more digits in than just 0-9?
<Zarutian_HTC>
i would call that a protocol even it is a crude one
<tp>
it's actually really easy to use and very accurate from the factory
<tp>
i dont think it's complicated enough to be called a protocol, but Im a simple tech :)
<tp>
the funny think is that both online projects used the ti ref example which is one sensor running continuously
<Zarutian_HTC>
well i be damned 200 degrees C operating range
<tp>
the Forth guy (me) made his so that it can use any practical number of sensors and just poll them as required
<tp>
as we know in the real world, temperature changes very slowly and we like our micros to do other things than be stuck reading them all the time
<Zarutian_HTC>
hmm, nice. Means that one could festoon a machine with these to keep track of temp on various points
<tp>
plus the two wire constant current system makes them really easy to use over short distances
<tp>
absolutely!
<Zarutian_HTC>
relatively slowly in relation to speed of an mcu
<tp>
a planned proj is a wet and dry bulb humidity sensor, a real one
<tp>
the main one is a proper battery charge meter
<tp>
the LMT01 is pretty cheap
<Zarutian_HTC>
you see, I have some interest in robotics and am on the opinion that numerous sensor are better than few
<tp>
I noted that there are zero arduino libraries for it, and they all use the accursed Dallas chip
<Zarutian_HTC>
it seem that people alway assume that the robot can move in exactly the same way every time
<tp>
Zarutian_HTC, well you're exceedingly practical in my opinion!
<Zarutian_HTC>
right dallas is the one with 1wire
<Zarutian_HTC>
naah, just have some experience with a pick and place nachine and mechatronics
<tp>
that bloody DS18B is ancient and very hard to drive, why do they use it at all ? I think because someone spent a lot of time writing a Arduino 'library' for it, probably Dallas as they had a million of them in stock and no one was buying them ;-)
<Zarutian_HTC>
however I am curious about soft robotics
<tp>
lol even the name is a joke, it's a 3 wire device!
<Zarutian_HTC>
oh? I thought the used gnd and data/power for total of two wires to the device
<tp>
Zarutian_HTC, I used to fix small manufacturers problems with P&P machines, you have to be very practical to do that
<tp>
well they need power and ground, and the 'one wire'
<tp>
being I2C
<Zarutian_HTC>
running an p&p as part of a small manifacturing line does that too
<tp>
exactly
<Zarutian_HTC>
oh, 1wire is not i2c. That is two wire when they are cheap and dont want to pay philips the i2c logo fee
<tp>
one manuf called me when their line on one machine was down to 5 units a hour with tons of rework (I cant remember exactly) but I increased the production by 50x, something like that
<tabemann>
aagh
<tabemann>
I need to do another release
<tabemann>
I just found that 2CONSTANT was broken
<tp>
Zarutian_HTC, oh, I2C like then ?
<tp>
tabemann, was it a constant error ?
<Zarutian_HTC>
on soft robotics: there two ways to make such, fluidic (air or hydraulics) or the cap soypacket method
<Zarutian_HTC>
tp: search for dallas iButton
<tp>
Zarutian_HTC, I remember I had to recalibrate the laser home position, replace many of the springs in the feeders
<Zarutian_HTC>
oh, these damn feeders!
<tp>
Zarutian_HTC, no thanks, I spent many hours trying to get a DS18b to work before I switched to the LMT01
<tabemann>
tp: 2CONSTANT constants were only returning one value
<Zarutian_HTC>
mechanically or electronically actuated?
<tp>
yeah, the operators had no clue the streched springs were so weak the feeters were taking 50x longer to feed the parts
<tp>
tabemann, so they were very constant ?
<tp>
Zarutian_HTC, pure mechanical
<tp>
it was a Yamaha mounter, the kind that would take your head off if the carriage hit it
<Zarutian_HTC>
tp: yeah, I recall doing the pluck springs test on feeders regularly
<tabemann>
tp: they were one cell rather than two cell
<Zarutian_HTC>
tp: pluck a spring to see if it sounded right
<tp>
tabemann, a easy bug!
<tp>
Zarutian_HTC, Id feel them by hand and just replace if in doubt
dddddd has quit [Ping timeout: 265 seconds]
<tp>
the before and after was spectacular as the machine had probably never been maintained
<tp>
they just worked it to death
<Zarutian_HTC>
wait what? nobody followed the mantenance schedule give by the manifacturer?
<tp>
Zarutian_HTC, when I ran a SMT plant we had 3 SMT p&P, a die bonder and a wire bonder, a massive solder flow line ugghh, and a nice IR reflow line anongst many other machines, I had to solve any and all technical issues. 80 production staff, 9 engineers and me
<tp>
Zarutian_HTC, this is australia where lots just run stuff into the ground
jsoft has joined #forth
<Zarutian_HTC>
tp: explains things
<tp>
Zarutian_HTC, one of those machines was a Amistar P&P with a awesome rotary head, 17500 parts a hour
<tp>
lol, it has a Z8000 and CP/M
<tp>
now there is a Forth challenge, ditch the old lame Z80's and get a Z8000!
<tp>
that Amistar was a legend, never broke down, I didnt have to do anything to it in the 12 months I was there
<tp>
but a lot of my large stock of old SMT parts came from that machine as they bounced of the platters and landed on the floor which I swept every day and kept :)
<Zarutian_HTC>
I never understood the mentality of some managers. Heck I once met a tech who physically handcuffed a elbow joggling manager to his desk to be able to get work done
<tp>
hahahahahah
<tp>
I came onto a production floor once to find my Q&A guy rolling on the floor with a team leader, fighting over a batch delivery
<Zarutian_HTC>
that manager was fired by his immediate boss because he was basically a workshop hazard
<tp>
yiu really cant get more commited people than that!
<tp>
we techs are like that, dont *uck with us
Sweedish has joined #forth
<Zarutian_HTC>
what was the fight about? batch not passing q&a?
Sweedish has quit [Client Quit]
<tp>
yeah
<tp>
exactly
<tp>
I was very impressed but broke it up of course
<Zarutian_HTC>
and what did this team leader want? pass the batch?
<tp>
we had a breakdown one day in the main area, 80 production people were idle while I was fixing the Dynapert P&P
<tp>
Im not sure exacty, but Q&A and a production team leader have the opposite aims
<tp>
the machine would stop about the same place every time and I was perplexed for a while
<Zarutian_HTC>
what did those 80 usually do? beside the q&a folks?
<tp>
assembly
<Zarutian_HTC>
aah, i see
<tp>
that line was inherited and the product was a nightmare
<tp>
the client always pushing for more units a day
<tp>
it had run for years
<Zarutian_HTC>
units of what? what kind of product? I think you told me a while back but i dont recall
<tp>
one of the 3 company directors was a PITA sales type and sadly he came down and got into the 'when will it be fixed, we have 80 people standing idle" routine
<tp>
a philips hand ironing controller
<Zarutian_HTC>
right that jogged me memory
<tp>
after about 1/2 hour of this bs while I was trying to fix the machine, I finally snapped and loudly told him "either fire me right now and I walk right now, or get off my production floor"
<tp>
he silently spun on his heels and left the floor
<Zarutian_HTC>
those types are annoying as hell. Best folks say, okay whatcha need to get it up and running? me out of yer hair? sure
<tp>
80 production people were probably wondering 'how did he not just get fired"
<tp>
do you remember what the fault was ?
<Zarutian_HTC>
nope sorry
<tp>
we must have spoken about that 6 years ago ?
<tp>
it was a DC servo commutator brush worn to it's limit
<Zarutian_HTC>
dont recall how long ago just that it was quite while back
<tp>
we had no spares, so I cut the flexible copper strap from carbon brush to brush cap and extended it slightly to get it going again
<tp>
there is always a margin of safety in the length of the standard copepr straps so the brush doesnt come out of the brush guide
<tp>
and we were back in action
<Zarutian_HTC>
this was before brushless DC motors I take it
<tp>
way before
<tp>
but a dc motor can really deliver the HP and torque
<tp>
that philips iron controller board was a horror from hell, I so badly wanted to redesign it for production but couldnt as it was CE ticked
<tp>
I have one here, I might take a pic and do a rant about what never to design
<Zarutian_HTC>
I know, tried out a gocart that had its engine replaced by an elevator dc motor
<tp>
hahaha
<Zarutian_HTC>
was fun but the cable for juice was annoying
<tp>
I rode in a lame Mitsubishi ecar once I think it was, and made the mistake of asking the driver 'does this thing have any power?'
<tp>
LOL
<tp>
my face must have looked like people who ride in a Tesla and ask the same wuestion
<tp>
-w+q
<Zarutian_HTC>
whenever I take the bus I hope it is an electric one as those have quite thr torque while being quiet
<tp>
yeah, electric is awesome
<tp>
have you seen the ecar hybrid made by Konisegggggg ?
<tp>
1800 HP, $1,000,000 plus
<Zarutian_HTC>
not those slow to respond diesels. Never understood why car enthusiast wanted diesel
<tp>
4WD etc, Anyone want to pay me $1,000,000 for a non essential organ ??
<tp>
the ecar is back with a vengance now, I thing that Konisegggggggg vehicle is 1.9 seconds to 60 MPH
<tp>
a constant 1.5G up to 300 mph
<Zarutian_HTC>
yeah, I think it is cause of Tesla and better battery tech
<tp>
Koenigsegg Gemera
<tabemann>
new release 0.1.1 !
<Zarutian_HTC>
not to mention regenerative breaking and supercap buffering
<tp>
Zarutian_HTC, you could get one, add snow/ice chains to the wheels
<tp>
would be awesome
<tabemann>
it fixes 2CONSTANT, includes the improved WORDS, and includes [if]/[else]/[then]
<Zarutian_HTC>
I personally hate to drive most of the time. I wouldnt say no to something like that Ultra system in Brittain even if top speed is just 50 kmph
<tabemann>
if it weren't for 2CONSTANT I wouldn't've made the release
<tp>
gees, it's becoming nearly useful at this rate tabemann
<tabemann>
but I felt that a buggy 2CONSTANT was worth the trouble of making a whole new release
<tabemann>
because the buggy 2CONSTANT was inexplicably breaking my [if]/[else]/[then] implementation, so I felt it might cause problems for others as well
<Zarutian_HTC>
but if I do not have to drive and it is constant once up to speed then I do not mind the slower speed. Nor that I do nor have to find parking
<tp>
tabemann, yeah, it would have been hard ... lifting a finger to type .1, committing and then running a script to pack it all up, I feel your pain ;-)
<Zarutian_HTC>
what do those words do?
<tabemann>
lol
<Zarutian_HTC>
[if] and co
<tabemann>
2CONSTANT is like CONSTANT, but it creates a constant that returns two cells rather than one
<tabemann>
[if]~[else]~[then] is like if~else~then except it is at compile time
<Zarutian_HTC>
aah, like #ifdef kind a thing
<tabemann>
WORDS displays all the words in the system - what I changed was that I made it display words in four columns, 20 characters-wide (assumes an 80 characters-wide terminal)
<tabemann>
yeah
<tp>
yeah I have one also "2constant name ( ud|d - - ) Makes a double constant."
<tp>
I've never needed it tho
<tp>
32 bits is pretty big in the real world
<rdrop-exit>
the last time I implemented 2constant was on a 16 bit system
<rdrop-exit>
hi guys
<tabemann>
in this case I used it to store strings which I had to put together character by character, because I couldn't use s" to write them (due to containing " in the strings themselves)
<tabemann>
someday I'll add strings that support escaping, but not today
<tp>
ugg
rdrop-exit has quit [Quit: Lost terminal]
<tabemann>
I am reading up on arduino and seeing how horrible it really is
<tp>
dont do it tabemann .... run for your LIFE, save YOURSELF!!!!
<tabemann>
I mean seriously - a full zeptoforth installation includes a REPL, a multitasker, an event scheduler, etc. - arduino has a setup() function and a loop() function
<tabemann>
I had been under the impression that arduino was basically C with a stupid user base
<tp>
tabemann, as youre not yet a fully fledged embedded guy, you probably have no idea just how bad Arduino is
<tp>
no, arduino was made for "artists with no computer knowledge"
<tp>
it was never meant for what it has become
<tabemann>
what are people with no computer knowledge doing programming embedded code
<tp>
theyre not.
<tp>
it's a loggo kit
<tp>
leggo
<tp>
they plug in, load a library, plug in a peripheral and it goes
<tp>
a 5 year old could do it
<tabemann>
oh, on another note
<tp>
I mean that, Ive had my kids assembling PCB's with components at 3 years of age
<tabemann>
I can't do what I do with zeptoforth release creation completely via scripting
<tp>
?? one can do *anything* with scripting ?
<tabemann>
because the zeptoforth_full binaries need to be manually created by downloading a kernel onto a board, loading the setup.fs on that board, using ihex to dump that board to a log, then massaging the log into a proper ihex file, then using objcopy to convert that ihex file to a binary - the important part is that each board has to be manually connected to the machine
<Zarutian_HTC>
even make coffee or tea if you hack the drinks automat
<tp>
tabemann, I do that all with one script, no manual intervention needed
<tp>
Zarutian_HTC, hehe
<tabemann>
tp: umm that requires a USB cable-connection robot
<tp>
mine is a serial system tho
<tabemann>
still, the connections need to be changed for each board
<tp>
or run simultaneously like I do
<tp>
I have up to 4 systems running seperately here
<tabemann>
this is on a laptop with three free USB ports (one is taken up by a wireless mouse/keyboard dongle), and two of my boards require single USB ports each while another requires two (because one for power and st-link and another for serial)
<tp>
eww, nasty
<tp>
as usual youre doing well with limited resources
<tp>
do I have to send you a USB hub for xmas ?
<tabemann>
lol
<tp>
dont force me, Im warning you!
<KipIngram>
Anyone doing anything particularly cool at the moment?
<KipIngram>
I've been a complete slug - been off doing stuff other than Forth for like the last year. :-|
<tp>
even slugs gotta have a rest from their gooey excretions dude!
tabemann has quit [Remote host closed the connection]
<KipIngram>
:-)
<KipIngram>
I suppose so.
<KipIngram>
And, crazy times...
<tp>
amen ...
<tp>
and that's just the C users, then you have stuff like Coronavirus
tabemann has joined #forth
<tabemann>
KipIngram: I'm getting my Cortex-M Forth, zeptoforth, into truly usable shape
<tp>
i think you should rename it to "coronaforth" tabemann
<tabemann>
right now it's at is first case level
<tabemann>
well, maybe two cases
<tabemann>
it hasn't infected anyone else yet
<tabemann>
but look at the coronavirus
<tabemann>
back in december it had infected only like one person
<tabemann>
look at it now
<tp>
I've run it and I'm still healthy ;-)
<tp>
yeah 2000 deaths yesterday in the USA
<tabemann>
and there's people who want to "reopen the economy by may", like my fearless leader
<tp>
no one has asked the virus it seems
<tp>
my fearless leader(s) keep printing articles about how Australia "leads the way in Coronavirus cure", "tests more people than anyone else in the world", has the best plan
<tp>
blah blah
<KipIngram>
tabeman: Groovy keen.
<KipIngram>
I'm still sitting at just having done a "proof of concept" on metacompilation, by implementing a few primitive in metacompiled form.
<KipIngram>
Just got sucked off into other interests at about that point.
<KipIngram>
What I'm hoping to wind up with here is a block file and a small C program that just loads some range of blocks into RAM and jumps to it.
<KipIngram>
And once I get that, I won't be using nasm anymore - it will all be self-sustaining.
<tabemann>
I'm not bothering with metacompilation myself
<KipIngram>
Yeah - certainly not required. I just decided I liked the idea.
<KipIngram>
Over my career I've found that when I "rewrite" a program it's generally much better. So this is in some senses a re-write, at least of the lower level parts of the system.
<KipIngram>
It will wind up cleaner.
<Zarutian_HTC>
KipIngram: you need to support cpu native code or is a small vm acceptable?
<KipIngram>
I plan a tight VM for most "straight compiled code," but also plan a profiler to identify critical code sections and an assembler to optimize those.
<KipIngram>
Being able to metacompile means having a way to build the primitives, so that's basically an assembler.
<KipIngram>
I've always felt that an assembler is fairly required.
<KipIngram>
Forth is fast, but it's not as fast as native code, so if you want a truly high performance system, you need to offer that ability.
<KipIngram>
But you also need to be able to identify where it will pay off.
<tabemann>
for a fast forth one needs SRT/NCI
<tp>
KipIngram, Forth can be as fast, even faster when it's made by a tethered system
<tp>
I have the proof
<KipIngram>
I'm trying to identify an "intermediate virtual instruction set," that will let me build for x86 or ARM with high efficiency.
<KipIngram>
So, "native code" level, "portable instruction" level, "primitive" level, and "compiled" level.
<tabemann>
even though I'm now questioning whether I should have made zeptoforth indirect threaded or even token threaded - because those would have resulted in substantially smaller code
<tabemann>
like with token threading I could get away with 2 byte tokens
<Zarutian_HTC>
oh, well and vm with 16 primitives and call has been plenty for me. Basically a switch statement inside an endless loop
<KipIngram>
That's a fair argument, but if you have the ability to optimize the critical sections then the overall performance is less important. And ITC brings you certain "smoothnesses" that I want.
<tp>
tabemann, by your 10th Forth youll have it down pat :)
<KipIngram>
I will have quite a few more primitives than 16.
<KipIngram>
But fewer portable instructions than primitives, but still more than 16.
<KipIngram>
I've always been fairly "performance hungry."
<tabemann>
tp: I chose to go the SRT/NCI route because I felt speed was needed, because my token threaded forth is, well, kinda slow
<KipIngram>
I still think minimal primitive implementations are super cool, though.
<tabemann>
and I mean it's kinda slow on a PC
<tabemann>
so on a MCU it'd be even slower
<KipIngram>
I try not to be elitist about any of the options - if you can implement the critical stuff fast, then you're covered. To some extent the rest is a matter of taste, because all of them are a hell of a lot better than, say, Python.
<Zarutian_HTC>
well one EXT is just to do io and syscalls. But yeah around 64 portable instructions
<KipIngram>
If you're anywhere in the Forth neighborhood, then you're doing something interesting.
rdrop-exit has joined #forth
<KipIngram>
That sounds about right - my PI count will land somewhere around 64.
<tabemann>
zeptoforth is heavily written in assembly, because I needed to get it built up sufficiently that it can execute forth code inputted over serial
<Zarutian_HTC>
I got 16 because I was designing an smpc circuit implementation of a dual stack machine
<tabemann>
hashforth had far fewer primitives because I made an assembler that generated token-threaded code (with the input code looking awfully like forth), which was then fed into the VM as an image
<Zarutian_HTC>
and I needed it to be as simple as possible
gravicappa has joined #forth
<rdrop-exit>
c[] hello Forthwrights
<tabemann>
hey
<rdrop-exit>
hi tabemann
<tabemann>
rdrop-exit: zeptoforth is at 0.1.1
<rdrop-exit>
kudos!
<rdrop-exit>
I haven't coded anything since the lockdown started
<tabemann>
sounds like the perfect time to code stuff
<rdrop-exit>
My wife is home full-time, I normally code only when I'm alone at home
<tabemann>
ah
<KipIngram>
Zarutian_HTC - you're running your Forth on some sort of non-stancard hardware?
<KipIngram>
Evening rdrop-exit. Been a while.
<KipIngram>
Because of me, not you.
<rdrop-exit>
hi KipIngram! welcome back, it has been quite a while
<KipIngram>
Yeah - I got distracted by various things.
<KipIngram>
I'm a man of many interests, if I want to put it in a flattering way. :-)
<KipIngram>
Or... a man that's lazy, if I don't.
<rdrop-exit>
Me too, too many hobbies
<Zarutian_HTC>
KipIngram: virtual sequential boolean circuit Secure Multi Party Computation. Wouldnt call it hardware but not vm in the traditional sense
<KipIngram>
Well, you could debate that - diversity is a nice thing.
<KipIngram>
That sounds very interesting.
<KipIngram>
Once you start trying to be close to hardware (even virtually) you quickly home in on 16 primitives, or 32, or perhaps 64.
<KipIngram>
Some power of 2.
<KipIngram>
I once came up with a fairly nice 5-bit encoding that made implementation of a hardware stack nice and clean.
<rdrop-exit>
On a PC, I usually go for 256, since bytes are such a natural unit
<KipIngram>
But then 32 started to feel too tight, so I added one opcode that said "grab the next five bits, and take the functionality from a "second opcode set."
<KipIngram>
So a kind of "extended" instructions.
<KipIngram>
That got me to 63, and that was plenty.
<rdrop-exit>
An escape opcode
<tabemann>
256 is what I'd do
<KipIngram>
Right.
<tabemann>
escape opcodes are slow
<Zarutian_HTC>
KipIngram: got five kinds of "components" in such circuit. INput, OUTput, MEMory (really delay), AND, and XOR
<KipIngram>
256 definitely has a "naturalness" to it.
<tabemann>
256 is enough space for what one'd need, without escapes
<KipIngram>
The nice thing about 32 is that you can pack three 5-bit opcodes into a 16-bit cell.
<tabemann>
actually, 256 has enough space that it allows dedicated primitives for small numbers like -16 to 15
<KipIngram>
With a bit left over to tell you when to treat the other 15 as an address.
<rdrop-exit>
On a PC based VM I use escape opcodes for calls to the underlying platform/os
<tabemann>
the problem is that decoding is expensive
<KipIngram>
tabeman: yes, 256 is a gorgeous plenty.
<tabemann>
because then you have to mask and bitshift
<rdrop-exit>
you can always set the ones you don't yet use to throw an illegal VM instruction exception
<tabemann>
whereas 256 can be fetched in a single processor instruction and then needs no decoding
<rdrop-exit>
It's always nice to have spare opcodes to customize/optimize your VM for a particular need
<KipIngram>
Well, with careful design you can have the 31 non-escaped instructions run fast (my goal was always two clock cycles), and then the other 32 can take longer.
<KipIngram>
I'm greedy - I always wanted just two levels of logic between flip flop outputs and flip flop inputs for the base instructions.
<tabemann>
256 is a simple mater of fetch, bitshift so as to refer to cell size, add to jump table address, execute
<rdrop-exit>
I don't know if it's worth it on a PC, since you'll need more instructions to get something done, VMs are inherently CISCish
<KipIngram>
You let a third level creep in - anywhere within those "basic" ones, and suddenly you have to wait for that on ALL of them. You can avoid it, but it complicates the logic.
<KipIngram>
And that's like 33% decrease in clock speed.
<tabemann>
with hashforth what I did is put system API call under a specialized "SYS" primitive
<rdrop-exit>
It all depends if your VM is a true VM or a prototype for a real chip
<KipIngram>
Or you can turn it around, and argue that avoiding that third level gives yu a 50% improvement in clock speed.
<tabemann>
so system API calls aren't part of the primitive namespace
<KipIngram>
Just depends on which end you're starting from.
<tabemann>
in the end, though, unless one is creating hardware to execute Forth, I'd say just go with SRT/NCI
<tabemann>
and if you are creating hardware to execute Forth, still go with SRT/NCI
<tabemann>
except one gets to create an arch that is specifically optimized for Forth
<rdrop-exit>
the instuction cycle is such high overhead on a VM, that I think one's better off with more instructions, i.e. bytecodes
<tabemann>
that's why I think that aiming for smaller instructions is not the right decision unless one's doing it in hardware
<rdrop-exit>
For a target though I prefer SRT/NCI unless the space is very tight, which it very rarely is if you're using a tethered setuo
<rdrop-exit>
* setup
<tp>
in fact space is artificially LARGE in a tether
<rdrop-exit>
brb kids are video calling
<tp>
I use MCU's with 2kB of flash in my tether, yet they think they have 64Kb flash
<KipIngram>
tabeman - I think it's more open to debate, and that there is no one right answer. Certain features of Forth become easier in the ITC model (thinking primarily about CREATE/DOES> here) than in other models. And as far as performance goes, if you can write assembly for the critical sections, then the rest just really doesn't matter. Yes, it matters if you put it on a stopwatch, but the advantage becomes very
<KipIngram>
small. So I think 1) those exotic features, and 2) preference of the implementor - what they're more comfortable with - become criteria.
<KipIngram>
That said, if you LIKE SRT, then DO SRT. It's fine.
<KipIngram>
If you compare a well-optimized SRT application to a well-optimized ITC application (with profiler directed assembly inserts), then you're probably down to no more than a 1%-2% advantage for SRT.
<KipIngram>
It will still often win, but I just think it's not by enough to be that big of a deal.
<KipIngram>
It really just depends on how much value you attach to ULTIMATE performance.
<KipIngram>
Maybe a percent or two or three matters to you. Go for it.
<KipIngram>
I just decided a long time ago that I was content with ITC, given what I felt I could achieve with profiling/assembly, and I really haven't thought about DTC or STC since.
<KipIngram>
They're still super-interesting models, though.
<KipIngram>
Well, it's about 1:30 am here - gonna hit the sack. Nice to touch base with you gents again. Stay safe and well!
<rdrop-exit>
back
<tp>
rdrop-exit, ZEN Guru of Forth!
<rdrop-exit>
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"
<rdrop-exit>
hi tp
<tp>
heya
<rdrop-exit>
* threading model
<tp>
hows that rooftop view ?
<rdrop-exit>
too sonny to go on the rooftop these days
<rdrop-exit>
sunny
<tp>
Ive havent been out of the compound for 3 weeks myself
<tp>
but Im a ground floor dweller
rdrop-exit has quit [Ping timeout: 260 seconds]
rdrop-exit has joined #forth
<rdrop-exit>
lost my connection
<rdrop-exit>
I've been walking the dogs on our living room balcony, they like sniffing around the plants
<tp>
oh oh
<rdrop-exit>
stay healthy, KipIngram
<tp>
wifi connection ?
<rdrop-exit>
yup, my wife's tablet screwed it up somehow
<tp>
do the other residents suspect that sniffing around the plants isnt the only things your dogs like doing ?
<tp>
(around the plants)
<tp>
maybe a bit of saltpeter is good for plants ?
<rdrop-exit>
they wouldn't know, they don't have a view into our balcony
<tp>
heh
<tp>
I've decided to fire up my tethered Forth in a week or so, update the code try out the new features
<tp>
and make a small hardware project
<rdrop-exit>
excellent!
<tp>
as it's all pretty much exactly the same Forth I use now the chageover is barely noticeable
<tp>
but it's a bit of a mind bender
<tp>
after using it for a few days I become convinved it's a 'normal' on chip Forth
<tp>
as it uses exactly the same IDE I made for my on chip Forth stuff, it's just a fair bit faster
<tp>
which is a mind bender because a on chip MSP430 Forth is actually slower than a on chip cortex-m Forth
<tp>
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
<rdrop-exit>
heh
<tp>
i run my svd2forth on the chip exactly as I do for cortex-m
<tp>
except it's the ti hardware descriptions converted to CMSIS-SVD
<rdrop-exit>
Once you get used to a tethered setup you might have a hard time going back to a single Forth setup.
<tp>
by some vary handy Rust programmers
<tp>
nah, the MSP430 is expensive and lacks a LOT of peripherals
<tp>
plus I have 478 STM32F051's left to use :)
<tp>
the MSP430 is also a bit slow. has only a 10 bit ADC etc
<rdrop-exit>
Perhaps he'll eventually make a tethered Forth for your ARM chip
<tp>
if I had a cortex-m tether then Id have a problem going back
<tp>
no, he hates cortex-m, he assures me it will never happen
<rdrop-exit>
too bad
<tp>
he used a ti cortex-m4 as the tethered host as it needs plenty of speed
<tp>
even then the speed of the emulated MSP430 is about 20x slower than the real thing
<tp>
which isnt a problem when developing, one just works around it
<rdrop-exit>
I wonder why he didn't just use a PC or RPi based Forth for the host side of the target, makes more sense
<tp>
even a 16Mhz MSP430 slowed by 20x is still pretty fast
<tp>
hardware
<rdrop-exit>
* host side of the tether (not "of the target")
<tp>
he said the MSP430 JTAG timing was critical
<tp>
I understand wht you mean
<rdrop-exit>
JTAG timing shouldn't be an issue, he can use an FTDI cable
<tp>
does the ftdi cable relieve the pc of the requirement for realtime ?
<tp>
pc timing has always been a hardware issue for external hardware
<tp>
Ive had to deal with it on occasions
<rdrop-exit>
yes, it has a chip that interacts with the JTAG and buffers on both sides
<tp>
ah cool!
<tp>
hopefully the USN FTDI would work under QEMU ?
<tp>
-N+B
<rdrop-exit>
No idea, I guess so
<rdrop-exit>
the downside of FTDI is talking to their chip through a closed source library
<tp>
but at least I have the MSP430 tether, which frankly the MSP430 needs
<tp>
oh yeah, hed hate that
<DKordic>
tp: "dmesg(1)" shows for my FT232R a buffer of 64 Bytes.
<tp>
cortex-m dont *need* a tether, they have tons of resources anyway
<tp>
DKordic, is that all, I thought they had more based on my XON/XOFF fail
<tp>
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
<DKordic>
I might be wrong. There might also be buffering in the libs.
<rdrop-exit>
The one I'm speaking of is a FTDI C232HM USB 2.0 Hi-Speed to MPSSE Cable
<rdrop-exit>
the secret sause is their MPSSE thingie
<DKordic>
What might possibly interesting about it?
<rdrop-exit>
Multi-Protocol Synchronous Serial Engine
<DKordic>
Snakeoil, as expected from FTDI.
<rdrop-exit>
perhaps but it's handy if you're on a PC with USB wanting to talk to JTAG
<rdrop-exit>
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.
<tp>
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
<rdrop-exit>
It little less convenient than running a PC Forth as your tether host, but very nice nonetheless
<rdrop-exit>
I'm sure
dddddd has joined #forth
jedb_ has quit [Remote host closed the connection]
jedb has joined #forth
rdrop-exit has quit [Quit: Lost terminal]
<veltas>
Zarutian_HTC: You're right that rant page of tp's is gold
<tp>
hahaha, whats gold a gram thesedays :)
<tp>
microgram ?
<tp>
nanogram ?
<veltas>
Gold is more a gram than it usually is right now, I know that much
<tp>
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 ...
<veltas>
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
<veltas>
I wonder what the Incas would have thought of the Bank of England
<tp>
yeah, a Iced Coffee will cost $500 soon
<veltas>
I wonder what the Incas would have thought of Iced Coffees
<tp>
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 ?
<veltas>
The more I think about this the less I care what the Incas thought about anything
<tp>
hoping
<tp>
ok, fair comment
<tp>
it is after all a Forth channel
<veltas>
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.
<tp>
ahh, that may explain why I have none :)
<veltas>
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.
iyzsong- has joined #forth
iyzsong has quit [Ping timeout: 256 seconds]
reepca has joined #forth
<veltas>
tp: D1+!
<veltas>
What does that word do?
<tp>
beats me, where is it from ?
<veltas>
I came up with it
<veltas>
+! adds to a number
<veltas>
So 1+! increments a number
<tp>
whats the D for ?
<veltas>
And D1+! increments a double-integer
<veltas>
I'll admit I might be going too far with that scheme
<veltas>
Maybe D+! is good enough? Just do 1. D+! ?
<tp>
it's a hard one
<tp>
I have this "+! ( u|n a-addr - - ) Plus Store, use to increment a variable, register etc"
<veltas>
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
<tp>
i have no answer, the naming in this case isnt easy
<veltas>
Hmmm
<tp>
D+! seems ok tho
<veltas>
D+! I think is a good name for incrementing a double variable
<veltas>
Yeah
<tp>
now you have explained it
<veltas>
But D1+! is going too far I think, I just like having an "increment 1" operator because I'm used to C ;)
<tp>
a stack comment will help ?
<tp>
D1+! ( D -- D + 1 ) ?
<veltas>
Yes but I kind of want my words to be mostly 'obvious' from the name, if you are familiar with conventional forth
<veltas>
Like how Mecrisp seems to do it
<tp>
I'm not used to too many CAPS, we normaly use lower case with Mecrisp-Stellaris because we are really lazy
<veltas>
Although I was a little lost at CTYPE but now I know it's COUNT TYPE it's at least easy to remember
<tp>
in Mecrisp-Stellaris it would be " d1+ ( d -- d + 1 )
<veltas>
I think lower case looks better, I have gotten in a habit of caps from Starting FORTH
<tp>
yes, it does vary between forths
<veltas>
tp: That would add 1 to a number on the stack
<tp>
I cant help but type them sometimes but I always convert all my sourcecode to lower case sooner or later
<veltas>
So really I should have a stack comment for you: ( addr -- ) \ adds 1 to 2VARIABLE addr
<tp>
ah yes!
<veltas>
Because it is not doing what you think it is
<tp>
it's a complex one, the simple ones are the hardest
<veltas>
D+! is definitely the right compromise
<tp>
id say just use it until more insight comes
<tp>
one has to feel things out first, sleep on them etc
<veltas>
I will not further optimise because frankly I would hope people don't use 32-bit too much on my 8-bit forth
<tp>
I find when I think I'm definitely right, I have insufficient information
<veltas>
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.
<tp>
plus it's YOUR Forth, so you get to decide anyway
<veltas>
And it's really not arrogant, I still do this even though it always burns me
<tp>
hahah
<veltas>
I think in my case humility is a kind of mental hangup
<veltas>
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
<tp>
I'm more of a Confucius type myself
<veltas>
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
<veltas>
tp: Explain it to me like I have no idea about Confucius
<veltas>
Because I don't
<tp>
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
<tp>
so it's meaningful if you already know, and not if you dont
<tp>
but as it has only three characters it's ability to explain itself is limited
<tp>
it's not alone tho
<veltas>
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"
<tp>
tell me what this Word does ? movwmovt,
<tp>
that has nearly 3 times the characters and youll have no clue
<tp>
nor would I
<veltas>
I assume it compiles an assembly instruction to do some kind of mov instruction, but not sure.
<veltas>
But yes it's not "self-evident"
<tp>
many Words are not self evident, hence the need for a "stack comment". This allows you to incread eteh information a lot
<veltas>
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
<veltas>
If that makes any sense
<tp>
I think with a clever stack comment it's function would be evident
<veltas>
Yes but you need to look up the stack comment
iyzsong- has quit [Read error: Connection reset by peer]
<tp>
true
<veltas>
I want a situation where you can just read the definition the word is used in and understand
<veltas>
when viabe
<veltas>
viable*
<tp>
Im still a Forth beginner, dont be fooled
<veltas>
See this is me talking like a programmer, I am concerned with readable, maintainable code. Even on my 8-bit forth
<veltas>
It is still important to me
<veltas>
And it is not a religious contention, I think it is actually useful even here
<tp>
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
<veltas>
Hmm maybe
<tp>
i learn heaps every time he and I talk
<veltas>
I learn from talking to you as well, even if you are not a "forth guru" ;-)
<tp>
and you can only ask that question once because after one knows, it is self evident
<tp>
whats the 'forgetability' score ?
<tp>
movwmovt, ( x Register - - ) Generate a movw/movt-Sequence to get x into any given Register. M3/M4 only
<veltas>
I was actually right with my guess but I don't know that kind of M3/M4 assembly intimately
<tp>
i'd never remember movwmovt, after reading the description, but ID remember d+! increments a double
<veltas>
Hmm
<tp>
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
<tp>
I think it's hard to beat in 3 chars
<veltas>
Yes that is better than being hard to remember as well
<veltas>
And this is important in maintainability
<tp>
absolutely
<veltas>
Makes it better to *write* with as well if you extend the code later
<tp>
but you must have a Word list with stack pictures and comments for a new user to read
<veltas>
Certainly
<tp>
and that solves any immediate understanding problem
<tp>
is it ambiguous ? Id say no
<tp>
I give d+! a 'good as one can do' score :)
<veltas>
Me too
<tp>
but check with rdrop-exit, he has a knack of enlarging ones Forth outlook
<MrMobius>
the problem no one has solved is making the stack picture obvious on every single line of code like it is in C
<tp>
and goodnight, it's 11pm here, time for some zzzz for me
<MrMobius>
ive thought about that a lot. doesnt seem to be a good answer yet
<MrMobius>
good night!
<tp>
MrMobius, whats obvious in C ?
<tp>
is that a joke MrMobius as one cant access the C stack ?
<MrMobius>
Forth: foo bar baz
<MrMobius>
C: foo=bar(baz);
<MrMobius>
or the 10+ other things that could be going on
<MrMobius>
bar=foo(baz);
<MrMobius>
bar(); foo(); baz();
<veltas>
Everything is either part of a maths-style expression, or named
<veltas>
In Forth all the above is on a stack, with limited support for named locals if you want and it's available
<MrMobius>
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
<MrMobius>
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
<MrMobius>
(other complaints about C not withstanding)
<veltas>
It's certainly a problem I know I will tackle head-on at some point and fail
<veltas>
I have been toying with trying to give explicit syntax for this relationship, and seeing if it fits into forth nicely
<tp>
how about this one ? void TIM_TIxExternalClockConfig(TIM_TypeDef* TIMx, uint16_t TIM_TIxExternalCLKSource,uint16_t TIM_ICPolarity, uint16_t ICFilter);
<tp>
hows that float your stack picture ?
<MrMobius>
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
<veltas>
tp: How would that work in Forth though?
<tp>
veltas, it doesnt, it's just some hard to grock C
<tp>
just in case you think your Forth methods are hard to read
<MrMobius>
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
<MrMobius>
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
<tp>
MrMobius, it's far from great, it's full of ambiguity to me
<veltas>
I just know I will have better input to this debate after trying 'real' code with Forth
<tp>
MrMobius, which timer does this apply to ?
<veltas>
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
<tp>
we have sereral canidates and they have many differences
<tp>
several
<MrMobius>
tp, how would you formulate Forth code that makes it any clearer what timer it applies to?
<tp>
MrMobius, Im glad you asked :)
<veltas>
I am also interested
<tp>
MrMobius, I do it this way
<tp>
: TIM1_DIER_TDE ( -- x addr ) 14 bit TIM1_DIER ; \ TIM1_DIER_TDE, Trigger DMA request enable
<tp>
: TIM1_DIER_COMDE ( -- x addr ) 13 bit TIM1_DIER ; \ TIM1_DIER_COMDE, COM DMA request enable
<tp>
: TIM1_DIER_CC4DE ( -- x addr ) 12 bit TIM1_DIER ; \ TIM1_DIER_CC4DE, Capture/Compare 4 DMA request enable
<veltas>
This is definitely less to do with language and more to do with the programmer
<MrMobius>
and that replaces TIM_TIxExternalClockConfig?
<tp>
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
<tp>
no, I configure every bitfield separately
<tp>
it the same way as my example code above
<MrMobius>
so you would have 4 words you use instead of a call to TIM_TIxExternalClockConfig with 4 arguments?
<tp>
that C code just tries to configure all the bitfields at once and it's a nightmare
<veltas>
I feel like you could overcomplicate it just as much in Forth but potentially make something that tp would appreciate
<tp>
mine would have as many lines as BITFIELDS
<MrMobius>
ya this is not a criticism of C
<tp>
it's meant to be :)
<tp>
I dont grok how it's not
<veltas>
You try telling him MrMobius, I already had this discussion yesterday lol
<tp>
I'm not humble like you, I'll just steamroller over mrmorbius ;-)
<MrMobius>
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
<MrMobius>
steamroll away :)
<tp>
MrMobius, :)
<MrMobius>
Im only bringing this up because I think there might be a better way to improve readability in Forth
<tp>
plese demonstrate it then ?
<MrMobius>
not to prove C is better
<tp>
MrMobius, hey, I adore people who disagree with me, it's a unbridled learning opportunity for me!
<tp>
youre a forther, I personally have no complaints
<MrMobius>
if I understand you right, each word sets up part of the timer configuration and you need multiple words to configure one timer, right?
<tp>
I've been trying to improve this same aspect
<tp>
correct
<MrMobius>
so what's stopping you from making four different functions in C?
<tp>
terminology is important here as well
<MrMobius>
or making them flags that are ORed together and passed to a function?
<tp>
we have 'peripherals' which can have any number of 'registers'. Each register can have up to 32 'bitfields'
<tp>
a STM32F7xx has 17,000+ bitfields
<tp>
my humble stm32f051 has 3300 bitfields
<MrMobius>
and each one has a word?
<tp>
yes
<tp>
and a description from the factory
<MrMobius>
so how is 3300 words better than 3300 functions or 3300 contants and one function?
<tp>
and a technical explanation of each bitfield in the tech manual
<tp>
my bitfield words contain the same abbreviated description that the factory tech manual does
<tp>
the C word is meaningless to a tech
<MrMobius>
what if I changed the name of all the functions to the names youve given the words?
<tp>
what that leant towards is understanding and maintennance
<tp>
theyd all be in the one function without descriptions
<tp>
my aim is to make sure my source tells the reader all the information they need
<MrMobius>
not if I made a function for each owrd or more likely made a constant for each word with the exact same name
<tp>
this is where programmers and techs differ
<tp>
sure, you could do that
<tp>
but NO ONE DOES
<MrMobius>
this is the problem. the source doesnt tell you that and Forth tells you even less than C
<tp>
?
<tp>
Forth tells you *everything*
<tp>
how san you claim Forth tells you less when it clearly has more information ?
<MrMobius>
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
<tp>
does that C code have a tech summary for every bitfield ?
<tp>
thats true
<tp>
I'm a tech a forth beginner, I write poor Forth, we can all be honest
<MrMobius>
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
<tp>
you guys would write great Forth
<MrMobius>
here is what I mean: foo bar baz
<MrMobius>
now tell me please what is being passed to which word and which ones are words and which ones are variables
<tp>
well, Forth gets 2/3 of that right, foobar
<tp>
thats just a programming question ?
<MrMobius>
no, it's an inherent flaw of the language
<tp>
to answer your question, I have no idea
<MrMobius>
I know instantly when I glance at C code. I never know in Forth unless I hunt down the delcaration for all 3
<MrMobius>
right. you have no idea. you always have an exact idea in C
<tp>
ok, I agree with that
<tp>
well no, you dont, didnt I show that above ?
<tp>
when it comes to *embedded* C is a utter mess
<MrMobius>
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
<tp>
for pire simple programming C is fine, I used it for a long time in a completely amateur way
<MrMobius>
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
<tp>
youre a excellent debater, nd I'm a good steamroller, but we have a chasm we cant cross here
<MrMobius>
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
<tp>
to me Forth is highly accurate, all the information I need to review and maintain my code is in the source
<MrMobius>
it is in the source but it
<MrMobius>
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
<tp>
well I'd hate to step outside my competency, that would only be a insult to you
<tp>
Im a tech, NOT a programmer, tho I hack my way thru things
<tp>
to answer your question, no I dont have to have all the stack pictures in mh head
<tp>
and I do constantly refer to my code
<tp>
Im not a 'scary brain hacker' like some I've seen who COULD hold it all in their head
<tp>
I use a simple GVIM editor, no pop up suggestions like in ECLIPSE
<tp>
they would drive me nuts
<tp>
when I develop Forth I do a small bit at a time, each Word becomes higher level, I dont care whats below them
<MrMobius>
no one can hold 3,300 timer words in their head
<tp>
once they are tested and work, that bit is finished
<tp>
well I sure cant
<MrMobius>
thats what people say but thats not how programming actually works. people have to go back and adjust things all the time
<tp>
and I dont need to either
<tp>
sure
<tp>
especialy while developing with hardware
<tp>
adjustment is everything in embeded
<tp>
and the adjustments are done via those bitfields
<tp>
now rdrop-exit does not like my method
<tp>
but hes yet to actuall add any hardware to his embeded Forth builder and I think he is in for some surprises
<MrMobius>
thats true. I meant more adjustments to the code once the hardware is finished
<MrMobius>
what platform is it for?
<tp>
well in a MCU like a STM32, most of the hardware is finished, and it's all in the tech manual
<tp>
it's a tethered Forth designed to work with any hardware
<tp>
which uses JTAG
<tp>
i dont know much more than that
<tp>
for instance my 'touch sensor' project required only one external capacitor and a piece of pcb as the touch sensor
<tp>
everything else was source just like above
<tp>
here is the project the main code is at the bottom
<tp>
while far from ideal, every piece of my code can be used to search the STM tech manual and confirm each step
<tp>
that was my main aim, code verification with hardware
<MrMobius>
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
<tp>
thats probably true
<tp>
when you say "just using Forth for initializing hardware" just doing that is substantive
<tp>
if you dont build mcu gear you may think it's trivial, sometimes yes, but many peripherals are very complex
<MrMobius>
right that is substantive
<MrMobius>
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
<tp>
it will be a minor project when I add LCD and touch button so it logs my exercise lap times and circuit numbers
<MrMobius>
oh nice. I thought about building one of those but never did. which mcu?
<tp>
no, and that code isnt complete, it's just demoing the touch code itself
<tp>
stm32f051, I have 478 left :)
<tp>
a nokis 5110 display $1
<tp>
a 9v battery
<MrMobius>
maybe you can make a spare then too :)
<tp>
the toch buttons
<tp>
Ill put it up with all details as a project
<MrMobius>
I bought one of those 5110 displays a while ago but havent hooked it up yet
<tp>
theyre so easy to drive
<MrMobius>
the nokia 1202 ones are cool too and slightly better resolution
<tp>
did you see my 5110 YouTube rant ?
<tp>
lol
<MrMobius>
hehe no
<MrMobius>
I heard a bunch of them you get have loose metal casings and dont display right
<tp>
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
<tp>
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
<tp>
those boards are about $10
<MrMobius>
oh nice
<MrMobius>
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
<tp>
oops thats the temp sensor!
<tp>
lets see if the lcd code is there
<MrMobius>
I think the big one has a temp sensor though
<tp>
yesh the lcd code is there
<tp>
no schematic as it's just serveral pins connecting lcd to Disco board
<tp>
but I sense youd probably ratehr discover it all for yourself
<tp>
Forth people are like that
<tp>
if you offer to help, you may get shot
<MrMobius>
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
<tp>
I like that "ill do it my way pal' attitude anyway
<tp>
sure, it's no substitute for your own project
<tp>
who wants to copy ?
<MrMobius>
so for LCDs and stuff they are usually "simple" enough to get going if you can find the datasheet and or startup commands
<tp>
um, not really
<MrMobius>
hmm, ive gotten 4-5 to work that way
<tp>
I often look around for C examples but theyre usually all the same copies and incomplete
<MrMobius>
as long as you have the commands and what order they go in and the timing between them
<tp>
oh sure, me too, but IM getting lazy in my old age
<MrMobius>
hehe
<tp>
MrMobius, some of this stuff is so complicated that you only understand the datasheet AFTER you have the device running
<MrMobius>
ya you just get lucky if they give you some pseudo code which datasheets occasionally do
<tp>
not me usually
<tp>
my implimentation of the LMT01 is totally different to any projects youll find on the net
<tp>
the Ti reference sucked
<tp>
that was one project I had to do 100% on my own
<tp>
the lmt01 was new to me, Id never run up a LCD before
<tp>
oops
<tp>
the 5110 was new to me, Id never run up a LCD before
<tp>
but I learnt a lot from a online c project aknowledged in the project
<tp>
my 5110 has a lot more code. that part just displayed the LCD self test
<MrMobius>
thats pretty far though. the worst is when you send commands and nothing at all happens :P
<tp>
I later set up character display using a font array
<tp>
yeah, the selt test comes first
<MrMobius>
ok gotta get going
<MrMobius>
nice talking to you
<tp>
it's agreat display, and very low power as you say
<tp>
okies, same here, thanks for the chat
<MrMobius>
you too. cya
<tp>
I may argue, but every word you typed will be examined in my mind for a few days at least
<crest>
tp: i improved my forth uploading scripts a little more
<crest>
now they check a marker word for each file before uploading all the missing files in loop
<crest>
this avoids the problem of multiple make targets fighting for a lock file uploading code in an undefined order
<tp>
eww
<tp>
what defines the upload order ?
<crest>
the order of the command line arguments
<crest>
send <sernum> [<file> <word>]*
<tp>
you dont have them inside all files ?
<crest>
"them"?
<tp>
dependency uploading ?
<tp>
nested dependency uploading ?
<crest>
not yet but it's possible
<tp>
what HAVE you been doing with your time ???????
<tp>
<kidding!>
<crest>
other things
<crest>
the easterhegg 2020 had to be converted to an online event
<tp>
it's awesome to see the forth diversity here of late
<crest>
i really want to handle compile errors before including even more code even faster
<tp>
I do a serial concatenator
<crest>
sure i could run the poor forth through the c preprocessor
<tp>
nive
<tp>
nice!
<tp>
?
<tp>
seems hard
<tp>
why not just strip comments and concatenate ?
<tp>
usage rcas.sh <file>
<tp>
sed 's/\\.*$//g' < $1 | sed '/^\s*$/d' | sed 's/([^)]*)//g' > $1.rcas.fs
<tp>
cat all the files and feet them into that
<tp>
thats what my make button does
<tp>
that way I get 2 files, one with all the comments for distribution and one with no comments for uploading
<tp>
all files are then in the one file and the right order
<tp>
I'm still working on your release btw
<tp>
lates improvement is not generating pretty print register files for "write-only" registers
<tp>
which will read $0 until the heat death of the universe
Zarutian_HTC has quit [Ping timeout: 250 seconds]
<crest>
why not use cpp -P to combine all source files?
<crest>
gcc and clang support #import "file.txt"
<crc>
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
<crc>
(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)
<KipIngram>
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.
<veltas>
That is such a good idea
<veltas>
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
<veltas>
So it's nice you have one with a bit of restraint
<KipIngram>
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.
<veltas>
Nice
rdrop-exit has quit [Quit: Lost terminal]
<tabemann>
back
<veltas>
tabemann: you reported yourself?
<tabemann>
somehow
<tabemann>
I don't remember doing it
<tabemann>
but my mouse has been kinda funky lately (just ordered a new one today)
<tabemann>
and I would have thought that reporting someone would require hitting okay on a modal, but maybe not