PyHP-pph / PyHP_pph

This repository serves as a centre for collaboration on the PyHP++# language. It will also include a functioning interpreter and compiler for PyHP++# once the standard is finalised.
https://www.reddit.com/r/PyHP_pph/
GNU Affero General Public License v3.0
23 stars 3 forks source link

Garbage Collection? #29

Open prydt opened 7 years ago

prydt commented 7 years ago

Will we leave garbage collection up to the programmer, such as in C(++) or should we implement garbage collection under the hood, such as in Python and in PHP?

Kampfkarren commented 7 years ago

This seems implementation-specific. Not something that might be in the spec, but something that should be looked into in the official CIC.

ghost commented 7 years ago

I think we should take C++'s manual memory management. No reference counting, no garbage collection at all. When you create something, you have to remember to add new, and when you're done with an object, you have to manually delete it.

Kampfkarren commented 7 years ago

The variables specification already has del which requires the memory be cleared, so it looks like we already have memory management.

ghost commented 7 years ago

I'm not sure if cic-suggestion is appropriate; something like del would be a language feature, and a requirement that the CIC keep track of memory and dispose of it when it becomes inaccessible would be in the specification.

iptq commented 6 years ago

Why not both? Have objects be garbage collected, and but require programmers to use del after every allocation as well.

Kampfkarren commented 6 years ago

How would that work, @iptq?