{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,1,3]],"date-time":"2026-01-03T05:23:13Z","timestamp":1767417793606,"version":"3.48.0"},"reference-count":40,"publisher":"MDPI AG","issue":"1","license":[{"start":{"date-parts":[[2026,1,1]],"date-time":"2026-01-01T00:00:00Z","timestamp":1767225600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100004564","name":"Ministry of Education, Science and Technological Development of the Republic of Serbia","doi-asserted-by":"crossref","award":["451-03-136\/2025-03\/200104"],"award-info":[{"award-number":["451-03-136\/2025-03\/200104"]}],"id":[{"id":"10.13039\/501100004564","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Computers"],"abstract":"<jats:p>Recursion is often presented as a nice and illustrative technique, only to later conclude that it should (almost) never be used due to potential problems with call stack overflow. However, recursion can often be the technique of choice during algorithm development and testing, and even in final solutions. Therefore, a simple but effective technique is needed to overcome call stack limitations. We designed and implemented the Extendable Stack Library (ESL), which provides a simple and effective interface that enables deep recursion in C++. Its flexible usage model allows deep recursion to be used where needed, without requiring major project modifications or customization of development tools. The performance overhead is moderate and localized only to deep recursive functions using ESL. The library is designed to be flexible and cross-platform. It supports Linux on AMD64 and AArch64 processors and Windows on AMD64. It can be adapted to more platforms with relative ease. ESL has been tested through a series of unit tests, experiments, and practical applications. It has proven to be an effective solution for deep recursion. ESL has been successfully used in the implementation of the Wafl programming language interpreter.<\/jats:p>","DOI":"10.3390\/computers15010015","type":"journal-article","created":{"date-parts":[[2026,1,2]],"date-time":"2026-01-02T09:18:56Z","timestamp":1767345536000},"page":"15","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":0,"title":["Enabling Deep Recursion in C++"],"prefix":"10.3390","volume":"15","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-4385-6322","authenticated-orcid":false,"given":"Sa\u0161a N.","family":"Malkov","sequence":"first","affiliation":[{"name":"Department of Computer Science, Faculty of Mathematics, University of Belgrade, Studentski Trg 16, 11158 Belgrade, Serbia"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-5358-0828","authenticated-orcid":false,"given":"Ivan Lj.","family":"\u010cuki\u0107","sequence":"additional","affiliation":[{"name":"Independent Researcher, 11000 Belgrade, Serbia"}]},{"ORCID":"https:\/\/orcid.org\/0009-0000-2153-4114","authenticated-orcid":false,"given":"Petar \u017d.","family":"\u0110or\u0111evi\u0107","sequence":"additional","affiliation":[{"name":"Department of Computer Science, Faculty of Mathematics, University of Belgrade, Studentski Trg 16, 11158 Belgrade, Serbia"}]}],"member":"1968","published-online":{"date-parts":[[2026,1,1]]},"reference":[{"key":"ref_1","unstructured":"Graham, R.L., Knuth, D.E., and Patashnik, O. (1988). Concrete Mathematics, Addison-Wesley."},{"key":"ref_2","unstructured":"Knuth, D.E. (1997). The Art of Computer Programming, Volume 1: Fundamental Algorithms, Addison-Wesley. [3rd ed.]."},{"key":"ref_3","unstructured":"Sedgewick, R., and Wayne, K. (2011). Algorithms, Addison-Wesley. [4th ed.]."},{"key":"ref_4","unstructured":"Drozdek, A. (2012). Data Structures and Algorithms in C++, Cengage Learning. [4th ed.]."},{"key":"ref_5","unstructured":"Weiss, M.A. (2013). Data Structures and Algorithm Analysis in C++, Pearson Education. [4th ed.]."},{"key":"ref_6","unstructured":"Patterson, D.A., and Hennessy, J.L. (2011). Computer Organization and Design: The Hardware\/Software Interface, Morgan Kaufmann. [4th ed.]."},{"key":"ref_7","unstructured":"(2025, June 02). Wafl Programming Language. Available online: https:\/\/poincare.matf.bg.ac.rs\/~sasa.malkov\/wafl\/index.html."},{"key":"ref_8","first-page":"345","article-title":"Customizing a Functional Programming Language for Web Development","volume":"36","author":"Malkov","year":"2010","journal-title":"Comput. Lang. Syst. Struct."},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Grune, D., Reeuwijk, K., Bal, H.E., Jacobs, C.J.H., and Langendoen, K. (2012). Modern Compiler Design, Springer. [2nd ed.].","DOI":"10.1007\/978-1-4614-4699-6"},{"key":"ref_10","unstructured":"Levine, J.R. (1999). Linkers and Loaders, Morgan Kaufmann."},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"O\u2019Regan, G. (2016). Mathematical Induction and Recursion. Guide to Discrete Mathematics, Springer.","DOI":"10.1007\/978-3-319-44561-8_4"},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"37","DOI":"10.1080\/08993408.2015.1033205","article-title":"Teaching and learning recursive programming: A review of the research literature","volume":"25","author":"McCauley","year":"2015","journal-title":"Comput. Sci. Educ."},{"key":"ref_13","doi-asserted-by":"crossref","unstructured":"Rubio-Sanchez, M. (2018). Introduction to Recursive Programming, CRC Press.","DOI":"10.1201\/9781315120850"},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"73","DOI":"10.1145\/328691.328700","article-title":"From recursion to iteration: What are the optimizations?","volume":"34","author":"Liu","year":"1999","journal-title":"SIGPLAN Not."},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"76","DOI":"10.1145\/366959.366968","article-title":"Sequential formula translation","volume":"3","author":"Samelson","year":"1960","journal-title":"Comm. ACM"},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"312","DOI":"10.1007\/BF01386232","article-title":"Recursive Programming","volume":"2","author":"Dijkstra","year":"1960","journal-title":"Num. Mathematik"},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"1756","DOI":"10.1093\/comjnl\/bxr002","article-title":"Dijkstra\u2019s rallying cry for generalization: The advent of the recursive procedure, late 1950s\u2013early 1960s","volume":"54","author":"Daylight","year":"2011","journal-title":"Comput. J."},{"key":"ref_18","unstructured":"Aho, A.V., Lam, M.S., Sethi, R., and Ullman, J.D. (2006). Compilers: Principles, Techniques, and Tools, Pearson Education. [2nd ed.]."},{"key":"ref_19","unstructured":"Bryant, R.E., and O\u2019Hallaron, D.R. (2016). Computer Systems: A Programmer\u2019s Perspective, Pearson Education. [3rd ed.]."},{"key":"ref_20","unstructured":"(2025, February 06). Overview of x64 ABI Conventions. In Microsoft Learn. Available online: https:\/\/learn.microsoft.com\/en-us\/cpp\/build\/x64-software-conventions."},{"key":"ref_21","unstructured":"(2025, February 06). System V Application Binary Interface, AMD64 Architecture Processor Supplement. Available online: https:\/\/refspecs.linuxbase.org\/elf\/x86_64-abi-0.99.pdf."},{"key":"ref_22","unstructured":"(2025, February 06). C++ ABI for the Arm\u00ae 64-bit Architecture (AArch64). In Application Binary Interface for the Arm\u00ae Architecture. Available online: https:\/\/github.com\/ARM-software\/abi-aa\/tree\/main\/cppabi64."},{"key":"ref_23","unstructured":"Love, R. (2013). Linux System Programming, O\u2019Reilly Media. [2nd ed.]."},{"key":"ref_24","unstructured":"Yosifovich, P., Ionescu, A., Russinovich, M.E., and Solomon, D.A. (2017). Windows Internals, Part 1: System Architecture, Processes, Threads, Memory Management, and More, Microsoft Press. [7th ed.]."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"153","DOI":"10.1145\/356571.356573","article-title":"Virtual memory","volume":"2","author":"Denning","year":"1970","journal-title":"ACM Comput. Surv."},{"key":"ref_26","unstructured":"(2025, February 06). Memory Limits for Windows and Windows Server Releases. In Microsoft Learn. Available online: https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/memory\/memory-limits-for-windows-releases."},{"key":"ref_27","unstructured":"(2008). MISRA C++:2008: Guidelines for the Use of C++ Language in Critical Systems, MIRA Limited."},{"key":"ref_28","unstructured":"(2025, February 02). Options That Control Optimization. In A GNU Manual. Available online: https:\/\/gcc.gnu.org\/onlinedocs\/gcc\/Optimize-Options.html."},{"key":"ref_29","doi-asserted-by":"crossref","unstructured":"Appel, A.W. (1992). Compiling with Continuations, Cambridge University Press.","DOI":"10.1017\/CBO9780511609619"},{"key":"ref_30","unstructured":"Taylor, I.L. (2025, February 02). Split Stacks in GCC. In GCC Wiki. Available online: https:\/\/gcc.gnu.org\/wiki\/SplitStacks."},{"key":"ref_31","unstructured":"Anderson, B. (2023, May 06). Abandoning Segmented Stacks in Rust. Available online: https:\/\/web.archive.org\/web\/20230605154530\/https:\/\/mail.mozilla.org\/pipermail\/rust-dev\/2013-November\/006314.html."},{"key":"ref_32","doi-asserted-by":"crossref","unstructured":"Ma, Z., and Zhong, L. (2023, January 22\u201323). Bringing Segmented Stacks to Embedded Systems. Proceedings of the 24th International Workshop on Mobile Computing Systems and Applications, HotMobile 2023, Newport Beach, CA, USA.","DOI":"10.1145\/3572864.3580344"},{"key":"ref_33","unstructured":"(2025, February 06). GNU Binutils 2.44 Released. Info-Gnu Discussion. Available online: https:\/\/lists.gnu.org\/archive\/html\/info-gnu\/2025-02\/msg00001.html."},{"key":"ref_34","unstructured":"Boost C++ Libraries (2025, February 06). Boost. Context Library. Version 1.88. Available online: https:\/\/www.boost.org\/libs\/context\/."},{"key":"ref_35","unstructured":"Kowalke, O., and Goodspeed, N. (2025, February 06). Fiber_Context\u2014Fibers Without Scheduler, C++ Standard Proposal P0876R20. Available online: https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2025\/p0876r20.pdf."},{"key":"ref_36","unstructured":"Stroustrup, B. (2025, June 23). C++ Exceptions and Alternatives. In JTC1\/SC22\/WG21\u2014Papers. Available online: https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2019\/p1947r0.pdf."},{"key":"ref_37","unstructured":"(2025, January 12). Extendable Stack Library. Available online: https:\/\/gitlab.com\/smalkov_\/libextstack."},{"key":"ref_38","doi-asserted-by":"crossref","unstructured":"Farvardin, K., and Reppy, J. (2020, January 15\u201320). From folklore to fact: Comparing implementations of stacks and continuations. Proceedings of the PLDI 2020: Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, London, UK.","DOI":"10.1145\/3385412.3385994"},{"key":"ref_39","doi-asserted-by":"crossref","unstructured":"Theodoridis, T., and Su, Z. (2024, January 24\u201328). Refined Input, Degraded Output: The Counterintuitive World of Compiler Behavior. Proceedings of the ACM on Programming Languages, Copenhagen, Denmark.","DOI":"10.1145\/3656404"},{"key":"ref_40","doi-asserted-by":"crossref","first-page":"S101","DOI":"10.1016\/j.diin.2018.01.013","article-title":"Building stack traces from memory dump of windows x64","volume":"24","author":"Otsuki","year":"2018","journal-title":"Digit. Investig."}],"container-title":["Computers"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2073-431X\/15\/1\/15\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,1,3]],"date-time":"2026-01-03T05:19:28Z","timestamp":1767417568000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2073-431X\/15\/1\/15"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,1,1]]},"references-count":40,"journal-issue":{"issue":"1","published-online":{"date-parts":[[2026,1]]}},"alternative-id":["computers15010015"],"URL":"https:\/\/doi.org\/10.3390\/computers15010015","relation":{},"ISSN":["2073-431X"],"issn-type":[{"type":"electronic","value":"2073-431X"}],"subject":[],"published":{"date-parts":[[2026,1,1]]}}}