ChatGPT voted for ⎕IO←0

No need to worry about going "off topic" here
Forum rules
This forum is for general chit-chat, not necessarily APL-related. However, it's not for spam or for offensive or illegal comments.

ChatGPT voted for ⎕IO←0

Postby kai on Thu Dec 15, 2022 6:22 am

Dave Ziemann came up with the idea to ask ChatGPT an APL-related question. The answer it gave is astonishing, to say the least.

I repeated the experiment:
User avatar
Posts: 130
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: ChatGPT voted for ⎕IO←0

Postby ray on Thu Dec 15, 2022 4:03 pm

Why the are "(" and ")" needed?
Neither Dyalog APL or STSC APL (that Dave Ziemann used to use on the mainframe, I know because I replaced him as an APL consultant at Commercial Union) require parentheses around the APL expression.

And I am unsure about the question:
"smallest number of glyphs" is that
1) "glyphs" ;
2)"unique glyphs"?
(At the supermarket, "maximum of 5 items in a basket" does a repeated article count as one or two items, as it only appears once on the bill but with a quantity of 2? Obscure Ref to Robbie Coltrane in "Cracker".)

From the answer "(+/⍳101)", I am assuming the 7 unique glyphs were '1' '0' '⍳' '+' '/' '(' and ')'. The "1" appears twice but only counts as a single glyph!

The "⍳101" is assuming ⎕IO←0, but in ⎕IO←1 exactly the same number of glyph are needed, just that the "0" rather than the "1" is repeated. But surely then the ⎕IO must either be explicitly set (and the extra glyphs counted) or the two alternative expression be quoted:
In ⎕IO 0 use
In ⎕IO 1 use
But then the unique glyph count is unaltered.

I suppose "50×101" (only using the 4 glyphs "0" "1" "5" "x" ) is cheating!
Ray Cannon
Please excuse any smelling pisstakes.
User avatar
Posts: 198
Joined: Wed Feb 24, 2010 12:24 am
Location: Blackwater, Camberley. UK

Re: ChatGPT voted for ⎕IO←0

Postby kai on Fri Dec 16, 2022 8:05 am

Well, if you want something to complain about then you could have pointed out that both ⍳ and +/ are functions, not operators.

But that is all missing the point which is something like "Doing statistics over literally many gigabytes of text will teach you a lot, and APL is among it"
User avatar
Posts: 130
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: ChatGPT voted for ⎕IO←0

Postby magnetron on Fri Jan 13, 2023 3:03 am

I've been putting ChatGPT through its paces in the programming world - so far using PowerShell and APL. In both cases it would get the basic approach right but then made what would best be described as silly oversights in the rendered code. But it was more than happy to take advice and in both cases corrected the code to the point where it worked correctly. Rather like briefing a rookie programmer!

In the APL case I gave it LeetCode Contest 327 Problem 1 ... it rendered a correct working solution after about three iterations. In each case it was able to explain in plain English what it was attempting to do, which facilitated the correction process.

So where I see a potential for future synthesis is where a smarter ChatGPT may be able to take an arbitrary APL idiom and explain what it is doing in plain English. Or simply help APLers debug their code.

Out of interest gave ChatGPT Conor Hoekstra's 12 byte APL solution to the LeetCode Contest 327 Problem 1 ... ("1 Problem, 24 Programming Languages" on YouTube). Initially it confused the Over operator with the Each operator. So I gave it the formal definition of the Over operator, following which it rendered a somewhat better explanation. For a language model to do as well as it did with something involving an APL derived function I found quite interesting.
Posts: 1
Joined: Tue Sep 06, 2016 9:29 am

Return to Chat

Who is online

Users browsing this forum: No registered users and 1 guest