Zarutian_HTC has quit [Read error: No route to host]
Zarutian_HTC has joined #forth
KipIngram is now known as Guest5275
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
dave0 has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
hosewiejacke has joined #forth
gravicappa has joined #forth
sts-q has quit [Ping timeout: 246 seconds]
hosewiejacke has quit [Ping timeout: 240 seconds]
sts-q has joined #forth
hosewiejacke has joined #forth
dave0 has quit [Quit: dave's not here]
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 265 seconds]
X-Scale` is now known as X-Scale
irsol has quit [Ping timeout: 272 seconds]
irsol has joined #forth
jedb_ has joined #forth
jedb_ has quit [Read error: Connection reset by peer]
jedb_ has joined #forth
jedb has quit [Ping timeout: 246 seconds]
scoofy has joined #forth
fiddlerwoaroof_ has joined #forth
rpcope has quit [Ping timeout: 240 seconds]
rpcope has joined #forth
fiddlerwoaroof has quit [Ping timeout: 258 seconds]
dave0 has joined #forth
xek has joined #forth
dysprosaic has joined #forth
iyzsong has quit [Ping timeout: 240 seconds]
iyzsong has joined #forth
cantstanya has quit [Ping timeout: 268 seconds]
cantstanya has joined #forth
dysprosaic has quit [Ping timeout: 256 seconds]
nitrix has joined #forth
<nitrix> Hello. I have a curious itch to scratch and I think some of you may know the answer so I'm giving it a try: Does threaded code (forth-like) execute slower or faster than the alternate calling conventions?
<nitrix> I haven't managed to find reliable information, especially with caching. If anyone knows, thanks in advance x]
<dave0> oh shit it's nitrix !
<dave0> hi nitrix
<nitrix> dave0, I'm joining the dark side, I think.
<dave0> i don't know sorry, i'm a newbie
<veltas> nitrix: Is the hypothesis something like if the code is smaller because of the threading model it might have less cache penalty?
<nitrix> veltas, I suppose so, yeah. The routines are pointers to codewords and forth words are just a bunch of those, so I'm guessing forth code has a really high code density.
hosewiejacke has quit [Ping timeout: 240 seconds]
<veltas> I don't know but I'm assuming it is generally slower as basically all mature x86 forths generate optimised machine code
Zarutian_HTC has joined #forth
elioat has joined #forth
<nitrix> Does the "optimised machine code" does register allocation?
<veltas> I think so, because forth is stack-based, a lot of existing understanding on e.g. JIT optimisation applies because those tend to target stack-based bytecodes
<patrickg> In some extreme scenario I suppose a threaded forth could keep all native code in the CPU's i-cache, producing churn in the d-cache only. Ideally that's using some non-FIG memory layout though (which intersperses code, headers and strings, making the cache situation a bit messy)
<veltas> It's a probably an extreme scenario where the bottlenecks don't already fit in cache, unless they're not very localised in which case they wouldn't be localised in threaded code necessarily either
hosewiejacke has joined #forth
<nihilazo> hi, I'm a complete newbie, I'm confused by the problem in starting forth chapter 2 to implement 3DUP
<nihilazo> because all the stack operations I know only operate on the top 3 items of the stack, so once I have duplicated 2 of the values I can no longer reach the third
<Zarutian_HTC> nihilazo: know of the R> and >R words?
<nihilazo> they haven't come up yet in the book
<Zarutian_HTC> have you read chapter 2 to the end? /me trying to recall if >R and R> are introduced there or not
<nihilazo> they don't seem to be there, I'm reading the web version
<inode> nihilazo: what about PICK?
<nihilazo> nope
<nihilazo> I have swap, dup, over, rot, drop, 2swap, 2dup, 2over, and 2drop
<nihilazo> I assume I am intented to use 2over etc to implement 3dup
<inode> i can think of one combination that will do it, do you want it?
jedb_ is now known as jedb
<nihilazo> sure
<inode> DUP 2OVER ROT
<Zarutian_HTC> inode: never assume that PICK is available or cheap. On Harris RTX2010 it isnt cheap because the stacks live in seperste memory devices seperated from program/working memory
dave0 has quit [Quit: dave's not here]
<inode> Zarutian_HTC: thanks for the tip, but i'll worry about that when you send me an RTX2010 to play with ;)
<Zarutian_HTC> eh, it also makes it faster on JITing Forth runtimes as there is no dynamic index into data dependency
<inode> fair enough, but to help someone with a book problem, i'm pretty sure a dirty hack for 3DUP like 2 PICK 2 PICK 2 PICK isn't going to kill anyone :)
<nihilazo> when it says 2dup is (d -- d d), I guess that is a pair of numbers on the stack rather than a single one
<nihilazo> I think that might be my confusion, I was reading those stack effects the same way as ( n -- n n) for dup and assuming each thing there was only one value
<MrMobius> re register allocation, optimizing forths like SwiftForth only use a subset of the registers and the rest lay dormant or you can use them if you want to drop into assembly
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
mikke|72 has joined #forth
Zarutian_HTC has quit [Ping timeout: 240 seconds]
mikke|72 has left #forth [#forth]
flashforth has joined #forth
Zarutian_HTC has joined #forth
zolk3ri has quit [Remote host closed the connection]
hosewiejacke has quit [Ping timeout: 260 seconds]
zolk3ri has joined #forth
<proteusguy> nitrix, typically threaded code will not run quite as fast as optimized linear code written for that processor. Note that most processors are register based rather than stack based and can't benefit as much due to their architecture. That said - thought out in the right environment, threaded code can sometimes beat what "normal" calling conventions may come up with but you've really gotta be aware of your architecture and
<proteusguy> looking out for opportunities. To me - it's more of a matter of speed of development and assurances that my code is correct because it's so much simpler. Forth can out perform languages like python & ruby fairly easily so it's rarely an issue in terms of performance.
elioat has quit [Quit: elioat]
elioat has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
Zarutian_HTC has joined #forth
hosewiejacke has joined #forth
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #forth
elioat has quit [Quit: elioat]
f-a has joined #forth
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #forth
gravicappa has quit [Ping timeout: 240 seconds]
gravicappa has joined #forth
hosewiejacke has quit [Quit: Leaving]
elioat has joined #forth
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #forth
f-a has quit [Ping timeout: 256 seconds]
f-a has joined #forth
<f-a> I am writing a simple «test» word, to test words
<f-a> as now it simply is : test ' execute = ;
<f-a> is there a way to print the name of the word I am testing?
<f-a> ideally I would like
<f-a> 9 3 square-me "square-me works!"
<f-a> 10 3 square-me "square-me does *not* work!"
<Zarutian_HTC> f-a: look into how the ' word works
<Zarutian_HTC> with see '
<lispmacs[work]> f-a: i think the word `word' grabs the next word from the input stream and returns it to you as a string
<f-a> super
<lispmacs[work]> f-a: double checking that...
<lispmacs[work]> f-a: I think `parse-name' is what I was looking for, a.k.a., `parse-word'
<lispmacs[work]> at least, those are the ones in gforth
<f-a> indeed indeed, I should have checked that with se- yes me too using gforth
<lispmacs[work]> f-a: I thought I remember learning something a little different in The Forth Handbook, but the Handbook is not with me here at work
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 264 seconds]
X-Scale` is now known as X-Scale
gravicappa has quit [Ping timeout: 272 seconds]
* Zarutian_HTC has only ever used eforth and openfirmware forth
<veltas> f-a: How do you know if a word works or not?
<veltas> Oh right I see now you give a desired result then the input
<f-a> oh yes I should have described the problem more accurately
<f-a> yeah I would like a "Dear Sir/Madam, your word XYZ fails the test"
<veltas> No it's my fault I'm trying to do two things at once
elioat has quit [Quit: elioat]
<veltas> f-a: : test bl word dup >r find drop execute r> count type = if ." works!" else ." does *not* work!" then ;
<veltas> 9 3 test squared \ squared works!
<veltas> 10 3 test squared \ squared does *not* work!
<f-a> super useful, I am going to `see` all of them words
<veltas> f-a: Also have a look at the forth200x tests, because it's more flexible than this and looks better. https://github.com/gerryjackson/forth2012-test-suite
<f-a> thanks
<veltas> e.g. T{ 1 0 AND -> 0 }T
<f-a> ohhh
<veltas> Checks that after "1 0 AND" you get 0 on stack and nothing else for example
<f-a> bl is… ?
<veltas> ' '
<f-a> see bl
<f-a> 32 Constant bl
<f-a> `see` is sometimes a bit uninformative without comments
<f-a> thanks
<veltas> Check out forth-standard.org
<veltas> f-a: Which forth are you using?
xek has quit [Ping timeout: 272 seconds]
<veltas> Funny how the BL word has so much activity on it
<f-a> gforth, veltas
<veltas> That website has I believe recent builds of the docs for gforth
<veltas> How did you obtain gforth f-a ?
<f-a> debian buster
<veltas> Which version are you on?
<f-a> f@extensa:~$ gforth --version
<f-a> gforth 0.7.3
<veltas> I recommend downloading and building the latest version, a lot has been added since
<veltas> Don't remove the current gforth you have, because I believe it's needed to build the newer version
f-a has quit [Read error: Connection reset by peer]
inode has quit [Ping timeout: 264 seconds]
dave0 has joined #forth