Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-11

New Feature: "Management Operators"

9 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

African Wild Dog

Hello,

I saw on the bug tracker a patch submission by Maciej Izak about the feature "Management Operators".

This feature is related to Automatic Reference Counting?

Regards

Reply by email

Maciej Izak
to African Wild Dog

2016-11-07 22:24 GMT+01:00 African Wild Dog :

Show quoted text 6 lines
I saw on the bug tracker a patch submission by Maciej Izak about the feature "Management Operators". This feature is related to Automatic Reference Counting?

Yes. We have a working ARC objects (not official yet, very raw form without "compiler magic", but fully functionally/compilable without any regressions) with http://newpascal.org latest release:

https://github.com/maciej-izak/PascalSmartPointers/blob/ master/examples/SmartObj01.pas
https://github.com/maciej-izak/PascalSmartPointers/blob/ master/sources/SmartObj.pas

anyway probably I have no motivation anymore to continuing my work.

Best regards, Maciej Izak

Reply by email

Lars
to Maciej Izak: 2016-11-07 22:24 GMT+01:00 African Wild Dog : Yes. We have a working ARC objects (not…
Maciej Izak wrote 12 lines
2016-11-07 22:24 GMT+01:00 African Wild Dog : > > I saw on the bug tracker a patch submission by Maciej Izak about the > feature "Management Operators". > > This feature is related to Automatic Reference Counting? > > Yes. We have a working ARC objects

Can someone briefly explain what this means for code?

Is this related to garbage collected heap allocated objects and similar, without using a garbage collector but using reference counting?

Sorry if I am way off base, I just have no idea what it is...

Reply by email

denisgolovan
to Lars

Yes. Mostly.

More general advantage is that this feature might finally bring FreePascal back into league of languages having nice support for value types (as opposed to OOP atrocities). To put it in other words, functional style might become both feasible and sufficiently fast in FreePascal.

IMHO, that is one of the most valuable additions to the language in years.

BR,
Denis

09.11.2016, 08:29, "Lars" :

Show quoted text 19 lines
On Tue, November 8, 2016 1:47 am, Maciej Izak wrote: >  2016-11-07 22:24 GMT+01:00 African Wild Dog : > >>  I saw on the bug tracker a patch submission by Maciej Izak about the >>  feature "Management Operators". >> >>  This feature is related to Automatic Reference Counting? > >  Yes. We have a working ARC objects Can someone briefly explain what this means for code? Is this related to garbage collected heap allocated objects and similar, without using a garbage collector but using reference counting? Sorry if I am way off base, I just have no idea what it is... _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Regards, Denis Golovan

Reply by email

leledumbo
to Maciej Izak: 2016-11-07 22:24 GMT+01:00 African Wild Dog : Yes. We have a working ARC objects (not…
anyway probably I have no motivation anymore to continuing my work.

Too bad, if only at least the patch for this feature is integrated, I can start arguing to my employer again that Pascal has simple, user selectable garbage collection mechanism. I really wanna know who's the person that you mention in your g+ post.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/New-Feature-Management-Operators-tp5726782p5726814.html Sent from the Free Pascal - General mailing list .

Reply by email

Lars
to denisgolovan: Yes. Mostly. More general advantage is that this feature might finally bring FreePascal…
denisgolovan wrote 16 lines
Yes. Mostly. More general advantage is that this feature might finally bring FreePascal back into league of languages having nice support for value types (as opposed to OOP atrocities). To put it in other words, functional style might become both feasible and sufficiently fast in FreePascal. IMHO, that is one of the most valuable additions to the language in years. BR, Denis

Does this remove the amount of "object.free" code seen all over the place?

I.e. is the intent to have something like an "auto" freed object, discussed long ago on the fpc list, literally many years ago... but I remember Michael V. C. saying something about it having some difficulties and road blocks for being implemented for reasons I cannot remember.

I do find the biggest disadvantage of delphi/fpc code, to be all the "Free" and creates scattered throughout code, which has nothing or little to do with the logic of the application and is just code bloat (takes up editor space, adds not much useful, similar to the allocations required in C programs to work with strings instead of it being automatic).

Reply by email

Lars
to leledumbo: Too bad, if only at least the patch for this feature is integrated, I can start arguing…
leledumbo wrote 8 lines
> anyway probably I have no motivation anymore to continuing my work. Too bad, if only at least the patch for this feature is integrated, I can start arguing to my employer again that Pascal has simple, user selectable garbage collection mechanism. I really wanna know who's the person that you mention in your g+ post.

FPC will have the garbage collection, but the question remains what happens in Delphi? Would delphi create a similar feature, but make it incompatible with fpc? Once again we arrive at the issue of standardization not being pascal's main advantage.... This will be an fpc extension only?

Would be interesting to see if Embarcadero has even heard of such an idea or plans to implement it (or already has something like it?). Would be good to bring it up with them if not already, as many fpc users are also delphi users. If a fpc user gets used to writing code a certain way in fpc, it would be hard to port all that code to delphi.

Reply by email

leledumbo
to Lars
FPC will have the garbage collection, but the question remains what happens

in Delphi?

None of my concern actually. It's a simple unit without compiler magic (but requires compiler support for the operator syntax).

Would delphi create a similar feature, but make it incompatible with fpc?

AFAIK their NextGen compiler already has similar feature, with compiler magic under the hood.

Once again we arrive at the issue of standardization not being pascal's main advantage.... This will be an fpc extension only?

With it being a unit, I think so. Just like a bunch of existing units that Delphi doesn't have.

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/New-Feature-Management-Operators-tp5726782p5726831.html Sent from the Free Pascal - General mailing list .

Reply by email