alexdovzhanyn / ThetaLang

θ A statically typed, functional programming language that compiles to WebAssembly
MIT License
32 stars 9 forks source link

Implement garbage collection #42

Open alexdovzhanyn opened 1 day ago

alexdovzhanyn commented 1 day ago

To enable the creation of more complex data structures in ThetaLang while maintaining a high-level programming model, we need to implement an efficient garbage collection (GC) system. This will help automate memory management, allowing developers to focus on writing clean, efficient code without worrying about manual memory allocation and deallocation.

Proposed Solution:
To avoid the complexity of hand-writing a garbage collector directly in WebAssembly, we propose leveraging existing tools like Emscripten. Emscripten would allow us to write the garbage collector in C++, which could then be compiled into WebAssembly. This approach enables better performance and reduces potential errors in memory management.

Required Updates:

Benefits: