GPT-4 writing Xojo code

For me it saves time working through tedious algorithms and math. Yes, I could do it on my own, but it’s usually way faster, in the same way I can do long division on my own but prefer to use a calculator.

3 Likes

I get that and I think it’s a fair analogy. However, you can trust the calculator. You’ll get the right answer every time, and if you don’t, it’s your fault because you made a mistake somewhere.

ChatGPT is not trustworthy. It is very frequently wrong. For example, I’m still staring at ((?:.(?![""']?\s+(?:\S+)=|[>""']))+.svg trying to figure out what that expression is trying to do, and I’m pretty good with RegEx. I suspect it is wrong. I can’t see why it wouldn’t just use something like ([^'""]+\.svg) to capture the path. I think maybe it’s allowing unquoted values.

Regardless, the point is I can’t trust it. I can see at least one mistake in the expression, and another chunk has me suspicious. I have to audit everything that was generated anyway, so why bother? We all hate working with other people’s code, so why would I subject myself to working with an LLM’s mashup of other people’s code? Shouldn’t I want to understand the code in my app? If somebody reports a bug with my app’s ability to find svg’s on a page, shouldn’t I be able to look at the expression and understand exactly what is going on?

5 Likes

You do have to sign up for ChatGPT Plus for $20/mo. You can get to it by going to your account in their web ui. Once you’ve paid, when you start a new chat thread, at the top of the body there are tabs to switch to GPT 4.

The Xojo code it generates is still quite imperfect a lot of the time. It hallucinates methods and properties that don’t exist. It’s fairly easy to find them and replace them with the proper code, and for the most part the logic it generates is pretty solid.

I wholeheartedly acknowledge @Thom_McGrath 's point too, that’s a very valid take. The regex it produced works for all the examples I’ve needed and tbh it doesn’t need to be all that versatile for this project. At this point GPT-4 is like having a buddy that you can ask for help with an algorithm, or some logic, or even some simple conversion of code from one language into another. But sometimes your buddy is very drunk. :woozy_face:

For Xojo code, you can’t expect miracles, but I certainly have been getting my $20 worth.

1 Like

I look at it in kind of the same way. GPT3 has pointed me in the right direction multiple times, with the logic stuff. Then I write the code. I’m good with that.

Does GPT-4 support images in any way? Specifically I’d like to use it to help generate some algorithms for pattern matching using OpenCV, but with very specific images that I provide. Can you upload images as references? I’m not looking to have it generate images, but the algorithms I’d need to generate would be specific to attributes of the image and it would be easier for me to describe what i’m after if I can provide an example.

2 Likes

Vanilla ChatGPT doesn’t allow image upload. They announced image processing a while back but it has yet to be implemented. That said, ChatGPT-4 does have a number of plugins made by third-parties that may allow that kind of image processing. The list of plugins is long and is growing every day.

Thanks. I took a look at ChatGPT plugins but don’t really see much beyond some product-specific plugins. Is there a different list, because there doesn’t seem to be much here. Or can you only see that if you’re a subscriber?

Hi Folks,

Be careful what you post into the streams at ChatGPT - any guarded code is not guaranteed to be private and you could expose trade secrets to others unexpectedly.

If I ask it to generate xojo code I usually as like, create X in Xojo (formerly Realbasic) seems to work much better than just asking for Xojo, and seems to skip a lot of the VB generation.

6 Likes