You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ola Fosheim Grøstad edited this page May 25, 2017
·
3 revisions
Some relevant topics:
Memory managment
Resource Management
Transactions
Garbage Collection with Finalize
Simula, Java, C#, Go, JavaScript...
Linear/Affine types
Whiley has linear/affine typing like Rust. Pony has a slightly more expanded version of this scenario that prevents locking/deadlocks in a highly concurrent context, but uses GC for memory management (?).
C++ has unique_ptr, which is almost the same, but not checked by the compiler.
Reference Counting
Another form for ownership management is reference counting, either with a seperate refcount object like C++ shared_ptr/weak_ptr or an counter embedded in the object like Objective-C/Swift (who also have automatic reference count acquire/release injection).
Copy on Write References?
S-Expressions, functional languages like Lisp/Haskell.
But there are other variants that are possible. What about a copy_on_write_ptr? That is more difficult to achieve since you need to detect whether a method can modify an object and create a copy before modification takes place. Maybe static analysis can help here and inject copying code where appropriate.