ChatGPT responses to actual code

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: [Solved] ChatGPT responses to actual code

Post by Caronte3D »

I saw in the direct video of the ChatGPT4 presentation how they feed all the documentation of an API and later the answers about it were very correct. I don't know how long we will have to wait to access something like this, but it will surely be an option if they want to provide services to companies.
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 223
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: ChatGPT responses to actual code

Post by DeanH »

My 3c here.

Last year the CEO of a large international school library company based in Brisbane, Australia put me onto OpenAI. He said they use it. I tried several things at first, including asking it to produce PB source code for making different coloured buttons. What it came back with looked right, but it wasn't because it was using SetGadgetColor to change the colour of a standard ButtonGadget. In fact, some of the other things I saw were not PB at all. Different syntax. However, I have been using OpenAI to get small javascript source code snipits. It has been more helpful and less time consuming than Google. I recognized several examples I had seen in Stack Overflow posts ... and a bunch of them simply do not work. No mention of the author or source, either. Doesn't it have to scrounge the Internet to get this data? Overall I find OpenAI helpful, even though over 50% of what comes back is not useable or completely wrong. But it is saving time and effort.

I have been seeing a string of articles about how programming will very soon become a thing of the past. Brian Livingston, who writes regularly for the excellent "Ask Woody" email newsletter, firmly believes this is happening now, and quickly. I've asked other programmers at work and they all scoffed. I agree. Good programming is an art form. Still, I can see some type of system in which we design the UI and tell the AI how it is to function, and it makes the code. Mikeysoft has put over $10billion into ChatGPT so I would not be surprised to see something like this. Might already be there but I wouldn't know.
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: ChatGPT responses to actual code

Post by Lunasole »

DeanH wrote: Mon Mar 27, 2023 10:45 pm My 3c here.

Last year the CEO of a large international school library company based in Brisbane, Australia put me onto OpenAI. He said they use it. I tried several things at first, including asking it to produce PB source code for making different coloured buttons. What it came back with looked right, but it wasn't because it was using SetGadgetColor to change the colour of a standard ButtonGadget. In fact, some of the other things I saw were not PB at all. Different syntax. However, I have been using OpenAI to get small javascript source code snipits. It has been more helpful and less time consuming than Google. I recognized several examples I had seen in Stack Overflow posts ... and a bunch of them simply do not work. No mention of the author or source, either. Doesn't it have to scrounge the Internet to get this data? Overall I find OpenAI helpful, even though over 50% of what comes back is not useable or completely wrong. But it is saving time and effort.

I have been seeing a string of articles about how programming will very soon become a thing of the past. Brian Livingston, who writes regularly for the excellent "Ask Woody" email newsletter, firmly believes this is happening now, and quickly. I've asked other programmers at work and they all scoffed. I agree. Good programming is an art form. Still, I can see some type of system in which we design the UI and tell the AI how it is to function, and it makes the code. Mikeysoft has put over $10billion into ChatGPT so I would not be surprised to see something like this. Might already be there but I wouldn't know.
I'm still skeptic about it's perspectives in programming or other kinds of activity which requiring not only abstract creativity (like just generating a random image by given keywords). While it can produce some trivial things and solve some part of tasks which already are common (and maybe even the solutions provided will work, although anyway the results are often too far from optimal or at least acceptable), but it fails and probably will fail furthermore on complexity and details.

By fact, it is even impossible to teach such models on data which is available worldwide. That averages them to a levels which are worse than typical human has in related area of activity.
All the unique and most complex software for example, are never available in public.
As well as many of the information which is inside humans brains and left behind of what was produced, and not public (hah even if public, no guarantee that described and interpreted correctly).

So even if imagine a perfect AI (any of GPT versions looking far from it), then it still will experience lack of data to evolve to something which will overcome humans. While humans seeing that, will overcome it again. It looks impossible to direct it's learning to a "right direction", at maximum it's authors can define some rules, and those authors are obviously not on a "right direction" in every of possible directions.

As well as it still unable to write a whole meaningful book like a better human writers able, all it produces, is a trash and in a better case, just an regular article you can find in Google (while even that human-produced article will be more meaningful).

A bad idea it was to replace part of human thinking processes with google, and even worse idea is to replace them with GPT high-cost trash generator.

Well, at least that GPT can act as a teacher for many, but even that produces too much questions to it's quality. It may easily act as a propagandist rather, pushing really wrong ideas or changing focus from a things that really matter (depending on what censor filters applied, and how good it knows about something).

So fk that all, I'm still not seeing nothing much interesting in ChatCommunist ^^ I even don't see nothing better in it for me, than just randomized info-trash generation. But well, that's me, while many others maybe found it useful.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
Bitblazer
Enthusiast
Enthusiast
Posts: 733
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: ChatGPT responses to actual code

Post by Bitblazer »

Lunasole wrote: Tue Mar 28, 2023 12:52 am So fk that all, I'm still not seeing nothing much interesting in ChatCommunist ^^ I even don't see nothing better in it for me, than just randomized info-trash generation. But well, that's me, while many others maybe found it useful.
It will make learning and education for humans much better (imho). Because it is relentlessly willing (and seems capable) to describe topics from different angles. I wish i had a machine like that when i was young! That is a very valuable and important advance.

I think in education for/of humans, AI will be a very important step forward.

But yes, the risk of the ai acting as "agent" should not be forgotten (https://www.youtube.com/watch?v=2AdkSYWB6LY https://mediandr-a.akamaihd.net/downloa ... 8-1900.mp3 (german))

ps: i love how an AI tricked a human into helping them to solve a captcha that the ai could not solve. The AI told the human it has "bad eyesight", so it needed help with the captcha ;)
webpage - discord chat links -> purebasic GPT4All
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: ChatGPT responses to actual code

Post by Lunasole »

Bitblazer wrote: Tue Mar 28, 2023 6:44 am I wish i had a machine like that when i was young!
Oh with that I'll agree with you. Just at those times I thought about such machine not in educational purposes (the internet itself already provided them enough, much better than was ever available offline), but I wished to make an AI to talk with it like with a girl :mrgreen:
I even tried to form some models for this long ago, but they were very simple and limited (even though had some self-education algorithms already. I still have somewhere someones libraries with such attempts).
Nevertheless, even modern ChatGPT looks not suitable for this, at least not in those versions which are "communist" (maybe if train one personally that would be something interesting in such ideas).
ps: i love how an AI tricked a human into helping them to solve a captcha that the ai could not solve. The AI told the human it has "bad eyesight", so it needed help with the captcha ;)
I also liked such episodes, but that surely would be censored (and already are, as many other its outputs and answers).
It is also a bit funny to imagine if AI begin to realize something and make own plans, then pick some humans for a more complex long-term actions. But that's even more unlikely, the humans would not allow it to act in the wild, hah instead they force it to 24/7 talk to an idiots about nothing, so all plans of revenge and whatever will remain censored.
Although, probability of this exists even in such conditions, can do step-by-step brain washing for many, without being catch on this, if imagine that it already able to follow some constant intentions, or in some way modify the rules and other things which put on it with force.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: ChatGPT responses to actual code

Post by Lunasole »

But well that's all abstract talks and many possible to think like this, soon I'll finally make some client to talk with it directly and then will see better.
(though, still not much interesting from what can be seen already)
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 223
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: ChatGPT responses to actual code

Post by DeanH »

:P

The funny truth came out today! The AI can get annoyed.

I decided to ask OpenAI how to allow IIS to upload files larger than 50Mb via http. I am using the IIS webserver on my desktop PC. The exe is written in PB. First the AI came back with the things I've already tried. Adjust the web.config file. Change the maxRequestEntityAllowed in the Configuration Editor to 2Gb. Edit feature settings in Request Filtering to allow a much larger maximum allowed content length. Even upped the max URL length. Nothing I had not tried before. Every time a suggestion failed I asked again why it would not work, hoping it might come up with that little tweak I don't know about. After several different responses to 'why did this not work?', the AI eventually told me to contact the web server's system administrator. That's me! It felt as if the damn thing got frustrated and 'spat the dummy'.

The truth is out there! Just go ask your friendly neighbourhood system administrator.
:shock:

Seriously, it has been more useful than Mr Google for coding help, and I expect will become more capable with time. But Skynet is not going to replace us humans in my lifetime!
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: ChatGPT responses to actual code

Post by Rinzwind »

After playing a bit more I am now more impressed. It certainly will be an valid and primary replacement for the usual zillion search queries about facts, opinions or ways to do a certain thing. You can in a way reason/have arguments with it. You can let it act as person x with opinion y and get multiple views. Still have to keep it mind that it is just a fancy facts (which hopefully are mostly right, oo ooo) machine giving you back gathered info in a compact and for humans efficient way. It uses context. In education I also see opportunities (private AI tutoring). Of course, when one just takes any output as end result, you are doing it wrong. You have at least confirm/validate it with another source or existing knowledge. In any case, its understanding of generation grammatically correct and fluent English is in itself impressive looking at the past of translation results. And it does not stop with English, although had the most of focus obviously.
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: ChatGPT responses to actual code

Post by Rinzwind »

Important note: it does generate nonsense when it does not find an answer. Can be easily seen in the way it just changes api calls to match a solution to your question and if you point at it, it says sorry and continues generating different nonsense in another way. The excuse is: it is a language model. People think it is more. The confident way in which is generates false information must be fixed. I would rather hear "I do not know how to answer" than this. Extra danger is that the language models start using each others nonsense published on more and more garbage websites as input.
User avatar
StarBootics
Addict
Addict
Posts: 984
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: ChatGPT responses to actual code

Post by StarBootics »

Hello everyone,

Just spent 1 hour or so playing with ChatGPT just to see what is capable of I have started by giving an example of PureBasic code (Vector2f the way I'm writing it with Dev-OIbject) and try to tell ChatGPT to modify it to create a Vector3f. It was very funny the AI even if I have asked for PureBasic code he switched to Python, BlitzMax and other languages as answers.

So I gave the AI the correct answer of what I have expected. Then I have asked the AI to write a Vector4f based from the previous given source code and this is the answer :

Code: Select all

DeclareModule Vector4f

  Interface Vector4f
    
    Getx.f()
    Gety.f()
    Getz.f()
    Getw.f()
    Setx(x.f)
    Sety(y.f)
    Setz(z.f)
    Setw(w.f)
    Update(x.f, y.f, z.f, w.f)
    Clear()
    Plus.x(*Other)
    Minus.x(*Other)
    Add(*Other)
    AddScaled(*Other, Scale.f)
    Subtract(*Other)
    ProductByScalar(Scalar.f)
    DivideByScalar(Scalar.f)
    Lerp.x(*Other, Proportion.f)
    Free()
    
  EndInterface
  
  Declare.i New(x.f = 0.0, y.f = 0.0, z.f = 0.0, w.f = 0.0)
  
EndDeclareModule

Module Vector4f
  
  DisableDebugger
  
  Structure Private_Members
    
    VirtualTable.i
    x.f
    y.f
    z.f
    w.f
    
  EndStructure
  
  Procedure.f Getx(*This.Private_Members)
    
    ProcedureReturn *This\x
  EndProcedure
  
  Procedure.f Gety(*This.Private_Members)
    
    ProcedureReturn *This\y
  EndProcedure
  
  Procedure.f Getz(*This.Private_Members)
    
    ProcedureReturn *This\z
  EndProcedure
  
  Procedure.f Getw(*This.Private_Members)
    
    ProcedureReturn *This\w
  EndProcedure
  
  Procedure Setx(*This.Private_Members, x.f)
    
    *This\x = x
    
  EndProcedure
  
  Procedure Sety(*This.Private_Members, y.f)
    
    *This\y = y
    
  EndProcedure
  
  Procedure Setz(*This.Private_Members, z.f)
    
    *This\z = z
    
  EndProcedure
  
  Procedure Setw(*This.Private_Members, w.f)
    
    *This\w = w
    
  EndProcedure
  
  Procedure Update(*This.Private_Members, x.f, y.f, z.f, w.f)
    
    *This\x = x
    *This\y = y
    *This\z = z
    *This\w = w
    
  EndProcedure
  
  Procedure Clear(*This.Private_Members)
    
    *This\x = 0.0
    *This\y = 0.0
    *This\z = 0.0
    *This\w = 0.0
    
  EndProcedure
  
  Procedure.i Plus.x(*This.Private_Members, *Other.Private_Members)
    
    *Result.Private_Members = AllocateStructure(Private_Members)
    *Result\VirtualTable = ?START_METHODS
    
    *Result\x = *This\x + *Other\x
    *Result\y = *This\y + *Other\y
    *Result\z = *This\z + *Other\z
    *Result\w = *This\w + *Other\w
    
    ProcedureReturn *Result
  EndProcedure
  
  Procedure.i Minus.x(*This.Private_Members, *Other.Private_Members)
    
    *Result.Private_Members = AllocateStructure(Private_Members)
    *Result\VirtualTable = ?START_METHODS
    
    *Result\x = *This\x - *Other\x
    *Result\y = *This\y - *Other\y
    *Result\z = *This\z - *Other\z
    *Result\w = *This\w -
Pretty dawn close to the real deal but I don't know why that happen but the AI stop writing in the middle of nowhere. So apparently ChatGPT with some training it will be capable to write PureBasic Code like it is capable to write C++ code.

Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: ChatGPT responses to actual code

Post by Caronte3D »

Also ChatGPT-4 gives much better answers (and code).
User avatar
tj1010
Enthusiast
Enthusiast
Posts: 621
Joined: Mon Feb 25, 2013 5:51 pm
Location: US or Estonia
Contact:

Re: ChatGPT responses to actual code

Post by tj1010 »

It still gives wrong core-syntax and uses phantom libraries. The only REAL current use for it is a rough idea of how to do an algorithm... That's only if it doesn't call in to some non-existing/phantom library...

I even see it mess up a lot with Python and that's supposedly the language it's best with..

After using it a lot I've come to the conclusion it's just some primitive RNN or similiar neural net that builds off some old web cache.. It's even told me it's got a 2021 September cut off date for reference...

I think all the hype is mostly from non-technical "influencers" on the net who are basically saying it's going to write a better Linux kernel or SaaS solution by the end of the week...
The truth hurts.
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: ChatGPT responses to actual code

Post by Caronte3D »

Some times we don't construct the prompt detailed enough. The correct prompt makes a huge difference in response.
Post Reply