Namely, that the code will be read by someone who knows the language. And arguably that the code should be capable of being "self-documenting." Although perhaps people well-versed in COBOL would argue COBOL can be, and I just don't know it.
What are the security guarantees with writing in COBOL? Like, does COBOL allow out-of-bounds memory access? How does it compare to C or Rust as far as allowing ‘accidental’ security lapses?
Modern COBOL compilers will catch this with an error; if you do manage to compile and run, you'll get a runtime error or immediate crash.
> How does it compare to C or Rust as far as allowing ‘accidental’ security lapses?
COBOL has reference modification that can easily be purposefully used to reference memory outside the bound of the original data you target. It isn't memory safe, it's just very restrictive so many errors/misuses get weeded out during compiling.
Cobol on Cogs: http://www.coboloncogs.org/HOME.HTM
Cobol on Wheelchair: https://github.com/azac/cobol-on-wheelchair
I applaud Jms Dnns! This project really makes you think.
For those who are unaware — you can use COBOL in two modes: free mode and fixed format mode.
Fixed format mode is (afaik) the original, based on punch card affordances, and specifies specific columns for specific purposes:
* The first 6 columns for line numbers
* Column 7 for the indicator character (notably: * for comments as you can see here https://github.com/jmsdnns/webbol/blob/main/file-structs.cpy )
* Column 8-11 for special division markers, though they can extend beyond (visible in this file: https://github.com/jmsdnns/webbol/blob/main/webserver.cbl)
* Columns 12-72 for ordinary COBOL statements
* Columns 73-80 for programmer comments or whatever notes you like
All the columns are undoubtedly a bit taxing to the modern developer and their tools, so 'free mode' which discards all the above is the suggested default.
But, I think fixed mode is very charming, and if you're going to write COBOL in 2025, you may as well try to get the most authentic experience!
This may help you get the feel (pick the COBOL card at the top). [0]
For an even more authentic experience, write the program on a coding form first, then give it to an assistant for keypunching. [1]
[0] https://www.masswerk.at/keypunch/
[1] https://www.mainframestechhelp.com/tutorials/cobol/coding-sh...
I've thought about a COBOL webserver before, but didn't get beyond reading the GnuCOBOL FAQ that mentions it's possible with CGI https://gnucobol.sourceforge.io/faq/gcfaq.html#id1126
I'm definitely going to dig into this project more later. This is very neat!
pantulis•1h ago
http://www.coboloncogs.org/INDEX.HTM