Some programming languages ​​are decades old and still working. 5 old, but relevant JP

Some programming languages ​​are decades old and still working. 5 old, but relevant JP

We recently wrote about the COBOL language, which is more than 60 years old. It is still relevant, as many systems of financial and banking organizations are based on it. But there are other old NAPs that are still used in some industries. We are talking about them today, without bypassing COBOL, which is not going to leave the market. Details – under the cat.

Fortran

At the beginning of 2024, this language was ranked 12th on the TIOBE list. After all, he is 67 years old, think about it. Last year, he was on the 27th position, and in just one year he was almost in the top ten. Rust, Ruby and Kotlin were unexpectedly behind.

Of course, you should not think that it is still the same as it was at the time of its appearance (the first version was released by IBM in 1957). In 2023, for example, a new standard appeared. Here are the advantages of the language:

  • high performance

  • static and strong typing

  • relative ease to learn and use

  • versatility

  • built-in parallelism

  • complex numbers as a built-in data type is extremely important for calculations in the field of radiophysics

  • a large number of libraries for various calculations, for example NAG

An example of code in this language:
! Print matrix A to screen
subroutine print_matrix(n,m,A)
  implicit none
  integer, intent(in) :: n
  integer, intent(in) :: m
  real, intent(in) :: A(n, m)
 
  integer :: i
 
  do i = 1, n
	print *, A(i, 1:m)
  end do
 
end subroutine print_matrix

It is still used in the field of high-performance computing, in physics, astronomy and climatology.

Weather and climate simulation programs are written on it, to take the last example. These are models of the Intergovernmental Panel on Climate Change (IPCC). The language is also used to perform calculations related to the chemical and physical properties of molecules. In addition, it is used to create simulation packages in chemistry and bioinformatics. An example of GROMACS for molecular dynamics.

ADA

This language was developed in the late 1970s, and not for nothing, but by order of the US Department of Defense. The agency needed it to create various software designed for military and aerospace systems. It was also used to write medical applications, and everything that required reliability and safety.

Its advantage is that it supports both object-oriented and non-object-oriented programming. It is suitable both for use in complex systems and for low-level development. The language allows errors to be detected during compilation, rather than directly executing the program. Also, Ada mostly uses words rather than symbols. In general, this reduces the risk of coding errors.

Example code on ADA:
h Interfaces; use Interfaces;
with System.Machine_Code; use System.Machine_Code;
with Ada.Text_IO;
 
procedure Asm_Test is
	Left, Right : Unsigned_32;
begin
	Left := 1; Right := 2;
 
	Asm("addl %1, %2",
    	Inputs => (Unsigned_32'Asm_Input ("a", Left),
                       Unsigned_32'Asm_Input ("b", Right)),
    	Outputs => Unsigned_32'Asm_Output ("=b", Right));
 
	Ada.Text_IO.Put_Line (Unsigned_32'Image (Right));
end Asm_Test;

Not to say that now the language is extremely popular, but in some places it is still used. For example, all in the same aerospace industry for flight control systems and satellites. In addition, some medical platforms and railway control systems still operate on it.

By the way, the modern version of the language (unlike the original) is actually object-oriented. Like its predecessor, it is reliable and has a simple syntax.

COBOL

The COBOL programming language is over 60 years old. Despite this, it is still actively used. Of course, in the vast majority of fields it has been replaced by modern programming languages. But the fact is that in a number of countries, hardware systems with software based on this software still work. There are especially many of them in the USA.

In August 2023, the language took 15th place in terms of popularity among Ukrainians. A year ago, he was on 31st position. Impressive growth.

Example code in COBOL:
5738CB1 V2R1M0  910524	
AS/400 COBOL Source  SGAFP/CBLLBL  RCHASA12  10/24/91 10:18:16  Page  3
STMT SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6....+....7..
IDENTFCN  S  COPYNAME                                                        CHG DATE
  42  002300 	88  END-OF-FILE              	VALUE "1".             	10/23/91
  	002400                                                                 10/23/91
  43  002500 PROCEDURE DIVISION.                                             10/23/91
  	002600 MAIN-PARA.                                                      10/23/91
  44  002700 	OPEN INPUT VENDOR-FILE                                      10/23/91
  	002800      	OUTPUT PRINTER-FILE.                               	10/23/91
  45  002900 	PERFORM PRINT-LABELS UNTIL END-OF-FILE.                     10/23/91
  46  003000 	CLOSE VENDOR-FILE, PRINTER-FILE.                            10/23/91
  	003100     GOBACK.                                                     10/23/91
  	003200                                                                 10/23/91
  47  003300 PRINT-LABELS.                                                   10/23/91
  48  003400 	READ VENDOR-FILE                                            10/23/91
  49  003500     	AT END SET END-OF-FILE TO TRUE.                         10/23/91
  50  003600 	IF NOT-END-OF-FILE                                          10/23/91
  51  003700     	MOVE CORRESPONDING VNDMSTR TO LABEL-O                   10/23/91
        	*   	** CORRESPONDING items for statement 51:
        	*   	**     NAME
        	*   	**     ADDR1
        	*   	**     CITY
        	*   	**     STATE
        	*   	**     ZIPCD
        	*   	** End of CORRESPONDING items for statement 51
  52  003800     	WRITE PRINT-REC FORMAT IS "LABEL".                  	10/23/91
* * * * *   E N D   O F   S O U R C E   * * * * *

By the way, in 2020 the language actually experienced its renaissance. The fact is that the American employment system in 2020 was still dependent on COBOL (now the situation has changed somewhat). And after the number of unemployed increased due to the pandemic, the infrastructure could not withstand the increased load. As a result, everything had to be quickly fixed, inviting existing COBOL specialists and training new ones.

Thanks to the efforts of IBM and other companies, the number of lines of code written in COBOL has already reached 800 billion in 2022. True, it is quite possible that in 2017 they simply did not count everything, but the fact remains that the number of lines of code written in COBOL is huge . .

It is likely that after some time the systems will still be rewritten with modern programming languages, but for now COBOL remains afloat.

APL

It stands for A Programming Language. The language was created in the 60s for working with arrays, as well as for processing large blocks of numbers. It was well suited for solving mathematical, statistical and logical problems, and the APL code is quite short.

Here is an example:
L←(Lι':')↓L←,L   	⍝ drop To:
 L←LJUST VTOM',',L	⍝ mat with one entry per row
 S←¯1++/∧\L≠'('   	⍝ length of address
 X←0⌈⌈/S
 L←S⌽(−(⍴L)+0,X)↑L	⍝ align the (names)
 A←((1↑⍴L),X)↑L   	⍝ address
 N←0 1↓DLTB(0,X)↓L	⍝ names)
 N←,'⍺',N
 N[(N='_')/ι⍴N]←' '   ⍝ change _ to blank
 N←0 ¯1↓RJUST VTOM N  ⍝ names
 S←+/∧\' '≠⌽N     	⍝ length of last word in name

The language has a very large set of built-in functions for scalars, vectors, sets, multidimensional objects and their combinations.

Here’s what its author had to say about the language: “I originally created APL as a writing and teaching tool. And although YA was mainly used in commercial programming, I also believe that its most important use is defined as a simple, accurate and feasible notation for studying a wide range of subjects.

APL has a high barrier to entry, particularly because it uses its own character set. He even created a specialized keyboard.

Now it is still alive, but it is rarely used – mostly for the analysis of data sets, processing of financial information in some organizations. In the scientific field, learning such concepts as array processing and functional programming.

In general, actual software on APL that someone uses is becoming less and less, but it still exists. By the way, conferences are held within the framework of the Association for Computer Machinery.

PL/I

Another very old programming language introduced by IBM in the 1960s. It was created as a universal application that combined Fortran and Comtran (the latter was used in business). It turned out to be a rather specific language with a large number of additional functions.

PL/I code example:
***********************************************************************
*                                                                     *
*  	PL/I EXAMPLE                                                   *
*  	OBJECT IS TEMPORARY                                        	*
*                                                                     *
*                                                                     *
*                                                                     *
***********************************************************************
 CRTPLN3: PROCEDURE OPTIONS (MAIN);                                 	CSR00010
                                                                        CSR00020
 DCL                                                                    CSR00030
  (                                                                     CSR00040
  K INIT(1024),                    	/* ONE KILO-BYTE          	*/ CSR00050
  PAGESIZE INIT(4096),             	/* 4K PAGE BOUNDARY       	*/ CSR00060
  OFFSET INIT(0),                  	/* WINDOWS STARTS         	*/ CSR00070
  WINDOW_SIZE INIT(20),            	/* WINDOW SIZE IN PAGES   	*/ CSR00080
  NUM_WIN_ELEM INIT (20480),       	/* NUM OF 4-BYTE ELEMENTS 	*/ CSR00090
  OBJECT_SIZE INIT (60))           	/* CHOSEN OBJECT SIZE IN PGS  */ CSR00100
  FIXED BIN(31);                                                        CSR00110
                                                                        CSR00120
 DCL                                                                    CSR00130
 /* 32767 IS UPPER LIMIT FOR ARRAY BOUND.                        	*/ CSR00140
  S(32767) BIN(31) FIXED BASED(SP); 	/* DEFINE WORD ALIGNED SPACE */ CSR00150
                                                                        CSR00160
 DCL SP PTR;                                                            CSR00170
                                                                        CSR00180
 DCL                                                                    CSR00190
  (                                                                     CSR00200
  ORIG,                            	/* START ADDRESS OF WINDOW	*/ CSR00210
  AD, I,                           	/* TEMPORARY VARIABLES    	*/ CSR00220
  HIGH_OFFSET,                     	/* SIZE OF OBJECT IN PAGES	*/ CSR00230
  NEW_HI_OFFSET,                   	/* NEW MAX SIZE OF THE OBJECT */ CSR00240
  RETURN_CODE,                     	/* RETURN CODE            	*/ CSR00250
  REASON_CODE) FIXED BIN(31);      	/* REASON CODE            	*/ CSR00260
                                                                        CSR00270
 DCL                                                                    CSR00280
  OBJECT_ID CHAR(8);               	/* IDENTIFYING TOKEN      	*/ CSR00290
                                                                        CSR00300
 /********************************************************************/ CSR00310
                                                                        CSR00320
 DCL CSRIDAC ENTRY(CHAR(5),        	/* OP_TYPE                	*/ CSR00330
               	CHAR(9),        	/* OBJECT_TYPE            	*/ CSR00340
               	CHAR(44),       	/* OBJECT_NAME            	*/ CSR00350
               	CHAR(3),        	/* SCROLL_AREA            	*/ CSR00360
               	CHAR(3),        	/* OBJECT_STATE           	*/ CSR00370
               	CHAR(6),        	/* ACCESS_MODE            	*/ CSR00380
               	FIXED BIN(31),  	/* OBJECT_SIZE            	*/ CSR00390
               	CHAR(8),        	/* OBJECT_ID              	*/ CSR00400
               	FIXED BIN(31),  	/* HIGH_OFFSET            	*/ CSR00410
               	FIXED BIN(31),  	/* RETURN_CODE            	*/ CSR00420
               	FIXED BIN(31) ) 	/* REASON_CODE            	*/ CSR00430
               	OPTIONS(ASSEMBLER);                              	CSR00440
                                                                        CSR00450
                                                                        CSR00460
 DCL CSRVIEW ENTRY(CHAR(5),        	/* OP_TYPE                	*/ CSR00470
               	CHAR(8),        	/* OBJECT_ID              	*/ CSR00480
               	FIXED BIN(31),  	/* OFFSET                 	*/ CSR00490
               	FIXED BIN(31),  	/* WINDOW_SIZE            	*/ CSR00500
               	FIXED BIN(31),  	/* WINDOW_NAME            	*/ CSR00510
               	CHAR(6),        	/* USAGE                  	*/ CSR00520
               	CHAR(7),        	/* DISPOSITION            	*/ CSR00530
               	FIXED BIN(31),  	/* RETURN_CODE            	*/ CSR00540
               	FIXED BIN(31) ) 	/* REASON_CODE            	*/ CSR00550
               	OPTIONS(ASSEMBLER);                              	CSR00560
                                                                        CSR00570
                                                                        CSR00580
 DCL CSRSCOT ENTRY(CHAR(8),        	/* OBJECT_ID              	*/ CSR00590
               	FIXED BIN(31),  	/* OFFSET                 	*/ CSR00600
               	FIXED BIN(31),  	/* SPAN                   	*/ CSR00610
               	FIXED BIN(31),  	/* RETURN_CODE            	*/ CSR00620
               	FIXED BIN(31) ) 	/* REASON_CODE            	*/ CSR00630
               	OPTIONS(ASSEMBLER);                              	CSR00640
                                                                        CSR00650
                                                                        CSR00660
 DCL CSRSAVE ENTRY(CHAR(8),        	/* OBJECT_ID              	*/ CSR00670
               	FIXED BIN(31),  	/* OFFSET                 	*/ CSR00680
               	FIXED BIN(31),  	/* SPAN                   	*/ CSR00690
               	FIXED BIN(31),  	/* NEW_HI_OFFSET          	*/ CSR00700
               	FIXED BIN(31),  	/* RETURN_CODE            	*/ CSR00710
               	FIXED BIN(31) ) 	/* REASON_CODE            	*/ CSR00720
               	OPTIONS(ASSEMBLER);                              	CSR00730
                                                                        CSR00740
                                                                        CSR00750
 DCL CSRREFR ENTRY(CHAR(8),        	/* OBJECT_ID              	*/ CSR00760
               	FIXED BIN(31),  	/* OFFSET                 	*/ CSR00770
               	FIXED BIN(31),  	/* SPAN                   	*/ CSR00780
               	FIXED BIN(31),  	/* RETURN_CODE            	*/ CSR00790
               	FIXED BIN(31) ) 	/* REASON_CODE            	*/ CSR00800
               	OPTIONS(ASSEMBLER);                              	CSR00810
                                                                        CSR00820
 /********************************************************************/ CSR00830
                                                                        CSR00840
                                                                        CSR00850
  PUT SKIP LIST                                                         CSR00860
      	('<< BEGIN DATA WINDOWING SERVICES INTERFACE VALIDATION >>'); CSR00870
  PUT SKIP LIST (' ');                                                  CSR00880
                                                                        CSR00890
  CALL                                                                  CSR00900
  CSRIDAC ('BEGIN',                	/* SET UP ACCESS TO A HIPER-  */ CSR00910
       	'TEMPSPACE',            	/* SPACE OBJECT           	*/ CSR00920
       	'MY FIRST HIPERSPACE',                                   	CSR00930
       	'YES',                                                       CSR00940
       	'NEW',                                                       CSR00950
       	'UPDATE',                                                    CSR00960
       	OBJECT_SIZE,                                                 CSR00970
       	OBJECT_ID,                                                   CSR00980
       	HIGH_OFFSET,                                                 CSR00990
       	RETURN_CODE,                                                 CSR01000
       	REASON_CODE);                                                CSR01010
                                                                        CSR01020
  ALLOC S;                         	/* ALLOCATE SPACE         	*/ CSR01030
  AD = UNSPEC(SP);                 	/* GET ADDRESS OF SPACE   	*/ CSR01040
  ORIG = MOD(AD,PAGESIZE);         	/* SEE WHERE SPACE IS IN PAGE */ CSR01050
  IF ORIG ¬= 0 THEN                	/* IF NOT ON PAGE BOUNDARY	*/ CSR01060
	ORIG = (PAGESIZE-ORIG) / 4;    	/* THEN LOCATE PAGE BOUNDARY  */ CSR01070
  ORIG = ORIG + 1;                                                      CSR01080
                                                                        CSR01090
  DO  I = 1 TO NUM_WIN_ELEM;       	/* PUT SOME DATA INTO WINDOW  */ CSR01100
	S(I+ORIG-1) = 99;              	/* AREA                   	*/ CSR01110
  END;                                                                  CSR01120
                                                                        CSR01130
  CALL                                                                  CSR01140
  CSRVIEW ('BEGIN',                	/* NOW VIEW DATA IN FIRST 	*/ CSR01150
       	OBJECT_ID,              	/* WINDOW                 	*/ CSR01160
       	OFFSET,                                                      CSR01170
       	WINDOW_SIZE,                                                 CSR01180
       	S(ORIG),                                                     CSR01190
       	'RANDOM',                                                    CSR01200
       	'REPLACE',                                                   CSR01210
       	RETURN_CODE,                                                 CSR01220
       	REASON_CODE);                                                CSR01230
                                                                        CSR01240
  DO  I = 1 TO NUM_WIN_ELEM;       	/* CALCULATE VALUE IN 1ST 	*/ CSR01250
	S(I+ORIG-1) = I+1;             	/* WINDOW                 	*/ CSR01260
  END;                                                                  CSR01270
                                                                        CSR01280
  CALL                                                                  CSR01290
  CSRSCOT( OBJECT_ID,              	/* CAPTURE THE VIEW IN 1ST   */  CSR01300
       	OFFSET,                 	/* WINDOW                	*/  CSR01310
       	WINDOW_SIZE,                                                 CSR01320
       	RETURN_CODE,                                                 CSR01330
       	REASON_CODE);                                                CSR01340
                                                                        CSR01350
  CALL                                                                  CSR01360
  CSRVIEW ('END ',                 	/* END THE VIEW IN 1ST WINDOW */ CSR01370
       	OBJECT_ID,                                                   CSR01380
       	OFFSET,                                                      CSR01390
       	WINDOW_SIZE,                                                 CSR01400
       	S(ORIG),                                                     CSR01410
       	'RANDOM',                                                    CSR01420
       	'RETAIN ',                                                   CSR01430
       	RETURN_CODE,                                                 CSR01440
       	REASON_CODE);                                                CSR01450
                                                                        CSR01460
  CALL                                                                  CSR01470
  CSRVIEW ('BEGIN',                	/* NOW VIEW OTHER DATA IN 	*/ CSR01480
       	OBJECT_ID,              	/* 2ND WINDOW             	*/ CSR01490
       	OFFSET+WINDOW_SIZE,                                          CSR01500
       	WINDOW_SIZE,                                                 CSR01510
       	S(ORIG),                                                     CSR01520
       	'RANDOM',                                                    CSR01530
       	'REPLACE',                                                   CSR01540
       	RETURN_CODE,                                                 CSR01550
       	REASON_CODE);                                                CSR01560
                                                                        CSR01570
  DO  I = 1 TO NUM_WIN_ELEM;       	/* CALCULATE NEW VALUE IN 	*/ CSR01580
	S(I+ORIG-1) = I-101;           	/* WINDOW                 	*/ CSR01590
  END;                                                                  CSR01600
                                                                        CSR01610
  CALL                                                                  CSR01620
  CSRSCOT (OBJECT_ID,                                                   CSR01630
       	OFFSET+WINDOW_SIZE,                                          CSR01640
       	WINDOW_SIZE,                                                 CSR01650
       	RETURN_CODE,                                                 CSR01670
       	REASON_CODE);                                                CSR01680
                                                                        CSR01690
  CALL                                                                  CSR01700
  CSRVIEW ('END ',                 	/* END THE CURRENT VIEW IN	*/ CSR01710
       	OBJECT_ID,              	/* WINDOW                 	*/ CSR01720
       	OFFSET+WINDOW_SIZE,                                          CSR01730
       	WINDOW_SIZE,                                                 CSR01740
       	S(ORIG),                                                     CSR01750
       	'RANDOM',                                                    CSR01760
       	'RETAIN ',                                                   CSR01770
       	RETURN_CODE,                                                 CSR01780
       	REASON_CODE);                                                CSR01790
                                                                        CSR01800
  CALL                                                                  CSR01810
  CSRVIEW ('BEGIN',                	/* NOW GO BACK TO THE VIEW IN */ CSR01820
       	OBJECT_ID,              	/* THE 1ST WINDOW         	*/ CSR01830
       	OFFSET,                                                      CSR01840
       	WINDOW_SIZE,                                                 CSR01850
       	S(ORIG),                                                     CSR01860
       	'RANDOM',                                                    CSR01870
       	'REPLACE',                                                   CSR01880
       	RETURN_CODE,                                                 CSR01890
       	REASON_CODE);                                                CSR01900
                                                                        CSR01910
  CALL                                                                  CSR01920
  CSRREFR (OBJECT_ID,              	/* REFRESH THE DATA IN 1ST   */  CSR01930
       	OFFSET,                 	/* WINDOW                	*/  CSR01940
       	WINDOW_SIZE,                                                 CSR01950
       	RETURN_CODE,                                                 CSR01960
       	REASON_CODE);                                                CSR01970
                                                                        CSR01980
  CALL                                                                  CSR01990
  CSRVIEW ('END ',                 	/* END THE VIEW IN 1ST WINDOW */ CSR02000
       	OBJECT_ID,                                                   CSR02010
       	OFFSET,                                                      CSR02020
       	WINDOW_SIZE,                                                 CSR02030
       	S(ORIG),                                                     CSR02040
       	'RANDOM',                                                    CSR02050
       	'RETAIN ',                                                   CSR02060
       	RETURN_CODE,                                                 CSR02070
       	REASON_CODE);                                                CSR02080
                                                                        CSR02090
  CALL                                                                  CSR02100
  CSRIDAC ('END  ',                	/* TERMINATE ACCESS TO THE	*/ CSR02110
       	'TEMPSPACE',            	/* HIPERSPACE OBJECT      	*/ CSR02120
       	'MY FIRST HIPERSPACE ENDS HERE ',                        	CSR02130
       	'YES',                                                       CSR02140
       	'NEW',                                                       CSR02150
       	'UPDATE',                                                    CSR02160
       	WINDOW_SIZE,                                                 CSR02170
       	OBJECT_ID,                                                   CSR02180
       	HIGH_OFFSET,                                                 CSR02190
       	RETURN_CODE,                                                 CSR02200
       	REASON_CODE);                                                CSR02210
                                                                        CSR02220
  FREE S;                                                               CSR02230
 END CRTPLN3;                                                           CSR02260
***********************************************************************
*                                                                     *
*                                                                     *
*  	JCL TO COMPILE AND LINKEDIT PL/I PROGRAM.                  	*
*                                                                     *
*                                                                     *
*                                                                     *
***********************************************************************
//PLIJOB   JOB                                                          00010007
//*                                                                     00041001
//*  PL/I Compile and Linkedit                                          00042001
//*                                                                     00043001
//*  Change all CRTPLNx to CRTPLNy                                  	00044001
//*                                                                     00045001
//GO   	EXEC PLIXCL                                                  00050000
//PLI.SYSIN DD DSN=WINDOW.XAMPLE.LIB(CRTPLN3),DISP=SHR              	00060008
//LKED.SYSLMOD DD DSN=WINDOW.USER.LOAD,UNIT=3380,VOL=SER=VM2TSO,    	00070000
// DISP=SHR                                                             00080000
//LKED.SYSIN DD *                                                       00090000
  LIBRARY  IN(CSRSCOT,CSRSAVE,CSRREFR,CSRSAVE,CSRVIEW,CSRIDAC)      	00100001
  NAME CRTPLN3(R)                                                       00110008
/*                                                                      00120000
//*                                                                     00121001
//* 	SYS1.CSSLIB is source of CSR stubs                          	00130001
//*                                                                     00190000
//LKED.IN 	DD DSN=SYS1.CSSLIB,DISP=SHR                           	00200000
***********************************************************************
*                                                                     *
*                                                                     *
*  	JCL TO EXECUTE.                                                *
*                                                                     *
*                                                                     *
*                                                                     *
***********************************************************************
//PLIRUN   JOB MSGLEVEL=(1,1)                                           00010000
//*                                                                     00011001
//*   EXECUTE A PL/I TESTCASE                                           00012001
//*                                                                     00013001
//GO   	EXEC PGM=CRTPLN3                                             00020000
//STEPLIB  DD  DSN=WINDOW.USER.LOAD,DISP=SHR,                       	00030000
// UNIT=3380,VOL=SER=VM2TSO                                             00040000
//SYSLIB   DD  DSN=CEE.SCEERUN,DISP=SHR                             	00050000
//SYSABEND DD SYSOUT=*                                                  00070000
//SYSLOUT  DD  SYSOUT=*                                                 00080000
//SYSPRINT DD  SYSOUT=*                                                 00090000

Systems from the fields of finance, banking, and insurance still work on the basis of this language. It is also used by some government organizations.

Related posts