dave0 has joined #forth
a3f has quit [Ping timeout: 258 seconds]
a3f has joined #forth
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> 10.2.0
<lispmacs> guix does not have a package for jonesforth yet, unfortunately
<siraben> Perhaps Guix is stripping the binaries? I know Nix always strips.
<siraben> yeah that's just my personal expression, not planning to upstream it (unless jonesforth adds a free software license)
<lispmacs> I was just setting up an environment with `guix environment --ad-hoc gcc-toolchain gdb make' and running the makefile.
<lispmacs> well, actually, no I wasn't running the makefile, I was using the build instructions in the jonesforth.S tutorial
<siraben> Ok looks like the call to gcc differs slightly from the makefile
<lispmacs> I seem to be getting the same result with the makefile
<lispmacs> hmm, maybe something related to 32 bit libraries...?
<siraben> (am on a different OS right now, starting up a NixOS docker image)
<siraben> works for me, hm.
<siraben> lispmacs: what 32 bit libraries?
<lispmacs> just thinking out loud... from my debian days I recall there was compatibility libraries for 32 bit software on 64 machine
<siraben> also works for me on GCC 9.3.0
<lispmacs> jonesforth.S is all 32 bit assembly code
<siraben> to be clear, you're on the latest commit of the jonesforth repo?
<proteus-guy> yeah I think you have to build it as 32bit executable.
<lispmacs> I cloned it a few days ago
<siraben> but -m32 should do that right?
<siraben> oh re: licensing the header says it's public domain, nice.
<proteus-guy> doesn't it use nasm rather than gas?
<siraben> the build command in the makefile is `gcc -m32 -nostdlib -static $(BUILD_ID_NONE) -o $@ $<`
<lispmacs> the tutorial says gas
<proteus-guy> I'm totally going from memory here - it's been years. hmm.. guess not. :-)
<proteus-guy> but doesn't it use intel syntax?
<lispmacs> proteus-guy: no, tutorial gives a few paragraphs on the quirks of gas syntax
<siraben> lispmacs: what happens when you do `cat jonesforth.f - | ./jonesforth` ?
<proteus-guy> wow.
<siraben> or me,
<siraben> s/or/for/
<lispmacs> cat: write error: Broken pipe
<lispmacs> Segmentation fault
<siraben> that is very strange, hm. maybe we should compare the hashes of jonesforth?
<lispmacs> commit 66c56998125f3ac265a3a1df9821fd52cfeee8cc
<siraben> ah, that's an old commit
<siraben> 4f853252f715132e7716cbd44e5306cefb6a6fec fixes the crash on modern gcc
<siraben> I think that's it then
<lispmacs> when I run git pull it says I'm up to date
<siraben> what's your upstream?
<lispmacs> git://git.annexia.org/jonesforth.git
<siraben> ah. I'm using the one from GitHub
<lispmacs> okay, I'll try that
<lispmacs> that worked
<siraben> nice
<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
elioat has joined #forth
<f-a> I cannot find it
<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
<f-a> apparently
<nihilazo> huh ok
<nihilazo> that seems designed to work with specific tools
<nihilazo> I guess I'll just do what feels right
jedb has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 256 seconds]
hosewiejacke has joined #forth
f-a has quit [Quit: leaving]
f-a has joined #forth
hosewiejacke2 has joined #forth
hosewiejacke has quit [Ping timeout: 272 seconds]
Zarutian_HTC has joined #forth
hosewiejacke2 has quit [Ping timeout: 240 seconds]
<f-a> https://pastebin.com/BDxLGC55 my forth skills suck ;_;
<remexre> this is exponentiation?
<f-a> yeah
<f-a> from starting forth book
<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
f-a has joined #forth