Hacker News new | ask | show | jobs
by __mp 905 days ago
When writing a small application in Go I had great success asking Chat GPT specific questions. It helped me figure out which packages I needed to use and how to interact with them.

I understand that this might not fit your use-case, but it's worth a try. Just be aware that it tends to hallucinate APIs.

3 comments

If it does hallucinate, you can just paste it the latest documentation and the hallucination rate goes to nearly zero.
Or it apologizes profusely, tells you you’re correct, and fails to fix its reasoning or the examples it gives you.
A couple of days ago I was trying to make Chatgpt give me the equivalent s3:// string for an https://... s3 bucket. The stupid thing would just replace http with s3, no matter how much I told it what I wanted (I needed to reformat several links, and search engines were just giving me s3 -> http scripts).

It finally landed on me that I was using gpt3.5 . Once I moved to gpt4 it got it right the first time.

I was trying to get it to write some Elixir code to handle Erlang B calculations and it just couldn't figure it out, but it was pretty confident with the wrong things it was printing out.
The rust borrow checker often requires too much critical thinking for ChatGPT, as well.

LLMs confer a tremendous productivity boost. You just have to understand their limits and know when it's faster to think through and write the solution yourself.

I told it to stop apologising all the time. It apologised for doing that :)
Did you also try telling it what it should do instead?
No, because there is nothing I wanted it to do instead. Perhaps what I should have done was to change the system prompt to something like "You are a helpful assistant that will admit its mistakes but never apologise for them."
> because there is nothing I wanted it to do instead.

"Simply do not say anything and move on" is something to do instead.

probably chatgpt is Canadian :)
Sounds like you need to add some custom instructions to get the tone, accuracy, and concision you want.
Does it actually consume the documentation? You could (haven’t tried in a while) also have ChatGPT tell you anything you wanted aslong as you stated “It’s been posted on Wikipedia after your last consumed date”.

I feel like telling it that it’s wrong and linking documentation is the same as referring to Wikipedia?

I mean you can just run the code and verify its functionality, right? I guess you could be in trouble if you get functioning hallucinations and try to build more around a false foundation.
The person asking the question seems to be looking for a course or textbook with which to challenge themselves.

What you've described is the opposite of that.

I understand. But as a long-time programmer I like to explore new programming languages or APIs by working on a small project. I start with a first prototype to get the feel of the language, before I look into extended documentation. Chat GPT helps with this use-case.

It's also more fun to have something which can be easily extended than to start from scratch.

>Just be aware that it tends to hallucinate APIs.

It gives you nice little hints and a different perspective on your api design itself. I'd have a chat with chatgpt and sometimes I'd miss to share specific code and it just assumes or hallucinate on that.