Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

garbage collection

Name: Anonymous 2012-02-21 2:10

Imagine a virtual machine that uses scopes, with variables indexed by their name's starting character for quick access times. Every call, a scope is pushed onto the scope stack. Every return, that scope is popped and destroyed, including the variables it holds.

So, why do people use anything else? Can it not possibly be this simple? `What about pointers', you say; every variable is in a scope, therefore every pointer points to something in a scope (only concerning heap allocated variables for this sake) . Nullify the pointers. The pointed to will be deleted.

Simple.

Name: Anonymous 2012-02-21 2:23

Congratulate yourself. You've reinvented escape analysis in a shittier form, without understanding why you still need a heap.

Name: Anonymous 2012-02-21 2:33

>>1
This is exactly the way I imagined it the first time I was trying to design a small scripting language. My first ever thoughts for garbage collection

Name: Anonymous 2012-02-21 2:34

>>2
implying there isn't a heap

Name: Anonymous 2012-02-21 2:34

So data structures are not allowed to contain references to other data structures?

Name: Anonymous 2012-02-21 3:07

>>5
It's good enough for APL. The closest thing APL has to references is using (eval) on the name of a variable.

Name: Anonymous 2012-02-21 3:14

>>5
References are shit.

Name: Anonymous 2012-02-21 4:21

dynamic scope is shit

Name: Anonymous 2012-02-21 7:07

OP's brain will be destroyed when he'll learn ret N command in assembler. Real assembler, no VM shit.

Name: Anonymous 2012-02-21 7:56

OP should learn Rust.

Name: Anonymous 2012-02-21 8:36

Saging just because.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List