lispmacs[work] has quit [Remote host closed the connection]
lispmacs[work] has joined #forth
_whitelogger has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 264 seconds]
X-Scale` is now known as X-Scale
<proteusguy>
siraben, hg has a far more intuitive workflow and you generally want the default arguments. Also it scales better when you're talking about projects with large histories and lots of branches.
<siraben>
hmm
gravicappa has joined #forth
proteus-guy has joined #forth
dave0 has quit [Quit: dave's not here]
X-Scale` has joined #forth
X-Scale has quit [Ping timeout: 246 seconds]
X-Scale` is now known as X-Scale
sts-q has quit [Ping timeout: 264 seconds]
sts-q has joined #forth
lispmacs has joined #forth
<lispmacs>
is anybody here using jonesforth? I wanted to work through the literate code tutorial, but jonesforth crashes with a segfault when I try to start it
lispmacs has quit [Remote host closed the connection]
lispmacs has joined #forth
<proteus-guy>
yikes - I haven't run it in ages. Have you run pdb against it to see where it traps? (Compile with debugging symbols on.)
<proteus-guy>
Sorry gdb
<lispmacs>
proteus-guy: I tried, but it actually crashes sometime so early that there is no stack yet to examine. I think something must have bit-rotted in the assembly code
<siraben>
lispmacs: jonesforth works fine for me on x86_64-linux running NixOS
<lispmacs>
siraben: hmm, maybe something about my environment
<lispmacs>
or the gcc version
<siraben>
What OS are you running?
<lispmacs>
what gcc/gas version do you use to build
<lispmacs>
Guix System 1.2.0-13.a53f711 x86_64
<siraben>
let me check (it's the one in Nixpkg's stdenv)
<siraben>
nix-repl> stdenv.cc.version
<siraben>
"10.2.0"
<siraben>
If you enter your Guix build environment, which version of gcc does it use?
<siraben>
Also my derivation is just using the makefile
<lispmacs>
siraben: okay thanks. I have to go to bed now
<siraben>
good night!
* lispmacs
dreams of electric sheep
xek has joined #forth
dave0 has joined #forth
remexre has quit [Ping timeout: 256 seconds]
remexre has joined #forth
hosewiejacke has joined #forth
nihilazo has quit [Ping timeout: 264 seconds]
fiddlerwoaroof_ is now known as fiddlerwoaroof
inode has joined #forth
remexre has quit [Ping timeout: 256 seconds]
remexre has joined #forth
hosewiejacke has quit [Ping timeout: 240 seconds]
hosewiejacke has joined #forth
f-a has joined #forth
hosewiejacke has quit [Read error: Connection reset by peer]
hosewiejacke has joined #forth
f-a has quit [Quit: leaving]
f-a has joined #forth
Zarutian_HTC1 has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
<f-a>
I am trying to write a toy forth in assembler
<f-a>
re: the dictionary
<f-a>
re: a single word in the dictionary
<f-a>
I understand that each entry has to contain:
<f-a>
- the name of the word itself
<f-a>
- a link to the previous word
<f-a>
my question is
<f-a>
should I also put a flag to highlight that the word is a primitive (i.e. assembler?)
<f-a>
otherwise I have difficulty getting how forth would understand the following address list
<f-a>
(i.e.: go there and execute (asm) or go there and execute (forth))
<f-a>
gah, I am not sure I was clear
wineroots has joined #forth
<MrMobius>
f-a, you could put a subroutine call in assembly at the beginning of the address list
<MrMobius>
and have the subroutine start executing the list of addresses found directly after the return address
<f-a>
mhhhhh
<MrMobius>
but also yes you can do it other ways
nihilazo has joined #forth
dave0 has quit [Quit: dave's not here]
Zarutian_HTC1 has quit [Ping timeout: 240 seconds]
elioat has joined #forth
nihilazo has quit [Quit: Gateway shutdown]
nihilazo has joined #forth
f-a has quit [Quit: leaving]
f-a has joined #forth
hosewiejacke has quit [Ping timeout: 240 seconds]
hosewiejacke has joined #forth
f-a has quit [Quit: leaving]
hosewiejacke has quit [Ping timeout: 272 seconds]
<proteusguy>
ah f-a is gone, alas...
<remexre>
yeah was gonna link my docs, lol
f-a has joined #forth
elioat has quit [Quit: elioat]
<nihilazo>
I'm confused at the ** word in chapter 6 of starting forth
<nihilazo>
it seems a lot more complex then it needs to be and I don't quite understand
<nihilazo>
there's the version on the web that uses tuck and some other things that aren't in the book so far, and the version in the PDF which just seems needlessyl complex, although that said I can't think of a simpler version
<f-a>
which definition are you referring to, nihilazo
<nihilazo>
the one that is given as an answer to the problem
<nihilazo>
of writing **
<nihilazo>
: ** ( n1 n2 -- n1**n2 ) 1 SWAP ?DUP IF 0 DO OVER * LOOP THEN NIP ;
<nihilazo>
I'm not sure how "nip" works
<nihilazo>
the version in the book uses rot and stuff
<nihilazo>
which I'm not sure why it should need
<nihilazo>
(I get what all these things are except nip, but I just feel like ** should be simpler than it is)
<f-a>
1 2 nip .s <1> 2 ok
<f-a>
pops the *second* element of the stack
<nihilazo>
ah ok
<nihilazo>
also ?dup is a nice shortcut, didn't really get why it was a word before but after writing "else drop then" a few times having ?dup is cool
<f-a>
yeah
<nihilazo>
is there any recommendation for how to format forth code over multiple lines? Like, a standard kind of style guide
<f-a>
no idea
<f-a>
but I have witnessed forth users are allergic to standards xD
<nihilazo>
one line gets messy and other than the "dup [condition] if [whatever] else \n" pattern idk if there is any way forth code is "meant" to be written on multiple lines
<nihilazo>
I've been putting starts of loops on their own lines and conditions on their own line with indenting the stuff inside them like with other languages but it looks odd
<remexre>
personally I'd do a single loop that goes through the exponent (the b in a^b) and chomps off the lsb each time, taking advantage of the fact that a^b = a^(b&1) * (a^2)^(b >> 1)
<remexre>
and that might be cleaner, and should be more factorable
<f-a>
the book comes up with
<f-a>
: ** ( n1 n2 -- n1**n2 ) 1 SWAP ?DUP IF 0 DO OVER * LOOP THEN NIP ;
<f-a>
(spoiler)
hosewiejacke2 has joined #forth
<remexre>
ah
<nihilazo>
I was trying to do something with trying to leave the input number on the stack and then loop keeping another thing
<nihilazo>
y'know what I think my idea might work
<nihilazo>
idk
Zarutian_HTC has quit [Ping timeout: 256 seconds]
hosewiejacke2 has quit [Ping timeout: 240 seconds]
Zarutian_HTC has joined #forth
f-a has quit [Ping timeout: 264 seconds]
f-a has joined #forth
elioat has quit [Quit: elioat]
elioat has joined #forth
rann has quit [Ping timeout: 264 seconds]
rann has joined #forth
elioat has quit [Quit: elioat]
dave0 has joined #forth
xek has quit [Ping timeout: 240 seconds]
spoofer has quit [Remote host closed the connection]
phadthai has quit [*.net *.split]
bluekelp has quit [*.net *.split]
phadthai has joined #forth
bluekelp has joined #forth
spoofer has joined #forth
elioat has joined #forth
f-a has quit [Read error: Connection reset by peer]
<veltas>
I think the point of the book example is more about how loops work rather than an efficient exponentiation