Conversation
forth is just scheme but oops all macros
1
0
2
@coolbean iirc lisp was cited as an influence at some point
1
0
0
@snacks i dont think ive heard that before but im definitely aware of the resemblance. i mean forth is literally lisp but linked lists function as stacks (matter of fact both dictionaries and stacks are implemented as linked lists in my dumbass flavour of lisp written in c by someone that sucks at and loathes writing c)

i should probably be writing this in ocaml instead
1
0
1
@snacks but ocaml is a bitch to bootstrap so no
1
0
0
@snacks wanna see my dipshit terrible code? i even went ahead used the most obscure indentation style i know
1
0
0
@snacks its not even code, its just initialisation. im just... im pretty much begging for approval and someone to check i didnt already misuse pointers
2
0
1
@snacks next up i have to figure out compilation which means generating qbe IL which means stringfuckery which means wanting to fucking hang yourself because doing that in c is quite possibly the worst most memory-bug-rich thing you could possibly do with a computr
0
0
0
@coolbean won't your data and return stack point to the same address once you fill in that null since you're just pointing to the same global struct?
1
0
0
@snacks the pop macro checks if its null and breaks out of the repl loop if thats the case
2
0
0
@snacks but also ugh this is stupid cause the repl macro doesnt actually work from the qbe IL what the fuck am i thinking
1
0
0
@snacks the the the the the pop/push macros
1
0
0
@snacks im at antidepressant trough. will report back later i gotta take my meds and wait until the brain zaps stop
0
0
1
@coolbean ok, it's just a placeholder value to mark the bottom of the stack. Still don't understand how your sp and rsp are gonna work
1
0
0
@snacks the rsp isnt real it literally just exists to accomodate forth code that uses it, the real hardware return stack is already managed by qbe
2
0
1
@coolbean also, i don't think you can do recursive structs
1
0
1
@snacks literally just a second parameter stack for my own amusement

i wish i could write this in ml instead functional languages are so much more ergonomical with recursive data structures (and strings simply cause they use garbage collection)
0
0
1
@snacks in which case im just changing it to void*
0
0
1
@coolbean c is dumb and this will result in an infinitely large struct
2
0
2
@snacks fucking hilarious tbh
1
0
1
@coolbean well, not dumb. Just strictly evaluated and it's a value type
1
0
2
@snacks whyd i abandon doing this in forth again?. its not like theres a lack of forths in the world so as long as i write it in ans forth it should be more than bootstrappable enough
1
0
2
@coolbean is the dict also just shortened dictionary?
1
0
0
@coolbean tbh, i have no clue what the parameter and definition on structs do
1
0
0
@snacks purely to make the structures less cumbersome to define by not needing to prepend "struct" all the time but its pointless and i should probably just not do that
0
0
1
@coolbean yeah, a bunch of forths use ans forth as base. Gforth just has the gforth path saved somewhere but technically can be bootstrapped with any c and ans forth combination.
Flk is completely written in ans forth as well
1
0
1
@coolbean i know way too much about this shit for never having done anything but a server that logs the body to console in forth
1
0
1
@snacks tell me about it my firth actual forth project is writing a forth
2
0
2
@snacks i remember now what happened. my initial plan was to use s\" to replace some variables while bootstrapping but then i realised that id have to supply the variable for literally each and every time that its called and that felt stupid so i stopped and just wrote it in qbe intermediate language thinking i could do the bootstrapping from it except jokes on me i need malloc
0
0
1
@coolbean forths are like text editors, just fun projects that seems simple but you can sink way too much effort into
1
0
1
@snacks i wanna write a forth based text editor as well
1
0
1
@snacks and with a visual mode. and it uses structural regex instead of expanded regex
1
0
0