Artificial intelligence

andymc

Well-Known Member
Licensed User
Longtime User
I've found it is improving slowly over time. But with B4X being quite niche compared to Javascript, c# or Python, it does hallucinate a lot and quite often starts writing java code when I ask it for B4A code. there may be models in future that are better for more languages, but right now I use chatGPT more for ideas and pseudo code rather than proper B4A code.
 

Gandalf

Member
Licensed User
Longtime User
I use Grok3 and I'm quite impressed. In most cases it writes working code after a single prompt. Several tips:
1. Specify exact dialect (B4A, B4J) instead of B4X.
2. Do not ask to write more than 1-2 functions at a time.
3. Give as much detailed description of the task as possible.
4. Give samples of incoming and desired result data.
 

LucaMs

Expert
Licensed User
Longtime User
Great news: yesterday I noticed that while generating source code B4*, ChatGPT is getting worse and worse.

Simple example: it generated 5 or 6 Subs in total and 2 of them were not called. Moreover, one of them was used to... declare global variables at module level!

Instead of getting better, it is getting worse day by day.
 

JackKirk

Well-Known Member
Licensed User
Longtime User
Great news: yesterday I noticed that while generating source code B4*, ChatGPT is getting worse and worse.

Simple example: it generated 5 or 6 Subs in total and 2 of them were not called. Moreover, one of them was used to... declare global variables at module level!

Instead of getting better, it is getting worse day by day.
You really should give Copilot a go.
 

LucaMs

Expert
Licensed User
Longtime User
I'll try to ask Copilot
:eek:

Main - 58: ',' expected.
Main - 57: Unknown member: createcanvas
Main - 172: Undeclared variable 'gc' is used before it was assigned any value.
Main - 164: Undeclared variable 'gc' is used before it was assigned any value.
Main - 151: Undeclared variable 'gc' is used before it was assigned any value.
Main - 139: Undeclared variable 'gc' is used before it was assigned any value.
Main - 138: Undeclared variable 'gc' is used before it was assigned any value.
Main - 119: Undeclared variable 'imagebitmaps' is used before it was assigned any value.
Main - 116: Undeclared variable 'newcol' is used before it was assigned any value.
Main - 108: Undeclared variable 'imagebitmaps' is used before it was assigned any value.
Main - 105: Undeclared variable 'newrow' is used before it was assigned any value.
Main - 61: Undeclared variable 'addressof' is used before it was assigned any value.
Main - 60: Undeclared variable 'addressof' is used before it was assigned any value.
Main - 59: Undeclared variable 'addressof' is used before it was assigned any value.
Main - 50: Undeclared variable 'imagebitmaps' is used before it was assigned any value.
Main - 49: Undeclared variable 'g' is used before it was assigned any value.
Main - 48: Undeclared variable 'g' is used before it was assigned any value.
Main - 47: Undeclared variable 'g' is used before it was assigned any value.
Main - 129: Unknown type: scheduledthreadpoolexecutor<br />Are you missing a library reference?
Main - 46: Unknown type: graphics<br />Are you missing a library reference?
Main - 45: Unknown type: bitmap<br />Are you missing a library reference?
Main - 136: Unknown type: graphicscontext<br />Are you missing a library reference?
Main - 114: Unknown type: bitmap<br />Are you missing a library reference?
Main - 103: Unknown type: bitmap<br />Are you missing a library reference?
Main - 19: Unknown type: bitmap<br />Are you missing a library reference?
Main - 58: Undeclared variable 'canvas'. (warning #8)
Main - 58: Types do not match. (warning #22)
Main - 62: Types do not match. (warning #22)
Main - 135: Unused variable 'canvas'. (warning #9)
Main - 163: Unused variable 'xPos'. (warning #9)
Main - 171: Unused variable 'yPos'. (warning #9)
Main - 160: Unused variable 'row'. (warning #9)
Main - 162: Unused variable 'wrapCol'. (warning #9)
Main - 168: Unused variable 'col'. (warning #9)
Main - 170: Unused variable 'wrapRow'. (warning #9)
Main - 127: Unused variable 'canvas'. (warning #9)
Main - 135: Sub 'DrawCanvas' is not used. (warning #12)
Main - 29: Layout file 'Layout1.bjl' is not used. Are you missing a call to MainForm.RootPane.LoadLayout? (warning #16)
Library 'jXUI' is not used. (warning #32)
 

JackKirk

Well-Known Member
Licensed User
Longtime User
I'll have to look for information, since I have "a feeling" I should have Windows 10+ and instead I have a laptop that is about 83 years old.
I am on Windows 10 but you might just need the Edge browser.
 

JackKirk

Well-Known Member
Licensed User
Longtime User
I haven't tried Grok but have found Copilot much better than ChatGPT.
 

aeric

Expert
Licensed User
Longtime User
One thing I can see that the current AI cannot replace a programmer (for the time being) is working on a complete project.
In real world, a project consists of a lot of files, modules, classes, data and logics behind.
Some resources are stored or documented on different location, servers, database, software and platforms.

Can it remembers and do thorough search?

For example, the AI provided you the code last week. Today, you ask it about the project again.
How about tomorrow you ask it again? and the day after tomorrow and so on...

Maybe you can say yes, "it thinks" but what I understand is, it will read and scan through all the files again.
A human can roughly know where the "location" (file path) or the "exact" object to find straight to the point,
provided the project is well organized in a structure which is "designed for human" to understand.

Let say it made a modification yesterday. Can you ask it to reverse what is changed?
Another scenario is a team of programmers are using AI to work on the same project.
Can it know the chronology and details who are responsible on which part?
Maybe yes with another tool to manage the audit log. But why we need it when now we don't?
Will it commented a todo and later come back to it?
Will it avoid something that a part of code which is marked dangerous not to touch or has warning code.

In a real world project, there are many parts may need improvement.
Can it provide some good ideas that cover every aspect?
I think it only can work on a specific scope.

A project is on going. Is AI part of the team?
 

Mashiane

Expert
Licensed User
Longtime User
ut have found Copilot much better than ChatGPT
Same here, I am using Copilot extensively. I have found that if at times if a LLM text file is provided, it makes it easy for it to provide answers.

So far I have created a TreeView, a ContextMenu, a ToastAlert (timed) for SithasoDaisy5 using co-pilot. Most of the code worked and I tweaked it to suit my needs, but so far so good.
 

JackKirk

Well-Known Member
Licensed User
Longtime User
One thing I can see that the current AI cannot replace a programmer (for the time being) is working on a complete project.
In real world, a project consists of a lot of files, modules, classes, data and logics behind.
Some resources are stored or documented on different location, servers, database, software and platforms.

Can it remembers and do thorough search?

For example, the AI provided you the code last week. Today, you ask it about the project again.
How about tomorrow you ask it again? and the day after tomorrow and so on...

Maybe you can say yes, "it thinks" but what I understand is, it will read and scan through all the files again.
A human can roughly know where the "location" (file path) or the "exact" object to find straight to the point,
provided the project is well organized in a structure which is "designed for human" to understand.

Let say it made a modification yesterday. Can you ask it to reverse what is changed?
Another scenario is a team of programmers are using AI to work on the same project.
Can it know the chronology and details who are responsible on which part?
Maybe yes with another tool to manage the audit log. But why we need it when now we don't?
Will it commented a todo and later come back to it?
Will it avoid something that a part of code which is marked dangerous not to touch or has warning code.

In a real world project, there are many parts may need improvement.
Can it provide some good ideas that cover every aspect?
I think it only can work on a specific scope.

A project is on going. Is AI part of the team?
I agree with pretty much all of this - Machine Learning at this stage is a coding assistant.

On the continuity front Copilot now keeps your prior conversations - you can click on one and resume where you left off. I don't know how much it keeps though.

I think you have to have opened an account for this - reasonably logical.
 

JackKirk

Well-Known Member
Licensed User
Longtime User
So far my ranking is:

  1. Grok
  2. ChatGPT
  3. Copilot
I just had another 2 day conversation with Copilot to build a real time filtered log message capability into an ABMaterial web app:

https://www.b4x.com/android/forum/t...-with-assistance-of-microsoft-copilot.167188/

During this, when it was running around in circles, I had a go at Grok (3 I think).

Firstly it was running around in the same sorts of circles - ultimately resolved by the supreme I (for Intelligence - Erel).

Secondly I found it incredibly verbose.

Thirdly after sucking me in it put up a paywall (USD40/month).

Possibly not the best of critiques but for now I think Copilot is better.
 

marcick

Well-Known Member
Licensed User
Longtime User
The method that seems to work best for me is to start with one, e.g. ChatGPT, until the results are satisfactory. When it reaches a point where it starts looping and can’t solve the problem, repeating the same mistakes, I take the best result achieved and present the issue again to, say, CoPilot, which has a different reasoning pattern and often helps to unlock the situation. Then, if CoPilot eventually starts looping too, I go back to ChatGPT
 

epiCode

Active Member
Licensed User
The method that seems to work best for me is to start with one, e.g. ChatGPT, until the results are satisfactory. When it reaches a point where it starts looping and can’t solve the problem, repeating the same mistakes, I take the best result achieved and present the issue again to, say, CoPilot, which has a different reasoning pattern and often helps to unlock the situation. Then, if CoPilot eventually starts looping too, I go back to ChatGPT
Did you realize that when they get into loop, you also get into loop (between them)?
 

JackKirk

Well-Known Member
Licensed User
Longtime User
The method that seems to work best for me is to start with one, e.g. ChatGPT, until the results are satisfactory. When it reaches a point where it starts looping and can’t solve the problem, repeating the same mistakes, I take the best result achieved and present the issue again to, say, CoPilot, which has a different reasoning pattern and often helps to unlock the situation. Then, if CoPilot eventually starts looping too, I go back to ChatGPT
Yes I have found that just starting a new conversation in Copilot - very easy to do - will quite often break the impasse,

The looping I was referring to 3 posts above seemed to be in both Copilot and Grok(3) - possibly because the B4X data they both had was insufficient for them to see a way out.
 
Top