Hi Jeff,
I do not think the core problem is that the AI is not up to speed on the latest Clarion versions. The bigger issue is that Clarion (especially templates) is not a mainstream language, so the AI often does not have enough real Clarion patterns in its training to reliably stay inside the lines.
I have used AI heavily for Clarion class work. In our QuickBooks API wrapper, I used it to produce well over 5000 lines of Clarion class code. It was not flawless, especially at first, but it absolutely became productive once I set it up to succeed.
What made the difference was giving the AI the ārules of the gameā and a couple of known-good patterns to copy.
What to feed it up front
-
Concrete examples of real Clarion source files: INC, CLW, and optionally EQU.
-
A tiny, correct starter class example (even āHello Worldā style) that shows:
- How the class is declared in the INC.
- How methods are implemented in the CLW.
- How you format indentation and structure.
-
Clarion-specific rules that AIs constantly mess up unless you spell them out, like:
- Do not use reserved words as variable names.
- Procedure prototypes in the INC include the return type, but the CLW method implementation line does not.
- Procedure names, routine names, and variable declarations start in column 0.
- Executable code starts in column 2 and indents by 2 consistently.
How to avoid correction loops
-
Give it a small task first, then build up.
-
When you get errors, paste back:
- The exact source it generated.
- The exact compiler error text.
- Your best guess about what is wrong (even if you are not sure).
-
Ask it to explain the fix in plain terms, then generate a corrected full block.
Also, keep reminding yourself what the AI is.
It is not sentient. It is a pattern machine.
If you show it the pattern you want, and you give it the constraints clearly, it can surprise you with how well it does even in a niche environment like Clarion. But if you ask it to invent a template or a class from scratch with no examples, you will get confident-looking nonsense.
One more practical tip
Because Clarion is not mainstream, you will often need to re-establish some of this context in new chats. When it starts drifting or āgoing off the railsā, grab a short continuation prompt from it and restart a fresh thread with your key rules and examples. That is usually faster than burning time in endless correction loops.
If you want to see the kind of prompting and structure that made this work for me, here is the QB AI primer I use as a base.
https://clarionproseries.com/ai/qbai-primer.txt
A developer can feed this to any major AI and it will write workable code that they can paste into our AI Code Checker (a part of the QB wrapper) and it will allow you to get instant results without even writing code in your program or knowing how the QuickBooks API works - the AI already knows this, so you just tell it what you are trying to do.
Also, I am working on a book called āReal Programmers Use AIā that gets very specific about how to work with AI effectively (prompt structure, iteration loops, error-driven repair, avoiding token drift, etc.). I am also planning a Clarion-focused supplement that shows concrete Clarion examples and patterns, since Clarion developers have a special challenge here due to limited AI familiarity with the language.
If you post a small example of the class you are trying to build (INC and CLW, plus the errors you are seeing), I can help you set up a tighter prompt and iteration loop so you get productive instead of stuck in correction cycles.
Charles