Recent

Author Topic: AI and Free Pascal  (Read 6521 times)

backprop

  • Full Member
  • ***
  • Posts: 236
Re: AI and Free Pascal
« Reply #15 on: April 02, 2026, 06:30:17 am »
PS: My previous question was serious, I wasn't "attacking" you, I was truely interested to know if the AI generated compiler was plagiarised.

The point is, does anyone believe that AI is capable to do such complicated task which require not just knowledge, but also assume human intelligence and deep conceptual understanding. Read more about these:

- Artificial Narrow Intelligence (ANI)
- Artificial General Intelligence (AGI)

I admit that LLM (Large Language Models) is incredible advance now, but AGI is still "holy grail".

Model families today: GPT-5.2, Gemini 3.1 Pro, Claude 4.6 Opus,  Llama 4 Scout. All is still in "weak Ai" category and only Claude is qualified to be used in "software engineering" field, but all is still quite limited.

Funny thing with Gemini is to do some IQ tests on it. While "what is next number" pass due large database as searching capabilities, with standard MENSA test which uses only Raven’s progressive matrices, AI will fail miserably. It as well failing with abstract thinking... Only what can do is to mimic some human behavior and respond on clear questions which answer can be found on internet or internal database.

Also try to "chat" with AI and use some paradoxical doubts and claims, force it as "axioms" and read what Ai response... Quite funny, but useless and indeed shows as all is still quite primitive and how processing entire "conversation" actually works.

It is long, long time before AI will reach human intelligence, if ever. Thus claims that AI is capable to create compiler by itself is quite a joke.
« Last Edit: April 02, 2026, 06:55:28 am by backprop »

440bx

  • Hero Member
  • *****
  • Posts: 6532
Re: AI and Free Pascal
« Reply #16 on: April 02, 2026, 06:54:07 am »
It is long, long time before AI will reach human intelligence, if ever.
if it ever reaches human intelligence then it will no longer be artificial.

Thus claims that AI is capable to be able to create compiler by itself is quite a joke.
It is unclear what level of human intervention or "initial seed" was required but, let's presume for argument's sake that it took a full time human being "assisting" the A.I model to produce a full fledged C compiler.  The fact is, enabling a human being to write a full fledged C compiler in two weeks is downright spectacular.  Artificial or not, that's an impressive performance.

That's roughly comparable to writing FPC for x86 in two weeks.  I believe it took the FPC team "a little" longer than that.

A.I is just a tool, the most annoying part of it is its disregard for "good etiquette" while it gathers knowledge by scraping websites without concern for the disruptions it causes.  That part is really annoying.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

backprop

  • Full Member
  • ***
  • Posts: 236
Re: AI and Free Pascal
« Reply #17 on: April 02, 2026, 07:06:54 am »
440bx, I have told you several times to avoid my posts and you know exactly why and also people who read there. And following that, I will not argue with you at all. From your point of view, you are always right, even not knowing the facts, while others are always wrong, thus any arguing is pointless.

Hint: ask AI what is 2+2 and force it to become a "math axiom" that is 5 and then go further to do some other related calculations (for instance, how much is 2+2+2), thus see what is doing... Similar as this, you have as axiom that AI did all work itself and no point further to argue with you.

440bx

  • Hero Member
  • *****
  • Posts: 6532
Re: AI and Free Pascal
« Reply #18 on: April 02, 2026, 08:39:37 am »
440bx, I have told you several times to avoid my posts
I have to admit, that's good advice considering your posts seldom have anything worth reading.

From your point of view, you are always right, even not knowing the facts, while others are always wrong, thus any arguing is pointless.
Is that really the best argument you can come up with against A.I ?... I didn't expect much but, I expected a little better than that.

no point further to argue with you.
I appreciate that.  Saves me time.  Please, keep your word, don't argue any further.  Thank you.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 438
  • I use FPC [main] 💪🐯💪
Re: AI and Free Pascal
« Reply #19 on: April 02, 2026, 09:09:03 am »
I think the example of the Pixie rendering engine and its creator’s experience with LLMs (which he shared) is a fairly telling illustration of the current capabilities of LLMs
I may seem rude - please don't take it personally

RayoGlauco

  • Full Member
  • ***
  • Posts: 227
  • Beers: 1567
Re: AI and Free Pascal
« Reply #20 on: April 02, 2026, 10:12:11 am »
I think AI is unstoppable. In general, anything a computer can do, even in a very rudimentary way, has infinite room for improvement.

We have the example of chess engines: not so many years ago, chess professionals laughed at them, but now they easily beat the world champion.

Also, a few years ago, digital cameras offered ridiculously low resolutions, like 320x200 px. But now, few people consider using a non-digital camera.

AI is already capable of saving many hours of work for those who know how to use it properly, and this is just the beginning.
To err is human, but to really mess things up, you need a computer.

Joanna

  • Hero Member
  • *****
  • Posts: 1454
Re: AI and Free Pascal
« Reply #21 on: April 02, 2026, 12:05:04 pm »
A chess game is far from real life situations. Chess has a specific easy to enforce set of rules.

creaothceann

  • Sr. Member
  • ****
  • Posts: 375
Re: AI and Free Pascal
« Reply #22 on: April 02, 2026, 01:44:02 pm »
@backprop, 440bx:
The forum software has support for ignore lists; posts from users entered into that list are hidden.

RayoGlauco

  • Full Member
  • ***
  • Posts: 227
  • Beers: 1567
Re: AI and Free Pascal
« Reply #23 on: April 02, 2026, 02:29:00 pm »
Chess is just one example. Interaction with AI shows us that:

- It is able to express itself perfectly in numerous languages, both in writing and speaking.
- It is also capable of interpreting the messages it receives, both written and spoken.
- It is able to give answers, generally coherent, with a notable degree of accuracy.
- It is capable of doing complex tasks in a few seconds.

I don't think we should despise AI's ability to evolve. It may make mistakes, sometimes ridiculous ones, but so do humans.

If right now it is already producing changes in the way many people work, in a few years a real revolution could occur.

Whether that will be good or bad, I don't know.
« Last Edit: April 02, 2026, 02:30:55 pm by RayoGlauco »
To err is human, but to really mess things up, you need a computer.

440bx

  • Hero Member
  • *****
  • Posts: 6532
Re: AI and Free Pascal
« Reply #24 on: April 02, 2026, 02:50:42 pm »
Chess has a specific easy to enforce set of rules.
Explain why you are not the chess world champion... after all, as a human you should be able to apply an "easy to enforce set of rules" with greater creativity than a dumb computer program can.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: AI and Free Pascal
« Reply #25 on: April 02, 2026, 02:53:50 pm »
Moderator notice: PLEASE RETURN TO TOPIC

If you want to keep endless AI discussions use a different medium.

440bx

  • Hero Member
  • *****
  • Posts: 6532
Re: AI and Free Pascal
« Reply #26 on: April 02, 2026, 03:11:02 pm »
I'm not spending money on a tool that isn't 100% reliable, and generates code that won't compile, and in one case, doesn't work properly!
Programmers are far from 100% reliable, more often than not generate code that doesn't compile (which is why compilers are designed to detect syntactic errors) and, it is exceptional for a program of reasonable complexity to work properly after the first successful compile.

Apparently, more is expected from A.I than from paid human programmers...
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

TBMan

  • Sr. Member
  • ****
  • Posts: 355
Re: AI and Free Pascal
« Reply #27 on: April 02, 2026, 05:58:38 pm »
AI is useful in coding for certain things. Here is a link to a game I coded. The graphic primitives and sound units are created by ChatGpt.

https://www.youtube.com/watch?v=tgKz0cxog-k

So what did ChatGPT actually do?

It created, with me looking over its shoulder, a Windows API wrapper which includes sprite management, font management, and an eight voice sound unit and an image display unit.

ChatGPT generated most of the artwork used in the game.

Did I spend a lot of time working out the kinks in ChatGPT's code? Yes.

I've always said, that for coding, AI is like a toaster without a timer. It works, but you have to watch it.
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

silvestre

  • Jr. Member
  • **
  • Posts: 84
Re: AI and Free Pascal
« Reply #28 on: April 02, 2026, 06:53:51 pm »
Hi Fred, Your observations are entirely valid. Most of the recurring errors you see aren't due to the AI ​​being "bad," but rather to the lack of a stable working structure. When working with Pascal, Lazarus, or UOS, the model needs some guidance to behave consistently.

To avoid the typical repetition of syntax errors, logic errors, or inconsistent code, everything is greatly simplified by establishing two essential elements: clear instructions and a suitable context file.

1. INSTRUCTIONS / RULES (what you tell the AI ​​before programming)
These are simple rules you provide to the model at the beginning of each session:
This is just a very basic example:

Generate modular and reusable code.
Use the Gettext translation format for strings: _('text')
Keep explanations brief; prioritize code.
If you need to make any significant changes to the architecture, let me know first.
Consistently maintain the same coding style throughout the project.
Don't invent functions or units; Ask questions before making assumptions.


Why it's important: Without these rules, the model improvises, changes style, and repeats the same Pascal mistakes you mentioned. With them, it becomes much more stable and predictable.

2. PROJECT CONTEXT FILE (the external memory the AI ​​needs)

This is a simple .md file that you should save and use every time you start a new session. It acts as the project's "memory." You can ask the model to update it after each session or work section.

What the file should include:
A brief project summary
Overview of the architecture
List of units and their function
Dependencies
Coding conventions (such as the Gettext rule)
Folder structure
Some examples of correct code
Any special constraints or patterns you want to apply
Why it's essential:
Models don't remember previous sessions.


If you don't provide them with this file, they lose the big picture and start generating inconsistent code, repeating mistakes. With the context file, even large projects with many units remain consistent.

I have absolutely nothing against AI, quite the contrary, but they should learn their lessons better.
All of them (Claude, Gemini, Chatgpt, Grok, etc.) make glaring syntax errors in Pascal. And when I ask them to create a program that plays MP3s using UOS, they produce an unusable program, full of syntax mistakes. And even though I show them the errors (which they correct with profuse apologies), by the next session they've forgotten everything and make the same mistakes again.
« Last Edit: April 02, 2026, 06:59:51 pm by silvestre »

backprop

  • Full Member
  • ***
  • Posts: 236
Re: AI and Free Pascal
« Reply #29 on: April 02, 2026, 07:23:16 pm »
1. INSTRUCTIONS / RULES (what you tell the AI ​​before programming)
These are simple rules you provide to the model at the beginning of each session:
This is just a very basic example:

Generate modular and reusable code.
Use the Gettext translation format for strings: _('text')
Keep explanations brief; prioritize code.
If you need to make any significant changes to the architecture, let me know first.
Consistently maintain the same coding style throughout the project.
Don't invent functions or units; Ask questions before making assumptions.


Why it's important: Without these rules, the model improvises, changes style, and repeats the same Pascal mistakes you mentioned. With them, it becomes much more stable and predictable.

I would add:
Do not use slang.
Compile and correct compiler errors. // for short console apps at least
Do not bugging me that you can't compile code on my computer!
...

No matter to all that, it is definite need to repeat the same several times in order to fully update weights for current session. At least that is with Gemini fast version... It is as a child with a lot of memory but lack of attention and intelligence...
« Last Edit: April 02, 2026, 07:27:17 pm by backprop »

 

TinyPortal © 2005-2018