X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 260 seconds]
X-Scale` is now known as X-Scale
Lord_Nightmare has joined #forth
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 260 seconds]
X-Scale` is now known as X-Scale
<siraben> remexre: Do you know of any languages that combine concatenative programming with effects?
<siraben> Layered effects, that is.
<remexre> siraben: like e.g. Eff has?
<siraben> remexre: Yes.
<remexre> siraben: no, sadly; I might try to do one some day, but that's pretty far down the TODO list
<siraben> remexre: I see. What are your interests wrt. to programming languages?
<siraben> Interesting, you're on various FP channels as well.
<remexre> siraben: researcher in the field; mainly I do dependently-typed lambda calculi, but I'm massively preferring Forth to anything else low-level
<siraben> remexre: Re: CT, heh, if only one could treat Forth words as exponential objects.
<siraben> Ah, nice. Dependent types are really neat. I'm studying Coq myself.
<remexre> nice, I'm in a reading group going through Logical Foundations
<siraben> remexre: do you know of formalization efforts for languages like Forth?
<remexre> if I need to do a proof on a Forth program /today/, I'm probably more likely to do some sort of model-checking approach, or maybe something with symbolic execution?
<remexre> I don't know of any work in the field
<siraben> Ah. Yes, LF is a classic. I'm trying to read through Volume 2, Programming Language Foundations.
<siraben> remexre: Have you read Algebra of Programming? That's another good book on program calculation.
<remexre> siraben: no,though I've seen the squiggol / bird-merteens stuff before
<remexre> havent' had a chance to go too deep in it
<remexre> I'll add it to our list of "books to read next," thx
<siraben> I'm currently reading it with an algebraist, it gets tricky to read starting with chapter 4 or so.
<siraben> Even though the book says "a first course in FP is assumed" in the beginning!
<remexre> oof, okay; we're trying to stay away from books that require too much math knowledge, in the interest of not scaring off undergrads
<siraben> Haha. I'm an undergraduate myself, and it can be intimidating. Of course it pays off well.
<remexre> gotta go; great talking to you! (should be back later tonight if there was smth else you wanted to discuss)
<siraben> I wonder how calculating Forth programs might look, haven't had a chance to explore much.
<siraben> cya
tabemann has joined #forth
jedb has quit [Ping timeout: 265 seconds]
<tabemann> hey guys
<tpbsd> heyhey
<rdrop-exit> c[] good morning
<tabemann> I need to figure out how to make CREATE and <BUILD work
<tabemann> including in Flash
<rdrop-exit> isn't <BUILD fig-forth?
<rdrop-exit> <BUILDS
<tabemann> thanks for the correction
<tabemann> I'm using it because it fits how my forth works with flash better than CREATE
<tabemann> CREATE is only to be used for allocating arbitrary blocks of memory, together with ALLOT
<tabemann> screw it
<tabemann> I'm not going to define these in assembly
<tabemann> rather I'm going to force the user to upload routines for these
<tabemann> but I will provide support routines in assembly, such as that needed to implement DOES>
<rdrop-exit> If you have inlining then CREATE would lay down a header and a literal
<tpbsd> tabemann, why not build them with forth, you can always do it in assembly later if you want ?
<rdrop-exit> |header|lit|<addr>|ret|
<tabemann> tpbsd: that's what I'm gonna do
<tpbsd> thats gotta be one of the big advantages
<rdrop-exit> (assumes inlining)
<tpbsd> I tend to test my mods in Forth first, then do it in assembly later
<tabemann> this isn't going to be inlined, because it will require dynamically changing the code, but rather it will be written with the assembler routines built into zeptoforth
<tpbsd> frankzappaforth
<tpbsd> why do STM even bother calling their redacted, incomplete code snippets "examples" ?
<tpbsd> I think the summer interns must do them
<tpbsd> if STM had a example of a "automotive" it would just be a chassis with a engine, no wheels or drivetrain, no seats or steeringwheel
<rdrop-exit> just make sure you leave enough space to patch the code
<rdrop-exit> initial: |header|lit|addr|ret|<padding>
<tpbsd> rdrop-exit, is that dynamic patching ?
<rdrop-exit> patched:|header|call|<addr>|ret|<leftover>|
<rdrop-exit> that's what DOES> implies
<tabemann> like : create : current-here <offset> + <align> dup 0 literal, 0 bx, end-compile, current-here begin over over > while 0 current, 1 + repeat drop drop ;
* tpbsd brain explodes
<rdrop-exit> why do complicated?
<tpbsd> because it's easiest ?
<rdrop-exit> just patch with a call to the new code
<tabemann> because it needs to provide room for the code before the buffer, it needs to align the buffer to a word boundary, and it needs to write out the padding explicitly (in case it is writing to flash)
<tabemann> well wait
<tabemann> my code's wrong
<tabemann> : create : 6 push, current-here <offset> + <align> dup 6 literal, end-compile, current-here begin over over > while 0 current, 1 + repeat drop drop ;
<rdrop-exit> DOES> is a hack
<rdrop-exit> you're using combined code and data spaces?
<rdrop-exit> on the target?
<tabemann> yes
<tabemann> the main dichotomy on my forth is between RAM space and Flash space
<tabemann> and in RAM between system variables, dictionary space, data stack, and return stack
<rdrop-exit> ok then you need to calculate where the data will start in advance
<tabemann> system variables and return stack are allocated upon bootup, dictionary space and data stack grow at each other from opposite directions (with no real border between the two)
<rdrop-exit> if your literals are variable sized you have to take that into account too
<tabemann> my literals are variable sized
<tabemann> they can be 16, 32, or 64 bit (for 8 bit, 16 bit, or 32 bit literals)
<tabemann> but that's ignoring the code needed to push the current TOS onto the data stack
<tpbsd> tabemann, Mecrisp-Stellaris has a system.s that configures memory per target, also allowing error messages when ram and flash are running low
<rdrop-exit> in this case its an address literal so that limits which of those might apply
<tabemann> tpbsd: I have configurations for these things, but I haven't implemented checks for them yet
<tpbsd> cool
<tpbsd> tabemann, there is also a M4 Forth for Amforth
<rdrop-exit> |header|lit|addr|ret|padding|<data>
<tpbsd> it looks much reduced compared to Mecrisp-Stellaris and sadly the comments are also in German
<tabemann> mein Deutsch ist nicht so gut!
<tpbsd> tabemann, it also reuses some Mecrisp-Stellaris code and mentions that
<tpbsd> mine is non existant
<rdrop-exit> gesundheit
<tpbsd> matthias has helped the author with some cortex-m problems
<tabemann> know what, I'm gonna implement some things I need like said checks
<tabemann> I'm not gonna bother with CREATE or <BUILDS right now
<tabemann> because I can always build them in Forth were I to need them
<tpbsd> I dont blame you, they have to be among the most complex definitions ?
<tpbsd> CREATE or <BUILDS ... the jewel of Forth
<tpbsd> or was that CREATE or <DOES ?
<rdrop-exit> <BUILDS was used by Fig-Forth
<tabemann> <BUILDS and DOES>
<rdrop-exit> DOES> is pretty useless IMO
<rdrop-exit> it's a hack and leads to bad factoring
<tpbsd> says the Mecrisp-Stellaris dictionary .. create name ( - - ) Create a definition with default action which cannot be changed later. Use <builds does> instead. Equivalent to : create <builds does> ;
<rdrop-exit> back to the future
<tabemann> I have thought of another way of doing CREATE - HERE <n> ALLOT CONSTANT FOO
<tabemann> this has the advantage that I don't have to figure out how big FOO will be in memory
<rdrop-exit> won't work
<rdrop-exit> I think ANS calls that BUFFER: IIRC
<tabemann> well, yes, it doesn't allow you to have arbitrarily sized buffers
<rdrop-exit> it won't allow you to do CREATE THINGIES 1 , 2 , 3 ,
<rdrop-exit> there also RESERVE
<rdrop-exit> * there's
<rdrop-exit> reserve ( # -- a )
<rdrop-exit> that's equivalent to your HERE <n> ALLOT
<tabemann> I actually implemened that, under that name!
<rdrop-exit> :)
<rdrop-exit> tpbsd, that's the first time I've seen <BUILDS since Fig-Forth
<rdrop-exit> it was removed in the 83 standard
<rdrop-exit> IIRC
<rdrop-exit> just checked, it was demoted to an "uncontrolled reference word"
<rdrop-exit> kinda cool to see it reappear
<tpbsd> Mecrisp-Stellaris is all about innovation ;-)
<rdrop-exit> I imagine he wanted to make does> less hacky by having a dedicated <builds
<tabemann> I don't see how you implement ANS CREATE in a system which writes to flash
<tpbsd> i remain mostly clueless about this area, it's my last mountain to climb
jedb has joined #forth
<tpbsd> tabemann, the only things one can create in flash are arrays and constants in Mecrisp-Stellaris
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
<tpbsd> there is a interesting hack to create a uninitialized array from flash but then it cant be seen in the dictionary ...
<rdrop-exit> tabemann, focus on what is layed down
<rdrop-exit> |header|lit|<addr>|ret|<padding>|
<rdrop-exit> (assumes inlining)
<rdrop-exit> you need carnal knowledge to calculate the forward address, that's the only special thing about it
<rdrop-exit> (assuming your code and data spaces are combined)
<rdrop-exit> it's similar to how forward references are resolved in control flow words
<tpbsd> matthias has mentioned the difficulty in reserving space for unknown forward references
<tpbsd> it's why Mecrisp-Stellaris has the short conditional jump limitation
<rdrop-exit> if your address is 32 bits, you do a HERE, then you allot 4 bytes, then you comma the ret, then you align your dictionary to a cell boundary, then you resolve the forward reference
<tpbsd> he mainly didnt want to waste memory reserving it for long jumps when in many cases only short ones are needed
<tpbsd> i guess it was the 4 bytes compared to one
<tpbsd> he said thats not a issue with risc-v however
<rdrop-exit> tpbsd, that's an extra twist, but not hard to do
<tpbsd> rdrop-exit, I think that the workaround for the short conditional jump is to replace it with a branch for 32 bit range
<rdrop-exit> e.g. you start with 16-bit addresses, then eventually switch to wider ones
<tpbsd> as thumb conditional jumps have a very limited range
<rdrop-exit> (in the case of CREATE I mean)
<rdrop-exit> tpbsd, conditional jumps are a different problem, but also easy to handle
<tabemann> back
<rdrop-exit> my alternative to CREATE is a little more sophisticated as it can handle arbitrary alignments
<rdrop-exit> and variable sized lits
<tpbsd> rdrop-exit, matthias seemed to think it was a problem with cortex-m, but hes very fussy about resource wastage atc
<tpbsd> etc
<rdrop-exit> it switches from 16-bit address lits to 32-bit address lits as the dictionary grows
<rdrop-exit> so your early creates use shorter lits than your later ones
<rdrop-exit> tpbsd, the best way not to waste target resources is to go tethered ;-)
<rdrop-exit> but you know that already :)
<tpbsd> yeah, but I'm not a Forth writer
<tpbsd> we have a tethered one and it's very nice, just not cortex-m
<tpbsd> well the host is cortex-m, the target is MSP430
<tpbsd> lol, it's a Mecrisp-Stellaris tethered Forth but the target is not cortex-m
<rdrop-exit> I wonder why he didn't use a PC as the host
<tpbsd> bbl folks
<rdrop-exit> ciao tpbsd!
<tpbsd> jtag
<rdrop-exit> jtag?
<tpbsd> he should have used rdrop-exits method
<tpbsd> yeah, he used a arm cortex-m4 for as the host for it's jtag facilities
<tpbsd> jtag is the umbilical
<rdrop-exit> ah I see
<tpbsd> anyway, bbl :)
<tabemann> lol
<tabemann> I just write CREATE in Forth
<tabemann> it looks so much simplier in Forth than it did in assembly
<tabemann> *wrote
<rdrop-exit> cool
jsoft has joined #forth
<tabemann> now I need to see if e4thcom as mode that works with zeptoforth
<tabemann> i.e. no hardware flow control, ok as a line end, CRLF for newlines
<tabemann> okay, I'm gonna get kicked out of this coffee shop - they're closing
<tabemann> bbiab
<rdrop-exit> have fun
tabemann has quit [Ping timeout: 256 seconds]
tabemann has joined #forth
proteus-guy has quit [Ping timeout: 240 seconds]
deesix_ has joined #forth
dddddd_ has joined #forth
deesix has quit [Ping timeout: 272 seconds]
dddddd has quit [Ping timeout: 265 seconds]
gravicappa has joined #forth
_whitelogger has joined #forth
proteus-guy has joined #forth
<tpbsd> nice, e4thcom!
dave0 has quit [Ping timeout: 268 seconds]
dave0 has joined #forth
WickedShell has quit [Remote host closed the connection]
dddddd_ has quit [Ping timeout: 260 seconds]
jpsamaroo has quit [Ping timeout: 258 seconds]
dys has quit [Ping timeout: 258 seconds]
mtsd has joined #forth
<rdrop-exit> hex font done
<mtsd> Hello Forthers
<rdrop-exit> hello mtsd
<mtsd> Hi rdrop-exit
<mtsd> Everything alright, I hope?
<rdrop-exit> all good, thanks
<rdrop-exit> and you?
<mtsd> Yes, thanks. Doing good over here. Winter coming to an end and everything
<rdrop-exit> nice
<rdrop-exit> 31C here
<rdrop-exit> I just made a hex font for my Forth
<rdrop-exit> having fun reacquainting myself with x11
<mtsd> Interesting!
<rdrop-exit> I'm using 16x16 raster for ASCII glyphs, and 8x16 for hex digits, so I can display any byte values that aren't ASCII glyphs as two hex digits in the same screen space that a normal glyph occupies.
<rdrop-exit> When I want to see a hexdump of all bytes, I just switch the font to the hex font for everything
<tpbsd> rdrop-exit, very slick!
<tpbsd> mtsd, g'day mate!
<rdrop-exit> thanks, it's fun :)
<mtsd> g'day tpbsd!
<tpbsd> yeah I know, I love making development tools
<tpbsd> mtsd, our hot summer with all the fires is drawing to a end sometime
<mtsd> Is it getting a bit better on the fire front?
<mtsd> Not much about it in the news up here anymore. The big subject now is Corona instead
<tpbsd> it's 28,93 C at my desk at 7:41 pm right now
<tpbsd> mtsd, yeah there are onlu about 30 fires still burning and theyre about 1500km south of me
<tpbsd> hey if that virus reaches Japan and infects the Toyota company, with they call it the "Toyota Corona" ?
<rdrop-exit> try the meatballs folks
<mtsd> tpbsd, :)
<rdrop-exit> There's a Mexican Corono beer
<rdrop-exit> Corona
<mtsd> Wonder if they have a PR problem right now?
<rdrop-exit> me too
<mtsd> Or if they sell more Corona beer than ever?
<tpbsd> sell more than ever
<tpbsd> as P T Barnum said once "I dont care what theyre saying about me as long as theyre talking about me"
<tpbsd> no everyone on earth will know about Corona Beerr
john_cephalopoda has joined #forth
john_cephalopoda has quit [Remote host closed the connection]
iyzsong has joined #forth
proteus-guy has quit [Ping timeout: 258 seconds]
dave9 has quit [Remote host closed the connection]
siraben has quit [Quit: killed]
jimt[m] has quit [Quit: killed]
nonlinear[m] has quit [Quit: killed]
mtsd has quit [Ping timeout: 256 seconds]
dave9 has joined #forth
siraben has joined #forth
jimt[m] has joined #forth
nonlinear[m] has joined #forth
rdrop-exit has quit [Quit: Lost terminal]
jfe has quit [Ping timeout: 258 seconds]
dave0 has quit [Quit: dave's not here]
jfe has joined #forth
deesix_ is now known as deesix
iyzsong has quit [Remote host closed the connection]
iyzsong has joined #forth
jedb has quit [Remote host closed the connection]
jedb has joined #forth
jsoft has quit [Ping timeout: 256 seconds]
jfe has quit [Ping timeout: 268 seconds]
jfe has joined #forth
xek has joined #forth
jfe has quit [Ping timeout: 256 seconds]
WickedShell has joined #forth
tp___ has joined #forth
tp___ has quit [Changing host]
tp___ has joined #forth
tpbsd has quit [Read error: Connection reset by peer]
tp___ is now known as tp
jfe has joined #forth
kori has quit [Ping timeout: 240 seconds]
tabemann has quit [Ping timeout: 256 seconds]
ecraven has quit [Quit: bye]
ecraven has joined #forth
jfe has quit [Ping timeout: 255 seconds]
john_cephalopoda has joined #forth
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
john_cephalopoda has quit [Quit: Leaving]
jfe has joined #forth
jfe has quit [Ping timeout: 268 seconds]
jfe has joined #forth
proteusguy has quit [Ping timeout: 265 seconds]
kieselsteini has joined #forth
kieselsteini has quit [Remote host closed the connection]
kieselsteini has joined #forth
jfe has quit [Ping timeout: 260 seconds]
john_cephalopoda has joined #forth
kieselsteini has quit [Remote host closed the connection]
kieselsteini has joined #forth
dys has joined #forth
kieselsteini has quit [Remote host closed the connection]
dys has quit [Ping timeout: 256 seconds]
dddddd has joined #forth
xek has quit [Ping timeout: 255 seconds]
gravicappa has quit [Ping timeout: 260 seconds]
dave0 has joined #forth
john_cephalopoda has quit [Quit: Leaving]
jfe has joined #forth
jfe has quit [Remote host closed the connection]
jfe has joined #forth
jfe has quit [Ping timeout: 260 seconds]
jfe has joined #forth
jfe has quit [Ping timeout: 256 seconds]