Source code
♡ 1 ↻ 2
#Cobol
#COBOL content.. from 8 years ago
The language designers made it have no functions on purpose because they thought functions were hard and were for egg heads.
The original BASIC had functions, but by the time BASIC was on all the 8 bit machines, BASIC was following COBOL with no functions (as a fundamental building block)
♡ 1 ↻ 0
This is the most interesting post I've read on #COBOL. COBOL is an alternative syntax to Assembler because of how COBOL at a syntax level lets you, makes you deal with memory like Assembler does.
#GnuCobol compiles to C, so GnuCobol is going to have the same paradigm mismatch that OtterCobol ran into.
#gcobol looks like it doesn't not have a c-transpilation layer. But I could be reading the docs wrong.
♡ 1 ↻ 0
@silentexception It writes simple #COBOL fine. Last time I did some side project hacking with LLMs and #gnuCOBOL
- too many dialects, the bot needs to be centered, by some huge system message with what gnucobol supports (you got $$$ for Z/OS time, then hire someone, what are you doing with bots)
- COBOL lacks 3rd party libraries, so it will have to reimplement everything
- gnuCOBOL can't do it all, it will need to switch to C from time to time.
I was using ChatGPT4o, if I tried again, I'd use Gemini because you need huge context windows to ground it in your current dialect, the C interop, and to leave space for all the missing libraries. (and if you don't tell it how to solve a common problem it will solve it 10x, I've seen this with bots and python, 10 different ways to do HTTP calls all over the code base)
♡ 1 ↻ 0
How to make #COBOL cool?
```cobol
IDENTIFICATION DIVISION.
PROGRAM-ID. COB2COL.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 TEXT PIC X(20) VALUE "COBOL to COBOL".
PROCEDURE DIVISION.
INSPECT TEXT CONVERTING "B" TO " "
DISPLAY FUNCTION REPLACE(TEXT " " BY "")
STOP RUN.
```
Mind blown. You can run IBM #zos on a PC with a personal edition license.
https://www.ibm.com/docs/en/zdt/14.2.x?topic=personal-edition
And it has IBM #COBOL inside it. I don't understand why this was so hard for me to find. Looks like I need a new machine (linux host, 1tb drive space and then enough oomph to run a VM)
Your periodic reminder that old #COBOL isn't only old COBOL. It is IBM assembler with some COBOL for the easier parts. Business apps written in assembler because the COBOL wasn't fast enough.
I can get the gist of code in most languages, but when I look at edin (assembler!) I can't figure out what is going on despite profuse comments.
Minecraft Server in #cobol
https://github.com/meyfa/CobolCraft
Surprisingly readable and stays in COBOL most of the time, not too much resorting to C.
I think it deserves more stars.