Re: [fpc-devel] FPC compiler architecture documentation

2012-08-31 Thread Hans-Peter Diettrich

Mark Morgan Lloyd schrieb:

However, what's needed /is/ the big picture, starting off with what's 
needed for a port (a PC, preferably running Linux, and a working FPC), 
where the modified source should be put (local svn, Lazarus CCR, or a 
branch of the main repository, and who to talk to and/or how best to do 
it in each case), and what naming conventions etc. should be applied 
(roughly, how to set up ./compiler/x and what to change in 
./compiler to make the build process aware of it).


Let me summarize the recent answers on this topic:

1. FPC is a production compiler[1].

2. Implementors shall ask the developers concrete questions, once they 
start running into problems.



[1] "production" means that the compiler is a moving target, with 
optimization in the first place - documentation will be outdated once it 
has been written. The same applies to the code for new targets, as long 
as it is not yet maintained by the core developers.


The basic FPC code violates all acknowledged programming rules, by e.g. 
using global variables for caching all over, so that it's impossible to 
track assignments to the underlying record fields.



With respect to everybody concerned, I'd strongly suggest that 
http://wiki.lazarus.freepascal.org/ZSeries/Part_1 et seq. are worth 
reviewing since they contain a number of misconceptions that have been 
echoed by others (e.g. that the best way to start is to have a working 
Pascal compiler on the target system).


A cross compiler doesn't deserve an bootstrap compiler on every target 
system. Delphi goes the same route BTW.


DoDi

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC compiler architecture documentation

2012-08-31 Thread Mark Morgan Lloyd

Florian Klaempfl wrote:

Am 31.08.2012 09:32, schrieb Michael Schnell:

On 08/30/2012 10:20 PM, Florian Klaempfl wrote:

 I doubt that a good developer needs such a document to get into the
compiler...


Hmmm.

I once thought about trying to do an fpc compiler for a not yet
supported arch, and I still am interested in having (AKA contributing to
such an effort) an "up to date" fpc compiler for as well 68K as PIC32
(AFAIK identical to a certain version of MIPS32). I doubt that I would
even be able to start, unless an up-to-date documentation of the
appropriate parts of the docu is available.


The big picture which could be documented is the easy part. But such a 
document can never cover all details and the details are the hairy part. 
Like certain properties of the target architecture might be special and 
not yet covered by the compiler thus they cannot be documented. They are 
the challenging and time consuming part when adding a new architecture.


I for one am very much aware of that, since for reasons not directly 
related to FPC I'm spending a lot of time inside CPU manuals (I've now 
got to something like p290 of the IBM S/390 manual, and it's finally 
starting to talk about opcodes- although it's not yet discussed the 
register model).


However, what's needed /is/ the big picture, starting off with what's 
needed for a port (a PC, preferably running Linux, and a working FPC), 
where the modified source should be put (local svn, Lazarus CCR, or a 
branch of the main repository, and who to talk to and/or how best to do 
it in each case), and what naming conventions etc. should be applied 
(roughly, how to set up ./compiler/x and what to change in 
./compiler to make the build process aware of it).


We can really do without another David Zhang episode where somebody 
well-meaning flattens the directory structure and duplicates files 
needlessly.


With respect to everybody concerned, I'd strongly suggest that 
http://wiki.lazarus.freepascal.org/ZSeries/Part_1 et seq. are worth 
reviewing since they contain a number of misconceptions that have been 
echoed by others (e.g. that the best way to start is to have a working 
Pascal compiler on the target system).


It's entirely in order for a document to state that some elements of 
what it describes are unknown, or unknowable without feedback from the 
reader. But there are still targets worth supporting and people with the 
motivation and target-specific skills to do so, and keeping the project 
"closed by complexity" is to nobody's advantage.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC compiler architecture documentation

2012-08-31 Thread Florian Klaempfl

Am 31.08.2012 09:32, schrieb Michael Schnell:

On 08/30/2012 10:20 PM, Florian Klaempfl wrote:

 I doubt that a good developer needs such a document to get into the
compiler...


Hmmm.

I once thought about trying to do an fpc compiler for a not yet
supported arch, and I still am interested in having (AKA contributing to
such an effort) an "up to date" fpc compiler for as well 68K as PIC32
(AFAIK identical to a certain version of MIPS32). I doubt that I would
even be able to start, unless an up-to-date documentation of the
appropriate parts of the docu is available.


The big picture which could be documented is the easy part. But such a 
document can never cover all details and the details are the hairy part. 
Like certain properties of the target architecture might be special and 
not yet covered by the compiler thus they cannot be documented. They are 
the challenging and time consuming part when adding a new architecture.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Unicode and Short Strings

2012-08-31 Thread Tomas Hajny
On Fri, August 31, 2012 16:22, Michael Schnell wrote:
> On 08/31/2012 03:21 PM, Tomas Hajny wrote:
>> Type ShortString stays unchanged (locale specific 8-bit character set).
>>
> Thus there will be auto-conversion when doing MyShortString := MyString; ?

Yes, this auto-conversion already exists now.

Tomas


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Unicode and Short Strings

2012-08-31 Thread Michael Schnell

On 08/31/2012 03:21 PM, Tomas Hajny wrote:

Type ShortString stays unchanged (locale specific 8-bit character set).


Thus there will be auto-conversion when doing MyShortString := MyString; ?

Thanks,
-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Unicode and Short Strings

2012-08-31 Thread Tomas Hajny
On Fri, August 31, 2012 12:39, Michael Schnell wrote:
> Regarding the discussion of potentially providing the Delphi compatible
> "String" type with 16 bit characters: What is in this case happening to
> Short strings. I don't know how Delphi handles this.

Type ShortString stays unchanged (locale specific 8-bit character set).

Tomas


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Unicode and Short Strings

2012-08-31 Thread Michael Schnell
Regarding the discussion of potentially providing the Delphi compatible 
"String" type with 16 bit characters: What is in this case happening to 
Short strings. I don't know how Delphi handles this.


-Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] What does fpc_ansistr_unique do?

2012-08-31 Thread Michael Van Canneyt



On Fri, 31 Aug 2012, Amir wrote:


Hi,

 I was profiling my code, that I noticed that there are about 2M calls to 
fpc_ansistr_unique function (5% of the CPU time). I could not find any 
reference to what this function does and/or who calls this function. I 
appreciate any help in this regard.


It makes sure that the reference count of the string is 1, making a copy if 
necessary.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] What does fpc_ansistr_unique do?

2012-08-31 Thread Amir

Hi,

  I was profiling my code, that I noticed that there are about 2M calls 
to fpc_ansistr_unique function (5% of the CPU time). I could not find 
any reference to what this function does and/or who calls this function. 
I appreciate any help in this regard.


Amir
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC compiler architecture documentation

2012-08-31 Thread Mark Morgan Lloyd

Michael Schnell wrote:

On 08/30/2012 10:20 PM, Florian Klaempfl wrote:
 I doubt that a good developer needs such a document to get into the 
compiler...


Hmmm.

I once thought about trying to do an fpc compiler for a not yet 
supported arch, and I still am interested in having (AKA contributing to 
such an effort) an "up to date" fpc compiler for as well 68K as PIC32 
(AFAIK identical to a certain version of MIPS32). I doubt that I would 
even be able to start, unless an up-to-date documentation of the 
appropriate parts of the docu is available.


I tried to make notes when looking at the "unofficial" MIPS compiler on 
Sourceforge, but things suddenly started moving faster than I could keep 
track of (I'll probably chop what I did out of the wiki once the 
compiler is stable). I still felt I learned a lot, but there has to be a 
better way. http://wiki.lazarus.freepascal.org/Native_MIPS_Systems


Paul Edwards started to make a list of units and their relationships (in 
the context of a mainframe compiler), but I don't see any recent 
updates. http://wiki.lazarus.freepascal.org/ZSeries/Part_1


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC compiler architecture documentation

2012-08-31 Thread Michael Schnell

On 08/30/2012 10:20 PM, Florian Klaempfl wrote:
 I doubt that a good developer needs such a document to get into the 
compiler...


Hmmm.

I once thought about trying to do an fpc compiler for a not yet 
supported arch, and I still am interested in having (AKA contributing to 
such an effort) an "up to date" fpc compiler for as well 68K as PIC32 
(AFAIK identical to a certain version of MIPS32). I doubt that I would 
even be able to start, unless an up-to-date documentation of the 
appropriate parts of the docu is available.


-Michael

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel