News for hackers. Stuff that matters.
Re:GPT-4 is phenomenal at Code by LightMachine on Tuesday March 14, 2023 @07:49PM (#35161329)
It managed to write, in one shot, a working λ-calculus parser, using a very specific programming style I asked it in JavaScript, and then translated it all to Python, including sarcastic, rhyming GLaDOS comments.

https://twitter.com/VictorTaelin/status/1635726202231988225

It also seems to be extremely competent at writing Agda types and proofs. We need some tool that highly integrates it with entire codebases, allowing for major refactors to be requested as a prompt. That would be groundbreaking (understatement of the year), specially if coupled with a strongly typed language that prevents it from accidentally breaking things up.

Re:GPT-4 is phenomenal at Code by amelius on Tuesday March 14, 2023 @08:13PM (#35161657)
I don't think this is a good test. Every CS graduate student has to write a lambda-calculus parser. There must be thousands of implementations on the web. It really is not strange that GPT-4 can reproduce this.
Re:GPT-4 is phenomenal at Code by worrycue on Tuesday March 14, 2023 @08:28PM (#35161844)
Frankly, if ChatGPT is only good at reproducing commonly written code, I don’t think it will impact the profession much given that code reuse is already a thing and lots are distributed free on the internet.
Re:GPT-4 is phenomenal at Code by LightMachine on Tuesday March 14, 2023 @08:31PM (#35161879)
Even if that was the case, it'd still be massively useful because it would allow code to be transposed between languages idiomatically. For example, certain things like game engines were only implemented in very messy C++ code. If GPT understands how these libraries work, could it recreate all these game engines as cleaned up, elegant Haskell code?
Re:GPT-4 is phenomenal at Code by og_kalu on Tuesday March 14, 2023 @08:37PM (#35161947)
Bilingual LLMs are already excellent at translating human languages. I imagine we'll find that GPT can translate between existing programming languages very well.

We could soon see a future where "Damn this useful paper/code is in x language. Have to wait for someone to port the code over to y language" is a thing of the past.

Re:GPT-4 is phenomenal at Code by dwohnitmok on Wednesday March 15, 2023 @12:10AM (#35163757)
They are excellent. Not quite human level, but very very close. I was curious about Chinese-English translation capabilities of the latest crop of models and on more difficult texts a bilingual model like GLM-130B makes several errors per page while GPT-4 is down to probably just around one.

Interested to see how that plays out for programming languages.

Re:GPT-4 is phenomenal at Code by CapstanRoller on Tuesday March 14, 2023 @08:32PM (#35161898)
Most code produced is commonly-written code.

A sizable portion of software devs ultimately work on something that, at its core, follows the basic CRUD pattern.

"Public static void main" has paid a lot of mortgages over the years.

Re:GPT-4 is phenomenal at Code by LightMachine on Tuesday March 14, 2023 @08:25PM (#35161811)
I sort of agree, but it still amazes me that it can get the code is correct, even though I asked for a highly specific style (i.e., use of recursion, representing "None" as null, the format of the JSON, making local functions, etc.). So, even thought it has never seen that exact implementation, it still assembles a working function that just works. If it was just mixing up different code it recalled from memory, it would likely have a bunch of silly errors here and there that I'd have to fix manually, but no, it just works. That's what impressed me.
Re:GPT-4 is phenomenal at Code by capableweb on Tuesday March 14, 2023 @08:15PM (#35161686)
Let's invent a better test then. What could be an example task that isn't widely available on the internet already? I'm having a hard time coming up with anything that isn't reproduced in many places.
Re:GPT-4 is phenomenal at Code by palijer on Tuesday March 14, 2023 @08:20PM (#35161756)
Take something from advent of code and change it up a bit seems like a good test
Re:GPT-4 is phenomenal at Code by rootusrootus on Tuesday March 14, 2023 @08:36PM (#35161939)
Ha, I gave Bing Chat something from Advent of Code and it correctly identified that it came from Advent of Code (without that being anywhere in the prompt). It provided a solution, but given that it identified the source of the question I don't think it was a good test. As you say, maybe changing some values will help.
Re:GPT-4 is phenomenal at Code by Jtsummers on Tuesday March 14, 2023 @08:31PM (#35161884)
Give it Synacor Challenge, just the spec, and see if it can pull it off. Fewer of those solutions out there. It just went offline recently, but Aneurysm9 has preserved the problem spec, their binary, and the checksum of the codes for their binary to check against.

https://github.com/Aneurysm9/vm_challenge

The program will, likely, need to be amended to get the last code (last 2 codes? been a while) so you can see how it would handle updating for the new requirements.

Re:GPT-4 is phenomenal at Code by jhp123 on Tuesday March 14, 2023 @08:18PM (#35161734)
it looks like the lam parser should throw, as is it will consume input then fall through to app.

whitespace handling is also not correct.

I don't believe I've seen one correct program written by GPT yet.

edit: try parsing "λ(x x)" for example, or "λ x. x"

Re:GPT-4 is phenomenal at Code by sualehasif on Tuesday March 14, 2023 @08:03PM (#35161522)
Yeah, its really cool how good it is. I personally am addicted to it.