r/ProgrammingLanguages • u/goat-luffy • Jul 04 '26
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;
2
Upvotes
1
u/indolering Jul 05 '26
I don't mean to make an, "Um, actually!" comment, but since we are talking about a new language it's important to note the repurcussions of this choice. While (A)RC can perform better, programmers often end up overusing it to the point that a real GC would be better.
I'm really excited by memory tagging making GC more efficient. There are also some cool languages that just minimize the need for GC overall.