When in November we turn back our clocks, then naturally do programmers' thoughts turn to Cobol, its promise, and future.
At last post, nine months ago, we were working our way through the NIST CCVS/85 test suite. I am pleased to report that process is complete. As far as NIST is concerned, gcobol is a Cobol compiler. For those keeping score at home, we're at 656 terminal symbols and 1636 yacc rules. Cobol is nothing if not a big language. NIST CCVS/85 includes: Basic Cobol grammar Intrinsic functions IPC support, in the form of called by and calling C modules I/O for sequential, indexed, and relative-addressed files Sorting and merging of files Compiler Directing Facility functions The NIST tests can be downloaded and executed using an included Makefile. They comprise 8846 tests in 348 files. We have adopted the ISO 2023 Cobol specification as the standard we're writing to. gcobol also includes a few extensions to support syntax that is specific to IBM and MicroFocus compilers, for features that are widely used or still in use but since dropped by ISO. Significant effort went, and continues to go, into a relatively new Cobol feature, not part of the 1985 standard: handling Exception Conditions. Good examples are scarce, though, and we would be pleased to work with anyone whose code depends on correct EC handling, or who would like to use it and cannot because their compiler doesn't support it. Cobol also has quite requirements for numerical precision. To that end, gcobol now uses the C _Float128 datatype. The precision of intermediate computed results grows as needed, and overflows and truncation are signified (if enabled) through the EC mechanism. The switch to _Float128 was a third pass over the computation statements (ADD, SUBTRACT, MULTIPLY, DIVIDE, and COMPUTE) and the lucky user benefits from our hard-won experience, in the form of much better performance. Of course, no battle plan survives first contact with the enemy. As the gcobol community grows and new erroneous code is encountered, the compiler's error messages continue to improve. Plans. We want the direction of gcobol to be influenced by user interest. Every Cobol shop relies on different variations and extensions to the language. Early adopters have an opportunity to make their voices heard and needs met. Operators are standing by. On deck for 2024: * User acceptance testing * support for EXEC SQL * modifications consequent to GCC review * updated gdb support Home page: https://www.cobolworx.com/pages/cobforgcc.html Packages: https://gitlab.cobolworx.com/COBOLworx/gcc-cobol/-/packages/2 Repository, and Issue tracker: https://gitlab.cobolworx.com/COBOLworx/gcc-cobol/-/tree/master+cobol We are: * James K. Lowden <jklow...@symas.com> Front of the front-end: lexer and parser * Robert Dubner <rdub...@symas.com> Back of the front-end: adapting Cobol to Gimple Thank you for you kind attention. --jkl