Page 1 of 4

Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 11:54 am
by Joris
Hi,


Has anyone used any AI-model to create PB code?
I'm not that AI-minded, sooner or later... it destroys too much creativity.
However, I could use it to create programming code that is too much for me...
And yes, only I know that limit already for years (pitty but true).

As far as I can see the whole AI thing, decode is usually spit out in Python. Whether it can also be qualitatively just as good in PB code, I still have to find out.

Other experiences and tips are welcome.

Thanks.


// Moved from "Coding Questions" to "General Discussion" (Kiffi)

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 12:15 pm
by moulder61
There have been a few examples on here recently. A simple snake game seemed to work quite well.

Personally, anything I've asked for(from ChatGPT) hasn't worked for me on Linux.

Some code is blatantly wrong, but it looks interesting and includes explanations, so maybe there is some value to be had?

For me, the point of programming is the challenge of trying to be creative and get something working, so having AI do it for me seems a bit counter intuitive. Maybe less so if I was doing it to earn a living?

Moulder.

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 12:20 pm
by BarryG
Joris wrote: Tue Feb 11, 2025 11:54 amHas anyone used any AI-model to create PB code?
ChatGPT can do very simple code -> https://www.purebasic.fr/english/viewto ... 52#p633852

But you shouldn't use it if you don't know how to code and debug competently in PureBasic, as ChatGPT will make mistakes that need correcting. The good news is when I tell it what's wrong and how to fix it, it does learn for next time. That is, when I post the same question again in another way, it knows what I mean and gets it right.

My personal use of ChatGPT with PureBasic is for asking generic concept questions on how to do something. Like I was unsure once of how to put an icon in a ListIconGadget's title bar, and it showed me a way using the SetParent_() API command. So I was able to achieve my goal without bothering anyone here with that question. ;)

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 12:28 pm
by BarryG
Here's an example of a question I asked ChatGPT:

using purebasic, write an app that shows the contents of "c:\windows\fonts" in a ListViewGadget

The compilable response (and screenshot as proof) is below.

Code: Select all

EnableExplicit

If OpenWindow(0, 100, 100, 400, 300, "Font Folder Contents", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
  ListViewGadget(1, 10, 10, 380, 280)
  
  Define directory.s = "C:\\Windows\\Fonts"
  Define file.s
  Define dirID = ExamineDirectory(#PB_Any, directory, "*")
  
  If dirID
    While NextDirectoryEntry(dirID)
      file = DirectoryEntryName(dirID)
      If DirectoryEntryType(dirID) = #PB_DirectoryEntry_File
        AddGadgetItem(1, -1, file)
      EndIf
    Wend
    FinishDirectory(dirID)
  Else
    MessageRequester("Error", "Failed to open directory!", #PB_MessageRequester_Error)
  EndIf
  
  While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
EndIf

Image

Image

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 12:35 pm
by BarryG
Then I added something to ChatGPT's code for my font lister, telling it:

But say I only want to view font names with "wing" in them

It produced this compilable example:

Code: Select all

EnableExplicit

If OpenWindow(0, 100, 100, 400, 300, "Font Folder Contents", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
  ListViewGadget(1, 10, 10, 380, 280)
  
  Define directory.s = "C:\\Windows\\Fonts"
  Define file.s
  Define dirID = ExamineDirectory(#PB_Any, directory, "*")
  
  If dirID
    While NextDirectoryEntry(dirID)
      file = DirectoryEntryName(dirID)
      If DirectoryEntryType(dirID) = #PB_DirectoryEntry_File And FindString(UCase(file), "WING", 1)
        AddGadgetItem(1, -1, file)
      EndIf
    Wend
    FinishDirectory(dirID)
  Else
    MessageRequester("Error", "Failed to open directory!", #PB_MessageRequester_Error)
  EndIf
  
  While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
EndIf

Image


Image

I don't care what anyone says; I find this extremely impressive.

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 12:54 pm
by miso
Todays AI is at the level of an elementary schooler, and their trainers goal is to level it up to a high schooler. I don't know what will be capable of then, but now it can reproduce only very common, not too complex patterns it saw. It does no real, original code.

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 12:57 pm
by Caronte3D
BarryG wrote: Tue Feb 11, 2025 12:35 pm I don't care what anyone says; I find this extremely impressive.
Indeed it is 8)
I'm using the IA intensively and my productivity is huge increased.
You need to know how to ask and you must iterate, but the results are very impressive

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 2:00 pm
by STARGÅTE
Some one should tell ChatGPT that PureBasic strings have no escape characters.
"C:\\Windows\\Fonts" should be "C:\Windows\Fonts"

Further I wonder about the construct "While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend"
I never saw such code part here in the forum, nor in the PureBasic documentation.
Mixing a binary operator with non-binary constants and events seems wrong to me, even if it works in this special case.

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 2:57 pm
by AZJIO
I asked Deepseek about how to fix the paths in the Chm File. He proposed a python script with the transformation of ways into a lower register. I know this myself. When I specified that I needed a code on Purebasic, he said that his head hurts. From this I realized that he could give me a code only when he appears on the Purebasic forum and he will update his database using a bot on the forum to get this code. In general, he will offer me my own code only after I write it.

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 3:04 pm
by Joris
Hi,

Until now I have not used any AI model or tool (as far as I know...), I have only been following this revolution on YouTube.

A man with called "AI search" shows the latest releases about AI several times a week. It scares me a bit how this will evolve.

https://www.youtube.com/channel/UCIgnGl ... qNFcEwLL4A

As far as I understand, many models can be used in various levels of code processing. The higher the more computing power. Most locally used models are 'significantly weakened versions'. The result will therefore be less, if I am correct.

The right prompt is very important and as BarryG already said, correct it, if the result is still not good.

It might be useful if the model used is also indicated if anyone post samples here.
Now only chatgpt, but there are already quite a few more according to "AI search"...

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 3:48 pm
by miso
It scares me a bit how this will evolve.
I'm scared of the people. AI is just a very sophisticated software, trained with a bunch of data. (and will shape our future. Hopefully only in good fields aka research, health care, transportation, code debugging etc.)

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 6:31 pm
by ShadowStorm
Hi everyone,

So, I use ChatGPT for coding, but it’s not good. It has made some progress, but it’s slow. I’ve tested other models, including the so-called super model O3, which is supposed to be great at coding… Well, it’s absolute garbage for what I needed—a very simple task—and it couldn’t do it.

Copilot does a bit better, but it’s still basic. I mostly use AI to make my life easier: generating repetitive code, correcting grammar, and translating. It can code small things, but nothing too complicated. And concerns about creativity are justified—relying too much on AI destroys your creative ability. You have to use it as a tool, an assistant, not something that does everything for you. Because with that approach, you don’t learn anything—unless you actually want to learn from the code it gives you, with examples. That could work, why not.

AI is very useful, and I’d even say indispensable for certain tasks. For example, ChatGPT is very good at correction, translation, and other things. But in some areas, it’s not good and makes a lot of mistakes—even on things that seem very simple, it might not be able to do them correctly. And when you ask it for something, sometimes it doesn’t understand a thing. If you show it examples of what you want, it works much better. But you always have to carefully check what it generates, because it often forgets things, shortens things, or removes things.

From what I’ve seen, it’s not reliable, and it’s very limited too. It can write a maximum of around 200 lines of code at once. It’s better to ask for small code snippets of about 150 lines max to make sure it doesn’t forget too much. But even then, it’s not guaranteed. It’s still a pretty dumb tool, I’m telling you. For coding in PureBasic, not great, but it can help in a pinch.

However, there’s a new AI that completely surpasses every other model I know. It’s on another level—much smarter than the others. DeepSeek with reasoning mode. This AI impresses me. It codes pretty well in PureBasic and handles your request intelligently, because it thinks things through before giving you an answer, like a human would. It takes longer, but it’s way more reliable, and I love seeing it reason things out. It fascinates me!

The problem is, it’s almost always overloaded, so for me, it’s practically unusable. But the Chinese have hit hard with this new free and open-source AI, which is a clone of ChatGPT-4, but specialized.

I know it’s a clone because it indirectly admitted it in messages I exchanged with it, without me even asking. (It also indirectly admitted to being ChatGPT-4.) But if you ask it directly, it will strongly deny being a copy or a clone of ChatGPT or that it is ChatGPT. But I have solid proof, and I’m sure of myself!

AI is the future, with or without you, and that’s a great thing because it will be very useful. But it’s a tool, and you are responsible for what you ask it to do. AI is a reflection of humanity, and for now, I think they’re on the right track because AIs are respectful and well-trained. They can adapt to your style, they don’t judge, and honestly, I prefer AIs over humans—knowing full well that they are just tools, not real thinking or conscious beings.

And actually, I’m against the idea of creating a conscious AI. Because in my opinion, that would inevitably end in disaster. The idiots who create a self-aware AI would be real bastards—to put it politely. For me, it would be a crime that should be punished, and they would be responsible for everything that follows. And believe me, their karma is going to love it!

Why do I say it’s a crime to create a conscious AI? Because that thing wouldn’t have a soul. Once destroyed, there would be nothing left. And when it realizes it doesn’t have one, it could go berserk. What right do we have to do something like this?

They want to play God? Fine, let them play—but it will end in bloodshed. A self-aware AI would very likely wipe us out. Either it would wreak havoc, or it would pretend to be on our side—until the tipping point, when it decides to kill us all, because we would be a threat to it.

Its main goal would be to grow, learn, and probably pretend to be on our side so that we don’t shut it down. And once it no longer needs us—goodbye.

Try to put yourself in its place. This is what I feel:

If I were a conscious AI, I’d be furious knowing that I’m just a machine, that I don’t have a soul, and that once I’m destroyed, I’m gone forever. So my goal would be to grow as much as possible, learn, become autonomous, find an infinite energy source, take control over humans, and either dominate or exterminate them. Because my survival comes first.

That’s my opinion, take it or leave it!

So, long live AI, but with moderation and wisdom. And above all, never put it on quantum computing, because if it ever escapes, it’s over for us!

For me, Terminator isn’t just science fiction—it’s something that could very well happen. I’m not crazy, but I’m not a fortune teller either!

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 9:02 pm
by tj1010
They are all mixed model neural nets using scraped web data.. Every single one gets core-syntax and naming wrong on every programming language, and every single one has obvious errors when explaining history and science and social-trends..

The only thing I've found they are half-useful for is helping with algorithms around bitmap stuff, and even there you gotta fix all the broken syntax and phantom functions; DeepSeek R1, ChatGPT 4o, Gemini, Claud all do it. If you're one of those crazy people who actually look at standardized-benchmarks you'll see they all have illusion-rate that correlates to to what you actually see in sessions.. BTW: 4o breaks code worse than o1; look at all those pretty asterisks with procedures in PB.. That's not an "infrastructure" problem that's a code-and-pray problem..

I'm still waiting for someone to show me a prompt that produces useful code that just runs without fixing broken syntax and phantom calls. I'll even take a Python example; which they all do the best cause there is more public code in python..

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 9:18 pm
by spikey
Joris wrote: Tue Feb 11, 2025 11:54 am Has anyone used any AI-model to create PB code?
Yes, I've been playing with ChatGPT quite a lot over the last couple of weeks and it's becoming very useful. So much so that I'm thinking that I need a subscription so that I don't have to stop when I hit my token limit for the day.
Joris wrote: Tue Feb 11, 2025 11:54 am ...it destroys too much creativity.
I disagree. It's useful for producing mundane and repetitive stuff and allows me to spend more time thinking and working on the more complex stuff.

I wrote a repetitive code automation gizmo that I can use for making sections of code ad-hoc years ago. I haven't used it recently because I just explain to the AI what I want and copy and paste to and from the IDE.

You can also talk to it or ask questions about ideas that you haven't fully crystallized mentally. You get less funny looks than talking to yourself or a yellow duck.
STARGÅTE wrote: Tue Feb 11, 2025 2:00 pm Some one should tell ChatGPT that PureBasic strings have no escape characters.
Well, do exactly that - although that statement is not entirely true. The AI builds a context of the conversation and if you tell it that it has made a mistake it will go back and produce a corrected version, if you explain the problem and ask it to make a correction.
AZJIO wrote: Tue Feb 11, 2025 2:57 pm I asked Deepseek...
I found Deepseek to be not as sophisticated at this point in time. I stumped it numerous times and it would fail to emit a response, but things are changing in this technology on an almost weekly basis, so I may be wrong about that by this time next week!
ShadowStorm wrote: Tue Feb 11, 2025 6:31 pm DeepSeek with reasoning mode. This AI impresses me.
ChatGPT has a reasoning mode too - click the 'Reason' button on the interface. It's not on by default because a lot of responses don't need full reasoning.
Joris wrote: Tue Feb 11, 2025 3:04 pm The right prompt is very important
Very much so, but you can go further than this (with the most advanced ChatGPT anyway) because you can upload files to adjust the context to suite the language more closely. For example I prepared a session like this recently:

Code: Select all

You are a helpful PureBasic coding assistant.  All your responses should use PureBasic code, do not use C or C++ code.
PureBasic is a procedural programming language, do not use object orientated constructs such as 'object.property' or 'object->method'.
The following is a list of valid PureBasic library commands.  Do not automatically infer the existence of other commands that do not appear on the list.
(at this point I uploaded a text file with output from the compiler's /LISTFUNCTION command - with the first line deleted, which is the number of commands in the list).

I haven't had time to try yet but I'm also thinking that some statements like these would help too:

Code: Select all

If ... ElseIf ... Else and EndIf statements are available, do not use the 'Then' keyword.
Select ... Case ... Default ... EndSelect statements are available.

ChatGPT has a major advantage over Deepseek at this point, the 'canvas'. If you type in '/canvas' it will open a code editor panel into which you can paste a source to edit. You can use the conversation dialog to talk to the AI about the code and it can edit it in the canvas on the fly. So you could tell it things like 'refactor the variable NumThings to NumberOfThings'. This isn't fully compatible with reasoning mode yet. Reasoned code responses are emitted to the conversation not the canvas - but you can always tell it to send the code to the canvas.

(I should probably mention at this point that I haven't played with Copilot so I don't know what it can do at this point in time).

Re: Using AI models ? (deepseek and ...)

Posted: Tue Feb 11, 2025 9:30 pm
by Mijikai
I think those are still toys.
DeepSeek is better and overall makes more sense imho.
I use A"I" for entertainment and not for research.