PxPlus User Forum

Main Board => Discussions => Off Topic => Topic started by: Kevin on July 30, 2025, 01:48:39 AM

Title: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: Kevin on July 30, 2025, 01:48:39 AM
Hi everyone,

At our company, we've been working extensively with AI across different domains, including the generation of web applications and business logic. Lately, we've applied it to PxPlus development, and the time savings have been nothing short of dramatic.

We're not just using AI to suggest snippets. The AI actually:

As an example: we had it generate a complex bin packing algorithm with multiple packing strategies, a task that would normally take several weeks of design and coding. With AI, we had a working version within one day, including multiple packing methods.

Even more impressively, the AI also produced an HTML file with a live 3D model of the box and its packed contents, making validation and demonstration far more intuitive.

We're not yet applying it to Nomads or PxPlus-level file I/O, but for logic-heavy tasks and algorithms, the time savings are massive, what used to take days now takes hours, and in some cases, minutes.



We'd love to hear from others in the PxPlus community:


Looking forward to the discussion!
Title: Re: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: Mike Hatfield on August 04, 2025, 03:08:19 AM
We have been experimenting with Copilot. We have a company subscription.
First we point the AI to the online documentation.
I have tried asking AI to improve the code in a couple of short and simple programs.
First thing is that it removes some of the Comment lines already in the program.
It does add functional Comment lines.
It attempts to add multiple error branches and reporting.

Second effort, we asked AI to read our customer payments history and produce a summary report of one line for each customer with a grand total.
The basic flow in the program was OK but it comletely screwed up its for next loop code.
It was trying to add each customer to an array and then accumulate for the customer in the array.
It was a total mess and didn't work.

We have a program that creates html code for emailing out invoces etc.
I asked it to improve the html. Since the html was ok to start with it only made a couple of minor changes.

I would be interested in which AI you are using and how you are doing your requests.
You certainly sound like you have made good progress.

Mike Hatfield
Title: Re: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: Kevin on August 05, 2025, 03:44:13 AM
Hi Mike,

Thanks for sharing your experience, great to hear others are exploring this as well.

We're using Claude through VS Code with the Claude Code extension. To give it proper context, we converted the entire PxPlus manual into Markdown files and added them to the workspace. That way, Claude has direct access to the full documentation while writing or reviewing code, which noticeably improves accuracy.

We also included a reference program in the workspace. Interestingly, Claude automatically tries to match the structure, naming, and logic style it sees in that code, even without explicitly prompting it to do so. That's been a big help in keeping generated output aligned with our internal conventions.

In addition, we wrote a few short instruction files, kind of like "developer notes", to clarify specific PxPlus behaviors that differ from other languages. For example, we explained that FOR/NEXT loops always execute at least once, which is different from how most languages handle them. Claude takes those notes into account when generating logic, which helps avoid subtle errors.

Before we let Claude generate any code, we often ask it to first read and summarize these internal notes, so it's "aware" of the domain-specific things before starting. That small step has made a big difference in the quality and reliability of its output.

We also added instructions for how to perform a syntax check and compile the program using our PxPlus executable. Claude frequently includes those steps itself now, helping catch issues early.

Title: Re: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: Patrick Denny on August 12, 2025, 03:22:10 PM
I did use ChatGPT-4 and while it did an "ok" job of generating (Basic) code, it often reported issues as "confirmed" and "double checked" that were completely false.  It would take multiple promptings to convince the Chat that it was lying.

You definitely want to CREATE A DOCUMENT to have a "guidelines document" that you are able to upload and maintain to layout preferences (naming conventions, coding guidelines, do's and don'ts, etc.).  This is a document you want to maintain and re-upload often and also have saved for your own sake.  The GPT can "lose it" at times, so you'll want to be able to re-upload when necessary.  Keep it up-to-date!
*** Note: Several times I had asked ChatGPT-4 to recreate my "guidelines document" so that it would be better organized, thinking it would be "better" to have the document in a format that the GPT had constructed. Wrong! I asked it why that didn't work out well and there was something to how the GPT is designed to work with and analyze human constructed information differently than something it constructed itself(?). Just a heads up that it might be better to maintain this documentation yourself(?) unless the new version handles things differently/better now?

You can point the AI to the PxPlus Online Documentation and it does a fairly good job of using it. When coding problems were realized, GPT-4 would often state that it had confirmed syntax against the online documentation, even providing a link to the documentation that it had referenced, often to find that the link was bad and that it had not actually referred to the documentation. I have not made time yet to use GPT-5 which is supposed to be approximately 50% improved in these areas.

I did come across a suggestion for coding projects, suggesting to use "Python" as the programming language to initially create your program in, which ChatGPT does a good job of coding with, then ask ChatGPT to convert the program to your desired programming language. I haven't tried it yet, but that sounds like a great idea.  Establish a working model in Python, then convert to PxPlus.

There's a lot I would like to do with AI to generate code, but it is time consuming to initially setup everything. Hopefully it will get better/faster as upgraded versions are released.

I did have ChatGPT help with confirming a large inventory cost analysis project as a support to my own work and was impressed that it was able to construct a downloadable executable program (in Python) that I could run on my own laptop and feed it data locally.  It did a fairly good job at following my guidelines and suggestions.  Again, CREATE A DOCUMENT that you maintain and upload. I created a separate project document that outlined the needs for this inventory project. Maintaining your own document will reduce your frustration for if and when the AI forgets everything and changes back into a pumpkin.  Maintaining a document was also an interesting exercise in understanding the complexity of what we are often doing!
Title: Re: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: Kevin on August 14, 2025, 05:36:36 AM
Totally agree on the importance of having a maintained guidelines document. We've done something similar by creating a structured workspace with our coding standards, naming conventions, and some PxPlus-specific notes (like how FOR/NEXT loops always run at least once). Everything is in Markdown and lives alongside the code, so the AI has consistent access to it.

Interestingly, the setup didn't take us that long, but that might be because we already had some experience using AI for development in other languages, especially Python and web-based tools. That helped us approach the prompt structure and environment setup.

We've also moved away from relying on AI to "look up" documentation. Instead, we embed the entire PxPlus manual (converted to Markdown) directly into the workspace. That avoids the classic "I double-checked this" hallucinations, because the model actually has the correct references. This made a huge difference in consistency and correctness.

One key difference for us has been switching from ChatGPT to Claude. In our experience, Claude has proven to be significantly stronger when it comes to programming tasks, not just in code correctness, but also in following patterns, preserving structure, and avoiding hallucinated syntax. It feels much more grounded in logic and context, especially when the reference material is present.

The idea of prototyping in Python and converting to PxPlus could be a good idea. We haven't tried that yet, but it could work well for logic-heavy routines. That said, we've had good results generating PxPlus directly, especially when the AI can reference to a well-written example program.

All in all, we're seeing real time savings now that the setup "complete". What used to take days is now sometimes reduced to hours, or even less.
Title: Re: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: HendersonS on August 26, 2025, 01:33:17 PM
Hi Kevin, we tried some prompts in Claude without much success, so maybe you could share those documents of the PxPlus manual conversions to Markdown files and others you mentioned so maybe we can replicate them and get better results. thanks in advance!

Title: Re: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: Kevin on September 01, 2025, 04:51:21 AM
Hi HendersonS,

Happy to share! We've made our full Claude + PxPlus setup publicly available here:
👉 https://github.com/Astecom/claude-pxplus-template

This repo contains everything we use internally to get consistent results with Claude when working on PxPlus code. It includes:

The entire PxPlus manual, converted into Markdown for better parsing.

A detailed instruction file that explains PxPlus-specific behavior (like FOR/NEXT quirks), coding style preferences, and how Claude should run syntax checks and compilation using the executable.

Note: We've found that the quality of Claude's output depends heavily on having all this context loaded and available together in the workspace. Partial use tends to lead to the kind of mixed results you mentioned.

There's no separate reference program or isolated syntax script, Claude learns from the structure and instructions in context. Once that's in place, it tends to follow our conventions and workflow very effectively.

Also, expect that in the beginning Claude may still make syntax mistakes or miss certain PxPlus-specific details. But one of the powerful aspects of Claude is that you can explicitly tell it to avoid those mistakes in the future, and it will store those instructions for itself during the session. Over time, it gets noticeably better at anticipating issues and generating cleaner code, especially if you keep refining the instruction context to your standards.

Hope that helps, and if you have questions while getting it running, feel free to reach out.
Title: Re: Letting AI Write, Fix, and Compile PxPlus Code. From Weeks of Work to Minutes
Post by: HendersonS on September 01, 2025, 10:52:09 AM
Hi Kevin, thank you very much. I see this is a great piece of work. I think it will be very useful. I'll try this repository and let you know what we think.