Recent

Author Topic: Which AI Model is the Best for Assisting in Lazarus/Free Pascal Code Development  (Read 2140 times)

Hansvb

  • Hero Member
  • *****
  • Posts: 715
They exist. Not for from my town….

Quote
https://www.pal-v.com/en/


carl_caulkett

  • Hero Member
  • *****
  • Posts: 649
Hello everyone,

I've been experimenting with various AI models for assisting in code development with Lazarus/Free Pascal, including OpenAI (such as ChatGPT) and Claude (Anthropic). Both of these AI models seem to have their strengths, but I'm curious to hear from the community:

Have you used any AI tools for generating or improving Lazarus/Free Pascal code?
Which AI model do you find most helpful for our specific programming language and environment—OpenAI, Claude, or perhaps another tool?
Do you think these AI models are reliable enough for more complex coding tasks, or are they better suited for simple snippets and debugging?
I'm looking forward to your thoughts and any experiences you've had with these AI tools when working with Lazarus/Free Pascal. Thank you!

I've found that using the Preview version of Zed Editor is pretty cool. It gives you access to Claude 3.5 Sonnet, which does seem to have a reasonable knowledge of Lazarus/FPC. I think, however, it is best used by someone with a reasonable amount of experience with Lazarus or Delphi, since this makes it easy to spot when the AI is giving you incorrect information, and stop you being led down a massive rabbit hole. Also, from a personal point of view, I find that the tone of Claude 3.5 Sonnet's suggestions are way less patronising that GPT 3.5/4.0. I know it's an inanimate system but it makes a difference 😉

The trick is, I think, not to ask AI to construct huge lumps of code but to break the problem down into bite sized chunks and then use the AI to fill in the gaps in one's knowledge.

A good example happened the other day when I asked the AI if it could remove an ugly if/then/else statement that smelt pretty bad. It came up with...
Code: Pascal  [Select][+][-]
  1.   CharToAdd := specialize IfThen<string>(Character = 'UNASSIGNED', '_UNASSIGNED', Character);
  2.  

which simplified the code, and taught me something new 😉
« Last Edit: October 02, 2024, 11:33:51 pm by carl_caulkett »
"It builds... ship it!"

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1218
Give it a couple more years.

https://www.newyorker.com/magazine/2024/04/22/are-flying-cars-finally-here
It will be great when car accidents aren’t limited to road areas  :D

Technically a flying car has existed for a long time it’s called a helicopter... I really don’t want those flying over my house, do you?
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

Thaddy

  • Hero Member
  • *****
  • Posts: 16184
  • Censorship about opinions does not belong here.
Joanna if you are really curious google for "Maarten Sierhuis", a very close friend of mine. You can even mention my name ;)
(His team wrote much of the mars lander software, using his own language that nobody knows:Brahms (the language, not the composer)
He used to be a good drummer too, but his brother is a better guitarist  (, because he plays in my band....)
If I smell bad code it usually is bad code and that includes my own code.

schuler

  • Full Member
  • ***
  • Posts: 242
I’m a heavy A.I. user myself. I pay for a number of A.I. services including ChatGPT and POE. I use these services for brainstorming, code review, code documentation and sometimes actual coding. Sometimes, bugs introduced by language models are hard to fix. Will I stop using? Not now.
At this precise moment in the evolution of A.I., language models won’t create working final solutions for you. But they can help you.

You may try the following:
* Hello super-intelligence! Do you find opportunities for improvement in the following code please?
* Hello super-intelligence! Do you see any obvious bug in the following code? Is there anything that I should care about please?
* Hello super-intelligence! Can you write a readme file for the following code please?
* Hello super-intelligence! Can you explain to me this source code please?
* Hello super-intelligence! Can you explain to me please the algorithm called … ? I’m particularly interested in the aspect about… . This portion of the algorithm doesn’t make sense to me because … Can you help me understanding it please?
* Hello super-intelligence! I typed this readme file for that source code. Can you format it to me please? Can it be improved further?

This is an example:
* https://poe.com/s/ELl4xkluKjNpEE1h6vuZ

When I am respectful, motivational and thankful, the AI replies look better.
The readme file https://github.com/joaopauloschuler/neural-api/blob/master/README.md was greatly improved by https://poe.com/CAI-NEURAL-API. My most recent release notes ( https://github.com/joaopauloschuler/neural-api/releases ) were also reformatted by https://poe.com/CAI-NEURAL-API .

In reply to the original post, these are my preferred tools at this moment:
* ChatGPT o1-preview.
* My own flavored Sonnet 3.5 200k context: https://poe.com/CAI-NEURAL-API .
* My own flavored ChatGPT-4o-Latest: https://poe.com/CAI-NEURAL-API-FREE .
* My own flavored ChatGPT-4o: https://chatgpt.com/g/g-6BrAwhTQ9-free-pascal-developer-neural-api

The one that I use the most is https://poe.com/CAI-NEURAL-API . Don’t expect miracles. Once you have some understanding of the current A.I. limits, then you can push A.I. tools to their limits.
 

VisualLab

  • Hero Member
  • *****
  • Posts: 573
<cut/>
...
When I am respectful, motivational and thankful, the AI replies look better.
...
<cut/>

Just remember, don't overdo it with politeness. If you sugarcoat your questions too much (using the suck-up mode), the super-intelligence will get angry. It certainly works just like INTERCAL :D

axel18

  • Newbie
  • Posts: 5

* My own flavored ChatGPT-4o: https://chatgpt.com/g/g-6BrAwhTQ9-free-pascal-developer-neural-api
[/quote]


This one is the better  for  free pascal with raylib library !

ad1mt

  • Sr. Member
  • ****
  • Posts: 327
    • Mark Taylor's Home Page
Its the one inside your own head.

 

TinyPortal © 2005-2018