How valuable is a compiler? How valuable are today's COBOL compilers, in particular?
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Compilers and interpreters both prepare written code for running online. A compiler gets the code ready all at once before running it, while an interpreter gets each instruction ready on the fly as the computer runs. The compiler is best at optimizing for performance and rooting out programming errors before you go to production. Databases and business programs that can come down for updates and garbage removal typically rely on compilers. The interpreter is easier to run for long periods of time, which is why object-oriented programs on a network tend towards interpreted code.
COBOL, an imperative, procedural, object-oriented programming language, absorbs new programming trends to adapt to changing applications. COBOL compilers have kept up well with new types of scale-up and scale-out distributed hardware, development tools, databases, and other related software (XML, anyone?). The advantages that COBOL compilers bring to the code -- plus the continual renewing of the COBOL programming language itself -- ensure that COBOL is just as useful for business-critical and run-the-business applications as it was in the past.
Anatomy of a COBOL compiler
Compilers excel at syntax checking, semantics checking and optimization. They are constantly refreshed (especially optimization) as new hardware and new software come along. However, it can take about a year for compilers to release a new version that takes full advantage of new technologies.
Syntax checking scans for typing mistakes, such as typing "preform" instead of "perform." Development tools now handle some syntax checking, so the compiler is a useful second filter.
Semantics checking is more sophisticated. It must check that each statement or group of statements (in the case of C, bracketed sets of statements or other types of loops) is in the proper order, begins and ends properly, and contains the correct data declarations to support follow-on code. Development tools are less equipped for this job.
Optimization is where the compiler really shines. This involves unpacking and reformulating groups of statements to speed up performance, often focusing on key bottlenecks. These include quick-and-dirty formulations of statement loops, overuse of sub-procedure calls, and such hardware- or software-specific features as database calls that fail to maximize I/O for a particular case. The result can be a ten-times speed improvement in code versus an interpreter.
The choice of a compiler over an interpreter does not matter so much for code that performs adequately already, but it is particularly beneficial for the speed of big data and business-critical online transaction processing, or OLTP, applications.
See how top researchers crunch big data
New life for OLTP
Get started on big data analytics projects
Big mistakes in big data
Get help with COBOL compilers