In the past there have been discussions about allowing a programmer to manually invoke the garbage collector as is possible for other programming languages.

For debugging purposes it may be mandatory in certain situations to be able to manually invoke the garbage collector as lately discussed on the RexxLA member list in the context of the ooRexx debugger by Dom Wise.

Most programming languages allow for debugging purposes the interaction with the garbage collector,  e.g., Python [1], PHP [2], Java [3] (a very nice overview!), .Net [4] (e.g. C#). All of these are major programming languages and/or garbage collecting runtime environments.

There are (granted rare) situations where it becomes important for developers to manually invoke the garbage collector which ooRexx - unlike other programming languages - currently lacks. For such scenarios a gc()-BIF would allow to debug edge cases linked to garbage collection which is quite important for such ooRexx programs and libraries.

Having a gc()-BIF would allow the ooRexx developers to employ the garbage collector manually if this becomes necessary.

[To inhibit naive usage, one could e.g. force the use of gc() by first enabling it and then running the garbage collector or supplying an argument like "run manually", such that not only the documentation for gc() would warn from improper use, but make its use a little bit cumbersome such that it only gets used when really needed. OTOH, I think that ooRexx programmers who use gc() would not do so naively.]

---rony

[1] Garbage Collection in Python, 2023: 
<https://www.geeksforgeeks.org/garbage-collection-python/>
[2] Garbage Collection in PHP, 2013: <https://stackoverflow.com/questions/19715048/what-gc-collect-cycles-function-is-useful-for> [3] Nayak S., Garbage Collection in Java (very nice introductory overview), 2021: <https://www.freecodecamp.org/news/garbage-collection-in-java-what-is-gc-and-how-it-works-in-the-jvm/>
[4] .Net (e.g., C#), 2021: 
<https://learn.microsoft.com/en-us/dotnet/api/system.gc?view=net-9.0>




_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to