inode has quit [Ping timeout: 240 seconds]
inode has joined #forth
_whitelogger has joined #forth
dave0 has joined #forth
zolk3ri has joined #forth
pareidolia has quit [Ping timeout: 246 seconds]
pareidolia has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
Keshl has quit [Read error: Connection reset by peer]
Keshl has joined #forth
veltas has quit [Ping timeout: 240 seconds]
neuro_sys has quit [Ping timeout: 240 seconds]
neuro_sys has joined #forth
neuro_sys has joined #forth
veltas has joined #forth
clog has joined #forth
remexre has quit [Remote host closed the connection]
remexre has joined #forth
hosewiejacke has joined #forth
dave0 has quit [Quit: dave's not here]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #forth
sts-q has quit [Ping timeout: 256 seconds]
gravicappa has joined #forth
hosewiejacke has quit [Ping timeout: 240 seconds]
sts-q has joined #forth
zolk3ri has quit [Remote host closed the connection]
dave0 has joined #forth
hosewiejacke has joined #forth
lispmacs has joined #forth
<lispmacs> thought this was interesting:
Gromboli has quit [Quit: Ping timeout (120 seconds)]
Gromboli has joined #forth
iyzsong has quit [Read error: Connection reset by peer]
iyzsong has joined #forth
xek has joined #forth
_whitelogger has joined #forth
neuro_sys has quit [Ping timeout: 240 seconds]
neuro_sys has joined #forth
neuro_sys has quit [Changing host]
neuro_sys has joined #forth
f-a has joined #forth
<f-a> when you need to store and fetch stuff
<f-a> you have to use different words for different sizes
<f-a> i.e. @ c@
<f-a> does it make sense to make a «container» to abstract this out? maybe with https://gforth.org/manual/Mini_002dOOF-Example.html ? Or is it unforthy?
<f-a> in general is abstraction frowned upon?
<hosewiejacke> I'd say most of the time you just use "@".
<inode> you can also do something like : @MARBLES MARBLE-SIZE * MARBLES + @ ; for accessing array elements
<f-a> appropriate
<f-a> thanks
f-a has quit [Quit: leaving]
hosewiejacke has left #forth ["Leaving"]
proteus-guy has quit [Ping timeout: 240 seconds]
proteus-guy has joined #forth
Zarutian_HTC has quit [Ping timeout: 264 seconds]
f-a has joined #forth
<lispmacs> f-a: I didn't look very closely at your question, but just to mention: it is also possible to define a class with an instance behavior, without using an OO framework:
Zarutian_HTC has joined #forth
<f-a> thanks lispmacs
<f-a> that is a much welcome answer
<f-a> since the only things I know about polymorphisms come from Haskell
<lispmacs> then, e.g., you could use the word `marbles' with a length parameter to create a marbles array called `mymarbles', then later call `<index> mymarbles'
<lispmacs> `10 marbles mymarbles' then `2 mymarbles' later
<f-a> magnificent
<lispmacs> it is forths simple way of allowing you to define your own data types similar to `constant' and `variable'
<lispmacs> the defining and instance behavior could be anything, so you could, e.g., create a data type that represents the memory on another computer chip
<lispmacs> I'm not sure exactly how you would translate in the idea of multiple class functions, like in OOP. I suppose if you needed to simulate multiple instance behaviors, you could pass in a behavior parameter to switch between behaviors
Lord_Nightmare has quit [Ping timeout: 256 seconds]
Zarutian_HTC has quit [Remote host closed the connection]
<nihilazo> "starting forth" uses >R and R> in an answer before introducing them in the text
<nihilazo> :(
<nihilazo> annoying book
<f-a> the leo brodie one?
<f-a> I found it nice to read, interesting regardless of forth
<nihilazo> yeah, it's what I'm learning forth from
<nihilazo> it's just being kinda annoying, using words in answers it didn't introduce in the chapter those questions are in
<f-a> ditto
<MrMobius> using a thing before you explain it can also be a teaching technique ;)
<nihilazo> it uses R> in an answer in chapter 4 then only teaches R> in chapter 4
Lord_Nightmare has joined #forth
<f-a> MrMobius: works when you have a tutor near you imho
<f-a> with a book it is annoying
<f-a> before the internet: blocking
<MrMobius> sometimes they're trying to get you to ask yourself what it is and guess what it's doing so when they explain it youre primed
<f-a> whoever wrote that test suite thingo needs a statue
<veltas> I worked through Starting FORTH first, and do not remember this.
dave0 has quit [Quit: dave's not here]
Zarutian_HTC has joined #forth
<veltas> nihilazo: Do you mean the answer to chapter 4 part 6, where it gives an answer without >R/R> and then one that does use them saying it's "a more efficient version, using tricks introduced in the next chapter"
crest has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<nihilazo> oh hmm, it's only showing me the second answer in the web version
crest has joined #forth
crest has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
PDogJr has joined #forth
crest has joined #forth
<joe9> lispmacs, the forth-cpu is cool.
f-a has quit [Quit: leaving]
f-a has joined #forth
f-a has quit [Quit: leaving]
f-a has joined #forth
Zarutian_HTC has quit [Ping timeout: 264 seconds]
f-a has quit [Ping timeout: 260 seconds]
f-a has joined #forth
gravicappa has quit [Ping timeout: 246 seconds]
gravicappa has joined #forth
<veltas> nihilazo: Oh right yeah the web version is bad, use the scanned PDF
<veltas> I am not surprised stuff is broken on the web version, I don't know if Brodie was even involved in the ANSI changes
<f-a> I wonder on how popular ANS Forth was
<veltas> I think ANS Forth 94 was a better standard than Forth 2012, except for environment query strings
<nihilazo> veltas: OK I'll grab the scanned PDF
<nihilazo> is it on forth.com too?
<nihilazo> the first edition
<nihilazo> yes, it is. OK, grabbing it
<veltas> Yes I think so
<veltas> Not that much stuff is outdated, and the places where things have changed are a bit of history and interesting
<veltas> The bit on the block editor is probably worth skipping or skimming
<veltas> I skimmed it anyway
<nihilazo> ok
<nihilazo> I find it interesting that a lot of earlier texts seem to consider forth an OS as well as a language
<nihilazo> I assume that's in a similar way to BASIC being both OS and langauge on many earily home computers?
<veltas> Some people still describe Forth as an OS
<veltas> There isn't really a good definition of "OS" anyway, not in my opinion. Forth might as well be an OS
<MrMobius> nihilazo, yes like BASIC
<nihilazo> ok
<nihilazo> actually I do know one early home computer that did come with forth rather than basic, the jupiter ace
<nihilazo> sadly it didn't seem to be very successful, they're super rare now
<veltas> Anything that runs on an older system and has general purpose programming + editor is essentially an OS
<nihilazo> I love the illustrations in starting forth
<nihilazo> the 2-headed SWAP dragon especially
shmorgle has joined #forth
<nihilazo> and the executioner etc. It has a fun vibe that I rarely see in programming books, even ones that are trying to be fun
crc has quit [Remote host closed the connection]
<nihilazo> it feels like it's just the author understanding fun ways to illstrate concepts rather than an author trying to put jokes into an otherwise boring programming book
<f-a> ↑
dnm has quit [Ping timeout: 264 seconds]
dnm has joined #forth
<nihilazo> are I, I' and J old? I notice the web version has R@ instead
<veltas> Yes and no
<veltas> I and J are now not necessarily the 1st and 3rd return stack items
<veltas> In the standard
<nihilazo> ok
<veltas> I' is not in the standard
<veltas> You can tell why I and I' are the top and 2nd of return stack, because that's where the iterator and limit are retained on the original forths
<veltas> The standard generally tries to assume less about e.g. return and control stack layout
<nihilazo> ah, i is the iterator
<nihilazo> that makes sense
<nihilazo> and r@ is the top of the return stack
<f-a> : a ( n n -- ) 0 do 0 do i j . . key loop loop ;
<f-a> this loops infinitely, what am I doing wrong?
<veltas> You haven't supplied a limit
<veltas> Oh wait you have
<f-a> (invoke it with `2 3 a`)
<veltas> Yes sorry I always half-ass reading your code my bad :P
<f-a> no worries
<veltas> Okay the limit isn't supplied to the inner loop correctly
<veltas> You need to retain it somehow for later loops
<veltas> It's consumed the first major loop
<nihilazo> is fixed point still the preferred math in forth even though we now have hardware FP on basically every modern machine?
<nihilazo> like, if you are programming for a machine with hardware floating point
<nihilazo> (well, "basically every modern machine", modern desktop platforms)
<veltas> It's *faster* to do FP on many machines now
<veltas> For embedded systems without an FPU often floating-point calcs would be extremely bloated
<remexre> also if you're an ideologue like me, you might not want the default non-integer math to have negative zero and nan :P
<nihilazo> so how does floating point work in forth?
<veltas> There are floating point words in the standard
<veltas> Optionally the floating point numbers get their own stack
crc has joined #forth
<nihilazo> alright, thanks
<f-a> : prova 3 3 0 do 0 do i j . . key cr loop loop ;
<f-a> sorry mispaste :P
<nihilazo> ah ok, pforth also has a seperate float stachpk
<nihilazo> s/stachpk/stack/
<nihilazo> is it still worth reading the chapter on fixed point even if floating is faster on modern desktop platforms
<nihilazo> actually the answer is "yes" because I probably will be programming forth on 8bit machines etc
<f-a> oh veltas
<f-a> now I see my error
<f-a> tricky
<MrMobius> nihilazo, cool that youre doing 8 bit stuff. which machine(s)?
X-Scale` has joined #forth
<nihilazo> probably c64?
<MrMobius> awesome
<nihilazo> I want to program for the c64 and forth seems like a nice step up from asm while still being able to use asm for stuff
<nihilazo> when it needs to be super quik
<nihilazo> s/quik/quick/
<nihilazo> I don't even have a c64, I'm using an emulator, but I want to program for an 8-bit machine for the sake of learning
scoofy_ has joined #forth
scoofy has left #forth [#forth]
<MrMobius> there is a subroutine threaded forth called TaliForth2 that runs on the newer 65C02, so not c64 compatible, but it's a neat thing to practice on. I have an emulated version on my website you can play with in the browser: http://calc6502.com/Simulators/TaliForth2/main.html
X-Scale has quit [Ping timeout: 272 seconds]
X-Scale` is now known as X-Scale
<MrMobius> subroutine threaded being generally the fastest but largest size model of forth
scoofy_ is now known as scoofy
<veltas> I would like to think it wouldn't be *that* heavy on 6502 comparitively, since 6502 itself is so verbose
<nihilazo> nice, the one I saw for the c64 is https://github.com/jkotlinski/durexforth
<MrMobius> veltas, what do you mean?
<veltas> Which part?
<MrMobius> heavy on 6502
<veltas> I mean not that large compared to more conventional 6502 machine code
<MrMobius> its much larger even if you dont count the 10k kernel
<nihilazo> on a different note, is there a forth that can target the lua platform similarly to how fennel can with a lisp
<nihilazo> just wondering how many different environments I can run forth in :D
<f-a> one of the main selling point imho
<shmorgle> how many environments can you run? there is a forth for just about everything I can think of
<nihilazo> I'm wondering if I can program forth for tic-80
<nihilazo> from real 8-bit platforms to modern fantasy consoles
<f-a> I suspect so
<nihilazo> (tic-80 uses a lua environment internally)
f-a has quit [Ping timeout: 264 seconds]
f-a has joined #forth
<nihilazo> damn, now I'm messing with tic-80 lol
gravicappa has quit [Ping timeout: 265 seconds]
crc has quit [Remote host closed the connection]
rpcope has quit [Ping timeout: 264 seconds]
rpcope has joined #forth
crc has joined #forth
dave0 has joined #forth
xek has quit [Ping timeout: 260 seconds]
<f-a> I dedided to program a tiny game for the GB to finally get into forth
<f-a> and I am excited in whatever complexities I will find and how people usually solve them
<f-a> once you get in the mood it is quite pleasant
<dave0> crc: your retroforth is on hacker news!
f-a has quit [Ping timeout: 265 seconds]
f-a has joined #forth
Zarutian_HTC has joined #forth
<f-a> archeologist are still debating how to interpret this
<veltas> lol I remember that page
f-a has quit [Read error: Connection reset by peer]
f-a has joined #forth
f-a has quit [Client Quit]
f-a has joined #forth
f-a has quit [Quit: leaving]
shmorgle has quit [Quit: [TalkSoup] via NEXTSPACE]
Lord_Nightmare has quit [Quit: ZNC - http://znc.in]
Lord_Nightmare has joined #forth