Conversation

yall didnt tell me C is basically no_std unsafe {} Rust

1
0
1
@fiore just wait until you realize you can borrow in c
1
0
0
@fiore well, references to them
0
0
0

@fiore

int arr[] = {2, 4, 8, 12, 16, 18};
2
0
0
@fiore with stackalloc you're nor even stuck with fixed sizes
0
0
0
@snacks @fiore i dont need C to "pass around locals" i can do that myself just fine.
1
1
3
@fiore @snacks milocal used to be the orange buses but now it dont mean anything anymore
0
0
2
@snacks @fiore safe as long as you only pass them to functions down the stack, and never store them anywhere else.
1
0
1
@icedquinn @fiore yes, idk if the borrow checker in rust enables stuff like that but the only one i have experience with pretty much limits you to what you can do in c already and just gives guardrails
2
0
0
@icedquinn @fiore i think c devs are gonna yell at me if i write a program and allocate everything on the stack tho
1
0
1
@snacks @fiore rust will allow it but the lifetime of the borrow is narrowed to the function call stack so it stops you from being able to accidentally store it somewhere, afaik.
0
0
1
@snacks @fiore that's just arena/region allocation and used to be a more popular concept. the old game Abuse ran a custom lisp which did the same thing. frames didn't GC, they just bump allocated and threw out the region every frame.
0
0
1