![]() | This article has multiple issues. Please help improve it or discuss these issues on the talk page . (Learn how and when to remove these template messages)
|
![]() | |
Original author(s) | Keisuke Nishida, Roger While |
---|---|
Developer(s) | Edward Hart, Sergey Kashyrin, Ron Norman, Simon Sobisch and many others. |
Initial release | 25 January 2002 |
Stable release | |
Repository | sf |
Written in | C, with a C++ branch |
Size | 2 MB |
Available in | English, German, Italian, Japanese, Spanish |
Type | Programming language |
License | GPL with runtime libraries under LGPL |
Website | gnu |
GnuCOBOL (formerly known as OpenCOBOL, and briefly as GNU Cobol) is a free implementation of the COBOL programming language that is part of the GNU project. GnuCOBOL translates the COBOL code into C and then compiles it using the native C compiler. [2]
While collaborating with Rildo Pragana on TinyCOBOL, Keisuke Nishida initiated the development of a COBOL compiler designed for integration with GCC, which led to the creation of the OpenCOBOL project. Nishida served as the lead developer until 2005, up to version 0.31. Roger While succeeded him as the lead developer and released OpenCOBOL 1.0 on December 27, 2007. Development on the OpenCOBOL 1.1 pre-release continued until February 2009. In May 2012, active development transitioned to SourceForge, and the February 2009 pre-release was officially marked as a release. [3] In late September 2013, OpenCOBOL was accepted as a GNU Project, renamed to GNU Cobol, and then finally to GnuCOBOL in September 2014. [4] Ron Norman contributed a Report Writer module as a branch of GnuCobol 2.0, and Sergey Kashyrin developed a version that uses C++ intermediates instead of C. [5]
Transfer of copyrights to the Free Software Foundation over GnuCOBOL source code (including versions with GNU Cobol and OpenCOBOL spellings) was finalized on 17 June, 2015. [6]
The latest current release is v3.2, which was released on 28 July 2023.
![]() | The factual accuracy of parts of this article (those related to number of tests passed (9732 now?), see GnuCOBOL FAQ) may be compromised due to out-of-date information.(April 2021) |
While aiming to adhere to COBOL standards, including the COBOL 2014 specification and features commonly found in existing compilers, the developers do not assert any formal level of standards conformance. [7] Nevertheless, the 2.2 final release successfully passes 9,688 out of 9,708 tests (99.79%) from the NIST test suite, with 20 tests excluded. [8]
GnuCOBOL translates a COBOL program (source code) into a C program. The C program can then be compiled into the actual code used by the computer (object code) or into a library where other programs can call (link to) it. On UNIX and similar operating systems (such as Linux), the GNU C compiler is used for this process. On Windows, the C compiler provided by Microsoft's Visual Studio Express package is used. Although the two-step compilation process is typically performed with a single command, an option is available to halt the process after the C code has been generated. [9]
From 2002 until 2012, the official home of the development team was the opencobol.org website, which served as the primary source of upstream development information. [10] However, more recent[ when? ] developments have shifted to a SourceForge project space under GnuCOBOL.
The GnuCOBOL Programmer's Guide, by Gary Cutler, was published under the GNU Free Documentation License. [9] It has been updated to include GnuCOBOL with Report Writer and is listed in the GnuCOBOL documentation overview page with latest versions in the code tree. [11] It is currently maintained by Vincent Coen and others as each new compiler version is issued and is available at GnuCOBOL - GNU Project.
000100* HELLO.COB GnuCOBOL example000200IDENTIFICATIONDIVISION.000300PROGRAM-ID.hello.000400PROCEDUREDIVISION.000500DISPLAY "Hello, world!".000600STOPRUN.
Compilation and execution:
$ cobc-xHELLO.COB $ ./HELLO Hello, world!
*> GnuCOBOL Hello World exampleiddivision.program-id.hello.proceduredivision.display "Hello, world!"end-displaygoback.
Compilation and execution:
$ cobc-x-freehello.cob $ ./hello Hello, world!
The shortest valid COBOL program, with the relaxed syntax option in GnuCOBOL 2.0, is a blank file. Compilation and execution:
$ cobc-x-frelax-syntax./empty.cob ./empty.cob: 1: Warning: PROGRAM-ID header missing - assumed$ ./empty $
For earlier versions and with relaxed syntax:
display"Hello, world!".
Compilation and execution:
$ cobc-x-frelax-syntax-freehello.cob hello.cob: 1: Warning: PROGRAM-ID header missing - assumedhello.cob: 1: Warning: PROCEDURE DIVISION header missing - assumed$ ./hello Hello, world!
Without relaxed syntax and with any version of GnuCOBOL, GNU Cobol or OpenCOBOL. (Note, there are 7 leading spaces to conform to FIXED layout COBOL source):
program-id.h.proceduredivision.display "Hello, world!".
Compilation occurs without errors:
$ cobc-xsmallest.cob $ ./smallest Hello, world!
Please note that these trivia listings are not to be regarded as good COBOL form; COBOL was designed to be a readable English programming language.
The parser and lexical scanner use Bison and Flex. The GPL licensed compiler and LGPL licensed run-time libraries are written in C and use the C ABI for external program linkage.
Build packaging uses the GNU Build System. Standard tests with make check
use Autoconf, ANSI85 testsuite run by make test
use Perl scripts.
The configure script that sets up the GnuCOBOL compile has options that include:
Bash, short for Bourne-Again SHell, is a shell program and command language supported by the Free Software Foundation and first developed for the GNU Project by Brian Fox. Designed as a 100% free software alternative for the Bourne shell, it was initially released in 1989. Its moniker is a play on words, referencing both its predecessor, the Bourne shell, and the concept of rebirth.
Debian, also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software and optionally non-free firmware or software developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of Debian (0.01) was released on September 15, 1993, and its first stable version (1.1) was released on June 17, 1996. The Debian Stable branch is the most popular edition for personal computers and servers. Debian is also the basis for many other distributions that have different purposes, like Proxmox for servers, Ubuntu or Linux Mint for desktops, Kali for penetration testing, and Pardus and Astra for government use.
GNU is an extensive collection of free software, which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popularly known as Linux. Most of GNU is licensed under the GNU Project's own General Public License (GPL).
A "Hello, World!" program is generally a simple computer program which emits to the screen a message similar to "Hello, World!" while ignoring any user input. A small piece of code in most general-purpose programming languages, this program is used to illustrate a language's basic syntax. A "Hello, World!" program is often the first written by a student of a new programming language, but such a program can also be used as a sanity check to ensure that the computer software intended to compile or run source code is correctly installed, and that its operator understands how to use it.
An integrated development environment (IDE) is a software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, and a debugger. Some IDEs, such as IntelliJ IDEA, Eclipse and Lazarus contain the necessary compiler, interpreter or both; others, such as SharpDevelop and NetBeans, do not.
Liberty BASIC (LB) is a commercial computer programming language and integrated development environment (IDE). It has an interpreter, developed in Smalltalk, which recognizes its own dialect of the BASIC programming language. It runs on 16- and 32-bit Windows and OS/2.
Source Mage is a source-based Linux distribution descended from Sorcerer. Components of this operating system are downloaded as source code and compiled locally on the user's computer.
A compile farm is a server farm, a collection of one or more servers, which has been set up to compile computer programs remotely for various reasons. Uses of a compile farm include:
Object Pascal is an extension to the programming language Pascal that provides object-oriented programming (OOP) features such as classes and methods.
The GNU Assembler, commonly known as gas or as, is the assembler developed by the GNU Project. It is the default back-end of GCC. It is used to assemble the GNU operating system and the Linux kernel, and various other software. It is a part of the GNU Binutils package.
FreeBASIC is a free and open source multiplatform compiler and programming language based on BASIC licensed under the GNU GPL for Microsoft Windows, protected-mode MS-DOS, Linux, FreeBSD and Xbox. The Xbox version is no longer maintained.
Mathomatic is a free, portable, general-purpose computer algebra system (CAS) that can symbolically solve, simplify, combine and compare algebraic equations, and can perform complex number, modular, and polynomial arithmetic, along with standard arithmetic. It can perform symbolic calculus (derivative, extrema, Taylor series, and polynomial integration and Laplace transforms), numerical integration, and can handle all elementary algebra except logarithms. Trigonometric functions can be entered and manipulated using complex exponentials, with the GNU m4 preprocessor. Not currently implemented are general functions such as f(x), arbitrary-precision and interval arithmetic, as well as matrices.
The Tiny C Compiler is an x86, X86-64 and ARM processor C compiler initially written by Fabrice Bellard. It is designed to work for slow computers with little disk space. Windows operating system support was added in version 0.9.23. TCC is distributed under the GNU Lesser General Public License.
In software development, CMake is cross-platform free and open-source software for build automation, testing, packaging and installation of software by using a compiler-independent method. CMake is not a build system itself; it generates another system's build files. It supports directory hierarchies and applications that depend on multiple libraries. It can invoke native build environments such as Make, Qt Creator, Ninja, Android Studio, Apple's Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system.
A free-software license is a notice that grants the recipient of a piece of software extensive rights to modify and redistribute that software. These actions are usually prohibited by copyright law, but the rights-holder of a piece of software can remove these restrictions by accompanying the software with a software license which grants the recipient these rights. Software using such a license is free software as conferred by the copyright holder. Free-software licenses are applied to software in source code and also binary object-code form, as the copyright law recognizes both forms.
The GNU General Public Licenses are a series of widely used free software licenses, or copyleft licenses, that guarantee end users the freedoms to run, study, share, and modify the software. The license was the first copyleft for general use and was originally written by Richard Stallman, the founder of the Free Software Foundation (FSF), for the GNU Project. The license grants the recipients of a computer program the rights of the Free Software Definition. The licenses in the GPL series are all copyleft licenses, which means that any derivative work must be distributed under the same or equivalent license terms. It is more restrictive than the Lesser General Public License and even further distinct from the more widely-used permissive software licenses such as BSD, MIT, and Apache.
Go is a statically typed, compiled high-level programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. It is syntactically similar to C, but also has memory safety, garbage collection, structural typing, and CSP-style concurrency. It is often referred to as Golang because of its former domain name, golang.org
, but its proper name is Go.
Objective-C is a high-level general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its NeXTSTEP operating system. Due to Apple macOS’s direct lineage from NeXTSTEP, Objective-C was the standard programming language used, supported, and promoted by Apple for developing macOS and iOS applications until the introduction of the Swift programming language in 2014.
Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level system programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.
While OpenCOBOL can be held to a high standard of quality and robustness, the authors DO NOT claim it to be a "Standard Conforming" implementation of COBOL.