From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.schemamania.org (rrcs-50-75-19-234.nys.biz.rr.com [50.75.19.234]) by sourceware.org (Postfix) with ESMTP id 49F693858C74 for ; Thu, 9 Feb 2023 18:29:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 49F693858C74 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=schemamania.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=schemamania.org Received: from oak.schemamania.org (localhost [IPv6:::1]) by mail.schemamania.org (Postfix) with ESMTP id 14CAB256FABB for ; Thu, 9 Feb 2023 08:49:44 -0500 (EST) Date: Thu, 9 Feb 2023 08:49:43 -0500 From: "James K. Lowden" To: gcc@gcc.gnu.org Subject: gcobol: a progress report Message-Id: <20230209084943.54cba18a7d3ede2020a0998c@schemamania.org> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_40,KAM_ASCII_DIVIDERS,KAM_DMARC_STATUS,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Home Page: https://cobolworx.com/pages/cobforgcc.html Repository: https://gitlab.cobolworx.com/COBOLworx/gcc-cobol Packages: https://gitlab.cobolworx.com/COBOLworx/gcc-cobol/-/packages/2 The GCC Cobol aspirant is now 16 months old, and pupating. If Cobol's 60-year history were an hour, gcobol is now one minute old. When last we met our intrepid duo, gcobol had compiled 100 programs, perhaps 1000 lines of Cobol. Today we're pleased to announce a milestone: success with "nucleus" and "intrinsic function" modules of the NIST CCVS-85 test suite. The Cobol Compiler Validation System "tests for conformity to the American National Standard (ANSI Document Reference X3.23-1985) and the standard of the International Organisation for Standardisation (ISO Document Reference ISO-1989-1985)". It comprises 14 modules totaling 391 programs, with each program implementing many tests. We addressed ourselves just to the 95 programs in "nucleus" module, which tests the core language features. We can report 100% of 4381 tests succeed for 93 of those 95. That's 8744 lines of Cobol. We ignored the remaining 2 programs because they test obsolete features. If you want a Cobol compiler that supports features that were obsolete in 1985, you probably have a card reader handy. We have, in other words, a verified, working Cobol-85 compiler. We add new NIST tests to the "ok" column as we progress. The packages above are created via CI/CD for each successful commit, and pass all tests. How big is it? 50,000 lines, give or take: $ cloc gcc/cobol/*.{cc,h,l,y} libgcobol/*.cc 36 text files. 36 unique files. 0 files ignored. github.com/AlDanial/cloc v 1.90 T=0.09 s (419.0 files/s, 710127.6 lines/s) ---------------------------------------------------------------- Language files blank comment code ---------------------------------------------------------------- C++ 19 5330 6546 32332 yacc 2 1147 367 8744 C/C++ Header 14 598 892 3010 lex 1 312 95 1637 ---------------------------------------------------------------- SUM: 36 7387 7900 45723 ---------------------------------------------------------------- But wait! There's more! https://cobolworx.com/pages/cobforgcc.html We're extending gdb for Cobol, too. While there's more work to do, the important stuff is there: set break points, jump over PERFORM statements, and examine data. For your administrative convenience, we have packaged both gcobol and gdb-gcobol as binary Ubuntu packages. The gcobol package contains *only* the gcobol files; installing it will not disturb your gcc installation. Each package is based on the master branch in the git repository, the better to facilitate eventual inclusion in GCC and gdb. Plans. We are continuing with other NIST verification modules. If using git, you can track our progress with "make -C nist/ report". We hope the future direction of gcobol will soon be influenced by user interest. While an ISO standard Cobol compiler is a good foundation, 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. For the immediate future, we're planning: * (more) conditional compilation * improvements to EBCDIC and Unicode support * better error messages * support for EXEC SQL * modifications consequent to GCC review We are: * James K. Lowden Front of the front-end: lexer and parser * Robert Dubner Back of the front-end: adapting Cobol to Gimple Thank you for you kind attention. --jkl P.S. As a reminder, gcobol is a Cobol compiler based on gcc. It should not be confused with GnuCOBOL (https://savannah.gnu.org/projects/gnucobol). That project is a Cobol translator: it compiles Cobol to C, and invokes gcc to produce executable code.