News for hackers. Stuff that matters.
Re:Show HN: Whole Git repo was made with ChatGPT by rightbyte on Sunday December 04, 2022 @12:55PM (#33855917)
Ye I signed up and tried some queries. It was quite scary.

"Write a function that sorts the elements of a c string backwards, in C." "Add a flag to the sort function which makes it sort the string forward." "Could you write a endian swap function for double argument in PIC assembler?" "Could you write a binary sort in PIC 8-bit assembler" "Write a Javascript function that prints the day of the week together with some Chinese words of wisdom."

It had no problem doing any one those. I ran them all, except the assembler ones.

The question is how good it is to process larger chunks of code and makes changes to it.

People thinking about becoming programmers might need to rethink their plans if this one improves ...

EDIT: Oh dear. I introduced bugs in its sort code and it found them and explained what they did.

Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @01:17PM (#33856119)
This idea that ChatGPT is "intelligent" is so absurd it's getting tiring. You do realize that the code you see regurgitated is most likely some permuted variant of a question/answer on Stack Overflow or a pull request on Github, right? ChatGPT can't even do basic categorization[1] reliably, but you think it can understand code?

[1] https://i.imgur.com/nw6rstc.png

Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @01:47PM (#33856394)
> You do realize that the code you see regurgitated is most likely some permuted variant of a question/answer on Stack Overflow or a pull request on Github, right?

What do you think coders do?

Did they learn to code by themselves, without ever looking at any preexisting code, or what?

Re:Show HN: Whole Git repo was made with ChatGPT by wizzwizz4 on Sunday December 04, 2022 @02:31PM (#33856860)
> What do you think coders do?

I've seen enough programmers who can't program, but most of them can at least be taught to program. (The look on their faces when they finally start to get it… It's one of the best things.) Most people working on the Linux kernel can actually program.

Most software engineering work is just plumbing existing libraries together, according to a specification given by a non-programmer. The hard part is translating the business requirements into something that a computer could understand; the exact syntax can be handled by a search engine, or a predictive text algorithm.

ChatGPT can't write a kernel device driver, and it can't act as a no-code tool for non-programmers. Those are the hard parts.

> “To tapping machine with hammer, 10s.; to knowing where to tap it, £10; total, £10. 10s.”

https://quoteinvestigator.com/2017/03/06/tap/

Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @02:41PM (#33856980)
> ChatGPT can't write a kernel device driver, and it can't act as a no-code tool for non-programmers. Those are the hard parts.

Oh, do I have news for you then.

Look at what I just did with ChatGPT in 30 seconds (and I did not cherry-pick, these were the first answers I got!):

https://gist.github.com/wizeman/b269be035308994be745025fc337...

Now to be fair, the code is probably not totally correct, as probably there are parts still missing/wrong and there might even be compilation errors or other problems.

But here's the important part: you can tell which errors or problems you've observed and ChatGPT will fix these problems for you. Exactly like what a programmer does.

And sure, it cannot yet do this at scale, such as in implementing a huge kernel driver like a GPU driver.

But at this rate, give it a few years and an improved version might just be able to do anything a programmer does, perhaps even autonomously if we allow it to interact with a computer like a human does.

Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @02:54PM (#33857138)
> Look at what I just did with ChatGPT in 30 seconds (and I did not cherry-pick, these were the first answers I got!):

Weird flex, as that code is like 90% boilerplate[1]. Everyone was freaking out about Copilot and no one seriously ended up using it because it just generates buggy (or copyrighted) code. It can't even handle writing unit tests with decent coverage (which is arguably the most repetitive/boring software engineering task).

[1] https://github.com/ngtkt0909/linux-kernel-module-template/bl...

Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @03:03PM (#33857255)
> Weird flex, as that code is like 90% boilerplate[1].

Isn't 90% of code boilerplate anyway?

Also, didn't ChatGPT generate more than just the boilerplate?

Didn't it interpret what I wanted and generated the code for computing the factorial as well, as well as modifying the boilerplate (e.g. the kernel module name, printed messages, function names, the module description, ...) so that it matches what the kernel module is supposed to do? Which is exactly what a human would do?

Aren't you also missing the fact that I gave it a 2-sentence instruction and it "understood" exactly what to do, and then did it? Like a human programmer would do?

Which, in sum, is totally the opposite of what you were claiming?

> Everyone was freaking out about Copilot and no one seriously ended up using it because it just generates buggy (or copyrighted) code.

Don't most programmers also generate buggy code at first? Don't they iterate until the code works, like what ChatGPT does if you give it feedback about the bugs and problems you've encountered?

Also, Copilot and ChatGPT have different levels of capabilities, don't assume just because Copilot can't do something, that ChatGPT can't. ChatGPT is clearly a big step forward as you can clearly see from how everyone is freaking out about it.

Finally, don't assume that these models are never going to improve, ever again.

Re:Show HN: Whole Git repo was made with ChatGPT by dragonwriter on Sunday December 04, 2022 @02:56PM (#33857165)
> no one seriously ended up using it

[citation needed]

I mean, I’ve seen people claiming to use it and that it has significantly accelerating their work. On what are you basing the conclusion that it has no serious use?

Re:Show HN: Whole Git repo was made with ChatGPT by vbezhenar on Sunday December 04, 2022 @04:04PM (#33857859)
I do use it and I'm very picky when it comes to writing code.

Here's example of tiny webapp I wrote recently: https://github.com/vbezhenar/pwgen/blob/main/pwgen.html

Of course it wasn't Copilot writing it, but it definitely helps with boring parts. Like I'd write

    const charactersElement = document.getElementById('characters');
and rest 10 lines will be written with Copilot with minimal assistance.

It's like having stupid but diligent assistant who's happy to copy&paste&adapt parts of code.

I can't claim that I often use fully generated Copilot functions. Sometimes I do, often with significant rework, but that's because, as I said, I'm very picky.

I paid GitHub $100 already and don't regret it.

Though I think that Copilot has plenty of features ahead.

For example finding obvious issues in the code would be very useful. Like typos.

Another issue with Copilot is that it only generates new code. Imagine that I need to edit 10 similar lines. I edit one line and I'd like Copilot to offer other edits.

Also UI is lacking. Like it generates 10 lines but I only like first line. Now I have to add 10 lines and delete 9.

But I'm sure that those are obvious directions.

Re:Show HN: Whole Git repo was made with ChatGPT by jraph on Sunday December 04, 2022 @04:33PM (#33858140)
Fortunately, a human will know to fix that broken 4-space indentation and that brace placement before inclusion in the Linux kernel repository.
Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @04:42PM (#33858221)
> Fortunately, a human will know to fix that broken 4-space indentation and that brace placement before inclusion in the Linux kernel repository.

What's your point, that ChatGPT wouldn't know how to do that, especially if the kernel maintainers gave it such feedback?

I thought it was clear that it can in fact do that (sometimes by asking clarifying questions, like a human would).

I think some of the major things missing in ChatGPT is the ability to interact with a computer directly (including the compiler and checkpatch.pl, and using files for information storage instead of a limited N-token context), as well as interacting with humans by itself (e.g. via email).

And sure, it would still have very limited capabilities in many ways, don't get me wrong, as I don't think it could replace a programmer at this point.

But I think the gaps are closing rapidly.

Re:Show HN: Whole Git repo was made with ChatGPT by jraph on Sunday December 04, 2022 @04:46PM (#33858267)
I was just joking

(about the fact that a bot handles the "creative" work of writing the device driver while a human will do the repetitive work of reindenting)

(sorry, I should have used /s)

Re:Show HN: Whole Git repo was made with ChatGPT by Arch-TK on Sunday December 04, 2022 @04:51PM (#33858329)
Aside from the boilerplate, which it got mostly right as far as I can tell, the actual logic is hilariously wrong. Moreover, Linux kernel development really isn't just writing stand-alone self contained chardev drivers which calculate n!. I would be more impressed if you used chat GPT to guide you through reverse engineering a piece of hardware and implementbing a driver for it.
Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @05:23PM (#33858614)
> Aside from the boilerplate, which it got mostly right as far as I can tell, the actual logic is hilariously wrong.

Please do tell, how is it hilariously wrong?

It seems to have written a factorial function just like it should, it implemented the logic to read the integer from /dev/factorial when a user-space program writes to it, and then it writes the result back to /dev/factorial, and it also returns the number of bytes written correctly.

Which was the entire point of the exercise. Also note that ChatGPT itself said it was just a sample and it might be incomplete.

I noticed it has a bug, because it reads `len` bytes instead of `sizeof(int)` bytes, but a programmer could have made the same mistake. Perhaps some additional logic to handle reading multiple integers and writing multiple answers could be written, but that would be a further iteration of the code, not the initial one that I would write.

If that is hilariously wrong, then I would also be hilariously wrong. And I'm not just some random web developer, I actually wrote Linux kernel code professionally for years (although, that was a very long time ago).

So, maybe it got some details wrong, but I could conceivably also get those details wrong until I tried to compile/run the code and see what was wrong.

> I would be more impressed if you used chat GPT to guide you through reverse engineering a piece of hardware and implementbing a driver for it.

Yes, I would be more impressed with that as well. Perhaps someone will do that sometime. Even if not with ChatGPT, perhaps with a future version of it or a similar model.

Re:Show HN: Whole Git repo was made with ChatGPT by sigotirandolas on Sunday December 04, 2022 @06:53PM (#33859425)
I'd expect the `copy_to_user` call to be inside `dev_read`, so that the userspace program can read the result with a further `read()` call, instead of mutating the buffer it gave to `write()` being mutated (that would probably not even work unless you used `write()` directly in your code instead of e.g. `fwrite()`).

Also as you noted, the logic related to handling `len` vs `sizeof(int)` is... curious.

While I find some ChatGPT examples impressive, this one isn't very enlightening. The block device structure and the factorial itself are fine, but those are likely in the training set as there are various tutorials online. But the combination of the factorial function into the block device is pretty awful (though I could imagine a novice doing it like this).

Both the OP and this driver kind of fit into this pattern, it looks like someone asked a novice programmer to do something using X and Y, so he read various few sample code and tutorials on X and Y and tries to put something together as best as it could, but the "plumbling" between X and Y (the part that wasn't in the tutorials) doesn't really work.

Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @07:02PM (#33859531)
> I'd expect the `copy_to_user` call to be inside `dev_read`, so that the userspace program can read the result with a further `read()` call, instead of the buffer it gave to `write()` being mutated (that would probably not even work unless you used `write()` directly in your code instead of e.g. `fwrite()`).

Yes, you're probably right. It's been many years since I've written Linux kernel code and also, I've never implemented such a driver, so I missed that.

I asked ChatGPT: what is wrong with this Linux kernel code (and fed it the dev_write() function), and this is what it answered (on the first try):

> There are a few issues with this Linux kernel code:

> 1. The function dev_write() is declared as returning ssize_t, but the return value at the end of the function is sizeof(int). ssize_t and size_t are different types, so this could cause a type mismatch.

This is an interesting observation that you and I both missed.

> 2. The factorial() function is not defined in this code, so it is unclear what it does or where it is declared.

This is because I didn't feed it the factorial function, it was on a different chat session. One could guess what it does based on the name, but to be fair, it's not clear why such a function would be on the Linux kernel unless I gave it the full context.

> 3. The copy_from_user() and copy_to_user() functions are used to copy data between user space and kernel space. In this code, buffer is a pointer to user space, but input and result are local variables in kernel space. This means that copy_from_user() will copy data from user space into kernel space, but then copy_to_user() will copy data back from kernel space into the same buffer in user space, overwriting the original data. This is likely not the intended behavior.

I think this is basically what you pointed out.

> 4. The len parameter is not used in this function, so it is unclear why it is included as an argument.

lol. Actually, it is being used, incorrectly.. and it wouldn't be used if we did the correction that I mentioned. So yes, this is somewhat hilariously wrong.

And it's clear why it has to be included as an argument, but to be fair, ChatGPT has no context whatsoever except knowing it's Linux kernel code (because I used a different chat session), so it's conceivable that it couldn't figure out why the function prototype has to be that way.

> Overall, this code is not well-written and would benefit from further clarification and revision.

It was you who wrote it, dumb-ass! :)

(Interestingly, ChatGPT can be compared to someone with Alzheimer in the sense that it can't remember conversations that happened in different chat sessions).

Re:Show HN: Whole Git repo was made with ChatGPT by wizzwizz4 on Sunday December 04, 2022 @09:20PM (#33860628)
> > 1. The function dev_write() is declared as returning ssize_t, but the return value at the end of the function is sizeof(int). ssize_t and size_t are different types, so this could cause a type mismatch.

> This is an interesting observation that you and I both missed.

Hah. Call me when you find an architecture where ints use over half the addressable memory.

Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @10:05PM (#33860961)
> Hah. Call me when you find an architecture where ints use over half the addressable memory.

I mean, I get your point if it's a joke :) But I think the AI was just pointing out that you'd get a compiler warning because of the type mismatch in signedness (is this even a word?).

Re:Show HN: Whole Git repo was made with ChatGPT by int_19h on Monday December 05, 2022 @09:28PM (#33875121)
It's the small negative numbers that bite you there when they undergo unsigned overflow.
Re:Show HN: Whole Git repo was made with ChatGPT by Arch-TK on Thursday December 08, 2022 @06:06AM (#33906628)
> Please do tell, how is it hilariously wrong?

It copies from user, and then copies to user, back into the const it got. I don't even know if this would compile but certainly nobody would expect the buffer they just wrote to a file to suddenly end up re-written with a "reply" when using a special file.

I found that logic very funny.

Edit: To elaborate, the actual code to do this properly would have to allocate some memory when the file was opened, this memory would hold the reply once a question was written. Then when the answer was read it would have to respond with that in there. Finally when the file is closed it would have to deallocate.

This code is quite far from accurate, the issue I have with the concept that even if this bot was 99% accurate, C is not a "try it and see" language. If you apply "try it and see" techniques to C you just get subtle undefined behaviour which you might not notice until someone uses it to remotely execute code on your machine. Really I am not so sure that even humans can be trusted to write C but at the very least I am well aware of all the instances where C is a minefield and can pay extra attention to those, if you simply look at the plethora of information on C out there to learn C and apply it to kernel development you won't automatically build these intuitions no matter how much code you read because an enormous amount of C out there is hideously wrong in many ways.

Final edit: Once you start looking at the details, it has managed to implement a bunch of buffer overflows to boot.

Re:Show HN: Whole Git repo was made with ChatGPT by wizzwizz4 on Sunday December 04, 2022 @09:15PM (#33860593)
> Please write me a small Linux kernel driver that calculates the factorial of a number when a user program writes an integer to /dev/factorial. The kernel driver outputs the answer to /dev/factorial as well.

That's not a device driver. https://en.wikipedia.org/wiki/Device_driver

> In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton.

I'm not disputing it can do that – plugging together well-known APIs and well-known programming problems. That's practically just style transfer, something we know these systems are fairly good at.

But given the spec for an unknown device – even quite a simple one – ChatGPT can't produce a device driver for it. How about this?

> An HP CalcPad 200 Calculator and Numeric Keypad behaves as a USB keyboard does. It has VID 0x040B and PID 0x2367. Please write me a small Linux kernel driver that allows me to use this keypad as a MouseKeys-style mouse device. If there's anything you don't understand, let me know.

I doubt any amount of prompt engineering would produce a satisfactory result – but if you did the hard part, and explained how it should do this? Well… maybe it'd be able to give a satisfactory output. But at that point, you're just programming in a high-level, hard-to-model language.

It's not a case of scale. Sure, a very large model might be able to do this, particular problem – but only because it'd have memorised code for a USB keyboard driver, and code for a MouseKeys implementation… and, heck, probably code for a MouseKeys kernel driver from somebody's hobby project.

GPT language models don't understand things: they're just very good at guessing. I've been an expert, and a schoolchild; I know how good you can get at guessing without any kind of understanding, and I know enough about what understanding feels like to know how it's different. (There is no metric you can't game by sufficiently-advanced guessing, but you'll never notice an original discovery even if you do accidentally stumble upon one.)

Re:Show HN: Whole Git repo was made with ChatGPT by pphysch on Sunday December 04, 2022 @02:42PM (#33856998)
Developing OS is just plumbing already existing syscalls together...

Developing the Linux kernel is just plumbing already existing CPU instructions together...

Developing a CPU is just plumbing already existing electronic components together...

Developing an electrical component is just manufacturing with already existing materials...

Re:Show HN: Whole Git repo was made with ChatGPT by valenterry on Monday December 05, 2022 @05:59AM (#33863974)
> The hard part is translating the business requirements into something that a computer could understand

No, that's actually the easy part.

The hard part is to translate the requirements into something that a computer can understand and a human can also easily understand at the same time. Because otherwise, it's a one-off program that can't really be changed afterwards anymore.

And that is the real challenge that I'm curious about: how good will ChatGPT be in not only helping me with small, trivial, issues, but with the big ones.

"ChatGPT, here's this small 500k line repository. I need to change the business requirements and make it so that when a user fails to login 3 times in a row, a captcha is being shown before they can attempt again."

And if ChatGPT then gives me a 10k line diff that would be terrible. It should really minimize the diff but still keep it understandable. THAT is what I would love to see.

Re:Show HN: Whole Git repo was made with ChatGPT by delusional on Sunday December 04, 2022 @02:47PM (#33857055)
How do you think programming actually began?
Re:Show HN: Whole Git repo was made with ChatGPT by philjohn on Sunday December 04, 2022 @03:04PM (#33857260)
I started programming in the 80's on a Commodore 128. I had the Commodore BASIC manual, and just went from there.
Re:Show HN: Whole Git repo was made with ChatGPT by wizeman on Sunday December 04, 2022 @03:10PM (#33857321)
> I started programming in the 80's on a Commodore 128. I had the Commodore BASIC manual, and just went from there.

ChatGPT can also learn about Commodore programming if you feed it the Commodore BASIC manual during training.

My guess is that it could learn even more/better if you'd allow it to interact with a Commodore 128 computer like you did when you were learning!

Re:Show HN: Whole Git repo was made with ChatGPT by Baeocystin on Sunday December 04, 2022 @03:38PM (#33857619)
No need to feed it. I had it converting between the C=128's BASIC 7 and C=64's BASIC 2 without any additional context. Did a better job than 14 year old me had done back in the day, too.
Re:Show HN: Whole Git repo was made with ChatGPT by topicseed on Sunday December 04, 2022 @01:47PM (#33856395)
Does it matter though? Perhaps all code we tend to write it's just regurgitated snippets from stuff we read, or stuff that's been written about enough time to make it "simple" for AI to reuse.

Perhaps the goal isn't to use AI to write up an entire repo, but to go through easy utils so the highly paid engineer can focus on the core logic, the core USP of the business.

Re:Show HN: Whole Git repo was made with ChatGPT by rightbyte on Sunday December 04, 2022 @01:54PM (#33856469)
I am not expecting it to do novel research. It seems to yank out algorithms explained to it in plain text as good as I would write them in 30 minutes.

In the hand of a newbie programmer with like one week of learning experience this thing will allow them to make usable programs. I don't think this thing will hit us with years of experience in the short term but entry level programmers might be in real danger of being flooded if OpenAI makes some "low code" IDE that just works and parses the whole set of code in the project when evaluating queries.

Re:Show HN: Whole Git repo was made with ChatGPT by broast on Sunday December 04, 2022 @02:33PM (#33856897)
I personally do. I don't really find it meaningful when people show a simple buggy output. Show me a hundred iterations of you intending on helping it achieve the correct output on the same question. Even if it doesn't learn as fast as a human your age, doesn't mean it's not learning the same underlying patterns that we apply for our own abstract understanding. I haven't been shown any evidence that human understanding is different than this other than humans are much more refined with more dedicated components
Re:Show HN: Whole Git repo was made with ChatGPT by edouard-harris on Sunday December 04, 2022 @02:57PM (#33857183)
Can you give a concrete example of an output ChatGPT could give — or an experiment one could run on it — that would persuade you that it's intelligent? (For whatever definition of "intelligent" you prefer.)

If you can't think of such a test, then it seems strange indeed to confidently claim that ChatGPT has failed to satisfy an untestable condition.

But if you can think of such a test, and any human fails it — does that mean the human who fails it isn't intelligent?

Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @03:14PM (#33857362)
You're putting the cart before the horse.

Searle's Chinese Room thought experiment argues with great precision why (solely) symbol-manipulating systems don't (and will never) think. The process of cognition is deeply internal and most likely involves self-reflection, internal states, and a sense of "I-ness" which seems to be unique to mental things (unlike Searle, I'm a substance dualist so I'm admittedly a bit biased). Ergo, I'd say, at the very least, an intelligent & thinking process would need to (also) operate on non-symbolic things (which rules out computational systems), maybe on qualia, but there's probably other primitives as well.

Re:Show HN: Whole Git repo was made with ChatGPT by edouard-harris on Sunday December 04, 2022 @03:37PM (#33857616)
> I'm a substance dualist so I'm admittedly a bit biased

Thanks, I appreciate you pointing this out. Given that's the case, it might not actually be possible to reconcile our two views and we can just agree to disagree. (I was a physicist for ten years, so it's challenging for me to inhabit a position that contends that thought and matter are non-overlapping magisteria.)

I guess one question I might ask you is: how do you think substance dualism will affect your expectations about AI going forward? For example, is there any specific, measurable thing that you expect a future AI system absolutely will not be able to do? Or do any such "forbidden" things have to fall into categories like "thought", "feeling", etc. — i.e., the magisterium of the "mental", as opposed to the "physical" — under substance dualism?

Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @03:58PM (#33857802)
> we can just agree to disagree

For what it's worth, Searle is a naturalist (so he thinks brains are "just" meaty machines) and he would also disagree with you.

> For example, is there any specific, measurable thing that you expect a future AI system absolutely will not be able to do?

Not sure how you'd measure this, but I think sentience is most likely unachievable by AIs (at least how we're building them now). This is not without controversy, as while Roger Penrose would agree with me, David Chalmers would not. I'm not actually sure when Chalmers pivoted on his stance (haven't read him much since undergrad) because he was a bit more hardline in the early 2000s[1].

[1] https://wanderingstan.com/files/chalmers_on_ai.pdf

Re:Show HN: Whole Git repo was made with ChatGPT by edouard-harris on Sunday December 04, 2022 @04:17PM (#33857976)
> For what it's worth, Searle is a naturalist (so he thinks brains are "just" meaty machines) and he would also disagree with you.

I definitely disagree that Searle's conclusion in the Chinese room experiment applies to the kinds of AI systems we're building today.

I agree that nobody to my knowledge has figured out how to measure sentience, so I don't think that fits under the "measurable" heading. And this does suggest to me — because this was your hand-picked example — that your position as a substance dualist doesn't affect your concrete expectations about what AI systems will actually be able to do in the future. Is that right?

Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @05:26PM (#33858635)
> I definitely disagree that Searle's conclusion in the Chinese room experiment applies to the kinds of AI systems we're building today.

Unless you're trying to say that today's AI systems do anything but manipulate symbols (which is imo patently obvious), I'm not sure how you can make that argument.

Re:Show HN: Whole Git repo was made with ChatGPT by baq on Sunday December 04, 2022 @03:27PM (#33857496)
You’re dodging the question. Have you tried this thing? You can declare yourself whatever, it doesn’t care if it’s a computational system, it just does things which are hard to describe as purely recombining what it’s already seen and not for the lack of trying.
Re:Show HN: Whole Git repo was made with ChatGPT by aflag on Sunday December 04, 2022 @03:42PM (#33857662)
I have tried and I felt like the thing it's quite not as good at is answering questions I didn't know. Or rather, he couldn't explain things in other words or try to tackle the actual conceptual question I had. It would just repeat itself. I think that's a good tell of the lack of actual understanding
Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @03:36PM (#33857606)
> hard to describe as purely recombining

I take issue with this; imo its output looks exactly like what a neural network being fed terrabytes and terrabytes of natural language then recombining it would look like. But either way, you're making the same mistake: looking at behavior and affirming the consequent (namely: it outputs smart-looking text, therefore it must be intelligent). But this is a mistake. Its behavior implies nothing about underlying processes.

Re:Show HN: Whole Git repo was made with ChatGPT by baq on Sunday December 04, 2022 @04:25PM (#33858066)
My argument is that the underlying processes don’t matter as long as results are classified as output of an intelligence - because that’s the only way I can judge it. What it is under the hood is… less important.

Oh btw you must’ve missed the post in which it was told it was a Linux shell and it mostly worked as one. Complete with recursively calling into a pretend API version of itself. I’m not calling that intelligence, but I’m not calling it regurgitation either.

Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @05:24PM (#33858622)
> My argument is that the underlying processes don’t matter as long as results are classified as output of an intelligence - because that’s the only way I can judge it. What it is under the hood is… less important.

That view is called "behaviorism" and is not really taken particularly seriously exactly because it's not very useful in truly understanding what is happening under the hood (which, as a curious species, we deem important). It's like not caring how electromagnetism works because the behavior of "the positive side of this chunk of rock is attracted to the negative side" is good enough.

Re:Show HN: Whole Git repo was made with ChatGPT by int_19h on Monday December 05, 2022 @09:21PM (#33875066)
We plainly don't know anywhere near enough about what's happening under the hood in our own heads to judge based on that, so in practice, "does it behave intelligent?" is the best test that we actually have available.
Re:Show HN: Whole Git repo was made with ChatGPT by tasuki on Sunday December 04, 2022 @04:29PM (#33858100)
> you're making the same mistake: looking at behavior and affirming the consequent (namely: it outputs smart-looking text, therefore it must be intelligent)

Why is that a mistake? What other means do we have of assessing intelligence?

Re:Show HN: Whole Git repo was made with ChatGPT by bhouston on Sunday December 04, 2022 @05:41PM (#33858780)
Charles Searle arguments never held much water. He basically argued that computers could never think because they were computers and not humans. And even if we replicated a human body and gave it experiences and ability to interact with the world and even if it appeared to be conscious in an undistinguished able way from humans it still would be intelligent like humans. Once you get into it Searle is a dualist who pretends that he isn’t.

I think you need to move beyond Searle because he isn’t right.

Re:Show HN: Whole Git repo was made with ChatGPT by dvt on Sunday December 04, 2022 @06:20PM (#33859153)
> I did a cog sci degree and I saw Searle as a troll

I did a philosophy degree and smart people still very much take him seriously. If not him, take a look at Nagel or Chalmers. I think that his idea† that conscious experience is non-computable is probably right, especially given findings in the early 20th century that many things that we thought may have been computable ended up not being computable.v

† Not exactly his idea, though it nicely segueys into it.

Re:Show HN: Whole Git repo was made with ChatGPT by bhouston on Sunday December 04, 2022 @09:34PM (#33860736)
> I have a philosophy degree and smart people still very much take him seriously.

I agree that some people take him seriously. Many people take religion seriously too. I don't take either him or religion seriously as true, but I do understand both his and religion's appeals.

That said, I do give a decent chance to aspects of the brain's problem solving ability having quantum properties and thus can not be calculated as efficiently on classical computers. We do not know this for sure, but evolution is incredibly inventive at finding efficient solutions. Still computable though, even on classical computers.

e.g. https://en.wikipedia.org/wiki/Quantum_mind

Re:Show HN: Whole Git repo was made with ChatGPT by int_19h on Monday December 05, 2022 @09:25PM (#33875098)
People who start with the assumption that there's some "secret sauce" take on consciousness and intelligence the Chinese Room seriously, because it is intentionally constructed to beg that exact question. People who start with the opposite assumption reject the experiment as not meaningful.

So, really, all that this tells you is that many people have this assumption.

Re:Show HN: Whole Git repo was made with ChatGPT by Winsaucerer on Monday December 05, 2022 @07:57AM (#33865006)
I'm sympathetic to dualism, being an idealist who thinks that there's just mental substances. I don't think there's any conflict between substance dualism and the belief that most of what we consider intelligence or understanding is actually the work of brains rather than mental substances. Minds have experiences, but that doesn't mean that those experiences aren't heavily influenced by facts about the physical (and, more specifically, our brains).

Machine learning is modeled at least in small part in a way that it's thought the brain operates. I expect such things to be able to mimic human reasoning and intelligence, I just deny that there's any consciousness behind it -- there's no qualia, no phenomenology. In short, there's nothing that it's like to be ChatGPT. Even so, ChatGPT is able to mimic human intelligence, and I won't be surprised if (when?) it gets even better.

Re:Show HN: Whole Git repo was made with ChatGPT by guerrilla on Sunday December 04, 2022 @04:28PM (#33858095)
They literally gave you a necessary condition: basic categorization. They don't need to give you sufficient conditions if it can't meet the necessary ones. You're making an obvious fallacy.
Re:Show HN: Whole Git repo was made with ChatGPT by jchw on Sunday December 04, 2022 @03:07PM (#33857295)
In the real world, it tends to perform better, though. Frankly, it also probably isn't as good as "mental math" as some humans, but that's also not what it's optimized for. However, it's able to perform roughly as well as an average human for practice SAT tests, so it doesn't seem that it really has general issues with intelligence test questions, even if they are more contrived than most real world problems. Nobody ever said that ChatGPT demonstrates intelligence similar to humans in every way, but again: who the hell cares? People are going to be saying this right into their own layoffs at this rate. I'm a career SWE, so I'm not really looking forward to it anymore than anyone else.

I also wonder: is there a chance you had more dialogue, but only presented this interaction?

Re:Show HN: Whole Git repo was made with ChatGPT by pyinstallwoes on Sunday December 04, 2022 @06:39PM (#33859321)
This idea that Rodger the new hire on the team is "intelligent" is so absurd it's getting tiring. You do realize that the code you see regurgitated is most likely some permuted variant of a question/answer on Stack Overflow or a pull request on Github, right? Rodger can't even do basic categorization[1] reliably, but you think Rodger can understand code?
Re:Show HN: Whole Git repo was made with ChatGPT by xur17 on Sunday December 04, 2022 @01:27PM (#33856216)
> The question is how good it is to process larger chunks of code and makes changes to it.

> People thinking about becoming programmers might need to rethink their plans if this one improves ...

Very true, and this thought definitely crossed my mind as well. In the short term I imagine this is going to be like any other tool, it will increase your leverage, and make it possible for you to write code faster.

For example, I fed it 100 lines of a Django model and asked it to write some query code for me. Produced something that was possible faster than I could have. The few slight deficiencies it did have (optimizations) basically felt like me doing a code review.

Re:Show HN: Whole Git repo was made with ChatGPT by guiambros on Sunday December 04, 2022 @01:06PM (#33856022)
Last night I entered the page-long instructions for Advent of Code day 4, and it spewed out perfectly readable code and solved it on the first try [1]. And we're not talking about a common algorithm that has been solved many times before, but a convoluted story that is full of "elves cleaning up overlapping sections of the camp" (!), and ChatGPT was still able to understand it, write the code to solve it, and even explain how it works.

It's nothing short of a phenomenal milestone.

[1] https://twitter.com/GuiAmbros/status/1599282083838296064

Re:Show HN: Whole Git repo was made with ChatGPT by ak_111 on Sunday December 04, 2022 @02:52PM (#33857103)
Are you sure this whole problem with its solution wasn't indexed in ChatGPT training set, so all it did here is retrieve the whole answer to the problem similar to how google will find the solution pretty quickly if you search for "advent of code day 4 solution"?

Can you see if it solves an advent of code problem whose solution hasn't been posted yet? If it did I will consider this an almost publishable breakthrough.

Re:Show HN: Whole Git repo was made with ChatGPT by ghusbands on Sunday December 04, 2022 @03:05PM (#33857284)
It wasn't in the training set - the puzzle was released today, as part of this year's advent of code. ChatGPT is eminently publishable and has demonstrably produced plenty of novel, if boring, code.
Re:Show HN: Whole Git repo was made with ChatGPT by TedDoesntTalk on Sunday December 04, 2022 @05:11PM (#33858505)
Genuine question: can it write larger codebases yet such as: “write a pac-man clone in JavaScript, html, and css”
Re:Show HN: Whole Git repo was made with ChatGPT by negamax on Sunday December 04, 2022 @05:25PM (#33858628)
It can't write pacman. But if you describe a scenario to it, it writes pretty accurate code and can drill down. Very impressive
Re:Show HN: Whole Git repo was made with ChatGPT by MacsHeadroom on Sunday December 04, 2022 @06:04PM (#33858997)
Yes, but you'll have to chop the project up into different parts and describe each sufficiently well.

For example, start with "write a level generator in JavaScript which outputs pacman like levels encoded in ASCII which could be used as the basis for a pacman clone."

Then you'd say "Great, now write a pacman clone in JavaScript which takes the input of the previously generated level generator and takes interactive input on the console."

Then you'd have to ask it to generate the HTML and CSS. It won't do it all at once. But it will do it piece by piece.

Re:Show HN: Whole Git repo was made with ChatGPT by rafabulsing on Monday December 05, 2022 @08:52PM (#33874834)
Yes, it's absolutely feasible. I did exactly that with a simpler version of this (Tic Tac Toe, and console only, no actual visual interface) but it worked pretty well.

The main thing is having a good idea of what the overall program structure will look like. If you have that, I think you can go pretty far with it.

Btw, in case anyone wants to see what working like this may look like, I recorded myself while doing that little experiment: https://youtu.be/TBMQIDMwI5E

Re:Show HN: Whole Git repo was made with ChatGPT by dwild on Sunday December 04, 2022 @08:41PM (#33860329)
I'm trying that right now. It can probably do it, the big issue right now is that it won't give really long answers and just stop in the middle, which can be avoided by asking him to finish it, but it doesn't always works.
Re:Show HN: Whole Git repo was made with ChatGPT by rafabulsing on Monday December 05, 2022 @08:55PM (#33874871)
If you can break down what you want into smaller functions, instead of just asking for the whole thing at once, you can actually do a lot with it, including telling it to out it all together at the end.

Won't link it again so as to not get too spammy, but I posted a recording of an experiment I did playing around with ChatGPT in that way on a sibling comment if you want to check that out.

Re:Show HN: Whole Git repo was made with ChatGPT by ignu on Sunday December 04, 2022 @05:06PM (#33858464)
I've tried giving it languages like Turbo Pascal or telling it to obscure frameworks like fp-ts and while sometimes it's not syntactically perfect, but I can guarntee it's not just scraping code snippets from somewhere.
Re:Show HN: Whole Git repo was made with ChatGPT by dwild on Sunday December 04, 2022 @07:54PM (#33859961)
The guy that got the first position for the first part, thus the first solution ever on that problem, was using ChatGPT to do it. [1]

[1] https://github.com/max-sixty/aoc-gpt

Re:Show HN: Whole Git repo was made with ChatGPT by alexeldeib on Sunday December 04, 2022 @01:08PM (#33856036)
I tried higher level problems: write an http serving in rust using warp and postgres, with endpoint for get users and put user.

9 compile errors, some due to cargo.toml issues (it only generated main.rs). But mostly worked.

The post we’re discussing is also pretty impressive, a working lexer/parser

Re:Show HN: Whole Git repo was made with ChatGPT by nwienert on Sunday December 04, 2022 @01:10PM (#33856054)
The answer is it’s very bad at large amounts of code. It has no skill at reasoning across a large amount of files where say you’d need to make many small changes in a handful of places and know that those changes all work together.

These models are amazing at regurgitation. They have no skill at reasoning and any solution outside their training set. They have a distinct disability for precision in anything remotely novel or large. And they will bullshit subtle bugs all over the place at scale.

Even a junior programmer would produce more value than the next generations of this, simply because they can take vague English instructions and actually make iterative progress across a huge codebase, test those changes for all sorts of vague constraints, and be precise. There’s no ability for that here.

Re:Show HN: Whole Git repo was made with ChatGPT by passion__desire on Sunday December 04, 2022 @01:23PM (#33856165)
This tool would make for a great pair programmer and an intelligent interactive rubber duck
Re:Show HN: Whole Git repo was made with ChatGPT by birdyrooster on Sunday December 04, 2022 @04:06PM (#33857890)
Except you must have the underlying knowledge to effectively review code. So how that would obviate a career in programming is a strange choice by the grandparent commenter. Anyone can rubber stamp bad code, but to stop bad code from entering projects you need experts.
Re:Show HN: Whole Git repo was made with ChatGPT by aprdm on Sunday December 04, 2022 @04:15PM (#33857960)
Most projects have plenty of bad code, nobody cares, as long as it solves the problem.
Re:Show HN: Whole Git repo was made with ChatGPT by ad404b8a372f2b9 on Sunday December 04, 2022 @05:00PM (#33858414)
The bad code it produces is not just stylistically bad, it often doesn't solve the problem.

It seems to be making the same kind of errors in code as we've seen in speech, you get a lot of plausible but subtly wrong hallucinated content that only someone who knows the subject can identify. It prefers probable output over matching the specifications so it'll add unnecessary branches just because it's seen them millions of times.

Among errors I've seen it make there is bad indexing, adding conditions that serve no purpose or assuming a variable has a specific structure when it doesn't.

Re:Show HN: Whole Git repo was made with ChatGPT by rightbyte on Sunday December 04, 2022 @04:31PM (#33858126)
Well my mortgage is thankful for that.

I have a feeling though that tools like this will lower the skill threshold for programming by a lot.

I gave it this code I just made and asked it what it does and it figured it out:

    public class mean_sink {

        double sum;
        long n;
        
        public mean_sink(){
        }
        
        public void add(double d){
            sum += d;
            n++;
        }
        
        public double getMean(){
            if(n == 0)
                return Double.NaN;
            return sum/n;
        }
    }
I asked it to improve the numerical accuracy and it did it with BigDecimal instead. I asked it to only use doubles and it did some strange reciprocal summation when I was "hoping" for Kahan summation algorithm. Its "reciprocal summation" did not work. But it made a correct Kahan when I asked for it.

I dunno. This is insane anyway. It is really hard to grasp the consequences.

Re:Show HN: Whole Git repo was made with ChatGPT by senectus1 on Sunday December 04, 2022 @07:56PM (#33859980)
>Even a junior programmer would produce more value than the next generations of this

At the rate this is evolving that wont be a limitation for long.

My 14 yr old son thats taught himself to code in c# over the last few years is going to be put of a potential job before he cab be taught to code professionally.

This is quite frightening, the rate of evolution.

Re:Show HN: Whole Git repo was made with ChatGPT by dopidopHN on Sunday December 04, 2022 @04:47PM (#33858271)
Hi, thanks for breaking it down.

Do you write code close to the machine at $job?

I wanna try with more feature and UI heavy request.

I actually comment because of your edit in your response : you manually introduced bugs, reran the process, and it seen you broke it ( fine ) but was able to explain it to you in English ?

Where is that comming from ? Adjacent comments and git comments?

Re:Show HN: Whole Git repo was made with ChatGPT by makestuff on Sunday December 04, 2022 @05:03PM (#33858441)
I asked it to make some stuff in flutter and it worked well. I did notice sometimes it just adds a comment in the function saying “insert logic here for X” when it doesn’t know how to write it.
Re:Show HN: Whole Git repo was made with ChatGPT by rightbyte on Sunday December 04, 2022 @06:21PM (#33859165)
> I actually comment because of your edit in your response : you manually introduced bugs, reran the process, and it seen you broke it ( fine ) but was able to explain it to you in English ?

I fed it it's own sorting function but I added bugs to it and asked it to spot the bugs.

Re:Show HN: Whole Git repo was made with ChatGPT by sage76 on Sunday December 04, 2022 @05:20PM (#33858585)
I tried a hard level leetcode problem on it. Perfect results on the first attempt.
Re:Show HN: Whole Git repo was made with ChatGPT by dvngnt_ on Thursday December 15, 2022 @01:54PM (#34003923)
it was trained with leetcode data though?
Re:Show HN: Whole Git repo was made with ChatGPT by sage76 on Friday December 23, 2022 @06:03AM (#34104470)
Ah I didn't know that.
Re:Show HN: Whole Git repo was made with ChatGPT by bcrosby95 on Sunday December 04, 2022 @06:09PM (#33859054)
I was experimenting with it a bit while building an RPG combat system.

One thing I noticed is its very subservient. I pointed out a bug and it fixed it. But then I immediately did the reverse - I asked it to re-introduce the bug (by stating a fact about the existing program which was incorrect), and it was happy to re-introduce the bug I had it squash a minute ago.

This particular example was related to the hit chance of an attack. It was rolling 1-100. But then when modifying that chance by an NPC's statistics, it first multiplied that statistic by 0.01. It couldn't connect the fact that the rest of the program was already using whole number percentages (1-100) with a statistic modifying your chance to hit, and had decided to use 0-1.0 for that.

So be careful about how "smart" you think it is. It can churn out code. But it will also introduce bugs if you ask it to, and at least in this experiment would not assert itself in situations where my stated understanding of the program as written was wrong.

Re:Show HN: Whole Git repo was made with ChatGPT by nobody5050 on Sunday December 04, 2022 @07:09PM (#33859589)
Something I’ve noticed in my own experimentations is that it’s really only limited by the length of its replies. It can happily generate perfect code but then stop in the middle of a function simply because the website only asked for 200 tokens or something. It’s really quite something to say that one of my gripes lies not in the model but in the user interface wrapping the model.
Re:Show HN: Whole Git repo was made with ChatGPT by melagonster on Sunday December 04, 2022 @10:59PM (#33861285)
programmers are final worker. there are not no more jobs.
Re:Show HN: Whole Git repo was made with ChatGPT by ChickeNES on Sunday December 04, 2022 @11:37PM (#33861527)
I already managed to get it to write an implementation of Pong and a Chip8 interpreter, both in C and using SDL2 for graphics/input/sound (it even wrote a function to generate the waveform for a beep for Chip8 and rebound sound for Pong!). I'm pretty sure I can get it to generate all the code for a Gameboy or NES emulator, I've taken a few tentative steps and it definitely can reproduce the memory map and generate code to parse iNES/GB cartridge headers