Recent

Author Topic: Seeking advice on setting up A.I  (Read 1630 times)

440bx

  • Hero Member
  • *****
  • Posts: 6472
Seeking advice on setting up A.I
« on: April 04, 2026, 05:18:05 pm »
Hello,

I've read some comments that have not only peeked my curiosity but also suggested A.I capabilities that would be very useful to exploit.

Specificallly, @retrofoxed made the following comment:
Quote
I found myself using Claude Code these days more than the Lazarus IDE itself.
That statement sure peeked my curiosity. Does the above mean Claude Code was able to replace some Lazarus functions or just that more time is spent interacting with A.I (for various reasons) than editing/debugging/etc (typical actions when using Lazarus) ?

For "completeness", the statement is found at: https://forum.lazarus.freepascal.org/index.php/topic,72587.msg568495.html#msg568495

Also from @retrofoxed:
For example, with the exception issue it just kept doing static analysis until I stepped in and said: here is an ARM64 machine, here is cdb, here is a disassembler, here are the Microsoft specs — now go and figure it out.

So yes, it definitely needs steering in the right direction, but once pointed properly, it usually gets the job done.
My questions are:
1. did you give Claude Code the ability to run programs on your machine (I mean the ARM64 machine) ?
2. if the answer to (1) above is yes, how did you manage that ? did you install Claude CLI directly in the ARM64 machine ?  Any details you can provide are most welcome.
3. does Claude Code know how to use cdb and a dis-assembler all by itself or were you in charge of using them and handing the results over to Claude Code.  What disassembler was used, IDA, ghidra or some other ?

Basically, I'll very much appreciate any information you can provide that illustrates the process you went through to reach the solution. 

Thank you very much in advance.


FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

cdbc

  • Hero Member
  • *****
  • Posts: 2772
    • http://www.cdbc.dk
Re: Seeking advice on setting up A.I
« Reply #1 on: April 04, 2026, 05:31:57 pm »
Hi
Good question -- +1
I'll be listening too.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Wallaby

  • Guest
Re: Seeking advice on setting up A.I
« Reply #2 on: April 05, 2026, 09:27:59 am »
Wow, where do I start. OK, here is my setup. It's a regular Win64 machine where I have Claude Code CLI running. Everything I say below equally applies to Gemini CLI and Codex.

It's important to note that it's an agent, not a chat. The key distinction is this: a chat is like asking someone on a forum "Hey guys, can you help me with my code?" — they'll try, but without access to the codebase and environment, they'll be guessing at times and you'll be copy-pasting back and forth. Cheap or free, limited utility, but that's what most people do. Agents are different — they are a layer between the chat and your PC. They can read and write files, use compilers, debuggers, all kinds of tools. There is a permission system and sandboxing, but it's rather annoying to confirm each action: "Yes, you can read that file", "Yes, you can launch the compiler", "Yes, you can search the web".

There is a way to run it unrestricted so any action is automatically allowed. Potentially destructive, but the worst thing that's ever happened to me is the agent got confused and reverted its own working copy changes, or committed without explicit permission. So that's how I run it — it's therefore capable of running anything on my PC, with network access, reading and writing files in allowed folders. My programs target a bunch of systems and architectures, so I have a number of physical and virtual machines representing macOS, Linux and Windows of varying bitness and CPU arch — all accessible via SSH.

To answer the specific questions:

1/2) Yes, the AI is allowed to run anything on my machine and remote machines via SSH (this is mainly to run tests; all compilation is done on the host via cross-compilers).

2) Yes, it knows how to use cdb and disassemblers. If you give it a new tool that it doesn't know, it'll learn it in seconds just by running newtool.exe --help or reading the accompanying doc. For cdb and kd (console debugger and kernel debugger), the main issue is that console apps cannot use full bidirectional pipes — at least not on Windows. The AI can prepare a sequence of commands to run at once, or you'd have to do it by hand. So far it cannot enter commands interactively and read output; rather it can execute a command and see what it returns. For disassemblers, the existing ones like Ghidra or IDA have limited scripting options. Instead, what works well is a Python package called Capstone — which is basically a script-based disassembler.

3) The reason I'm not using Lazarus IDE — there is simply no need. I can just say "refactor my code in such and such way" and it will do it. I can tell it to add a button and it will modify both LFM and PAS as asked. That being said, the visual part of the AI is still not as good as the textual and logical one. I do sometimes revert to Lazarus IDE to rearrange controls the way I like rather than explaining all that in plain text.

Overall observations: what works great is anything that has testable text-based or binary input and output — math, logic, databases, protocols, text and binary formats. What works less great is the visual part. The AI's idea of what looks great may not match yours, and it's rather weak at prototyping UI in Lazarus — unless you resort to a trick and ask it to create a pseudo-graphics text-based UI or HTML UI first, then ask it to do something similar in Lazarus.

For those who don't know, I've put together a FreePascal/Lazarus HTML renderer in ~2 weeks; doing that solo would have likely taken years. So back to the above point — the logical part was easier because the AI can rapidly test and prototype with any HTML/CSS input and retest everything after changes. However, the visual part — rendering artefacts like incorrect margins/paddings, SVG strokes — requires human input to explain what exactly is wrong. As I said, the visual part of the AI's perception is still maturing, though it can see and analyse screenshots.

All coding is governed by two MD files called CLAUDE.md (or AGENT.md or GEMINI.md) — these basically tell the AI what it may, should, must and cannot do, along with your preferences, paths to tools, etc. The file in the home folder defines global operation and the file in a project folder defines things specific to that project.

How this works in general: you open a terminal at your project folder. From there you could instruct it to fix a specific bug or add a new feature. For something complex, it makes sense to start with a discussion about what you'd like, and over a few iterations you both arrive at a better understanding of what's needed. Then you can just tell it to make a detailed plan and execute it. A very important thing is that the AI needs a detailed task description of what you want. Anything that is not described, it will fill in with assumptions — and those may not be what you expect. So before coding anything complex, have a discussion about the architecture and what specifically you want to achieve.

All in all, it feels like you got a few assistants as your disposal who we'll take on anything you throw at them, though like humans, they may not exactly do what you expect or how you expected it, but the productivity gains are enormous. Oh, and you can set up its personality, I sometimes like mine to swear in Russian or English - a more fun way to work.
« Last Edit: April 05, 2026, 09:44:23 am by retrofoxed »

440bx

  • Hero Member
  • *****
  • Posts: 6472
Re: Seeking advice on setting up A.I
« Reply #3 on: April 05, 2026, 09:51:18 am »
retrofoxed, I cannot thank you enough for all the information and insights you made available in the above reply.

Absolutely great and extremely useful.

THANK YOU !!!.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

devEric69

  • Hero Member
  • *****
  • Posts: 655
Re: Seeking advice on setting up A.I
« Reply #4 on: April 05, 2026, 10:25:36 am »
I do the same thing with web development (PHP + HMTL + JS): I'm using the NetBeans IDE. In its settings, I've entered the account I've created on web site mistral.ai (you can select another) and then I've selected a programming-oriented agent they've created. Basically, you need to define the essential inference rules first ("Easy to read for human!", "Hungarian notation!", etc), followed by the conditional important ones ("If ... then..."), and then the remaining details\context ("The purpose is to write a service to do..."), generally speaking (one rule per line, in the IDE's settings).

Typically, the agent has rights to read n' write in the current project's scope (so, the agent is - too - allowed to write inside the IDE’s text editor: I see the proposal of code inside the EDI, inserted at the prompt). So, at last: I ask a question by writing a\some line(s) of comment above where I want to create new code or refactor the code starting below; I highlight the question-comment line(s) and the surrounding code below (a few lines or up to the end of the file), and with a keystroke sequance (CTR + ALT + ...), I send the question to the agent. He\it writes the response at the prompt in the EDI.

At present (concerning me), this involves communication with the remote website. So, much of the contextual data is transmitted through the WAN\internet (compiled agents are being soon deliverable, which could\can(?) be installed on the client machine).

The quality of such a work is closely linked to the quality of the ordered written inference rules, the quality of the question, the quality of the context, and the quality of reformulating the question by highlighting what is good ("ceteris paribus" in the last response) and what needs to be changed and inferred in the future response to change the previous response.

I believe this would be a good approach, too, to take such a compiled implementation in the Lazarus EDI (although most of these coding AI solutions often start by distributing their knowledge through a centralized forum-website that allows their client users to chat with a {fast}-CGI (?) remote specialized chat'bot, helped by attached and sent source code files providing conversational context, first AFAIK. Then, stay in the EDI using a downloadable binary specialized helped by a local\LAN conversational-agent can\could be done, AMHO). Pretty easy! Isn't it ˆˆ(humour)?

Regards.
« Last Edit: April 05, 2026, 12:23:03 pm by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

440bx

  • Hero Member
  • *****
  • Posts: 6472
Re: Seeking advice on setting up A.I
« Reply #5 on: April 05, 2026, 10:44:27 am »
The quality of such a work is closely linked to the quality of the ordered written inference rules, the quality of the question, the quality of the context, and the quality of reformulating the question by highlighting what is good ("ceteris paribus" in the last response) and what needs to be changed and  inferred in the future response to change the previous question.
Yes, I've noticed that the correct "formulation" is critical to obtaining the desired result.  A bit like choosing the right algorithm.

Thank you devEric69.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

dbannon

  • Hero Member
  • *****
  • Posts: 3801
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Seeking advice on setting up A.I
« Reply #6 on: April 05, 2026, 12:30:34 pm »
Wow, thanks for this discussion. The curiosity got the better of me, and have given it a very slight try. imekon in another thread, sort of, recommended Cursor so, Last night, I installed it using a (linux) deb and followed a startup guide on their website. Easy, really easy.

The app gives me a text window here I type into, an adjoining window shows the AI response. The guide suggested I point it to an existing project, get it analysis my code and report. Absolutely astounding ! The project is a long term, slow (and unguided) growth thing, bits added when needed. But the AI understood it all, worked out all the units role, great descriptions.

So, the guide then says, ask it for 3 suggested improvements, I did and got back one I knew needed to be done, never "got around to it", two others that sounded good but will require me to think more before deciding. The AI offered to fix them, one by one. I chickened out at that point, needing some time to consider.

Folks, this really is, one way or another, the future. Ignore it at your peril !

Davo

Edit : Hey, we have a dedicated place to discuss Pascal and AI, thanks Martin !

« Last Edit: April 05, 2026, 12:33:01 pm by dbannon »
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

devEric69

  • Hero Member
  • *****
  • Posts: 655
Re: Seeking advice on setting up A.I
« Reply #7 on: April 05, 2026, 12:39:19 pm »
You're welcome @440bx, but I've made a mistake: I should have written:
Quote
The quality of such a work is closely linked to the quality of the ordered written inference rules, the quality of the question, the quality of the context, and the quality of reformulating the question by highlighting what is good ("ceteris paribus" in the last response) and what needs to be changed and inferred in the future response in order to change _differentially_ the previous question
(I've edited my previous post).

So, sound semantics, underpinned by a solid grasp of the programming language’s grammar, are essential. Otherwise, the AI will quickly display overly complicated, off-topic responses or even start hallucinating. It’s a non-stop job of supervising the AI, Amho, @dbannon.

Regards.
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 413
  • I use FPC [main] 💪🐯💪
Re: Seeking advice on setting up A.I
« Reply #8 on: April 05, 2026, 03:40:40 pm »
In my opinion, any LLM with 30 billion parameters or fewer (like Qwen3.5 or Gemini) is useless for programming tasks
That’s what I’ve been able to test locally. I haven’t been able to deploy larger LLMs locally

But maybe someone else has had a different, positive experience with LLMs of ~30B or less
I may seem rude - please don't take it personally

440bx

  • Hero Member
  • *****
  • Posts: 6472
Re: Seeking advice on setting up A.I
« Reply #9 on: April 05, 2026, 04:46:34 pm »
So, sound semantics, underpinned by a solid grasp of the programming language’s grammar, are essential.
I think that's really crucial too.  A.I may in some cases appear to be a substitute for the programmer being knowledgeable in a particular field but, it isn't because sooner or later solid knowledge will be necessary to guide it effectively (not to mention recognize situations it did not handle "ideally".)
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

bull370

  • Newbie
  • Posts: 1
Re: Seeking advice on setting up A.I
« Reply #10 on: April 15, 2026, 01:51:17 pm »
What I’ve seen with tools like this is that the biggest difference comes when the AI can actually access the working environment, not just the pasted code snippets.

once it can inspect files,search the project, and keep the thread of what was already tried, it becomes much more useful for debugging and investigation. Still needs steering, though: especially when external tools or platform specific details are involved.

Thaddy

  • Hero Member
  • *****
  • Posts: 19129
  • Glad to be alive.
Re: Seeking advice on setting up A.I
« Reply #11 on: April 15, 2026, 02:06:36 pm »
~30B or less
You mean bytes? Yes, Eliza would fit in that if text is not counted to code  %) %).

Anyway: my experience is that since clipboards exist and I usually ask advice about snippets or theory, the occasional full program, frankly all free are acceptable. Running local can be with some but not many llm's.
And llm's are by definition large.....
Meaning in practise they need to be run from a local server to make any corporate sense. There is no such thing as free beer yet, apart from locally my birthday.
« Last Edit: April 15, 2026, 02:14:11 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

Thausand

  • Hero Member
  • *****
  • Posts: 531
Re: Seeking advice on setting up A.I
« Reply #12 on: April 15, 2026, 03:23:52 pm »
And llm's are by definition large.....
Is depend what is mean large: https://prismml.com/news/bonsai-8b
A docile goblin always follow HERMES.md

gidesa

  • Full Member
  • ***
  • Posts: 242
Re: Seeking advice on setting up A.I
« Reply #13 on: April 15, 2026, 07:02:04 pm »
In my opinion, any LLM with 30 billion parameters or fewer (like Qwen3.5 or Gemini) is useless for programming tasks
That’s what I’ve been able to test locally. I haven’t been able to deploy larger LLMs locally

But maybe someone else has had a different, positive experience with LLMs of ~30B or less

You can think "small" local LLM (8-14b) as very flexible generators of some type: for basic code, for comments, for documentations, etc.
It's always an improvement, and time saving, to generate something from a brief description in human/natural language, instead of
write all by hand.
"Agentic" use, for now, is unusable, yes. But an important cause is that agent programs are optimized for cloud LLM (Claude, etc.),
not for local ones.
I think it's possible to create good agents for local LLM, also in Pascal, of course.

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Seeking advice on setting up A.I
« Reply #14 on: April 17, 2026, 03:36:28 pm »
This is a recommendation with conflict of interest: If you like Pascal with Claude Code or GitHub Copilot or similar, you should give a try to BPSA - https://github.com/joaopauloschuler/beyond-python-smolagents .

If you go for a local model, I also agree that 30B parameters is the minimum.

 

TinyPortal © 2005-2018