<proteus-guy>
one line is best. sometimes if you're doing particularly low level stuff you might have several lines of one or two words like asm. but words are meant to be crazy short and highly factored. loops and control structures are typically the longest words and you should break any multi-depth ones into separate words.
<jsoft>
Actually looking at my current code, even if its bloated for forth code, its still somehow many times smaller than the equiviliant / typical c code
<proteus-guy>
yep looks good.
<proteus-guy>
jsoft, no body writes optimized code the first time. get it working first. then refactor. then refactor. then refactor one more time. :-)
<proteus-guy>
key is to work on as small a useful problem you can at a time.
<jsoft>
Its kind of interesting though, as trying to make it smaller seems to simplify it
<jsoft>
Somehow
<jsoft>
Not sure how to describe it
<proteus-guy>
I makes it more elegant as you remove all the things that aren't strictly necessary to succinctly describe the solution and intent of the programmer's mental model.
<proteus-guy>
Good languages encourage this. Forth practically demands it. ;-)
<proteus-guy>
I think this is a natural consequence of the stack-oriented concatenative nature of forth.
<jsoft>
Its quite satisfying though, seeing what would be/was many lines of code, into some tiny stupidly small bunch of lines
<jsoft>
And then as a bonus, you can interactively diddle with the micro controller :D
<jsoft>
And test the words and such
<proteus-guy>
Yes I love the interactive nature of the repl. My language ActorForth is targeted towards Ethereum and Bitcoin contracts and no one has interactive models for those yet. Extremely useful.
<proteus-guy>
jsoft, what kinds of things are you working on with your forthing?
<jsoft>
proteus-guy, at the moment I am working on a mouse trap
<jsoft>
After this, it will be some radio sensor stuff
<proteus-guy>
Ah cool - mechanical AND violent! :-) What hardware you playing with?
<jsoft>
Nah not mechanical, its an stm32l0, which essentially drives a car ignition coil to... erm.. neutralize the mouse
<jsoft>
Takes a PIR logic input to trigger it.
<jsoft>
But also has adjustable PWM freq and duty cycle, low battery voltage cut outs and such
<proteus-guy>
electric shock even!
<jsoft>
Yep
<proteus-guy>
what's going to trigger it?
<jsoft>
PIR
<jsoft>
Like infra red gizmo
<jsoft>
Like whats on security lights and such
<proteus-guy>
Ah ok.
<jsoft>
But yeah, this is really just an excuse to get back into uC forth stuff
<jsoft>
The tricky stuff will be the radio sensor project
<jsoft>
Bunch of AES stuff etc
<proteus-guy>
sounds like a fun project.
<jsoft>
Oh also want to make a music maker
<jsoft>
So generates random tunes, like it goes 'hmm randomly generate a drum beat' and so on and so forth for other instruments, in pre-defined time signatures
<jsoft>
That could be fun :D
<jsoft>
What kinds of things do you use forth for ?
<proteus-guy>
jsoft, like any "real" forther - writing new forths. ;-) haha
<jsoft>
:D
<proteus-guy>
normally embedded devices but it's been a long time since I've had the opportunity. Right now creating a new forth language for the purpose of creating specialized DSLs for cryptoledger smart contracts.
<proteus-guy>
main aspect of mine is that it is strictly typed. correctness is critical for cryptocontracts.
brainfunnel has quit [Quit: whoops]
<jsoft>
Oh ok
<jsoft>
Nerd :P
<proteus-guy>
totally
<jsoft>
What kinds of embedded devices have you played with in the past?
<proteus-guy>
186 controllers, AtMel stuff (which I really loved), avoided 8051s and PICs. I don't like the ARM ISA but I've dealt with ARM devices. Have a few of the first ever RISCV socs. My main interest is FPGAs. Wanna make an ActorForth CPU once I have the language stable.
<proteus-guy>
Of course back in the 80s the 8bit CPUs - mostly 6502 and 6809 (which I still love) and 68k stuff.
<proteus-guy>
jsoft, do you use Mecrisp in your development?
<jsoft>
proteus-guy, yep
<jsoft>
proteus-guy, pretty much the only forth ive used to date
<proteus-guy>
Ah I just noticed you're on the #Mecrisp channel. :-)
<jsoft>
:)
<proteus-guy>
It's a really well done environment. You're lucky to have hit upon it. :-)
<jsoft>
Mate, I love it
<jsoft>
It is so damn useful being able to test out / figure out things from a terminal
<proteus-guy>
Sucks for those mice, however. ;-) haha
mokulus has joined #forth
<jsoft>
:D
jsoft has quit [Remote host closed the connection]
jsoft has joined #forth
gravicappa has joined #forth
WickedShell has quit [Remote host closed the connection]
Zarutian_HTC has quit [Remote host closed the connection]
Zarutian_HTC has joined #forth
cmtptr has quit [Quit: leaving]
clog has joined #forth
pointfree has quit [Ping timeout: 240 seconds]
pointfree has joined #forth
cmtptr has joined #forth
Zarutian_HTC has quit [Ping timeout: 240 seconds]
Zarutian_HTC has joined #forth
Guest53709 is now known as KipIngram
mokulus has quit [Quit: WeeChat 2.9]
proteus-guy has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
Zarutian_HTC has quit [Ping timeout: 258 seconds]
Zarutian_HTC has joined #forth
gravicappa has quit [Ping timeout: 265 seconds]
<crest>
proteus-guy: so far my only exposure to arm has been through with cortex m0/3/4 controllers. i disliked the thumb1 limitations, i like a lot of things about tumb2, but it's a supprisingly large instruction set
<crest>
with a complex encoding
<Zarutian_HTC>
why the complex encoding?
<crest>
because arm decided attempt a very dense packing
<crest>
to improve code density
dave0 has joined #forth
<Zarutian_HTC>
and why did they need that?
<Zarutian_HTC>
it isnt like memory is that dire these days even on fast mcus
<tabemann>
hey guys
<tabemann>
1 MB of flash only goes so far
<Zarutian_HTC>
right, one day I will write a bit about various design decisions that pile on bad on bad
<tabemann>
but yeah
<tabemann>
Thumb-2 is kind of ridiculous (I wrote a (partial) disassembler for it)
<tabemann>
and yeah, you generally only need half of its instruction set unless you plan on doing DSP-type stuff