<crab1> At any rate I certainly prefer it to linux/gnu operating systems and it's growing taller than the bsds for me if I can just get it to be usable
<tabemann> I tend to want something that can run firefox
<crab1> firefox is a mess
<tabemann> which allows for gnu/linux and xbsd, but not stuff like 9front
<Kumool> the web is a mess, but its a necessary mess
<tabemann> unfortunately, today is an age where one cannot get by without javascript
<Kumool> hopefully more and more people give gopher a try.
<crab1> I am too stubborn to accept those sorts of absolutes @tabemann
<tabemann> I have real things I have to deal with, like my banks and my daughter's school's website
<crab1> I have banking to do too, I'm not sure how that's gonna go since my credit card is through an online-only bank
<tabemann> one of my banks even complains about firefox, but it at least it lets me use it
<tabemann> I also need a platform on which I can run gas, openocd, and gdb
<tabemann> which, again, includes gnu/linux and xbsd but probably excludes 9front
<Zarutian_HTC> what is this 9front?
<tabemann> a plan 9 fork
<crab1> it would exclude 9front yes. why specifically gas and gdb?
<tabemann> because they're part of the arm-non-eabi toolchain
<Kumool> considering everything is done online and theres a pandemic, throwing firefox out with no support is not commendable
<tabemann> I really do not want to write my own thumb-2 assembler
<tabemann> and without a compiler/assembler/linker/debugger toolchain, what do I write and debug that with
<Zarutian_HTC> tabemann: right, you are hacking on STM32, no?
<tabemann> Zarutian_HTC, yes
<crab1> I haven't thrown anything out, I still have a system running gnu, I'm just spending time to figure how usable I can get 9front to be for myself
<tabemann> got zeptoforth working for l476 and mostly working for f407
<tpbsd> Welcome to zeptoforth ok
<tpbsd> happy2
<tpbsd> ok
<tpbsd> only 90 mA !
<tabemann> tpbsd: if you hadn't noticed, I put in a hack to shrink the size of the compiled basic.fs a bit
<crab1> oh hello tp
<tabemann> I bet it'll have more impact on the l476, because the l476 has bigger flash pages than the f407
<tpbsd> tabemann, I have my own source shrinker
<tabemann> btw, hey tp
<tpbsd> oh, it shrinks the binaries you mean
<tpbsd> yes tabemann
<tabemann> tpbsd: what this is that it was putting a coda of <address of last word>$DEADBEEF after each single word compiled to flash
<tpbsd> tabemann, I use a script that strips all comments and blank lines and concatenates all the source files
<tabemann> and what I did was eliminated that, when compress-flash mode was set on, and then only write it out when doing end-compress-flash afterwards
<tpbsd> $DEADBEEF did what ?
<tabemann> however I also added something called commit-flash, which is called to force write-out of pending flash (for l476) before another thing dependent on it
<tpbsd> just a last worf flag ?
<tabemann> yeah
<tabemann> it's used in initialization to detect when exactly the last word ends
<tpbsd> does Mecrisp-Stellaris do that ?
<tabemann> or more like, where the address pointing to the last word is
<tabemann> donno
<tpbsd> I've never seen it in the binaries so I dont thing so
<tabemann> I calculated that with my changes, basic.fs now takes up 13K
<tabemann> still big, but not super-big
<tpbsd> it was 19.5kb
<tabemann> note that basic.fs is loaded starting at $6000
<tpbsd> I've never worried about where stuff is loaded
<tabemann> okay, gonna have dinner - bbl
<crab1> enjoy
<tpbsd> I have an app that reads out the dictionary as ihex, the terminal log grabs it and turns it into a binary, so the chip is then cloned
<tpbsd> cya
<crab1> tpbsd: you use freebsd, right?
<Zarutian_HTC> tpbsd: zeptoforth uses direct threaded code or?
<tpbsd> Zarutian_HTC, youd have to ask tabemann
<tpbsd> Zarutian_HTC, Im just a Forth user
<Zarutian_HTC> it is just that I have the habbit of agresdively refactor for less space consumption
<Zarutian_HTC> s/sd/ss/
<Kumool> that seems like a good habit
<tpbsd> me too, in my user programs as I only have 64kB flash
<tpbsd> which is a fair bit but I also use a lot of development apps and they have a lot of text
<Zarutian_HTC> heck I have on occasation thought of using extended Zork text encoding to cut further down on space
<tpbsd> I use a standard ascii terminal so I couldnt do that
<Zarutian_HTC> just as the internal encoding. Would have to transcode to and from ascii (utf-8 really)
<Zarutian_HTC> on the chip itself
<tpbsd> oh!
<tpbsd> I remove all the text based dev stuff on the final product anyway
<tpbsd> If I had a deve chip with a couple of MB of flash it would solve the space issue
<tpbsd> and they are available
<Zarutian_HTC> I usually leave it in because who know who needs to reverse engineer the thing three decades down the line
<tpbsd> yeah, good point
<Zarutian_HTC> it isnt like serial 8soic flash chips are expensive
<tpbsd> I leave the self test words there
<tpbsd> my Forth doesnt have the ability to load words outside the internal flash
<Zarutian_HTC> even saw a board with one that accidentially not connected to the main mcu. It was the 'docu' chip so to speak
<tpbsd> I like the idea of inbuilt doc very much as I'm a electronics tech
<tpbsd> of course unless you know it's there you may not go looking for it
<crab1> unless it was standard practice, which would be nice
iyzsong has joined #forth
<Zarutian_HTC> talking about hw. I have heard through the grapewine that newer john deere tractors are now slowly being to be called jOHn DEERe as they cant be fixed in the, literal, field
<tpbsd> thats so true
<Zarutian_HTC> tpbsd: not sure if standard practice but it is standard R.E. practice to dump all flash chips and have a look
<tpbsd> Zarutian_HTC, it's not standard practice for repair as the usual trouble is faulty connectors, pcb, maybe a dead chip
<tpbsd> Zarutian_HTC, I think farmers are all trying to buy older john deere tractors or keep older ones without all the software lockin
<Zarutian_HTC> it is when all that have been attempted to be repaired, at least on equipment whose manifacturer has been lost to the sands of time
<tpbsd> i doubt youll find any chips with design and repair notes in the JD gear
<tpbsd> but there is a healthy market for R/E GD gear
<Zarutian_HTC> heard that JD gear often has all their control circuitry ripped out and replaced in many countries around the world
<Zarutian_HTC> often due to more stringent safety regulations
<tpbsd> I dont work in that industry thesedays so I dont know
<crab1> what's JD stand for
<Zarutian_HTC> I heard but have not prooven that JD think that software only safety interlocks are okay
<tpbsd> I used to repair instrumentation and sensors for one large farm machinery manuf about 20 years ago
<Zarutian_HTC> crab1 John Deere
<crab1> ahhh gotcha
<tpbsd> Zarutian_HTC, back then it was just electronics, nothing was locked in software
<tpbsd> stuff like tachometers and grain rate meters etc
<crab1> sounds riveting
<crab1> but who knows maybe tachometers are more interesting than I realize
<tabemann> back
<crab1> how was dinner
<tabemann> Zarutian_HTC, zeptoforth is SRT/NCI
<tabemann> good
<tabemann> i.e. it's a native code Forth
<tabemann> the irony is that it'd use far less memory if it were token-threaded or even ITC
<tabemann> i.e. zeptoforth is a memory hog
crab1 has quit [Ping timeout: 250 seconds]
<Zarutian_HTC> SubRoutineThreaded/NativeCodeImplemenred ?
<tabemann> subroutine threaded / native code inlining
<Zarutian_HTC> how big is the usual subroutine callsite?
<tabemann> a call from RAM to flash is a whopping 10 bytes
<tabemann> a call from flash to flash is normally 4 bytes
<tabemann> likewise a call from RAM to RAM is normally 4 bytes
<Zarutian_HTC> why so big in the first case?
<tabemann> because I need to use a full-size literal, which is 8 bytes (4 bytes for the lower 16 bits, 4 bytes for the upper 16 bits) followed by a call to that address
<Zarutian_HTC> 4 bytes for 16 bits? Do you mean 32 bits?
<tabemann> no, 32 bits for a 16 bit literal
<Zarutian_HTC> oh, you are building up the 32 bits in two halves of an register
<tabemann> yes
<Zarutian_HTC> if I recall how ARM works correctly
<tabemann> in a good few cases inlining actually saves space
<Zarutian_HTC> how big are the ram and flash?
jsoft has joined #forth
<tabemann> the flash is 1 meg
<tabemann> the RAM I think is either 128k or 96k (as is the STM32L476); not sure though
<tabemann> shit
<tabemann> syslogd is eating all my CPU for some reason
<tabemann> bbiab
tabemann has quit [Quit: Leaving]
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
tabemann has joined #forth
jedb has quit [Ping timeout: 250 seconds]
<MrMobius> tabemann, isnt there a PC relative thing where you canb have a constant pool?
<MrMobius> I remember reading briefly about that
ryke has joined #forth
<tabemann> the problem is how compilation works in zeptoforth combined with flash
<tabemann> when I'm compiling code I have no way of knowing when the current word ends
jedb has joined #forth
<MrMobius> so you cant save all the constants and write them after ; ?
<tabemann> (note that PC-relative data addresses have to be after the PC, but even if they did not, I cannot put literals before the word because the code there has already been written to flash)
<MrMobius> oh I think I see. you wont know where ; is at the point where youd have to write the offset
<tabemann> yeah
<MrMobius> hmm, I can think of workarounds but they all seem messy
<MrMobius> like put the pool as far away as possible and write words up to that
<tabemann> exactly
reepca has joined #forth
<Zarutian_HTC> well, what are the max literal pc-relative offsets?
<Zarutian_HTC> if you have the equiv of colon word with no inlining you could do the literals first then the calls using them
<Zarutian_HTC> if you have some maximum distance the you could do it in chunks
<Zarutian_HTC> heck if you can read back from flash or flash write buffer you could eliminate duplicate literals
kori has joined #forth
kori has joined #forth
kori has quit [Changing host]
dave0 has quit [Quit: dave's not here]
<MrMobius> sounds like literals have to come after the instructions that load them if its PC relative
<MrMobius> and doing it in chunks, what do you do when a word gets close to the chunk? youd have to decide on a maximum word size or put a jump in the word to skip over the chunk
<MrMobius> or maybe if the word reached the chunk, mark it as unused and copy the word up to that point to the space after the chunk
reepca has quit [Read error: Connection reset by peer]
reepca has joined #forth
<MrMobius> or i guess you wouldnt have to mark it as unused if the new copy after the chunk has the same name
<tabemann> back
C-Keen has quit [Ping timeout: 265 seconds]
<MrMobius> if youre ok with wasting the flash for the half word before the constants
ryke has quit [Remote host closed the connection]
ryke has joined #forth
C-Keen has joined #forth
C-Keen is now known as Guest56414
cp- has quit [Quit: Disappeared in a puff of smoke]
nighty- has joined #forth
actuallybatman has quit [Ping timeout: 260 seconds]
nighty- has quit [Quit: Disappears in a puff of smoke]
ryke has quit [Ping timeout: 272 seconds]
dddddd has quit [Ping timeout: 250 seconds]
nighty- has joined #forth
gravicappa has joined #forth
nighty- has quit [Quit: Disappears in a puff of smoke]
Zarutian_HTC has quit [Ping timeout: 240 seconds]
cp- has joined #forth
jsoft has quit [Ping timeout: 256 seconds]
Zarutian_HTC has joined #forth
mtsd has joined #forth
Guest56414 has joined #forth
Guest56414 has quit [Changing host]
Guest56414 is now known as C-Keen
webchat9 has joined #forth
<webchat9> hello, how to define a word that skips input ;till the end of file ? (comment till end of file)
xek has joined #forth
<DKordic> Welcome webchat9. By refactoring the word that imports from a file?
rdrop-exit has joined #forth
<rdrop-exit> webchat9, in most Forth's QUIT will bring you back to the outer interpreter loop
<rdrop-exit> * Forths
<webchat9> nice, thanks
<rdrop-exit> my pleasure
webchat9 has quit [Remote host closed the connection]
webchat9 has joined #forth
<webchat9> https://pastebin.com/bTzLaSVa Now I want to make something like "nested comments" . THat code is buggy but it's not obvious where the bug is. I tried to use swiftforth's "Single-step debugger" https://www.forth.com/swiftforth/ but it doesn't work (it's either a demo version limtiation or I didn't do it well.. I evaluated [DEBUG : 2X DUP +
<webchat9> ; DEBUG] 4 DEBUG 2X \ didn't work ) . Also installed vfx forth but no idea how to debug with it. I'm thinking of reading 4th's debug.4th ( breakpoint debugger ) lib and try to implement it in the forth I'm using (win32 spf-forth ) . any suggestion?
<webchat9> https://pastebin.com/LLXa9XGy (* anything *) \ gives memory exception
klys has joined #forth
WickedShell has quit [Remote host closed the connection]
<rdrop-exit> true nestable comments are not trivial, they require keeping track of the nesting level
cartwright has quit [Ping timeout: 240 seconds]
rprimus has quit [Ping timeout: 256 seconds]
rprimus has joined #forth
cartwright has joined #forth
dave0 has joined #forth
<DKordic> ATM I use ""[if]"" for nested comments for a lack of a better one.
<rdrop-exit> I use blocks so the issue doesn't really come up
<webchat9> how to define a word that silences all the text output from already defined words?
<rdrop-exit> depends on the Forth, if your Forth has a vectored emit, revector emit
rdrop-exit has quit [Ping timeout: 265 seconds]
rdrop-exit has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
rdrop-exit has quit [Ping timeout: 256 seconds]
rdrop-exit has joined #forth
webchat9 has quit [Ping timeout: 240 seconds]
dddddd has joined #forth
iyzsong has quit [Quit: ZNC 1.7.1 - https://znc.in]
rdrop-exit has quit [Quit: Lost terminal]
jpsamaroo has quit [Quit: ZNC 1.7.4 - https://znc.in]
jpsamaroo has joined #forth
ryke has joined #forth
mtsd has quit [Ping timeout: 240 seconds]
webchat9 has joined #forth
ryke has quit [Quit: ryke]
cartwright has quit [Ping timeout: 240 seconds]
tabemann has quit [Ping timeout: 240 seconds]
<webchat9> using QUIT as comment-til-eof is not good (in my case) because I use a loop to repeatedly load a sourcefile. If the sourcefile has QUIT then the loop will also quit
<webchat9> any solution / idea ?
cartwright has joined #forth
<webchat9> : \z 0 PARSE 2DROP ; IMMEDIATE \ tried this but doens't work well
DKordic is now known as S-Jack
dave0 has quit [Quit: dave's not here]
<webchat9> ah, windows encoding problems; forgot that spf wants winows style line endings
<webchat9> : \z BEGIN 0 PARSE 2DROP REFILL NOT UNTIL ; \ this one seems to work well
actuallybatman has joined #forth
jpsamaroo has quit [Remote host closed the connection]
* Zarutian_HTC reads about new Huawei phones having ""USA"" chips in them and wonders when country-siloing goes the way of the divine rights of kings.
Zarutian_HTC has quit [Ping timeout: 256 seconds]
Zarutian_HTC has joined #forth
john_cephalopoda has joined #forth
<john_cephalopoda> Hi
<MrMobius> hi
<tpbsd> g'day
<john_cephalopoda> I found some pretty neat collection of Forth-related stuff at https://users.ece.cmu.edu/~koopman/stack.html
<john_cephalopoda> Like a copy of the RTX2010 processor handbook and similar.
* Zarutian_HTC recalls J1 verilog core exist at https://excamera.com/sphinx/fpga-j1.html
john_cephalopoda has quit [Remote host closed the connection]
john_cephalopoda has joined #forth
djinni has quit [Quit: Leaving]
djinni has joined #forth
webchat9 has quit [Ping timeout: 240 seconds]
<john_cephalopoda> I got an Arduino Uno lying around. Any recommendations for a nice AVR-8 Forth?
<tpbsd> amforth ?
<tpbsd> eforth ?
<tpbsd> flashforth ?
<john_cephalopoda> Hmm...
xek has quit [Ping timeout: 265 seconds]
actuallybatman has quit [Ping timeout: 264 seconds]
john_cephalopoda has quit [Read error: Connection reset by peer]
john_cephalopoda has joined #forth
john_cephalopoda has quit [Ping timeout: 250 seconds]
john_cephalopoda has joined #forth
gravicappa has quit [Ping timeout: 250 seconds]
WickedShell has joined #forth
actuallybatman has joined #forth
john_cephalopoda has quit [Ping timeout: 264 seconds]
cox has joined #forth
john_cephalopoda has joined #forth
<john_cephalopoda> Installation seems a bit tricky for all of them. Welp.
<tpbsd> maybe it's the avr bit that makes it hard ?
<cox> someone working with AVR?
<john_cephalopoda> I have actually tried writing an AVR assembler in a Forth dialect before, but their opcode encoding is all over the place.
<cox> i HAVE written an avr assesmbler in forth :)
<cox> oh
<cox> this is mark4 btw, i created a new account on my laptop to do all the work in for the company im working for right now
<cox> cox communications
<cox> and i found avr encoding to be quite nice :)
cox is now known as mark4
<john_cephalopoda> "0001 11rd dddd rrrr" where r and d are registers... Lots of bit shuffling.
<john_cephalopoda> There are some common patterns, but I didn't really have the time to generalize them.
<mark4> yes i had a word to split bits apart within a byte so you could turn 00001111 into 11000011 or put any number of bits any number of bits higher up :)
<john_cephalopoda> Oh, that's a neat idea.
<mark4> thats my never released avr forth assemblker
<john_cephalopoda> I've written an x86 assembler, which went way smoother. It's not trivial, but they avoid shuffling bits around.
<mark4> assembler
<mark4> and thats the definition file for the 32u4
<mark4> create a definition file for ANY device and that assembler should work
<mark4> and its NOT bass ackwards
<mark4> the asm is normal asm looking not forth ish
crc has quit [Ping timeout: 260 seconds]
<john_cephalopoda> So you write "r10 r11 adc"?
<mark4> no
<john_cephalopoda> Uuh, "adc r10 r11"
<mark4> adc r10, r11
<mark4> the COMMA is needed for the destination register
<mark4> thats what tells me its the D reg not the S reg
<mark4> also a local label facility
<mark4> L0: through L9: define local lables and L0 through L9 reference them
<mark4> you can reference locals across definitions or turn that off if you dont like it
<mark4> false !> glocals \ turn global locals off
<mark4> or off> glocals :)
dzho_ has joined #forth
veltas_ has joined #forth
crc has joined #forth
<john_cephalopoda> mark4: That sounds cool. How do you resolve forward references? Two-pass? One-pass with backpatching?
<mark4> ONE pass
<mark4> well. you define a coded definition between code foo and end-code a check is done at end-code to make sure there are no undefined forwards i think
<mark4> yea
<mark4> oh >L0 >L9 are FORWARD reference to a local
<mark4> so you can literally define L0 through L9 multiple times in the same definition
<mark4> beq L0
<mark4> bne >L0
<mark4> first is a branch back to L0: second is a branch forward to L0:
<john_cephalopoda> Here's some x86 assembler that I wrote in the RETRO Forth dialect: https://cuttle.space/tmp/rasc.html
jn__ has quit [Ping timeout: 272 seconds]
<mark4> oooh 32 bit!
<mark4> x4 never had an assembler :(
<john_cephalopoda> It is single-pass with backpatching. Not very advanced, but I can create executables with it.
<mark4> thats what i do
<mark4> i PREFER not very advanced
<mark4> i need an assembler for x4 written in the x4 dialect of forth
<mark4> x4 is now 20 years old omg
diginet2 has quit [*.net *.split]
dzho has quit [*.net *.split]
veltas has quit [*.net *.split]
<mark4> and still no meta compilation
<john_cephalopoda> Let me upload some example code for the assembler.
<mark4> look in my sources at the definiton and explanation for the word asm> its forth black magic :)
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
[1]MrMobius has joined #forth
MrMobius has quit [Ping timeout: 256 seconds]
[1]MrMobius is now known as MrMobius
<mark4> does retro have a rep word?
<john_cephalopoda> Hah, it really is :D
<mark4> 10 rep foo
<mark4> run the word foo 10 times
<mark4> it really is what?
<mark4> oh - black magic yea
<john_cephalopoda> It's called "times".
<john_cephalopoda> #10 [ foo bar baz ] times
<john_cephalopoda> It's relatively far from ANS Forth.
<mark4> the ans forth standard does not describe the forth language but a language of the same name. i would however say the same of colorforth lol
<john_cephalopoda> A lot of things are done with prefixes. Numbers got the # prefix. You can also define own prefixes. Example (n:put is like ANS '.'): #10 #12 + n:put
<john_cephalopoda> Bbiab.
dzho_ is now known as dzho
<mark4> dzho were you the guy that emailed me from china wanting an avr forth?
<dzho> mark4: no
mark4 has quit [Quit: Leaving]
diginet2 has joined #forth
<john_cephalopoda> Getting late. Bye.
john_cephalopoda has quit [Quit: Leaving]
jedb_ has joined #forth
jedb has quit [Ping timeout: 264 seconds]
dave0 has joined #forth