[Info-vax] VMS Software needs to port VAX DIBOL to OpenVMS X86 platform

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Tue Dec 15 14:47:39 EST 2020


On 2020-12-15 15:59:28 +0000, ultradwc at gmail.com said:

> THINK OF DIBOL AS A TYPE OF 4 GL COBOL
> 
> RECORD MISC
>     NUMBOTTLES	,D2,99			;Default # of bottles to 99
>     ANUMBOTTLES	,A2			;Used to mask the output of bottles
> 
> 
> PROC
>     XCALL FLAGS (0007000000,1)		;Suppress STOP message
>     OPEN (8,O:C,"TT:")        		;Open the terminal/display
>     REPEAT
> 	BEGIN
> 	ANUMBOTTLES = NUMBOTTLES,'ZX'
> 	WRITES (8,ANUMBOTTLES+" Bottles of Beer on the wall,")
> 	ANUMBOTTLES = NUMBOTTLES,'ZX'
> 	WRITES (8,ANUMBOTTLES+" Bottles of Beer,")
> 	WRITES (8,"   Take one down, pass it around,")
> 	DECR NUMBOTTLES	      		;Reduce # of bottles by 1
> 	IF (NUMBOTTLES .LE. 1) EXITLOOP	;If just 1 bottle left, get out
> 	ANUMBOTTLES = NUMBOTTLES,'ZX'
> 	WRITES(8,ANUMBOTTLES+" Bottles of Beer on the wall.")	WRITES (8," ")
> 	END
>     ANUMBOTTLES = NUMBOTTLES,'ZX'
>     WRITES(8,ANUMBOTTLES+" Bottle of Beer on the wall.")    WRITES (8," ")
>     WRITES (8,ANUMBOTTLES+" Bottle of Beer on the wall,")
>     WRITES (8,ANUMBOTTLES+" Bottle of Beer,")
>     WRITES (8,"   Take one down, pass it around,")
>     WRITES (8," ")
>     WRITES (8," ")
>     WRITES (8, "Hey the Beer's gone, I am out of here...")
>     SLEEP 2
>     CLOSE 8
>     STOP
> END


For grins, and written entirely off the cuff...




for i in (1...99).reversed() {
    print("\(i) bottle\((i == 1 ? "" : "s")) of beer on the wall, \(i) 
bottle\((i == 1 ? "" : "s")) of beer.")
    print("Take one down and pass it around, ", terminator: "")
    if i == 1 {
        print("no more bottles of beer on the wall.")
    } else {
        print("\(i - 1) more bottle\((i == 2) ? "" : "s") of beer on the wall.)
    }
}
print("No more bottles of beer on the wall, no more bottles of beer.")
print("Hey, the beer's all gone, I'm outta here.")





This Swift code would be a little less involved if the code was 
switched to the internationalized support for text messages and for 
pluralization, and with the text strings moved to a local-language 
file. This Swift code also eschews OO features, etc.

Other languages may and variously will be shorter than DIBOL or COBOL 
code, too.

But then back to the original DIBOL availability question, the 
production compilers and production OpenVMS x86-64 availability are all 
going to be 2022 at the earliest. And quite possibly 2023, if something 
slips somewhere. Call back closer to then, and maybe Synergex has a 
port underway, or has a DIBOL compiler available.



-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list