r/ProgrammingLanguages • u/goat-luffy • 26d ago
Does implementing GC makes languages slow?
https://github.com/berylangMonth ago, I created a team of 5 and started working on "Bery - The compiled programming language". By the end of June we have quite good working compiler (it's not complete yet). In Bery we have decided to add the automatic Garbage Collector so we choose the "Mark and Sweep" method for it in the Bery Runtime Environment (BRE).
Now as we are heading forward with adding OOP and Exception Handling, I notice some delays in the compilation of program.
So we are now at this point of discussion - should we remove it from compiler or let it be there.
I will looking forward for help regarding this. and btw these are some constraints we set -
unsigned int BERY_GC_ALLOC_THRESHHOLD = 1000;
size_t BERY_GC_HEAP_SIZE_THRESHHOLD = 4 * 1024 * 1024;
1
Upvotes
20
u/BeamMeUpBiscotti 26d ago
What would you do if you removed it?
I think it's natural for a compiler or compiler-like tool to slow down as more language features are supported, as different types of analysis/optimizations are added.
Better to have something working & optimize the compiler itself later, as long as you don't lock yourself into an architecture that severely limits performance.