Transpiler assistence (Go to Delphi conversion/translations, also logic equivalence) #254
SkybuckFlying
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to convert the vite go blockchain to Delphi (and maybe later the javascript wallet to Delphi) for better understanding and possibly modifications also verification.
Currently the AI has issues/problems with this:
My suggestion to solve these problems are:
So for example:
filename1: type.TAddress
filename2: type.TBlock
filename3: type.TConfig
then for functions:
filename1: func.CreateBlock
filename2: func.VerifyBlock
etc.
Basically like a new programming language, where each type is in it's own file, and each function is in it's own file.
This will help to keep the context window small, plus showing the AI a list of files might make it easier for the AI to find the necessary types. (Reducing token usage)
Finally the logic equivalance problem, while said to be theoretically unsolveable because of the halting problem I do see some practical solutions:
Assume code does not hang forever, in those cases all inputs can be brute forced and all outputs compared for program A and B.
For code hangs implement a timeout condition, and mark it as "hung code"
For crashes also mark them as "crash code".
Finally some inputs could be reduced by "logical deduction/reduction" perhaps AI can assist with that as well deepseek has a new math AI good at math, maybe also logical reasoning, I believe so.
Some further ideas:
Use the "web" version of co-pilot/bing, phind.com and deepseek r1, these usually seems to work somewhat, phind.com is a bit shacky... might depend on cache settings in webbrowser not sure. Scrap web output, perhaps this can by-pass API limitations.
Because of "data center api token" limitations it could/would be desirable to also try use local AI to process files at night.
Further suggestion:
Use phind.com as planning
Use co-pilot for easier code.
Use deepseek R1 in case generic/interface or more complex must be generated.
I experimented a bit with "splitting files" however, didn't work so well it missed types, so an AST parser might be necessary to catch all types.
Co-Pilot assisted in a basic parser to split go files into types, variables, functions, only tested on one slightly complex go file:
Here is the code, it does prove that GO has "AST/Parsing" capabilities. (Another idea could be to study/use/feed the GO compiler source code into AI or modify it for import resolution...):
(I wonder if maybe plandex can help with this project/idea, some transpiler support in plandex to convert GO to any other language would be very cool and handy to have, so basically an AI-assisted transpiler).
Beta Was this translation helpful? Give feedback.
All reactions