Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ChatGPT - Joke about OpenVMS and Linux walking into a bar

207 views
Skip to first unread message

Slo

unread,
Dec 31, 2022, 1:41:48 PM12/31/22
to
1. Two operating systems, OpenVMS and Linux, walk into a bar.
The bartender looks up and says, "What can I get you?"
OpenVMS says, "I'll have a VMSCoffee, please."
Linux says, "I'll have a LinuxLatte."
The bartender pauses for a moment and then says, "I'm sorry, but I don't think I've heard of those drinks before. What are they?"
OpenVMS says, "Oh, VMSCoffee is a rich, robust blend of legacy code and modern features. It's been around for decades and has a loyal following."
Linux says, "LinuxLatte is a light, open-source coffee with endless customization options. It's a newer option, but it's gaining popularity quickly."
The bartender nods and says, "Well, I'll see what I can do. But I have to warn you, I'm not sure I know how to make either of those."
OpenVMS and Linux just laugh and say, "Don't worry, we'll help you out. We're both pretty good at adapting to new environments."

2. OpenVMS and Linux walk into a bar, and the bartender looks at them and says "What can I get for you guys?"
OpenVMS says "I'll have a whiskey neat, please."
Linux says "I'll have a whiskey neat too, but I'll also need a virtual machine to run it on."
The bartender looks at them and says "Well, I can't really give you a virtual machine, but I can give you a separate glass to put your whiskey in."
OpenVMS looks at Linux and says "Well, at least I don't have to worry about compatibility issues."

3. OpenVMS and Linux walk into a bar. The bartender asks, "What can I get for you guys?"
OpenVMS says, "I'll have a whiskey neat, please."
Linux says, "I'll have a vodka neat, please."
The bartender asks, "So, what brings you two together?"
OpenVMS says, "Oh, we're just trying to get away from all the updates and patches on Windows."
Linux says, "Yeah, me too. I'm sick of always being told to 'apt-get upgrade'."
The bartender says, "Well, you've come to the right place. We don't have any updates or patches here."
OpenVMS and Linux both sigh in relief and say, "Ahh, finally some peace and stability."

Slo

unread,
Dec 31, 2022, 1:45:56 PM12/31/22
to
> Code a DCL procedure to add the first 20 integers, then mail it to v...@vsi.com

$! This DCL procedure adds the first 20 integers and sends the result to v...@vsi.com
$! Declare variables
$ integer = 0
$ sum = 0
$! Loop through the first 20 integers and add them to the sum
$ do i = 1, 20
$ sum = sum + i
$ enddo
$! Use the MAIL command to send the result to v...@vsi.com
$ mail/subject="Sum of the first 20 integers" v...@vsi.com "The sum of the first 20 integers is: " sum
$! End the procedure
$ exit

Simon Clubley

unread,
Dec 31, 2022, 3:39:27 PM12/31/22
to
On 2022-12-31, Slo <slo...@gmail.com> wrote:
>> Code a DCL procedure to add the first 20 integers, then mail it to v...@vsi.com
>
> $! This DCL procedure adds the first 20 integers and sends the result to v...@vsi.com
> $! Declare variables
> $ integer = 0
> $ sum = 0
> $! Loop through the first 20 integers and add them to the sum
> $ do i = 1, 20
> $ sum = sum + i
> $ enddo

Oh, I wish. :-) Oh, I really, really, wish. :-)

I wonder where it got that from ?

A suggestion: try asking it to do something with associative arrays in
DCL and see what it comes up with. :-)

> $! Use the MAIL command to send the result to v...@vsi.com
> $ mail/subject="Sum of the first 20 integers" v...@vsi.com "The sum of the first 20 integers is: " sum
> $! End the procedure
> $ exit

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Arne Vajhøj

unread,
Dec 31, 2022, 4:00:31 PM12/31/22
to
ChatGPT is not good at DCL.

My suggestion for the task:

$ sum = 0
$ i = 1
$ loop:
$ if i .gt. 20 then goto endloop
$ sum = sum + i
$ i = i + 1
$ goto loop
$ endloop:
$ fnm = f$unique() + ".txt"
$ open/write f 'fnm'
$ write f sum
$ close f
$ mail 'fnm' "SMTP%""v...@vsi.com"""
$ del 'fnm';*
$ exit

Arne

Slo

unread,
Dec 31, 2022, 4:03:34 PM12/31/22
to
> A suggestion: try asking it to do something with associative arrays in
> DCL and see what it comes up with. :-)

I asked for a recursion example in DCL and it showed this:

Recursion in DCL is a programming technique in which a function
or procedure calls itself repeatedly until a certain condition is met.
This allows for the repetition of a task without the need for a loop.

Here is an example of a DCL procedure that uses recursion to calculate the factorial of a number:
$! Declare the procedure and a variable to hold the result
$ procedure factorial
$ integer result
$! Check if the input number is 0 or 1
$ if $1 .eqs. 0 .or. $1 .eqs. 1 then
$ result = 1
$ else
$ ! Recursively call the procedure with the input number - 1
$ result = $1 * factorial($1 - 1)
$ endif
$! Return the result
$ return result
$! End the procedure
$ end

To use this procedure, you would simply call it with the number you want to find the factorial of

Slo

unread,
Dec 31, 2022, 4:21:02 PM12/31/22
to
This is much better, beats reading the docs and googling for someone new to OpenVMS:

1. Code VAX C program to add the first 20 integers
--------------------------------------------------------------------------------
Here is a VAX C program that adds the first 20 integers:
#include <stdio.h>
int main() {
int i;
int sum = 0;
// Loop through the first 20 integers and add them to the sum
for (i = 1; i <= 20; i++) {
sum += i;
}
// Print the result
printf("The sum of the first 20 integers is: %d\n", sum);
return 0;
}

2. compile link and run
------------------------------------

To compile, link, and run a VAX C program on OpenVMS, you can follow these steps:

Compile the program using the CC command. For example:
$ CC MYPROG.C

Link the program using the LINK command. For example:
$ LINK MYPROG, SYS$SHARE:VAXCRTL/OPT

Run the program by typing the name of the executable file. For example:
$ MYPROG

Note: These steps assume that you have the necessary tools and libraries installed on
your OpenVMS system. You may also need to specify additional options or libraries
depending on your program's needs.

Arne Vajhøj

unread,
Dec 31, 2022, 4:30:17 PM12/31/22
to
On 12/31/2022 4:21 PM, Slo wrote:
> This is much better, beats reading the docs and googling for someone new to OpenVMS:
>
> 1. Code VAX C program to add the first 20 integers
> --------------------------------------------------------------------------------
> Here is a VAX C program that adds the first 20 integers:
> #include <stdio.h>
> int main() {
> int i;
> int sum = 0;
> // Loop through the first 20 integers and add them to the sum
> for (i = 1; i <= 20; i++) {
> sum += i;
> }
> // Print the result
> printf("The sum of the first 20 integers is: %d\n", sum);
> return 0;
> }

It seems to understand C.

> 2. compile link and run
> ------------------------------------
>
> To compile, link, and run a VAX C program on OpenVMS, you can follow these steps:
>
> Compile the program using the CC command. For example:
> $ CC MYPROG.C
>
> Link the program using the LINK command. For example:
> $ LINK MYPROG, SYS$SHARE:VAXCRTL/OPT
>
> Run the program by typing the name of the executable file. For example:
> $ MYPROG

But again it fails in DCL.

One not optimal (it is not necessary to specify extension .C) and
two not working on a standard VMS system (it is some time since I have
last seen VAX C as opposed to DEC/whatever C, but I do not recall a
SYS$SHARE:VAXCRTL.OPT file).

Arne


Phillip Helbig (undress to reply)

unread,
Dec 31, 2022, 5:04:35 PM12/31/22
to
In article <toq7tc$1af6$1...@gioia.aioe.org>, =?UTF-8?Q?Arne_Vajh=c3=b8j?= <ar...@vajhoej.dk> writes:

> $ mail 'fnm' "SMTP%""v...@vsi.com"""

The SMTP prefix hasn't been needed for a long time.

Dave Froble

unread,
Dec 31, 2022, 10:24:21 PM12/31/22
to
On 12/31/2022 4:21 PM, Slo wrote:
Maybe even easier in Basic ...

S = S + I For I = 1 to 20
Print S

Oh, wait, no Basic on x86, yet, ....

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: da...@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Johnny Billquist

unread,
Jan 1, 2023, 9:45:30 AM1/1/23
to
On 2023-01-01 04:24, Dave Froble wrote:
> Maybe even easier in Basic ...
>
> S = S + I For I = 1 to 20
> Print S
>
> Oh, wait, no Basic on x86, yet, ....

BASIC2

s = s + i for i=1 to 20 \ print s


210

BASIC2

print date$(0);" ";time$(0)


01-Jan-23 15:45

BASIC2



(On a PDP-11, no less...)

Johnny

Arne Vajhøj

unread,
Jan 4, 2023, 8:45:25 PM1/4/23
to
On 1/1/2023 9:45 AM, Johnny Billquist wrote:
> On 2023-01-01 04:24, Dave Froble wrote:
>> Maybe even easier in Basic ...
>>
>> S = S + I For I = 1 to 20
>> Print S
>>
>> Oh, wait, no Basic on x86, yet, ....
>
> BASIC2
>
> s = s + i for i=1 to 20 \ print s
>
>
>  210

Basic has a pretty good LOC/FP ratio.

It has never had a great reputation among let us
call it "programming language gourmets", but lots
of business usage.

One will need to go to way newer languages to
get something similar.

Python:

print(sum(range(1,21)))

Groovy:

println((1..20).sum())

Even though one could argue that a more equivalent
code (being able to sum functions of i instead of
just i) would be Python:

print(sum([i for i in range(1,21)]))

because you can do:

print(sum([i*i for i in range(1,21)]))

Groovy would need to use a different approach like:

println((1..20).collect{it*it}.sum())

Arne


0 new messages