Forum > Pascal and AI

AI Assist Python - to - Pascal?

(1/5) > >>

Curt Carpenter:
I have a programmable instrument (vector network analyzer) that is supported by a bunch of python code.  I would like to convert the python code to Pascal -- a fairly routine project but my first starting from python source (a new and unfamiliar language to me).  Can anyone give me an idea of if/how AI might help me with this translation effort, and if so -- first steps in undertaking its use?   This is strictly a personal interest/hobby project that's been in my project backlog for a few years.

(I can use the instrument as a "black box" using the python-based GUI, but I would like to be able to add some features and get a better view of what's going on in that box.)

440bx:
I am very "green" with A.I but, one thing I have found useful is to use the free Claude Code to get an idea of how well and how much A.I can contribute to a project.

If I were you, I'd start with the simplest piece of Python code, the one you believe is the easiest to port and go through the process of getting Claude Code to produce a Pascal port.  I am sure you'll learn a number of useful things in the process, such as, what it can and cannot do well, as well as how to present/phrase your request to get the best results (that's actually very important.)

I don't know how much experience you have with A.I but, it you are a beginner (like me), I suggest you follow the tutorials offered by Anthropics.  While they are a bit slow paced for my taste, I have found them useful.

HTH.

egsuh:
I tried to convert a C/C++ program (quite large) to pascal, but not very successful yet.
AI gives a whole framework or structure, which is not much helpful.

Wallaby:
It depends. Something like AI chat wouldn't be helpful much, however using something like Claude Code or Codex could have done it in hours, depending on the size of it. It would have to be a rewrite rather than conversion, but yes very doable and very easy especially if you have some testable input/output.

gidesa:
I think that, when using AI tools, you have to know the argument, at a minimum in general mode.
You say not knowing anything of Python (although knowing well Pascal), so you haven't great chances to verify the correctness of translation Python-Pascal. That is, maybe Pascal code is formally correct, but it hasn't correct match with Python one.


Navigation

[0] Message Index

[#] Next page

Go to full version