Recent

Author Topic: Can /my/ AI help me with pascal coding?  (Read 5120 times)

MathMan

  • Hero Member
  • *****
  • Posts: 501
Re: Can /my/ AI help me with pascal coding?
« Reply #15 on: April 12, 2026, 07:33:14 am »
The pascal based core-math implementation has started: https://github.com/joaopauloschuler/pas-core-math

This is the status: https://github.com/joaopauloschuler/pas-core-math/blob/main/tasklist.md

I will need help to validate this benchmark: https://github.com/joaopauloschuler/pas-core-math/blob/main/src/tests/BenchmarkFPC.pas

Treat it as a “work in progress”. It may contain bugs and incorrect benchmarking.

It runs well on the free account of GitHub codespace.

I only had a cursory look at it so far. Going through this will take some time, for me mere human  :)

I'm impressed by some of the speedups reported - I had expected speedups, but lower actually.

By "need help to validate the benchmark" you mean running it on different machines, or actually take a deep look at the implementation? If former it would be good to know on which hardware it was run so far.

By "it runs well ..." you mean it can be compiled and executed, or it passed the test? <= no longer relevant, I just read through 'tasklist.md'
« Last Edit: April 12, 2026, 09:02:57 am by MathMan »

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Can /my/ AI help me with pascal coding?
« Reply #16 on: April 19, 2026, 01:48:50 am »
@domaz,
Quote
1) ZSTD - it would be nice to have a fast compressor in pure Pascal:
https://github.com/facebook/zstd

What about https://github.com/DenisAnisimov/ZSTD.pas ?

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Can /my/ AI help me with pascal coding?
« Reply #17 on: April 19, 2026, 03:27:59 am »
@domaz,
Quote
2) BZ2 - it's the last popular compressor we don't have in pure Pascal. We have a decompressor but not compressor.
https://github.com/libarchive/bzip2

I have not properly tested:
https://github.com/joaopauloschuler/pas-bzip2

domasz

  • Hero Member
  • *****
  • Posts: 629
Re: Can /my/ AI help me with pascal coding?
« Reply #18 on: April 19, 2026, 07:23:35 am »
What about https://github.com/DenisAnisimov/ZSTD.pas ?
This is just a wrapper around a DLL but don't do ZSTD. I found one and I'm testing it. Looks fine so far.

I have not properly tested:
https://github.com/joaopauloschuler/pas-bzip2
Thank you! Works great!


How about some multimedia? Like mp3 encoder?
https://lame.sourceforge.io/
Or maybe webp?
https://github.com/webmproject/libwebp/
Or maybe something AI, your specialty?
https://github.com/Tencent/ncnn/

Generally speaking we, Pascalers, need a lot of DLLs to do many advanced things because the libraries are written in C/C++. And DLLs are a problem because FPC can compile to 32 bit, 64 bit, Windows, Linux, MacOS and each of these would require a new DLL.
« Last Edit: April 21, 2026, 01:27:22 am by domasz »

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Can /my/ AI help me with pascal coding?
« Reply #19 on: April 22, 2026, 03:47:39 pm »
Making a list of suggestions so far:
* mathman: core-math 32 bits (coded and tested on X86_64) -> https://github.com/joaopauloschuler/pas-core-math
* mathman: core-math 64 bits (coded)
* domaz: bzip2 (coded - not tested) -> https://github.com/joaopauloschuler/pas-bzip2
* cdbc: Sqlite3 (in progress) -> https://github.com/joaopauloschuler/pas-sqlite3
* domaz: https://lame.sourceforge.io/
* domaz: https://github.com/webmproject/libwebp/
* domaz: https://github.com/Tencent/ncnn/

Any other suggestions?
« Last Edit: April 28, 2026, 04:40:10 pm by schuler »

domasz

  • Hero Member
  • *****
  • Posts: 629
Re: Can /my/ AI help me with pascal coding?
« Reply #20 on: April 23, 2026, 09:39:46 am »
+1 vote for Sqlite3


schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Can /my/ AI help me with pascal coding?
« Reply #21 on: April 28, 2026, 01:34:22 pm »
« Last Edit: April 28, 2026, 01:36:29 pm by schuler »

440bx

  • Hero Member
  • *****
  • Posts: 6472
Re: Can /my/ AI help me with pascal coding?
« Reply #22 on: April 28, 2026, 04:23:59 pm »
Any other suggestions?
I would love to see the Zydis dis-assembler ported to Pascal.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

domasz

  • Hero Member
  • *****
  • Posts: 629
Re: Can /my/ AI help me with pascal coding?
« Reply #23 on: April 28, 2026, 07:38:16 pm »
:) pas-sqlite3 coding has started: :)

Great, thanks!

Just translate the whole Github to Pascal ;)

cdbc

  • Hero Member
  • *****
  • Posts: 2772
    • http://www.cdbc.dk
Re: Can /my/ AI help me with pascal coding?
« Reply #24 on: April 28, 2026, 07:48:52 pm »
Hi Joao
Wow, how COOL is that then, I've just downloaded a snapshot for testing \o/\ö/\o/
Great work mate and thanks from me too  8)
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

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Can /my/ AI help me with pascal coding?
« Reply #25 on: April 29, 2026, 11:04:45 am »
@cdbc,
Quote
I've just downloaded a snapshot for testing

It is too early for testing. AI is still coding.

You've read my mind: I was thinking that I will need help with testing... Many thanks!
« Last Edit: April 29, 2026, 04:02:47 pm by schuler »

Thaddy

  • Hero Member
  • *****
  • Posts: 19129
  • Glad to be alive.
Re: Can /my/ AI help me with pascal coding?
« Reply #26 on: April 29, 2026, 11:11:38 am »
@schuler

Let A.I code windows compatibility too...
(passqlite3os)
BTW: this should not be necessary since FPC has opaque functions for that in system? I mean fpopen and consorts..., really? (system.assign, system.rewrite, system.reset, system.close, system.flush) fpopen and family are one level too deep and is taken care of in system? Maybe the model did not see that  :) :D O:-)

It should also see the filemode properly, so filemode :=2 means it also works open read/write, no reset for reading.
(Or have I just defeated this particular A.I. system?)

It is probably just a definition issue, rules feeding.
Sqlite3 should compile cleanly without platform specifics, that is how it is designed. It would be nice if the Pascal version adheres to that.

At first sight I can't flaw the rest of the code. (early days)

Regards, Joao,

Thaddy
« Last Edit: April 29, 2026, 11:35:30 am by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Can /my/ AI help me with pascal coding?
« Reply #27 on: April 30, 2026, 09:58:48 pm »
Quote
Or have I just defeated this particular A.I. system?

Probably ...  :)

I'll eventually FUP the other topics.

440bx

  • Hero Member
  • *****
  • Posts: 6472
Re: Can /my/ AI help me with pascal coding?
« Reply #28 on: April 30, 2026, 11:12:20 pm »
@schuler,

Since you asked for suggestions, here are a couple more,

Port QBE (Quick Back End) and PCL (Portable Code Language) to FPC. 

Ports of these could be used to add reasonably good optimizations to FPC as well as enable the compiler to produce both, DWARF and PDB debugging symbols (what PCL produces.)

It would be rather nice to have those back ends available for FPC, among other things it would also open the door to using FPC as a compiler development tool.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

schuler

  • Sr. Member
  • ****
  • Posts: 336
Re: Can /my/ AI help me with pascal coding?
« Reply #29 on: May 03, 2026, 01:35:00 am »
@440bx,
Quote
Port QBE (Quick Back End) and PCL (Portable Code Language) to FPC.
I will give consideration to it.

Wondering what are the URLs?
* https://c9x.me/compile/
* PCL?

 

TinyPortal © 2005-2018