4 ms·
> Due to COBOL's lack of functions and recursion, the recursion required for Lisp is built from the ground up using file processing. Does this mean that they a
by mrighele 8y ago
> Due to COBOL's lack of functions and recursion, the recursion required for Lisp is built from the ground up using file processing.
Does this mean that they are storing the stack as records on a file ? Hopefully they will implement tail recursion as soon as possible :-)
- dan-robertson 8y agoDrives are large so there’s less reason for tail recursion if you stack lives on disk anyway. Also Common Lisp does not require tail recursion and the traditional style doesn’t really use it either
- mrighele 8y agoI was thinking more about performance than space. If you hit the disk for every recursive call (not sure if it is the case, I can't read COBOL) the performance is probably going to be terrible even if the files are memory mapped. Optimized tail recursion would avoid most of that.
- agumonkey 8y agodefine callcc { cp ./stack ./stack.old ; }
- ww520 8y agoThey can definitely implement garbage collection with copying. Just copy all the live objects to another directory and then "rm -fr old-heap."
- flyinghamster 8y ago> Due to COBOL's lack of functions and recursion Wait, what? Someone forgot about the PERFORM verb. Or, are they writing this in an old enough version of COBOL for that not to be present?
- rst 8y agoPERFORM was in the original 1960 COBOL spec -- but attempting to use it recursively was (and may remain) undefined behavior.
- zerr 8y agoCan't the recursion be implemented explicitly with Stack data structure? (if it's possible to have/implement the stack in COBOL, not sure).
- abrax3141 8y agoCOBOL, and other PLs of that day, were heavily integrated with the ISAM file structure. ISAM a precursor of SQL, and was basically a hash table implemented very efficiently in a file. If you have hash tables, you can do pretty much anything. (Actually, it was better than a hash table. Once you had indexed (I) into the file, you could sequentially read forward (S). The AM is Access Method.)
- flyinghamster 8y agoAh, that makes sense, then. The last time I wrote anything in COBOL was in a class about 35 years ago. ;)
- drbw 8y agoYeah, but there's no local variables or dynamic memory allocation (from what I remember of COBOL85 on Tandems, anyway)