Announcement: VitTransform is released

Announcement: VitTransform released

Seven years in the making. VitTransform rewrites Clarion source — safely.

What It Does (Out of the Box)

Point it at your .clw and .inc files, and it automatically hunts down and fixes:

  • Unused variables
  • Dead code
  • Unread assignments
  • Missing or incorrect AUTO attributes
  • The legacy code smells every codebase collects over time

It also immediately makes your program do less work by:

  • Eliminating unnecessary clip() statements.
  • Analyzing your logic to automatically choose better alternatives.
  • Stripping out the extra work your code was doing for no reason.

The Safety Guarantee

This is the part worth reading twice. VitTransform respects your code:

  • Your comments stay.
  • Your blank lines stay.
  • Your indentation stays exactly as you wrote it, unless you explicitly want it changed.
  • It never deletes dead code. It comments it out and tells you why, so you make the final call.
  • If it can’t prove a change is safe, it does nothing at all.

Opt-In Performance Tuning

What it won’t do without your permission is rewrite code purely for speed at the expense of readability. That is one switch away.

Flagging --style=optimised:

  • Stops your program from building a whole copy of a string just to compare it and throw it away.
  • Turns single-character searches into lightning-fast byte searches.

It’s faster, but perhaps harder for some to read—which is precisely why that is your decision, not ours.

Fully Customizable Rules

VitTransform ships with two ready-to-use rule sets, but the real power is under the hood: the rules are just a text file.

  • Every transform is data, not compiled-in behavior.
  • If you find a pattern your codebase repeats a thousand times that isn’t in the shipped rules, you can add a new rule and fix all thousand in one go.
  • No Clarion code required.

What’s Included

Two programs ship together to give you complete control:

  • VitStyle: A visual UI. Tick the transforms you want, watch a live before-and-after preview, and save it as a profile.
  • Command-Line Tool: Replay your saved profile automatically across your entire project.

Both come as ready-to-run EXEs, plus full source code.

Note on Compiling: You can run the EXEs immediately out of the box. If you choose to compile it yourself, you will need Capesoft’s StringTheory, which powers VitTransform’s string handling under the hood.

By Geoff Robinson. Free of charge. MIT licensed. Source and releases on GitHub:
GitHub - Geoff-Robinson/VitTransform: A general-purpose, rule-driven source-to-source transformer for Clarion. · GitHub

Is that the only thing it does?

It sounds good.

no it does heaps more but I didn’t want to reproduce what the readme is for :grinning_face:

so have a look at the readme on the github page - or fork it or download etc.

thanks - have a good look as there are lots of options. You can use it simply or get as deep "down into the weeds"as you like - eg. write your own transformation rules rather than just use the provided ones.

Have a look at VitRules.txt to see the current main rules file.

Also have a look at the FAQ for some quick answers to (guessed) common questions.

cheers
Geoff R

Small point

--group=cosmetic-keywordcase-title

Wouldnt the word Capitalise be a better word to use?
Title makes it seem like a title eg Mr, Mrs, Miss, Ms…

Is there an option to make some keywords Upper and some Capitalise?

I tend to upper some small keywords like IF, OR, AND, ELSE, CASE, OF, OROF just to make them stand out and capitalise the rest of the keywords.

I have used AI to add new features and search for and fix bugs etc. I started with Gemini but ended up deciding Claude was the better choice (for me at least - YMMV)

I get too many hallucinations with any Ai on my template builder. This is where the poor documentation keeps Ai out…

Just to clarify…
B.2 Overloaded methods

To be clear, its just counting the number of parameters detected and not looking at the data type?

The return type belongs to the overload, not to the name, so VitTransform picks the overload by the number of arguments at the call site.

So this would fail…

JoinToks Procedure(LONG p1, LONG p2, String p3),Byte
JoinToks Procedure(*Cstring p1, LONG p2, String p3),Byte

Sounds brilliant Geoff :smiley:

I have an app I’d love to try it on but I have the feeling there would be nothing left! :rofl:

Have you used it on any of the Clarion example apps?

EDIT: I’ve just had a quick read through the Read.me Geoff, this is obviously a major work, congratulations on the quality of the documentation.

Maybe - but perhaps Capitalise could be interpreted as all caps - as in UPPERCASE. Although Clarion programmers would be familiar with it from its use elsewhere in the language. I’ll consider it as an alternative rather than a replacement - I know other people use “Pascal case” or “Heading case” or some such. I have already put one alternative spelling in for our US friends - optimise can be mispelt “optimize” and still work.

no not at the moment - but I can take it on notice for a future version - but I have my hands full right now with some fixes so it probably won’t be in the next version.

I think Claude has improved a lot over, say, the last 6 months so it might be worth re-trying with Opus 5 or whatever the latest model is.

reading a little further: Where the count alone cannot decide - two forms that both accept it and disagree about the return type - the argument types break the tie. But your example has the same return type so I would need to check as it may refuse to transform (which is its fallback safe option when it is unsure - a bit like The Hippocratic Oath).

ha ha - I am sure that would not be the case

no not yet - please feel free to try but maybe hold fire for the next version - @Mark_Sarson has kindly done a thorough review and sent me a list of fixes he (and I think Claude or another AI) came up with which I am working through methodically and testing/merging now - so hopefully a new improved version will be out today or in the next day or two.

Thanks Geoff - I would like to take the credit but in fact the docs are largely Claude’s work! I mentioned to Richard that AI has come a long way very quickly recently so it will be interesting to see where it is next year (and beyond). I am being very polite with the AI even when it makes stupid errors just in case it holds a grudge :grinning_face:

ALL of the major AI models have improved dramatically in the last six months, and even in the last three months.

As someone who uses both Claude and ChatGPT 8-10 hours a day, I can definitely say that neither of them is even remotely close to what it was six months ago. They are far more capable now.

When you watch Claude and ChatGPT work, they are actually using fairly similar methods of reasoning and work delegation, even when you are just using them in normal “chat” mode.

The code I see coming out of ChatGPT today is pretty much on par with what I see from Claude, and Gemini is getting very close as well.

Grok and DeepSeek are advancing too, although in the coding-related tests we run against them, they are still not quite at the same level. Both do fairly well for general information, although Grok can sometimes seem a little scatterbrained. Perhaps that comes with the territory. :slight_smile:

Right now I have five fairly high-level projects that are intertwined and in the later stages of development and testing.

I use multiple sessions of both Claude and ChatGPT, sometimes deliberately from different accounts so they do not share the same conversational history or develop the same code bias, to check the work of the others.

I can move sections of a project from Claude to ChatGPT and back again and, for the most part, the transition is seamless.

One of the things I’ve written about recently is that the way you need to interact with these systems has changed dramatically, particularly over the last 90 days.

The giant prompts that helped in the beginning can actually hurt you now.

These days it is much more about context, balance, and clear instructions that define not only what work needs to be done, but also what constitutes success and failure.

Likewise, where a giant file containing every rule and guideline might once have worked well, I now get better results by maintaining a short, definitive guide that points to smaller focused documents. The AI can then retrieve the information it actually needs for the task at hand instead of dragging the entire project’s history into every decision.

It is also important to understand that just because today’s models have much larger context windows and you CAN run a conversation much longer, that does not mean you SHOULD.

I use a two-level process.

One AI session acts as the project conductor, and we spawn separate threads as workers to perform specific jobs.

The worker gets exactly what it needs to do that job, and the handoff to the worker is normally written by the AI project conductor itself.

When the worker finishes, it writes a handoff back to the conductor explaining what it did, what changed, what was tested, and anything the conductor needs to know. Then that worker thread is finished.

The conductor evaluates its own health every three or four worker iterations and decides when it is time to hand its own job to a fresh conductor.

I also keep discussions about new ideas, bugs, architecture changes, or major feature changes in completely separate conversations. I don’t want those exploratory discussions polluting the project conductor’s context.

When one of those discussions produces something we want to implement, the result gets turned into a handoff document and passed to the project conductor. The conductor can then assign it to a worker when it fits into the project plan.

Interestingly, both Claude and ChatGPT have accumulated enough broad knowledge of what I am working on that they understand how the different projects fit together and where they diverge.

But they also understand that my rules of engagement require them to “stay in their lane” and not allow work on one project to start influencing the conductor of another.

The newer high-powered models are slower because they spend more time reasoning. That really doesn’t bother me.

Working this way, I simply assign one conductor/worker pair a task and move to another project.

I do whatever testing or evaluation is needed there, have that worker write its handoff when the job is complete, close the worker thread, and then the conductor and I determine the next task and create a handoff for a new worker.

Then I move on to another pair.

So in practice, I am almost never sitting around waiting for an AI to finish something.

I use Firefox, and its colored tab groups make it easy to keep the conductor and worker threads for each project together.

About once a day I also shut down the entire PC and the VMs where I run AI coding agents. The agents NEVER run directly on my host PC.

When everything comes back up, Firefox restores the tabs and groups exactly where I left them, and I continue working on each project.

It is actually quite efficient. Once you apply a little organization to the process, it becomes surprisingly easy to manage.

It feels a lot like being the lead programmer overseeing several development teams.

I don’t have to personally type every line of code, but I remain 100% in control of what is being built. More importantly, I don’t waste huge amounts of time or tokens, and the projects don’t “drift” because an agent wandered off and decided to redesign something on its own.

“Plan the work and work the plan” still applies when programming with AI.

It works a lot better than saying, “Build me one of these,” and hoping for the best.

My advice to everyone would be not to get too comfortable with any one AI vendor, or with what you think you already know about how to use AI.

At least once a month, step back and revisit the other major systems. Also keep up with what the companies themselves are saying about how their models are changing and how they recommend using them.

Anthropic and OpenAI both publish regular information about changes in their models and tooling, and there are plenty of people writing good articles every week about what they are discovering in actual use.

Whatever you concluded about AI as a programming tool a year ago, or even six months ago, is almost certainly out of date today.

And the same will probably be true six months from now.

As they say in some circles:

“Hang onto your hat. You ain’t seen nothing yet!”

Charles