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.
no it does heaps more but I didn’t want to reproduce what the readme is for
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.
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…
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).
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
OK just a heads up that VitTransform Version 1.0.3 is now released with extra fixes of things Claude found and a couple of minor edits resulting from a discussion with Carl (thanks!).
I still have more work to do on the alignment of comments which is still not 100% but is getting better - and a lot of things on my to-do list. So visit regularly and always grab the latest version.