COBOL for GCC Development
cobolworx.com
cobolworx.com
Weirdly though, I get put off by their name, as my brain wants to pronounce it with a long o sound instead of the 'eh' sound from 'works' (werx as a spelling works better for me than worx, no pun intended). It has me wondering if people pronounce 'Torx' screws as 'Turks' screws.
As for the 2nd "o", I don't know. Whatever the case, you should say the entire word slowly and loudly since they are all capital letters.
Like, imagine yourself as an inept alien spy. You walk up to a group at a party and interrupt someone in the middle of their story. "HELLO, I AM BOB FROM CORPORATE. I PROGRAM IN COBOL. HOW ARE ALL OF YOU TODAY?"
That's how you should pronounce it.
I'm told that you eventually make your way to the "GCC IR", but it seems like you are largely on your own with how to get there.
I did not invest a lot of time here, so I could be wildly off base, but thought I'd at least try to give a very-slightly-hands-on perspective.
https://www.gnu.org/software/gnucobol/
$ rpm -q gnucobol
gnucobol-3.2-1.el9.x86_64
$ rpm -qi gnucobol | tail -2
COBOL compiler, which translates COBOL
programs to C code and compiles them using GCC.
It will output intermediate C; one interesting thing is that the MOVE directive is mostly turned into memcpy().I have been able to get the Oracle Pro*COBOL preprocessor to fully compile and run a demo database connection that connects to the "scott/tiger" schema and runs simple queries. Oracle packages both Pro*C and Pro*COBOL here (look for " Additional files for Pro*C and Pro*COBOL"):
https://www.oracle.com/database/technologies/instant-client....
It built with the two commands:
procob MODE=ANSI INAME=procobdemo.pco ONAME=procobdemo.cob
cobc -x -fixed procobdemo.cob /instantclient_21_12/cobsqlintf.o /instantclient_21_12/libclntsh.so
There is a similar "embedded SQL" implementation for PostgreSQL.https://github.com/opensourcecobol/Open-COBOL-ESQL
There are a few other free COBOL compilers.
http://mainframeking.blogspot.com/2012/01/free-cobol-compile...
Kudos to the folks that are writing the parser!
https://www.ibm.com/docs/en/cobol-zos/6.1?topic=division-ide...
Hmm, yea. I guess I'll have to take a look and see how they handled it. Thanks for the link!
It's nice to be able to use the same compiler for everything (not that I use cobol, or plan to use it...)
It makes sense as OpenCOBOL isn't part of GCC as a front-end, it generates C code that is compliant to various COBOL standards and extensions. That C code can subsequently be audited and/or compiled with GCC/clang.
https://www.microfocus.com/en-us/products/visual-cobol/overv...
And this is not the existing GnuCobol compiler https://gnucobol.sourceforge.io/