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;
View all comments
Show parent comment
1
u/EggplantExtra4946 Jul 05 '26
What are you talking about? Up until the new C replacements, almost all languages were GC'd except for C, C++ and a handful of lesser used ones. It's only recently that we've had a few new manually memory managed languages, but none of them are quite good enough so we'll be having more until they fullfill the needs we have for them, ie different tradeoffs between safety, performance and low level control, and in all cases it needs to have good abstractions, type system, metaprogramming features, a clean evaluation model and a correct implementation.