Recent

Author Topic: C/C++ code to Object Pascal AI converter found.  (Read 1695 times)

jamie

  • Hero Member
  • *****
  • Posts: 7651
C/C++ code to Object Pascal AI converter found.
« on: March 08, 2026, 11:36:17 pm »
https://products.codeporting.ai/convert/c-to-object-pascal

You know I hate AI, but I just tried this with a simple C++ file, and it actually gives you something that looks like legit code!

Jamie
The only true wisdom is knowing you know nothing

zeljko

  • Hero Member
  • *****
  • Posts: 1905
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: C/C++ code to Object Pascal AI converter found.
« Reply #1 on: March 09, 2026, 12:46:17 am »
Ask him about overriding virtual methods :)

jamie

  • Hero Member
  • *****
  • Posts: 7651
Re: C/C++ code to Object Pascal AI converter found.
« Reply #2 on: March 09, 2026, 01:16:26 am »
I know it isn't perfect I see that; however, the amount of time it saves to get you started on a conversion is a large payback.

I also noticed that is does generate a USES list with assumed unit names and I also its good at generating guess code.

I did place a C++ file in there that had the original Authers listing and those files came from the net so it wouldn't surprise me if it went out and found the files then filled in some methods, because in one experiment I only supplied the header file but it had some function code headers with no body, it found the correct body of code to put in there and was Object Pascal.

Just amazing. %)

Come to think about it, I did first try the body of that file then the header, I suppose it cached what I had and matched them.

 :o

Jamie


 

« Last Edit: March 09, 2026, 01:21:05 am by jamie »
The only true wisdom is knowing you know nothing

440bx

  • Hero Member
  • *****
  • Posts: 6317
Re: C/C++ code to Object Pascal AI converter found.
« Reply #3 on: March 09, 2026, 02:25:45 am »
Jamie,

Have you tried to make the thing port Petzold's Programming Windows code ?  if you have how was the result ?

The reason I ask is because, I think it would be very useful to have a large number of Pascal examples of how to program with the Windows API.  MS has thousands of relatively simple C examples that would be great to have in Pascal.

An A.I thing that would do 90%+ of the work would be absolutely wonderful.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 747
Re: C/C++ code to Object Pascal AI converter found.
« Reply #4 on: March 09, 2026, 03:58:28 am »
I'm not surprised.  Imagine what the situation will be in another ten years.  The creative genius that has given us the advances of the last eighty years will then be freed from all that routine to do more amazing stuff.

domasz

  • Hero Member
  • *****
  • Posts: 624
Re: C/C++ code to Object Pascal AI converter found.
« Reply #5 on: March 10, 2026, 10:44:20 am »
Like ChatGPT, Gemini and others it has a limit of ~4kB. That's not enough to convert even something as simple as BZ2 decompressor.

 

TinyPortal © 2005-2018