Anyone Using AI To Generate Xojo Code?

I’m not talking about having AI write all or significant parts of your code, just wondering what everyone else is doing with it in terms of software development.

I’ve just been tinkering having it create Xojo code to do some stuff I already know how to do. Most of the time it screws something up creating code that generates errors. I either have to fix it, or continue tweaking my prompts of asking it to do things to make the output work.

Now don’t get me wrong, I love coding myself. I’ve just been curious and wanting to see how it handles things. I can see as it gets better and I’m able to write better prompts, it could save time in some situations.

What’s your take and/or experience?

I have asked chat gpt 5.1 to help with with very small parts of xojo code with mbs and it has been very helpful. 95% of the time the functions it creates work. Giving it as much context as possible is the key.

I have asked Claude through visual studio code to help with gui stuff but it has told me xojo is a hard language to interpret gui layouts and had issues doing simple things like check and ensure all controls are aligned

1 Like

I use AI all the time. I see AI as my second pair of eyes. Yes, sometimes it needs help but it’s an invaluable tool.

9 Likes

I asked Claude, ChapGPT and Grok to write a certain Method and they all failed (wrote code but said Xojo doesn’t provide this call to XXX) and one hallucinated four new MBS classes that don’t exist (I checked with CS)! So, not impressed yet.

Recently I wrote a web app which transfers backup files of a cubesqlserver to a S3 compatible Backblaze bucket, and then is cleaning up old files on the database server and on the cloud backup server as well.

ChatGPT was very helpful in figuring out all the details. Basically I did not need to study myself the API documentation of backblaze, but ChatGPT wrote plug-and-play code for me.

I had to learn how to be very explicit and detailed, when formulating my prompt.

Yes.

Why ?

  1. Coding with API II is not easy for me.
  2. I tend to forget and reading the suggested code recalls me how to do. And the AI does not ask me a project to understand.

I do not copy / paste the code…

The only time I do that, it does not works as is.
I asked here what is wrong in the code and never get an answer.
Then I used a trickery / adapted it and that works.

PS: I have the feeling that someone trains Gemini to Xojo. Each time I asked I get good answer and… a Xojo video on the subject.

It even gave me a laught when telling ListBox.InsertColumnAt does not exists and gave hints to insert a column in a Populated column (After I read some words, I understand how to resolve my immediate need and let for another day the “Insert a Column” coding; I used a bunch of Copy Column Contents / Paste Column Contents, then save as text and in TextEdit, change the Header) :wink:

1 Like

Personally, I’ve been playing with Microsoft’s Copilot. It’s easy to use and seems to do ok when I give it the information it needs. I’ve also used it in place of Google Searches and does pretty well with that. I will say that Google’s AI overview can save time looking through several separate responses.

Definitely decent prompts help a lot and then sanity checking what is returned is important.

I now use AI regularly when writing Xojo code. Results vary but it has become invaluable.

Gemini 3 is exceptional.

Also run GPT OSS:120b locally.

1 Like

for what use cases ? coding ?

cool ! you saw improvement over 5.0 ?

Over the past few months ChatGPT has written over 10.000 lines of code for me. Most of them are quite complex math calculations. It has saved me countless hours of coding and preventing errors I could have made when deciphering the math calculations that were given to me.

95% of the code worked, a few hallucinations for function names that didn’t exist but they were easily fixed.

3 Likes

I have used both Chatgpt and grok AI to generate code. At best, it gets about 50% of the code correct, and about 50% of the logic, correct.

I am doing a bunch of electronic work at the moment, so there is no code available in Xojo history, which makes it difficult for the AI simulations to learn from.

These AI llms tend to be really good with python, c, c++.

I use it daily.
Not for the stuff that is my own magic, but for some of the routine junk that consumes time and could be done by a programmer who couldn’t do the parts of the code that need my specific industry knowledge.

It makes a lot of mistakes. Then I tell it why and get it to regenerate, or I fix it myself.

My take is that it’s the same as having a friend who can write code, but needs some guidance, and who never gets tired or grumpy about it.

I used it recently do write a bunch of xojo code to automate scripting into creative suite apps. I got it done in a day or two with Chat GPT, but if you know that scripting….. it would have taken a month to iterate it on my own.

It’s also so good because it respond to everything with something like “That’s a great question and really shows you are thinking about this like an advanced <blah blah blah?>… and let’s face it – who else is going to complement me nonstop all day!?

Short answer: It’s a great tool.

4 Likes

I find most LLMs write bad answers to my Xojo questions. Usually using deprecated functions or straight up just the wrong language Visual basic.

The more popular the language is on the internet the better they do because they can suck up and ignore licenses of more code. Also the better the documentation and tutorials out there are the same for random questions. Python and C have been more productive with LLMs than Xojo.

Which LLMs did you check? My experience with Claude and Perplexity is good, especially if a prompt is bit more specific. „Xojo Desktop API 2“ does help, for example.

Deepseek R1 for reasoning and Mistral/dolphin for traditional LLM mostly. I don’t pay for anything, all is ran via LM Studio on my rig.

Apologies I should of said that, these are all in the 12b parameters and below range. But if I can’t run it locally Or it needs an ongoing subscription I don’t use it.

I am currently testing the new AntiGravity-IDE with both Gemini and Claude models. First thing I asked Gemini was what it thinks about it’s own Xojo expertise and it said “I’d rate my Xojo expertise as high.” So far it seems to be correct in that afaics. I’d definitely recommend giving it a shot.

I am a heavy user. I happen to use ChatGPT because I am paying for it. I have not extensively tested one AI against another when coding Xojo.

I have told it that I want the code to be heavily commented and to use API 2. Despite this, it does lapse into API 1 code every now and then.

It has been most valuable when coding various mathematically heavy Methods. The output helps me even if the code does not run perfectly out of the gate. I generally am just asking it to create a single Method/Function to accomplish some specific task. My major project of the moment is an application to design kayaks. I am not a naval architect and the AI is very helpful to me in introducing various concepts. One of the challenges that I faced recently was outputting the data within my program in formats that can be accepted by various 3D-CAD programs. The AI was enormously helpful here.

The comments are helpful to me and partially relieve me of this task. It deals with edge cases that I might initially fail to consider. It provides me with correct terminology for various mathematical calculations or concepts that I am unaware of, which is very helpful when doing further internet research.

5 Likes

Since Gemini 3.0 came out it’s a big improvement. I’ve been doing an entire Desktop app with Gemini doing all of the heavy coding. The trick is to tell it to focus on Xojo API 2 when you start a coding session. It also helps to upload the code that you’re working on in text format. Every now and then it throws in an API 1 property or hallucinates things in Xojo that haven’t really been documented well, but it always finds a solution. I have it working on an app that runs in Raspberry Pi 5 that uses Python as a back end to control my PCA9685 boards with Xojo being the front end user interface. It’s coming together far better then I could do myself. Gemini 3 is basically the programmer and I’m acting as the project manager guiding it along. However, Xojo could make future versions of Xojo more AI friendly just by letting us copy more details in the debugger so that we can paste it back to the AI. It’s kind of a pain to piece together all of the parts of the halt so that it has all of the info. And I’ll be honest, about 3 months ago I had Grok do this with a Python only app and it had about the same abount of debugging required as I’m having with Gemini 3 and Xojo.

1 Like

Well I have crossed the Rubicon. I have tried to reject, and avoid AI at all costs.

Now I am ashamed to admit it, but I have weakened to ‘if you can’t beat them, join them’. So far from what I have seen with just a little practice confirms what I have thought from the beginning. There will be NO jobs in programming….. soon.

Anyhow, I am long retired so I will just try to enjoy it while I still can.

1 Like