Re: [fpc-devel] Changes to TProcess

2024-01-03 Thread Wayne Sherman via fpc-devel
On Wed, Jan 3, 2024 at 5:29 AM Michael Van Canneyt wrote: > I merged a significant evolution of the TProcess component to FPC trunk... > There is now a testsuite for the TProcess command, so everything was tested. A much more flexible TProcess plus tests. Your work is appreciated. Thanks. :-) ___

Re: [fpc-devel] Interesting short article about optimisation

2023-12-02 Thread Wayne Sherman via fpc-devel
On Sat, Nov 25, 2023 at 3:10 PM J. Gareth Moreton wrote: > I just stumbled across this article about micro-architecture-specific > optimisations in ARM: > https://www.phoronix.com/news/ARM64-Linux-No-Uarch-Opts > > They briefly mention x86_64, and I agree it's good to avoid > micro-architecture-spe

Re: [fpc-devel] Record representation clauses

2023-11-13 Thread Wayne Sherman via fpc-devel
On Sun, Nov 12, 2023 at 9:14 PM dave--- wrote: > I am currently working on defining records to describe memory-mapped > registers on the Raspberry Pi's arm/aarch64 processor. It is painful and > brittle to do this in Pascal. Recent versions of Ada/GNAT allow one to > define both field locat

Re: [fpc-devel] fnmatch (linux), where is the external code/symbol located?

2023-10-26 Thread Wayne Sherman via fpc-devel
On Wed, Oct 25, 2023 Alfred wrote: > AFAIK, the GTK fnmatch can be found here: > https://codebrowser.dev/gtk/include/fnmatch.h.html > Additional source-link: > https://gitlab.gnome.org/rburton/gdk-pixbuf/... Ok, I searched again in the official/upstream repo and found the function fnmatch and file

Re: [fpc-devel] fnmatch (linux), where is the external code/symbol located?

2023-10-25 Thread Wayne Sherman via fpc-devel
On Tue, Oct 17, 2023 at 12:32 AM Marco van de Voort wrote: > - Since it has perfectly fine definition in libc, my guess that this is > some old workaround of GTK2 for some defunct version (or multiple > varying prototypes) of fnmatch, something might have been resolved a > decade ago already. > > -

Re: [fpc-devel] x86_64 SHA1 implementation

2023-09-16 Thread Wayne Sherman via fpc-devel
> assembly version of SHA-1 for x86_64 Another example which I thought is beautiful in form and simplicity (I don't know how it compares for performance): https://github.com/nayuki/Nayuki-web-published-code/blob/master/fast-sha1-hash-implementation-in-x86-assembly/sha1-fast-x8664.S ___

Re: [fpc-devel] x86_64 SHA1 implementation

2023-09-16 Thread Wayne Sherman via fpc-devel
> OpenSSL x86 64-bit assembly code > https://github.com/openssl/openssl/blob/master/crypto/sha/asm/sha1-x86_64.pl To generate plain assembly from the OpenSSL perl asm script requires downloading these files to the same folder: https://github.com/openssl/openssl/tree/master/crypto/perlasm _

Re: [fpc-devel] x86_64 SHA1 implementation

2023-09-16 Thread Wayne Sherman via fpc-devel
J. Gareth Moreton via fpc-devel wrote: > So this past week I've been building on Rika's work by adding an > assembly version of SHA-1 for x86_64 to complement Rika's i386 version. > So far I've successfully made a version that runs twice as fast as the > Pascal code. I hoped to go even faster by

Re: [fpc-devel] Division nodes

2023-05-11 Thread Wayne Sherman via fpc-devel
On Thu, May 11, 2023 at 11:42 AM J. Gareth Moreton wrote: > This is the code block in question (ncnv.pas, starting at line 3397) The git "blame" function shows who last made changes: https://gitlab.com/freepascal.org/fpc/source/-/blame/main/compiler/ncnv.pas?page=4#L3396 Most of that code was add

[fpc-devel] Compiler optimization techniques

2023-03-24 Thread Wayne Sherman via fpc-devel
Explaining my fast 6502 code generator "To learn how optimizing compilers are made, I built one targeting the 6502 architecture. In a bizarre twist, my compiler generates faster code than GCC, LLVM, and every other compiler I compared it to..." https://pubby.games/codegen.html

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-17 Thread Wayne Sherman via fpc-devel
On Tue, Jan 17, 2023 at 7:08 AM Wayne Sherman wrote: > A REST class should know how to generate a complete and correct JSON > representation, so there must be a way to distinguish REST properties > from non-REST. Which properties have been modified is not sufficient. Rephrasing that last sentence

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-17 Thread Wayne Sherman via fpc-devel
On Tue, Jan 17, 2023 at 1:23 AM Michael Van Canneyt wrote: > Yes. The reason is the code generator: > > Ideally, every property simply has a unique index specifier. > > But when generating classes, the code generator has no way of knowing how > many properties exist in parent classes, so it must st

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-16 Thread Wayne Sherman via fpc-devel
On Mon, Jan 16, 2023 at 12:16 PM Wayne Sherman wrote: > I need clarification about the auto generated class index > specifiers. Do they always start at 0 in each descendant > class, or are they unique across all descendant classes? > > TBaseObject --> TChild --> TGrandChild > > TChild = class(TBas

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-16 Thread Wayne Sherman via fpc-devel
On Sun, Jan 15, 2023 at 9:28 PM Michael Van Canneyt wrote: > On Sun, 15 Jan 2023, Wayne Sherman wrote: > > On Sun, Jan 15, 2023 at 9:24 AM Michael Van Canneyt wrote: > >> On Sat, 14 Jan 2023, Wayne Sherman wrote: > >> > >>> I see a couple of problems TBaseObject.SaveToJSON > >>> > >>> 1) TBaseObjec

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-15 Thread Wayne Sherman via fpc-devel
On Sun, Jan 15, 2023 at 9:24 AM Michael Van Canneyt wrote: > On Sat, 14 Jan 2023, Wayne Sherman wrote: > > > I see a couple of problems TBaseObject.SaveToJSON > > > > 1) TBaseObject.SaveToJSON cannot distinguish properties that are part > > of the REST protocol from properties that are not part of

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-14 Thread Wayne Sherman via fpc-devel
I see a couple of problems TBaseObject.SaveToJSON 1) TBaseObject.SaveToJSON cannot distinguish properties that are part of the REST protocol from properties that are not part of it. It only knows that properties which have been modified are part of the rest protocol, but properties which have not

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-14 Thread Wayne Sherman via fpc-devel
Michael wrote: > >> Because there may be other published properties that are not part of the > >> REST protocol. You may for instance decide to add published properties to a > >> base class that describe where to save the object in a local database. Wayne wrote: > > Ok, that clears up that. If I

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-14 Thread Wayne Sherman via fpc-devel
On Sat, Jan 14, 2023 at 12:36 PM Michael Van Canneyt wrote: > On Sat, 14 Jan 2023, Wayne Sherman wrote: > > On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote: > >> On Sat, 14 Jan 2023, Wayne Sherman wrote: > >>> 2) Doesn't each object already have the parent properties included in > >>> it

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-14 Thread Wayne Sherman via fpc-devel
On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote: > On Sat, 14 Jan 2023, Wayne Sherman wrote: > > 3) Why does MarkPropertyChanged offset the index and > > IsPropertyModified does not take the offset into account? > > They should be the same. I don't remember why I created the two methods

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-14 Thread Wayne Sherman via fpc-devel
On Sat, Jan 14, 2023 at 10:34 AM Michael Van Canneyt wrote: > On Sat, 14 Jan 2023, Wayne Sherman wrote: > > 2) Doesn't each object already have the parent properties included in > > its own properties by inheritance? > > Why this question ? > An object does not know the property count of the parent

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-14 Thread Wayne Sherman via fpc-devel
On Fri, Jan 13, 2023 at 11:48 PM Michael Van Canneyt wrote: > Markpropertychanged is called in the setter of the properties generated by > the code generator: Check all generated units. Thanks for your explanations, it is getting more clear how modified property tracking is being used. More clari

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-13 Thread Wayne Sherman via fpc-devel
Is there a better way to track changed TBaseObject properties (and get rid of property index declarations)? Lazarus knows which properties on a form have been changed from their default value and only properties which do not match the default are saved in the lfm file. Can the same thing be used

Re: [fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-13 Thread Wayne Sherman via fpc-devel
Some related misunderstandings: 1) When StopRecordPropertyChanges is called it destroys all the change records (stored in TBits) in which case SaveToJSON saves ALL the properties even if they were not loaded or modified previously. 2) Nothing in restbase.pp or TBaseObject calls MarkPropertyChange

[fpc-devel] restbase.pp LoadFromJSON calling StopRecordPropertyChanges;

2023-01-13 Thread Wayne Sherman via fpc-devel
I am trying to check the googleapiconv "TGoogleRestDescription" object contents (which is descended from restbase TBaseObject) by using "SaveToJSON". But it always saves an empty object, even when the properties have values assigned to them (via LoadFromJSON). https://gitlab.com/freepascal.org/fp

[fpc-devel] googleapiconv issues

2023-01-05 Thread Wayne Sherman via fpc-devel
The google api binding generator "googleapiconv" is generating empty files for the api pascal bindings and it also causes access violations randomly. I have not found the issue with AVs yet, but I found out why it is creating empty source code files. restcodegen.pp TRestCodeGenerator was refactor

Re: [fpc-devel] Make file questions (Makefile.fpc, fpmake.pp, etc)

2023-01-03 Thread Wayne Sherman via fpc-devel
On Tue, Jan 3, 2023 at 12:17 AM Sven Barth wrote: >> 1) How do I generate the fpmake.pp file? Or is it created by manual coding? > > This is created manually and is *the* source for how to build a package. > >> 2) Does "Makefile" automatically get generated during a build or do I >> have to manual

[fpc-devel] Make file questions (Makefile.fpc, fpmake.pp, etc)

2023-01-02 Thread Wayne Sherman via fpc-devel
Each package directory (./fpc-source/packages/some-package/) typically has these files: fpmake.pp (where does this come from?) Makefile (this is generated by FPCMake?) Makefile.fpc (config file for FPCMake to create Makefile?) Some package directories also have: Makefile.fpc.fpcmake

Re: [fpc-devel] Incompatible assignments but no compile error (char array and shortstring)

2022-04-16 Thread Wayne Sherman via fpc-devel
. On Sat, Apr 16, 2022 at 2:24 PM J. Gareth Moreton via fpc-devel wrote: > > It does look like a bug on the surface. What happens if you run the > program with these false negatives? If you get a buffer overrun, then > it is pretty serious. > > Gareth aka. Kit > > On 1

[fpc-devel] Incompatible assignments but no compile error (char array and shortstring)

2022-04-16 Thread Wayne Sherman via fpc-devel
Tested with fpc 3.3.1 trunk (as of 2022-Mar-12) and 3.2.2 stable. Ubuntu 20.04 64-bit Good compile time error checking is one of the wonderful things about Pascal. But some char array and shortstring assignments which are not size compatible do not produce a compile error as expected. Please see

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2022-03-14 Thread Wayne Sherman via fpc-devel
On Mon, May 10, 2021 at 7:08 PM Wayne Sherman wrote: > The Google API supports the following signing algorithms: > https://cloud.google.com/iot/docs/how-tos/credentials/jwts > >JWT RS256 (RSASSA-PKCS1-v1_5 using SHA-256 RFC 7518 sec 3.3). This > is expressed as RS256 in the alg field in the JWT

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2022-03-14 Thread Wayne Sherman via fpc-devel
On Mon, Mar 14, 2022 at 3:45 AM Michael Van Canneyt wrote: > Yes. I would still like to see if we can integrate the OAuth of the google > API and > the JWT signing more closely, possibly through some extra classes. The paint is still wet on the JWT signing code, so I figured there was some more

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2022-03-13 Thread Wayne Sherman via fpc-devel
On Tue, Jun 30, 2020 at 12:47 AM Michael Van Canneyt wrote: > > The problem with the service account is that you must create a JWT Token. > FPC does not yet have a unit that can generate *and sign* a JWT Token. I had a little time this weekend and started looking into this again. I was happy to d

[fpc-devel] Missing bootstrap compilers and feature request

2021-11-01 Thread Wayne Sherman via fpc-devel
Most stand alone compilers for bootstrapping a new system are missing from recent releases: ftp://ftp.freepascal.org/pub/fpc/dist/3.0.4/bootstrap/ [has 7 bootstrap compilers] ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/bootstrap/ [has 2 bootstrap compilers] ftp://ftp.freepascal.org/pub/

[fpc-devel] How does FPC perform in the FASTEST Computer Language Race

2021-07-09 Thread Wayne Sherman via fpc-devel
If you are a speed geek, you will probably be interested in this. What is the FASTEST Computer Language? 45 Languages Tested! (E01) https://www.youtube.com/watch?v=tQtFdsEcK_s Current standings at the time of this video Iterations per sec: Ada: 67 Pascal: 143 Fastest language: 7301 Slowest langu

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2021-05-10 Thread Wayne Sherman via fpc-devel
On Tue, Jun 30, 2020 at 12:47 AM Michael Van Canneyt wrote: > > The problem with the service account is that you must create a JWT Token. > FPC does not yet have a unit that can generate *and sign* a JWT Token. > > The good news is I have this weekend a reminder that I received some code > that wi

[fpc-devel] Google API service acct and JWT

2020-10-20 Thread Wayne Sherman via fpc-devel
Michael Van Canneyt, there is a discussion about using fphttpclient with Google API service account on the forums: https://forum.lazarus.freepascal.org/index.php/topic,51478.0.html The last post has a code example of signing a JWT: https://forum.lazarus.freepascal.org/index.php/topic,51478.msg3814

Re: [fpc-devel] OpenSSL v1.1.x DLL loading / Bug 37137

2020-09-28 Thread Wayne Sherman via fpc-devel
On Mon, Sep 28, 2020 at 6:34 AM Michael Van Canneyt wrote: > I made some time for this, it's checked in with revision 46987. > > Thank you for your patch, and I'm sorry that it took me so long to get to > it... No worries, thank you so much for your work on this. Much appreciated. :-) _

Re: [fpc-devel] OpenSSL v1.1.x DLL loading / Bug 37137

2020-09-11 Thread Wayne Sherman via fpc-devel
On Tue, Jun 30, 2020 at 12:38 AM Michael Van Canneyt wrote: > > On Tue, 30 Jun 2020, Wayne Sherman via fpc-devel wrote: > > > OpenSSL library loading fixes. Patch file is attached. Comments are > > welcome. > > > > Summary: > > 1) For Windows and O

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2020-06-30 Thread Wayne Sherman via fpc-devel
On Tue, Jun 30, 2020 at 1:36 AM Michael Van Canneyt wrote: > > I know. But we can't include Synopse in FPC. Can just the JWT/crypto portions be incorporated if it makes sense? It is released under these Open Source licenses: Mozilla Public License, version 1.1 or later (MPL); GNU General P

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2020-06-30 Thread Wayne Sherman via fpc-devel
On Tue, Jun 30, 2020 at 12:47 AM Michael Van Canneyt wrote: > The problem with the service account is that you must create a JWT Token. > FPC does not yet have a unit that can generate *and sign* a JWT Token. > > The good news is I have this weekend a reminder that I received some code > that will

Re: [fpc-devel] OpenSSL v1.1.x DLL loading / Bug 37137

2020-06-30 Thread Wayne Sherman via fpc-devel
OpenSSL library loading fixes. Patch file is attached. Comments are welcome. Summary: 1) For Windows and OS2, remove DLLSSLNameX and DLLUtilNameX variables. Instead use matched arrays of DLL filenames (SSL_DLL_Names and Crypto_DLL_Names) 2) Due to refactoring, remove LoadLibHack or Load

Re: [fpc-devel] Google APIs - Authenticate using a service account?

2020-06-26 Thread Wayne Sherman via fpc-devel
On Fri, Jun 26, 2020 at 6:27 PM Wayne Sherman wrote: > > Is there support in the fpc google api units for authenticating as a > service account? Also for reference, here is a sample G Suite Service OAuth2 json file (with made up keys and IDs). After configuring a service account, this file can b

[fpc-devel] Google APIs - Authenticate using a service account?

2020-06-26 Thread Wayne Sherman via fpc-devel
Is there support in the fpc google api units for authenticating as a service account? Background: Service accounts allow an application to interact with Google APIs without authenticating as a specific user. Instead a service account is created with it's own credentials, ID, and key. By authenti

[fpc-devel] OpenSSL v1.1.x DLL loading / Bug 37137

2020-06-25 Thread Wayne Sherman via fpc-devel
*Bug Reference:* "OpenSSL v1.1.1 could not loaded on Windows platform" https://bugs.freepascal.org/view.php?id=37137 1) I can confirm that the new v1.1.x DLL names are correct. I also checked some of the builds linked from the OpenSSL binary's page. The OpenSSL commit that discusses the name cha