[fpc-pascal] FPC 3.0.0-rc1 release

2015-08-25 Thread Joost van der Sluis

Hello

We have placed the first release candidate of the Free Pascal Compiler
version 3.0.0 on our ftp servers.

You can help improve the upcoming 3.0.0 release by downloading and
testing this release. If you want you can report what you have done here:
http://wiki.freepascal.org/Testers_3.0.0

New features are listed at
http://wiki.freepascal.org/FPC_New_Features_3.0

Changes that may break backwards compatibility are documented at
http://wiki.freepascal.org/User_Changes_3.0.0

Issues with this release candidate that we already know of are listed in
the wiki: http://wiki.freepascal.org/Issues_3.0.0

A preview of the 3.0.0 docs is available at
http://www.freepascal.org/docs-html/3.0.0/

Downloads are available at:
* ftp://freepascal.stack.nl/pub/fpc/beta/3.0.0-rc1
* ftp://gd.tuwien.ac.at/languages/pascal/fpc/beta/3.0.0-rc1
* ftp://ftp.freepascal.org/pub/fpc/beta/3.0.0-rc1

Enjoy!

The Free Pascal Compiler Team


Free Pascal Compiler

 Version 3.0.0-rc1


* Introduction


Please also read the platform specific README file, if it exists.

This package contains an advanced freeware 32-bit/64-bit/16-bit pascal
compiler for several platforms. The language and the runtime library are
almost compatible with Turbo Pascal 7.0 and recent Delphi releases. 
There is also partial support for the Macintosh pascal dialect.


News and changes related to this release are described in whatsnew.txt.

Free Pascal 3.0.0 is currently available for the following platforms:
- Linux-i386
- Linux-x86_64 (amd64)
- Linux-powerpc
- Linux-sparc
- Linux-ARM
- Win32-i386 (Win95/98/Me/XP/2000/2003/Vista/7 and WinNT)
- Win64-x86_64 (XP/Vista/2003)
- Wince-ARM (cross compiled from win32-i386)
- FreeBSD-i386
- FreeBSD-x86_64
- Mac OS X/Darwin for PowerPC (32 and 64 bit)
- Mac OS X/Darwin for Intel (32 and 64 bit)
- iOS, iPhoneSimulator
- OS/2-i386 (OS/2 Warp v3.0, 4.0, WarpServer for e-Business and eComStation)
- GO32v2-i386

There are other platforms (like other BSD variants) which are more or 
less working, but there is currently no maintainer for them and thus we 
cannot provide adequate support. If you want to change this and create 
and maintain versions for other platforms and targets, feel free to 
contact us, e-mail addresses are listed below.




* Features


- high speed compiler
- fully 16, 32 or 64-bit code
  - 32 bit compiler can be used on x86_64 Linux distributions to compile
32 bit applications
- language features:
  - almost fully compatible with Borland Pascal and Borland Delphi
  - ansi strings
  - wide strings
  - exception support
  - RTTI support
  - procedure overloading
  - generics (experimental)
  - operator overloading
  - COM, CORBA and raw interfaces support
  - dynamic array support
  - variant support
  - inlining
- code optimizer:
  - peephole optimizer (80x86 only)
  - jump optimizer
  - loading of variables into registers
  - assembler level dataflow analyzer (80x86 only)
  - stack frame eliminations
  - sophisticated register allocator
- integrated BASM (built-in assembler) parser
  - supports ATT syntax used by GNU C
  - supports Intel syntax used by Turbo Pascal (80x86-only)
- can compile code into assembler source code for these assemblers:
  - GNU Assembler (GAS)
  - Netwide assembler (Nasm)
  - Microsoft Assembler/Turbo Assembler (Masm/Tasm)
  - Watcom assembler (wasm)
- internal assembler for ultra fast object file generation
- can call external C code
  - h2pas utility to convert .h files to Pascal units
- smart linking (also known as dead code stripping)
- support for the GNU debugger
- integrated development environment (disabled by default on Mac OS X)
  - powerful user friendly Wordstar compatible multi file editor
  - context sensitive help supports help files in HTML, Windows HLP and
Borland TPH format.
  - debugger on most platforms
- can create binaries running natively under both DOS and OS/2 (EMX version)
- no need for Linux distribution specific binaries, programs you write run
  on all distributions
- high quality documentation



* Minimum requirements


i386, x86_64, PowerPC or Sparc processor
Win32:
 - MS Windows NT/2000/2003/XP/Vista/7 (Win95, 98 and ME are not supported
   in FPC officially any longer).
 - 16 MB RAM
OS/2:
 - OS/2 Warp v3.0 with one of late fixpaks - FP 35 should be fine,
   OS/2 Warp v4.0 with FP 5 and above, WSeB, MCP or any eComStation version
   (OS/2 2.0/2.1 currently not supported, not even for compiled programs).
 - Certain features (e.g. Unicode 

[fpc-pascal] Misleading Statement at Comparison Operator Description

2015-08-25 Thread Daniel Gaspary
Hi,

   I believe the statement[1] bellow is not accurate:

   The result type of a comparison operator is always a boolean.

   Because this code compiles and works:


program Project1;
type
TMyType1 = class(TObject);
TMyType2 = class(TObject);
TMyType3 = class(TObject);

operator  (t1: TMyType1; t2: TMyType2): TMyType3;
begin
 //some code...
end;

var
   t3: TMyType3;
begin
 t3:=TMyType1.Create  TMyType2.Create;
end.

Am I Wrong, the documentation need fixing.. ?

Thank you.

[1] http://www.freepascal.org/docs-html/ref/refse93.html#x198-20800015.5
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] FPC's generics implementation

2015-08-25 Thread Jani Mátyás
Hi All,

I have some questions regarding FPC's generics implementation, just out of
curiosity.

The FPC wiki states that the ppu file stores all the tokens for the generic
classes. Browsing the source of compiler/symdef.pas (r31298) also gave me
this impression. Does it mean that a recompilation occurs for every
specialization?

There have been some ideas (again, regarding the wiki) to store the parse
tree instead of the source code (or tokens) in the ppu. I guess that would
made the specializations quicker. What were the reasons against it?

Disabling assignment compatibility of the separate specializations (with
same parameter type) might reduce the number of specializations. Were there
any specific reasons for enabling it in objpas mode?

Please CC me the answers, I'm not a list member!

Best,
Mátyás Jani
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC's generics implementation

2015-08-25 Thread Sven Barth
Am 25.08.2015 08:34 schrieb Jani Mátyás jzo...@gmail.com:
 The FPC wiki states that the ppu file stores all the tokens for the
generic classes. Browsing the source of compiler/symdef.pas (r31298) also
gave me this impression. Does it mean that a recompilation occurs for every
specialization?

Not for every specialization. If a specialization for the same generic with
the same types already exists that one will be used. This also works across
units.


 There have been some ideas (again, regarding the wiki) to store the parse
tree instead of the source code (or tokens) in the ppu. I guess that would
made the specializations quicker. What were the reasons against it?

Ease of implementation/maintainability.
For the node tree approach the tree would need to be walked and all
accesses to variables of the generic parameter types would need to be
adjusted. This would need adjustments if new node types are added or node
types are extended. However for the token stream approach all this is
handled by existing parser code, so once the parser supports something it's
immediately supported by generics as well (corner cases of respecting
generic types aside).

 Disabling assignment compatibility of the separate specializations (with
same parameter type) might reduce the number of specializations. Were there
any specific reasons for enabling it in objpas mode?

On the contrary. /Enabling/ assignment compatibility reduces the number of
specializations, because existing specializations can be reused (see above).
Also having specializations be compatible in mode Delphi, but not in other
modes would likely lead to the confusion of users as units with different
modes can be mixed freely.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal