[fpc-devel] Small virtual machine to cross compile FPC

2014-10-27 Thread Paul Breneman
I've spent a bit of time during the past 7 years trying to figure out how to simplify things by avoiding cross-compiling. This page has many of the details: http://turbocontrol.com/monitor.htm I think there is a way to simplify cross-compiling. Levinux is a small (~20 MB) QEMU download for

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
Well... we may differ on this one. I absolutely love attributes, but I guess that is just me :-D . I think attributes are the greatest thing that has happened to Delphi ever, I just wish they ware not so limited. Attributes allowed us to cut 3/4 of our code base. You can't beat that easily. Wi

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 21:01, schrieb Boian Mitov: Hi Sven, Great work! I think it will be better if the weak is attribute as done in Delphi. Attributes eliminate the need for introducing new keywords, to the already crowded OP keywords space. Indeed week is a real attribute of a variable, and it makes

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 21:00, schrieb Hans-Peter Diettrich: Sven Barth schrieb: Am 27.10.2014 17:20 schrieb "Hans-Peter Diettrich" mailto:drdiettri...@aol.com>>: > Something like ShortString and AnsiString? With the difference that Short- and AnsiString are assignable to eachother while Jonas does

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 21:06, schrieb Marco van de Voort: - TObject and all descendants are reference counted (please no size and performance discussion here) No they are not. Of course they are not. That would be stupid. Sorry, I don't get what you're trying to say here. Would you please elaborate?

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 20:49, schrieb Hans-Peter Diettrich: Kostas Michalopoulos schrieb: On Mon, Oct 27, 2014 at 5:17 PM, Hans-Peter Diettrich mailto:drdiettri...@aol.com>> wrote: Then the compiler can safely generate refcounting code for *all* objects and non-weak references, and the counting

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 21:10, schrieb Boian Mitov: I second this. I would surely love to test drive it. I am also sure we will gather valuable experience from testing it. Then simply use my branch. That's what it's there for. This won't be in trunk for quite some time and the less people test it in the b

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 21:32, schrieb Boian Mitov: As for 2. this is example where attribute could have helped ;-) . Just another argument in favor of attributes vs. new keywords ;-) . No. It would not. Lazarus doesn't know attributes either. Despite that I /hate/ that attribute syntax. Regards, Sven _

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
In general the C/C++ notion of doing as little in the language as possible, and as much in library has worked very well for it over the years. Yes, pluggable languages concept has existed at least since C ;-) . I agree, and as I said has worked well. I think OP can learn a lot from those language

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
Actually Ref. Counting may reduce memory usage, as in reality it will require less code. It will eliminate a large number of destructors, and in many cases a lot of if statements etc. I am speaking of personal experience since we introduced [AutoManage] attribute in our libraries, and it reduced

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Marco van de Voort
In our previous episode, Boian Mitov said: > Well... since attributes can be implemented in compiler extending library, And tell me again why directives couldn't? A switch or whatever trigger could also plug additional directives into the parser. (and then I'm not even discussing the actual use o

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Florian Klämpfl
Am 27.10.2014 um 19:59 schrieb Sven Barth: >> >> No problem with all that, interesting ideas even, but not with the current >> codebase and RTL. > Florian has written me an idea two weeks ago regarding the "backwards > compatibility" aspect (I won't > argue the performance impact one ;) ): > - TO

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
Well... since attributes can be implemented in compiler extending library, then attributes can be enabled/disabled just by adding a unit ;-) . That can't be said for new keywords. I think library extension of the compiler is a better option that having a bunch of switch directives. This also al

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Hans-Peter Diettrich
Sven Barth schrieb: A semicolon has the problem that you need to distinguish between it being a modifier and a normal following identifier as not every keyword is a keyword in every context (like for example "read" and "write" for properties). In this discussion I almost miss the elementary

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Hans-Peter Diettrich
Kostas Michalopoulos schrieb: On Mon, Oct 27, 2014 at 5:17 PM, Hans-Peter Diettrich mailto:drdiettri...@aol.com>> wrote: Then the compiler can safely generate refcounting code for *all* objects and non-weak references, and the counting methods take care of required operations Woul

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Hans-Peter Diettrich
Sven Barth schrieb: Am 27.10.2014 17:20 schrieb "Hans-Peter Diettrich" >: > Something like ShortString and AnsiString? With the difference that Short- and AnsiString are assignable to eachother while Jonas does not want that for reference counted and ordinary cl

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Marco van de Voort
In our previous episode, Boian Mitov said: > Except attributes can't be confused with variables ;-). The variables can't be confused with attributes. Attributes are only useful in addition to an established languages, and as extensions/implementation specific parts (so that the simpler parsers ca

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
As for 2. this is example where attribute could have helped ;-) . Just another argument in favor of attributes vs. new keywords ;-) . With best regards, Boian Mitov --- Mitov Software www.mitov.com --

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > >> scratch, or was it initially based on something like the P6 compiler > >> which I believe was on some DEC systems? > > > > The page he referenced lists extensions to both standard and extended > > pascal. So it seems it is an extended pascal c

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
Except attributes can't be confused with variables ;-). And the other benefit I did not mentioned earlier, a lot of the attributes (if not all) can actually be implemented as compiler extending libraries ;-) . With best regards, Boian Mitov

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Mark Morgan Lloyd
Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said: I see from your reference that the compiler extends ANSI/ISO Pascal, but there's no indication of whether, when it was written, it was based on Jensen & Wirth or the somewhat later ISO standard. Was it written from scra

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Marco van de Voort
In our previous episode, Boian Mitov said: > I think that we should start considering using attributes instead of > introducing new keywords. > This should reduce the compatibility issues due to the new keywords, keep > the language cleaner IMHO. No, they just move the potential conflicts from m

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
I think that we should start considering using attributes instead of introducing new keywords. This should reduce the compatibility issues due to the new keywords, keep the language cleaner IMHO . There are other benefits of doing it with attributes, but they are subject of another discussion ;-

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
I second this. I would surely love to test drive it. I am also sure we will gather valuable experience from testing it. With best regards, Boian Mitov --- Mitov Software www.mitov.com --- ---

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
I second that. This is definitely a variable not a type modifier. The variable is the one that is weak. With best regards, Boian Mitov --- Mitov Software www.mitov.com --- -Original Messa

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Marco van de Voort
In our previous episode, Sven Barth said: > Florian has written me an idea two weeks ago regarding the "backwards > compatibility" aspect (I won't argue the performance impact one ;) ): Let's not christen this a step forward. So talking about backwards is premature :-) > - TObject and all descen

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Boian Mitov
Hi Sven, Great work! I think it will be better if the weak is attribute as done in Delphi. Attributes eliminate the need for introducing new keywords, to the already crowded OP keywords space. Indeed week is a real attribute of a variable, and it makes more sense to be in attribute form. I am

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > I see from your reference that the compiler extends ANSI/ISO Pascal, but > there's no indication of whether, when it was written, it was based on > Jensen & Wirth or the somewhat later ISO standard. Was it written from > scratch, or was it initi

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 19:24, schrieb Michael Van Canneyt: On Mon, 27 Oct 2014, Sven Barth wrote: Am 27.10.2014 17:20 schrieb "Hans-Peter Diettrich" : > > Jonas Maebe schrieb: > > >> Additionally, as mentioned before, I still believe it's a very bad idea to be able to inherited from a regular clas

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 16:23, schrieb Sven Barth: Am 27.10.2014 14:54 schrieb "hinsta...@yandex.ru " >: > > I tested it a bit; thoughts so far: > 1. generic and refcounted do not work well together: no matter how I arrange it, a class can't be bo

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Sven Barth
Am 27.10.2014 18:35, schrieb Mark Morgan Lloyd: Richard Apthorp wrote: Hi Sven, Actually found that HP have a documented list: http://h71000.www7.hp.com/doc/82final/6083/6083pro_032.html#extensions_app I'm not sure I feel qualified to change the compiler but as I work on this porting project

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Van Canneyt
On Mon, 27 Oct 2014, Sven Barth wrote: Am 27.10.2014 17:20 schrieb "Hans-Peter Diettrich" : > > Jonas Maebe schrieb: > > >> Additionally, as mentioned before, I still believe it's a very bad idea to be able to inherited from a regular class and turn it into a reference counted class. Refere

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Mark Morgan Lloyd
Richard Apthorp wrote: Hi Sven, Actually found that HP have a documented list: http://h71000.www7.hp.com/doc/82final/6083/6083pro_032.html#extensions_app I'm not sure I feel qualified to change the compiler but as I work on this porting project I will be creating a list of the main changes whic

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 17:20 schrieb "Hans-Peter Diettrich" : > > Jonas Maebe schrieb: > > >> Additionally, as mentioned before, I still believe it's a very bad idea to be able to inherited from a regular class and turn it into a reference counted class. Reference counted and non-reference-counted >> classe

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 17:19 schrieb "Kostas Michalopoulos" : > > On Mon, Oct 27, 2014 at 11:50 AM, Marco van de Voort wrote: >> >> There are multiple existing ones already see e.g. http://www.freepascal.org/docs-html/ref/refse21.html > > > But all of those (and "absolute" that Sven mentioned) are not use

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Kostas Michalopoulos
On Mon, Oct 27, 2014 at 5:17 PM, Hans-Peter Diettrich wrote: > Then the compiler can safely generate refcounting code for *all* objects > and non-weak references, and the counting methods take care of required > operations > Wouldn't that cause all objects to "pay" (both in terms of performance

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: Additionally, as mentioned before, I still believe it's a very bad idea to be able to inherited from a regular class and turn it into a reference counted class. Reference counted and non-reference-counted classes are different language entities with different behaviour and

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Kostas Michalopoulos
On Mon, Oct 27, 2014 at 11:50 AM, Marco van de Voort wrote: > There are multiple existing ones already see e.g. > http://www.freepascal.org/docs-html/ref/refse21.html > But all of those (and "absolute" that Sven mentioned) are not used in function parameters (something that i already mentioned)

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 14:54 schrieb "hinsta...@yandex.ru" : > > I tested it a bit; thoughts so far: > 1. generic and refcounted do not work well together: no matter how I arrange it, a class can't be both generic and refcounted, it causes the compiler to produce some internal error 2014092205. Oh, good to

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Richard Apthorp
Hi Sven, Actually found that HP have a documented list: http://h71000.www7.hp.com/doc/82final/6083/6083pro_032.html#extensions_app I'm not sure I feel qualified to change the compiler but as I work on this porting project I will be creating a list of the main changes which I could then decide if

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread hinsta...@yandex.ru
I tested it a bit; thoughts so far:1. generic and refcounted do not work well together: no matter how I arrange it, a class can't be both generic and refcounted, it causes the compiler to produce some internal error 2014092205.2. Lazarus CodeTools parser hates refcounted keyword, but can be fooled

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 11:47 schrieb "Kostas Michalopoulos" : > Is there any other such use of a keyword? I think it is a bad idea to introduce a new keyword placement if there isn't already one since it breaks consistency (all those other keywords are placed in front of the type name whereas this special o

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 11:26 schrieb "Jonas Maebe" : > > > On 27 Oct 2014, at 11:10, Sven Barth wrote: > >> A third possiblity would be to implement a cycle detector in the decrement helper, but I haven't come around that for now as I wanted to get a first rough implementation out to you all ;) > > > I thin

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
Am 27.10.2014 11:37 schrieb : > > I think we should just roll out this feature to FPC trunk and let people test it; so those who are interested in it would test it and detect potential problems in practice rather than in thought experiments Then just checkout the branch I mentioned in my initial m

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Schnell
On 10/27/2014 11:37 AM, hinsta...@yandex.ru wrote: I think we should just roll out this feature to FPC trunk and let people test it; so those who are interested in it would test it and detect potential problems in practice rather than in thought experiments Hmm. The potential TList problem t

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Flávio Etrusco
On Mon, Oct 27, 2014 at 8:37 AM, Sven Barth wrote: > On 27.10.2014 11:51, Richard Apthorp wrote: >> >> Hi Sven, >> >> Thanks for the reply. Yes some of it could be handled by a unit for >> special types etc but not sure what adding a new mode means or how to do >> it, could this handle difference

Re: [fpc-devel] VMS Pascal Compiler mode

2014-10-27 Thread Sven Barth
On 27.10.2014 11:51, Richard Apthorp wrote: Hi Sven, Thanks for the reply. Yes some of it could be handled by a unit for special types etc but not sure what adding a new mode means or how to do it, could this handle differences such as - Type conversions: Var::integer instead of integer(var)

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Van Canneyt
On Mon, 27 Oct 2014, Michael Van Canneyt wrote: On Mon, 27 Oct 2014, Kostas Michalopoulos wrote: On Mon, Oct 27, 2014 at 11:32 AM, Michael Schnell wrote: So you suggest cyclic references should be forbidden (erroneous programming technique). Are they ? IMO if a program takes

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Van Canneyt
On Mon, 27 Oct 2014, Kostas Michalopoulos wrote: On Mon, Oct 27, 2014 at 11:32 AM, Michael Schnell wrote: So you suggest cyclic references should be forbidden (erroneous programming technique). Are they ? IMO if a program takes care to avoid cyclic references (with a heaptrc-like

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Marco van de Voort
In our previous episode, Kostas Michalopoulos said: > I think it is a bad idea to > introduce a new keyword placement if there isn't already one since it > breaks consistency (all those other keywords are placed in front of the > type name whereas this special one is placed after). There are mult

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Kostas Michalopoulos
On Mon, Oct 27, 2014 at 11:32 AM, Michael Schnell wrote: > > So you suggest cyclic references should be forbidden (erroneous > programming technique). Are they ? > IMO if a program takes care to avoid cyclic references (with a heaptrc-like unit to find such cases), it shouldn't pay for the overh

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread hinstance
I think we should just roll out this feature to FPC trunk and let people test it; so those who are interested in it would test it and detect potential problems in practice rather than in thought experiments 27.10.2014, 13:35, "Michael Schnell" : > On 10/27/2014 11:26 AM, Jonas Maebe wrote: >>   

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Schnell
On 10/27/2014 11:26 AM, Jonas Maebe wrote: (e.g. suppose that inherited method inserts "self" into a linked list). Or using TList with it ? Would we need an alternate TList for ref-counted objects ? -Michael ___ fpc-devel maillist - fpc-devel@list

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Schnell
On 10/27/2014 11:26 AM, Jonas Maebe wrote: I think that a cycle detector should be an independent component, just like heaptrc is an independent add-on to detect memory problems in regular programs. So you suggest cyclic references should be forbidden (erroneous programming technique). Are

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Jonas Maebe
On 27 Oct 2014, at 11:10, Sven Barth wrote: A third possiblity would be to implement a cycle detector in the decrement helper, but I haven't come around that for now as I wanted to get a first rough implementation out to you all ;) I think that a cycle detector should be an independent com

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread hinstance
In my opinion, such thing as cycle detector would be an unnecessary complication; however I have not studied the subject in depth therefore not sure 27.10.2014, 13:10, "Sven Barth" : > On 27.10.2014 11:12, Nikolai Zhubr wrote: >>  Hello Sven! >> >>  25.10.2014 0:23, Sven Barth: >>>  Hello togethe

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Sven Barth
On 27.10.2014 11:12, Nikolai Zhubr wrote: Hello Sven! 25.10.2014 0:23, Sven Barth: Hello together! I've now finished my Proof of Concept ARC implementation which is based on the RFC I published a few weeks back: [...] Could you please elaborate a bit on what will happen to cyclic references?

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Nikolai Zhubr
Hello Sven! 25.10.2014 0:23, Sven Barth: Hello together! I've now finished my Proof of Concept ARC implementation which is based on the RFC I published a few weeks back: [...] Could you please elaborate a bit on what will happen to cyclic references? Is there autodetection in place already?

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Van Canneyt
On Mon, 27 Oct 2014, ListMember wrote: On 2014-10-27 09:39, Michael Van Canneyt wrote: On Mon, 27 Oct 2014, ListMember wrote: On 2014-10-27 00:00, Sven Barth wrote: On 26.10.2014 12:17, Kostas Michalopoulos wrote: On Sun, Oct 26, 2014 at 8:32 AM, Sven Barth

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread ListMember
On 2014-10-27 09:39, Michael Van Canneyt wrote: On Mon, 27 Oct 2014, ListMember wrote: On 2014-10-27 00:00, Sven Barth wrote: On 26.10.2014 12:17, Kostas Michalopoulos wrote: On Sun, Oct 26, 2014 at 8:32 AM, Sven Barth > wrot

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Michael Van Canneyt
On Mon, 27 Oct 2014, ListMember wrote: On 2014-10-27 00:00, Sven Barth wrote: On 26.10.2014 12:17, Kostas Michalopoulos wrote: On Sun, Oct 26, 2014 at 8:32 AM, Sven Barth mailto:pascaldra...@googlemail.com>> wrote:     Definitely not. We are in Pascal and there

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread ListMember
On 2014-10-27 00:00, Sven Barth wrote: On 26.10.2014 12:17, Kostas Michalopoulos wrote: On Sun, Oct 26, 2014 at 8:32 AM, Sven Barth mailto:pascaldra...@googlemail.com>> wrote: Definitely not. We are in Pascal and there such directives are placed afterwards. how about these: 1) 'record