<veltas>
x64 they are next to each other and grow downwards like regular stack
<mark4>
a grows down stack is one that when it overflows and segfauls linux automatically assigns a new page to the stack
<veltas>
Oh okay
<mark4>
is what i meant, its one of the options you can pass to the mmap syscall
<veltas>
I just meant the direction of growth
<mark4>
ya
<veltas>
Of data
<veltas>
Not pages
<mark4>
the push direction more accurately
<veltas>
Yes
<mark4>
in x86 thats always down
<mark4>
it is also USUALLY down on 32 bit arms too :)
<mark4>
put arm did not have a PUSH opcode really till aarch64
<veltas>
I don't think I've seen an arch where it's not down
<mark4>
it used movm
<mark4>
arm can be either diraction
<veltas>
It's convenient because your stack contents is at positive offsets from current stack pointer that way
<mark4>
you can create a grows up stack in arm
<veltas>
And you can stick it at the end of your available memory in a flat setup
<mark4>
yup
<mark4>
which is what i do :)
<Zarutian_HTC>
veltas: 6502 and variants? Motorola 68K?
<mark4>
Zarutian_HTC: does that mean coldfire is grows up too?
<veltas>
Zarutian_HTC: I was thinking of 6502 but couldn't remember which way, is it really upwards?
<Zarutian_HTC>
that Hitatchi sr04 bot uses.
<Zarutian_HTC>
in 6502 iirc, the stack is in page 0x0100 and incr when pushed iirc
<mark4>
yes the stack is in page 1
<Zarutian_HTC>
and I am not sure but I suspect 6502 never had any stack relative memory addressing mode
<veltas>
Zarutian_HTC: I just looked it up and it's not upwards, it grows downwards
<veltas>
And apparently S points to next free word rather than last allocated word? Very strange
f-a has left #forth [#forth]
f-a has joined #forth
<mark4>
6502 has push and pop but with indexed x and indexed y you CAN index into the stack
<mark4>
but i dont think ive ever seen that doen lol
<mark4>
veltas: on arm you can make push grow up or down and make the stack pointer point to the last item pushed or to the next cell to push into
<mark4>
ldm and stm
<mark4>
not movm which is 68k bs lol
<mark4>
ldmfd stifd ldmia stmia i think
<veltas>
You have told me this like 3 times now mark4
<mark4>
veltas: i didnt state taht you can point to full or to empty tho :)
<veltas>
I find features like this really pointless
<mark4>
well arm does not really have push or pop it has load and store multiple which you can use to do memory to memory moves really really fast
<veltas>
Like on PowerPC the ability to work with either endianness is never used, it's just there so NT can be incompatible with everything else
<mark4>
lol
<veltas>
And big endian itself is utterly pointless and confusing now
f-a has left #forth [#forth]
<Zarutian_HTC>
eh, it is left out of the radhardened versions of PowerPC
<veltas>
Good
<Zarutian_HTC>
I say little endian is pointless on all levels
<veltas>
It's like saying 8-bit bytes is pointless
<Zarutian_HTC>
and many sane arch have returned to cell addressing instead of byte addressing
<veltas>
Big endian gives me 1-based-indexing vibes
<Zarutian_HTC>
have you looked how contorted and big little endian adder with and without lookahead is?
<veltas>
If it's an 'adder' and it cares about byte order you're doing it wrong
<Zarutian_HTC>
whacha mean? adders in most alus and other places in an cpu core are of the full datapath width of the machine, nowdays 64 bit usually
<veltas>
Yes so by the time the data gets there it is as a 'word', not in bytes
<veltas>
I can read a little endian number from an address as any size, and get the right answer truncated to that read size.
<veltas>
Byte indices are in ascending order of shifts/units, so most endian-aware algorithms operating on the raw bytes are cleaner
<veltas>
And it's convention now too
<Zarutian_HTC>
then why bother with byte addressing? there are byte select instructions/addressing-modes that can select which of eight bytes are used in the calculation
<veltas>
So that's all there is to say about it for me, I don't see point in big endian the way I don't see point in 10-bit bytes.
<veltas>
Well actually 10-bit bytes aren't worse they're just unconventional
<veltas>
I think big endian is actually worse
<veltas>
Zarutian_HTC: Why bother? Because e.g. if I want to store an unaligned 24-bit number in a binary format, I can't in general use a single instruction to load that, and would probably be writing C at work anyway so instruction would be irrelevant
<Zarutian_HTC>
I know of one exploit (old one) that relied on addresses and ints being little endian
<veltas>
There are reasons to want either, but mostly rare concerns. The most common endian-aware code I write is neater with LE
<veltas>
For example big endian is better for encoding words in my tokenized forth that are not tokens
<Zarutian_HTC>
stack ovetflow by one byte, an ending null byte of the shell string
<veltas>
Because I can write the high byte of XT first, and determine if it's in range
<veltas>
Or if it's not in range it's the single byte indexing the token vector
<veltas>
But it's a specialist usage and machine endianness support here is irrelevant to algorithm
<Zarutian_HTC>
that overflow over rode the return address so it started at the 256 byte page of where the calling function was
<veltas>
This is not a very strong point against LE in general though
<Zarutian_HTC>
it just happened to be a handy gadget that used offsets into the callstack, offsets that pointed into the shell string
<Zarutian_HTC>
suffice to say the exploit was rather neat
<Zarutian_HTC>
personally I am against little endian in, file formats, network protocols, and device interfacing
<veltas>
I wonder if there is a reason
<veltas>
The only advantage of big endian I see is making it easier to spot data in a hex dump, because the bytes are in reading order already
<Zarutian_HTC>
hours and hours trying to figgure out why a wrong value was being written to a memory address mappend device control register
<Zarutian_HTC>
mapped*
<veltas>
Yes but the issue there is that there are alternative endianness, you can't blame it on one or the other, only complain that there are two
<veltas>
You, at best, can blame it on the less conventional one for trying to stick around, which is big endian
<Zarutian_HTC>
oh, no there are not two, there at least three
<Zarutian_HTC>
middle endian has it place of honour in the hall of hated abominations
<veltas>
"middle endian" just means using both big and little endian I thought
<Zarutian_HTC>
the damn compiler thought I was writing an in when in fact the cell-word was an 32 bit split into bitfields
<Zarutian_HTC>
an int*
<mark4>
doesnt little endian allow you to store a char in a 23487659234659 bit value and you can just printf it ? :)
<veltas>
The ZX Spectrum's BASIC stores line numbers as big endian for no apparent reason
<mark4>
lol
<mark4>
i had a zx81
<mark4>
typed a full 16k basic program in by hand and on the final "enter" the ram pack moved and.... it crashed
<mark4>
the ram pack plugged in to the back and had legs that lifted the back of the computer up so pushing down too hard unplugged the rm pack lol
* Zarutian_HTC
is still looking for that home computer zine that dissasembled Bill Gates MicroSoft BASIC and proceeded to utterly trounch it
<mark4>
but i lived in cambridge where clive sinclair lived... never saw him tho
* Zarutian_HTC
notes that was in response to Bill Gates (in)famous letter to the editor
* Zarutian_HTC
further notes that in next issue after that the zine published much better BASIC implementation
rixard has quit []
<Zarutian_HTC>
it was only eclipsed by Bill Gates use of Ctrl-Alt-Del in Microsoft (yes I am aware of the capitalization changed) software
<Zarutian_HTC>
you know Windows Logon key combo
<mark4>
yea u had to give the vulcan nerve pince to log in lol
<mark4>
DUMB
<Zarutian_HTC>
it was onstensibly to prevent bluepilling the ui
<mark4>
wtf is that lol
<Zarutian_HTC>
it is when someone made a full screen application mimicing the logon screen
<mark4>
aha
<Zarutian_HTC>
the nifty thing that this was before the movie The Matrix had even been shot so the term bluepilling had not yet been coined
eli_oat has joined #forth
Zarutian_HTC has quit [Read error: Connection reset by peer]
<siraben>
Apparently AOC implies this but not vice versa, so it's weaker and rules out paradoxes like Banach-Tarski
<siraben>
I think the closest we got to this was when we used the well-ordering property of natural numbers to prove some things, didn't get to talking about moduli of Cauchy sequences though
<siraben>
Interesting nonetheless.
xek has joined #forth
APic has quit [Ping timeout: 276 seconds]
APic has joined #forth
hosewiejacke has joined #forth
f-a has joined #forth
APic has quit [Ping timeout: 245 seconds]
APic has joined #forth
hosewiejacke has quit [Ping timeout: 245 seconds]
hosewiejacke has joined #forth
dave0 has quit [Quit: dave's not here]
elioat has joined #forth
f-a has quit [Ping timeout: 245 seconds]
f-a has joined #forth
hosewiejacke has quit [Ping timeout: 245 seconds]
Zarutian_HTC1 has quit [Ping timeout: 245 seconds]
hosewiejacke has joined #forth
tech_exorcist has joined #forth
shmorgle has quit [Quit: [TalkSoup] via NEXTSPACE]
tech_exorcist has quit [Remote host closed the connection]
shmorgle has joined #forth
tech_exorcist has joined #forth
f-a has quit [Quit: leaving]
Zarutian_HTC has joined #forth
<veltas>
mark4: Do tell us if you get through to CM about IRC
<veltas>
I do know it applies to results in real analysis though
<siraben>
Yeah, I think those types of things would be deferred to a graduate course im analysis.
<siraben>
Pretty funny that even as you take the higher undergrad courses in math they're still introductory, because the theories are quite well developed
<veltas>
I think it's more interesting if you do axiomatic set theory, a good course on ZFC or similar will end with defining real numbers and some extremely basic analysis
<siraben>
I'm a big fan of constructivism and type theories like Calculus of Constructions
<siraben>
so yeah would be needed if I wanted to build analysis from scratch in Coq/Agda
<veltas>
Maths is an exercise in understanding complicated pure theoretical stuff, a maths degree is kind of like a very high brow IQ test :P
<veltas>
I suppose there is a lot of problem solving and rigour trained as well
<siraben>
introductory calculus was probably the worst of it because it's non-rigorous and lots of arbitrary things to memorize
<veltas>
Yeah my uni never did that
<veltas>
Are you doing maths or CS?
<f-a>
a constructivist
<f-a>
in forth
<veltas>
Sorry I'm sure you've told me this before
<siraben>
veltas: both!
<veltas>
"discrete maths"?
<siraben>
pure
<veltas>
Anyway, if you're doing maths courses, at my uni we never did "boring rote calculus" or anything like that,
<siraben>
that was like intro calc 1st year
<veltas>
Day 1 we were doing analysis
<veltas>
And set theory
<siraben>
heh nice, Europe I imagine
<veltas>
And algebra
<veltas>
Yes
<siraben>
north american curricula pale in comparison sometimes
<siraben>
that's great
<veltas>
There is no standard 'curriculum' in the UK
<siraben>
I know there's a lot of electronics folk here, I wonder if I should do some signal processing classes/Fourier analysis
<siraben>
Right
<siraben>
bbl
<veltas>
Signal processing is definitely worth knowing
<veltas>
As is fourier analysis, although the answer on whether to take those *classes* depends on your lecturers and individual course quality
<veltas>
You can learn all this stuff in your own time...
Zarutian_HTC has quit [Ping timeout: 240 seconds]
jai_cha has joined #forth
<jai_cha>
hi, is there a forth bot here?
<f-a>
ciao jai_cha , I do not think os
<f-a>
*so
<jai_cha>
sad, my distro doesn't have a forth included
<f-a>
really?
<f-a>
not even gforth?
<jai_cha>
no
<f-a>
mhhh
<f-a>
which distro is that
<jai_cha>
alpine
<remexre>
edge/testing has it, if you feel like enabling that :p
<jai_cha>
gforth?
<remexre>
yeah
<jai_cha>
cool, although, my experience is that many packages never make it from testing to stable
<f-a>
I mean
<f-a>
compiling the tar.gz yourself is a way too
<remexre>
yeah... gnuware is probably especially tricky given musl doesn't try to implement all of glibc's... unique behaviors
<f-a>
it is supereasy, iirc just `make`
<jai_cha>
if I have to compile stuff I think I'm going for something else, gforth is not very much alive (dead?)
<jai_cha>
maybe retroforth
gravicappa has quit [Ping timeout: 240 seconds]
<f-a>
gforth is quite alive
<f-a>
but any forth will do
<f-a>
laters
f-a has quit [Quit: be back in a bit]
Keshl_ has quit [Ping timeout: 264 seconds]
<jai_cha>
do you use forth with alloc? Last time I tried forth I did not fear really comfortable manually managing memory.
<remexre>
personally I do, but I mainly use forth without an operating system
<remexre>
so I'm using a dictionary stored in a fixed buffer until I get a "normal" ALLOCATE/FREE allocator up and running
<jai_cha>
remexre: embedded development? what forth do you use?
<jai_cha>
remexre: is stahl for arm64 like raspberry pi 4?
<remexre>
yeah, though I care more about the rk3399 (as used in the rockpro64 and pinebook pro) than the pi (don't actually own one)
<remexre>
arm64 assembly is just _so much nicer_ to write than amd64
<remexre>
and not having to deal with acpi is a big plus
<jai_cha>
I'm on a rpi4 right now
<jai_cha>
I can try that, how do I compile it
<remexre>
it definitely won't boot there, arm boards in general need custom linker scripts, a bootloader, etc
<remexre>
but it's built using the Nix package manager, just run nix-build with it installed
<remexre>
right now it really won't run anywhere but qemu though
<remexre>
older revisions worked on the rk3399, but they didn't do interrupts right so most of it ended up getting scrapped
<remexre>
and I'm slowly making my way thru the ARM GIC docs...
<jai_cha>
I thought it could work with all arm64 boards without customization, but I see I was wrong
<remexre>
if you do wanna mess around with it under qemu, ./run.py starts it; at the moment, the easiest way to play around with things will be by dropping them in the 99-testing.fth file; there's an example of what a REPL would look like in src/platforms/js/90-repl.fth, but I need to finish interrupts to be able to do input
<remexre>
yeah, ARM stuff is way less standardized in general; there's some recently-released? spec for SBCs' boot process, but it's based on UEFI and therefore dumb (only half joking...)
<remexre>
and idk of anything that "natively" supports it (i.e. supports it in rom or something)
<jai_cha>
f I run it in qemu here I don't have any advantange compared to running it in x86 right?
<remexre>
not really; I keep KVM disabled because it's a bit funky on one of my boards
<jai_cha>
remexre: well, maybe I'll try when I'm back at my laptop then, thanks for the chat and the link, bye!
jai_cha has quit [Quit: leaving]
inode has joined #forth
f-a has joined #forth
<mark4>
does alpine forth run on an arm processor?
<mark4>
try github.com/mark4th/t4
<mark4>
thats an arm thumb2 sub threaded forth
<mark4>
already tested in on beagleboard black, beaglebone and every version of PI there is
<elioat>
mark4, I've been trying to use x4, but on every one of my machines it throws the following error:
lispmacs has quit [Read error: Connection reset by peer]
<f-a>
1 directory, 1 file
<mark4>
here are 4 locations where a terminfo database can be. /etc/terminfo/ ~/.terminfo, lib/terminfo and /usr/share/terminfo. i was only looking in /usr/share
<mark4>
i now look in /lib/terminfo too i though
<elioat>
yeah, this is debian
<elioat>
buster
<mark4>
think the only valid reason for having ~/.terminfo in that list is if you are creating your own terminal
<mark4>
when did you last download from github?
<mark4>
i think i did that fix a few months ago now
<elioat>
this AM
<mark4>
err
<mark4>
and its still not working?
<elioat>
I'm on whatever the default branch is
<elioat>
does my shell matter, maybe?
<mark4>
yea erm. im 9999.99% positive i made that fix AND pushed it to github lol
<mark4>
but NONE of the copies of x4 or x64 i have here on this machine have that fix
<mark4>
ugh
<mark4>
i basically rewrote src/ext/erminal/term.f
<elioat>
hmmm
<elioat>
the last commit I see in gitlog is Jul 19, 2019
<mark4>
yea erm
<mark4>
the fix WAS done but only on X64 not on x4
<mark4>
im actually going to be doing a MAJOR rewrite of all of that term stuff and the TUI code that is currently broken and support gray scale text coloring and 24 bit RGB colors
<mark4>
just because i can lol
<elioat>
oooh
<mark4>
but i thin if you replace term.f with the one in the x64 repo that might be enough
<mark4>
i only got about 2 hours of sleep last night and am kind of a zombie right now lol
<mark4>
even though i have drunk a full pot of coffee since 3am lol
<elioat>
wooof, sleepy! No worries
<elioat>
I'm actually at work right now, and was playing with this while on a call 🤫 but will defo be dipping back in later tonight I hope
<mark4>
if i dont fade out at the keyboard ill be here to help :)
<elioat>
hahaha, for certain
<mark4>
i already need to go through every single x64 primitve and compare it with the x4 primitive and verify the sanity in x64 because somethings that should just work (tm) dont lol
hosewiejacke has left #forth ["Leaving"]
<mark4>
i also want to do some silver smithing (a new hobby) but i dont think i shoudl operate oxy acet right now lol
<mark4>
need to make some sterling silver from fine silver and some copper
<mark4>
i made my kid sister a silver baby spoon for her first munchkin (not yet yatched :)
Zarutian_HTC has joined #forth
<elioat>
I imagine silver smithing while sleepy is way more dangerous than coding :P
Keshl has joined #forth
eli_oat has joined #forth
eli_oat has quit [Client Quit]
elioat has quit [Quit: elioat]
wineroots has quit [Remote host closed the connection]
xek has quit [Ping timeout: 264 seconds]
tech_exorcist has quit [Quit: I'm a quit message virus. Please replace your old line with this line and help me take over the world.]
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC1 has joined #forth
<veltas>
mark4: "the only valid reason for having ~/.terminfo in that list is if you are creating your own terminal" or if you're installing a new terminal locally, not everyone has root all the time
<veltas>
But seriously terminals are too fucking complicated, wow. Everything I learn about terminfo etc makes me wish I knew less
<veltas>
And it's such an uninteresting subject too, and yet so much has been poured into it. plan9 had the right idea by moving out of the terminal emulator
<veltas>
It's like moving out of your parents' house, it has to happen
<veltas>
Today I used my forth on my real ZX spectrum for the first time and it feels amazing, there is so much I want to add on top but what I have so far is already so much better than the BASIC experience
<veltas>
I need save/load functions, I think I need to force myself to make them a priority because I will avoid adding them otherwise
<veltas>
And need to compress the image
<mark4>
veltas: oh... good point :)
<mark4>
i actually love working with terminfo and doing cursor control stuff
<mark4>
i pretty much learned 99% of it after 8 hours of man 5 terminfo lol
<mark4>
then i bought the termcap and terminfo book and verified i ahd it all right lol
<mark4>
im never going to write anything as full featuered as ncurses thought
<mark4>
thats WAY too much.
<mark4>
what kind of images do you need to compress