Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ryan Joseph via fpc-pascal
> On Feb 16, 2021, at 3:35 PM, Benito van der Zander via fpc-pascal > wrote: > > But it is not calling the method, it is calling the wrapper function what you say wrapper function do you mean the ref counting functions when you pass around the interface? I guess for ref counting you're supp

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ryan Joseph via fpc-pascal
> On Feb 16, 2021, at 2:43 PM, Sven Barth via fpc-pascal > wrote: > > FPC currently does not yet support class types not to mention records and > objects which is what I had mentioned earlier already. Yes I see this on https://freepascal.org/docs-html/ref/refse47.html. Why isn't this suppor

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Benito van der Zander via fpc-pascal
Hi, And there often is a lot of unintentional deep copying. This is also why a property returning a record is fairly useless except for extremely small records like TPoint (and even that is not optimal no But a managed record to replace an interface, would only contain a single pointer/cla

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Benito van der Zander via fpc-pascal schrieb am Di., 16. Feb. 2021, 23:35: > Interfaces are not slow because they are are interfaces! When you call a > interface method it has the same costs as a virtual method call! And the > cost for reference counting that interfaces have right now would be th

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Benito van der Zander via fpc-pascal
Hi, If you need to create 1000 class instances each frame then you have a flaw in your logic in my opinion. I have more like a million class instances For my XPath stuff, and every returned value is put in a variant-like class. Selecting all nodes on an GB large XML, could even create almos

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Am 16.02.2021 um 19:53 schrieb Ryan Joseph via fpc-pascal: On Feb 16, 2021, at 11:44 AM, Sven Barth wrote: I wasn't saying anything that contradicts this, only that the original mechanism of the delegation will be available even with the default modifier and this mechanism will in fact be n

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Marco van de Voort via fpc-pascal
Op 2021-02-16 om 21:33 schreef Ryan Joseph via fpc-pascal: On Feb 16, 2021, at 1:27 PM, Marco van de Voort via fpc-pascal wrote: And there often is a lot of unintentional deep copying. This is also why a property returning a record is fairly useless except for extremely small records like

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ryan Joseph via fpc-pascal
> On Feb 16, 2021, at 1:27 PM, Marco van de Voort via fpc-pascal > wrote: > > And there often is a lot of unintentional deep copying. This is also why a > property returning a record is fairly useless except for extremely small > records like TPoint (and even that is not optimal no deep cop

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Marco van de Voort via fpc-pascal
Op 2021-02-16 om 19:21 schreef Ryan Joseph via fpc-pascal: Interfaces are extremely slow. Virtual method calls are also slow. I have been using interfaces for reference counting, and have been thinking to replace it all with managed records because they are so slow (unfortunately records can

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ralf Quint via fpc-pascal
On 2/16/2021 10:48 AM, Sven Barth via fpc-pascal wrote: Ryan Joseph via fpc-pascal > schrieb am Di., 16. Feb. 2021, 19:21: > > There we have: > > * slower creation of the class, because each implemented interface adds another VMT refer

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ryan Joseph via fpc-pascal
> On Feb 16, 2021, at 11:48 AM, Sven Barth wrote: > > If you need to create 1000 class instances each frame then you have a flaw in > your logic in my opinion. > You can reuse classes and reset fields but getting a new piece of memory could be faster. These things do happen and adding on c

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ryan Joseph via fpc-pascal
> On Feb 16, 2021, at 11:44 AM, Sven Barth wrote: > > I wasn't saying anything that contradicts this, only that the original > mechanism of the delegation will be available even with the default modifier > and this mechanism will in fact be necessary to access them through RTTI. > Can you

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 16. Feb. 2021, 19:21: > > > > There we have: > > > > * slower creation of the class, because each implemented interface adds > another VMT reference to the class which needs to be initialized. > > How bad is this? We need to make a test case we can profi

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 16. Feb. 2021, 19:22: > > > > On Feb 15, 2021, at 11:41 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Again, the point of the interface would be to control which methods and > properties of the delegated type would be

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ryan Joseph via fpc-pascal
> On Feb 16, 2021, at 6:51 AM, Benito van der Zander via fpc-pascal > wrote: > > Interfaces are extremely slow. Virtual method calls are also slow. I have > been using interfaces for reference counting, and have been thinking to > replace it all with managed records because they are so slow

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Ryan Joseph via fpc-pascal
> On Feb 15, 2021, at 11:41 PM, Sven Barth via fpc-pascal > wrote: > > Again, the point of the interface would be to control which methods and > properties of the delegated type would be available. Also it would allow for > seamless integration with the RTTI as it's possible to query the im

Re: [fpc-pascal] Traits Proposal

2021-02-16 Thread Benito van der Zander via fpc-pascal
There are no significant performance implications of interfaces. They're essentially a virtual method call, something that one is doing all day long with Object Pascal classes. Interfaces are extremely slow. Virtual method calls are also slow. I have been using interfaces for reference c

Re: [fpc-pascal] compiling on command line linux

2021-02-16 Thread duilio foschi via fpc-pascal
very good. I created the new directories ./synapse and ./lazutils in /usr/lib/fpc/3.2.0/units/x86_64-linux It worked like a charm. It seems that all the units in that directory are searched by default. Thank you Duilio On Tue, Feb 16, 2021 at 7:29 AM Sven Barth wrote: > Am 15.02.2021 u