Sign in Join

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

Mailing lists / fpc-devel / 2020-06

FPC 3.2.0 released!

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Marco van de Voort

Hello,

Finally, the Free Pascal 3.2.0 release is available from our servers and from sourceforge.

Changes that may break backwards compatibility will be documented at: http://wiki.freepascal.org/User_Changes_3.2.0.

For an overview of what is new see

https://wiki.freepascal.org/FPC_New_Features_3.2

The website has been update for the major targets and work is still being done for the rest.

All downloads are available at the main FTP server and sourceforge.

https://sourceforge.net/projects/freepascal/files/

ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/

Enjoy!

The Free Pascal Compiler Team

Reply by email

Keith Bowes
to Marco van de Voort

Je 2020-06-20 je 12:03:58 (+0200) Marco van de Voort skribis:

Finally, the Free Pascal 3.2.0 release is available from our servers and from sourceforge.

I've been playing around a little with it. So far, so good. It compiles as fast as ever and the generated binaries are much smaller than with 3.0.4. It's little wonder why Pascal is my go-to language when writing something (unfortunately, I have to use primarily C and Python when sending patches for existing projects).

I was really hoping that ISO 10206 support would be able to make it into 3.2, but there were significant roadblocks. For one, for the Bind function to be correctly implemented, I'm pretty sure file I/O would have to be rewritten to allow Bind to know whether a file could be successfully opened or not. Another thing was the Card function, which I thought would be easy to do, as surely the code keeps track of how many elements there are in a set, but if it does, I couldn't find it. It just occurred to me right now that a possible hack could be to create such a function in the extpas unit using a for..in loop, but that would perform very badly compared to compiler code.

I'll probably get back into it eventually, but I might have to redo what I've already done, because conflicts in the Makefiles are pretty much a certainty. Personally, I'm nut sure why the Makefiles are included in SVN; they should be generated `fpcmake -r` before compilation (or being packed into a source tarball) to avoid this kind of thing.

Anyway, it'll be nice if we can get some more ISO 10206 features. Some have been popping up here and there over the years (string slices, the ** operator, WriteStr/ReadStr, etc), but a lot of useful features are missing and seemingly have no equivalent in Borland's proprietary dialect.

Reply by email

Marco van de Voort
to Keith Bowes

Op 2020-07-03 om 19:18 schreef Keith Bowes via fpc-devel:

 Another thing was the Card function, which I thought would be easy to do, as surely the code keeps track of how many elements there are in a set, but if it does, I couldn't find it.

(Just a bit of fun, doesn't really answer your question, since obviously you'd need it in a ISO compatible mode. Also note that 3.2.0 branched over an year ago)

But 3.2.0 supports generic functions, and 3.0.0 already supported popcnt (https://www.freepascal.org/docs-html/rtl/system/popcnt.html).

But the syntax will be CARD<settype>(variable), and there are some minor things wrong with it: (anyone?)

- needs set type to be defined as type to reuse.

- what to do with a small registerable set, need const ref, but const [ref] is not yet supported in delphi mode?)

- and alignment requirements for the pointer walking.

- assumes unused bits in the last byte are 0. If that is unsure one could use the result of the AND 7 to make an and mask to mask out the unnecessary bits.

{$mode delphi}
{$pointermath on}
Function CARD<T>(const a: T): Integer;
Var bits,dwords,rest,i : Integer;
     p: pbyte;
begin
   result:=0;
   ;
   bits:=(high(t)+1) ;
   dwords:=bits div 32;
   rest:=(bits mod 32); // bytes
   if (rest and 7)>0 then // round rest bits (and 7) up to whole byte (8)
     rest:=rest+8;
   rest:=rest shr 3; // bits -> bytes.
   for i:=0 to dwords-1 do
     begin
       result:=result +popcnt({unaligned?} pdword(p)^);
       inc(pdword(p));
     end;
   for i:=0 to rest-1 do
     begin
       result:=result +popcnt({unaligned?} pbyte(p)^);
       inc(p);
     end;
end;
Type TSettype = set of 0..80;
Var t : TSettype;
     i : Integer;
Begin
   t:=[];
   for i:=0 to 5 do
     Include(t,i*13);
   Writeln(CARD<tsettype>(t));
End.
Show quoted text 5 lines
I'll probably get back into it eventually, but I might have to redo what I've already done, because conflicts in the Makefiles are pretty much a certainty. Personally, I'm nut sure why the Makefiles are included in SVN; they should be generated `fpcmake -r` before compilation (or being packed into a source tarball) to avoid this kind of thing.

But that would cause a bootstrap requirement on fpcmake, instead just the compiler. Note that recently, the generation date has been removed from the generate file to reduce conflicts.

Show quoted text 5 lines
Anyway, it'll be nice if we can get some more ISO 10206 features. Some have been popping up here and there over the years (string slices, the ** operator, WriteStr/ReadStr, etc), but a lot of useful features are missing and seemingly have no equivalent in Borland's proprietary dialect.

And of course schemata are the proverbial elephant in the room.

Reply by email

Ryan Joseph
to Marco van de Voort
On Jul 4, 2020, at 8:10 PM, Marco van de Voort wrote: But the syntax will be CARD<settype>(variable), and there are some minor things wrong with it: (anyone?)

I'm waiting on my patch for implicit function specialization to be reviewed since I did a redesign (as per Svens request). If there are any other code reviewers available I can finally get it cleaned up and submitted. specialize CARD<settype>(variable) is really verbose in ObjFPC mode so it would be nice to get this cleaned up.

https://bugs.freepascal.org/view.php?id=35261

Regards,
Ryan Joseph

Reply by email

J. Gareth Moreton
to Keith Bowes: Je 2020-06-20 je 12:03:58 (+0200) Marco van de Voort skribis: I've been playing around a…

That's great to know that the compiled binaries are smaller with, hopefully, no loss in speed.  Glad to see my little assembly language optimisations have come in handy!

Now I need to get a move on and implement pure functions for the future release.

Gareth aka. Kit

Keith Bowes wrote 36 lines
Je 2020-06-20 je 12:03:58 (+0200) Marco van de Voort skribis: > Finally, the Free Pascal 3.2.0 release is available from our servers and > from sourceforge. > I've been playing around a little with it. So far, so good. It compiles as fast as ever and the generated binaries are much smaller than with 3.0.4. It's little wonder why Pascal is my go-to language when writing something (unfortunately, I have to use primarily C and Python when sending patches for existing projects). I was really hoping that ISO 10206 support would be able to make it into 3.2, but there were significant roadblocks. For one, for the Bind function to be correctly implemented, I'm pretty sure file I/O would have to be rewritten to allow Bind to know whether a file could be successfully opened or not. Another thing was the Card function, which I thought would be easy to do, as surely the code keeps track of how many elements there are in a set, but if it does, I couldn't find it. It just occurred to me right now that a possible hack could be to create such a function in the extpas unit using a for..in loop, but that would perform very badly compared to compiler code. I'll probably get back into it eventually, but I might have to redo what I've already done, because conflicts in the Makefiles are pretty much a certainty. Personally, I'm nut sure why the Makefiles are included in SVN; they should be generated `fpcmake -r` before compilation (or being packed into a source tarball) to avoid this kind of thing. Anyway, it'll be nice if we can get some more ISO 10206 features. Some have been popping up here and there over the years (string slices, the ** operator, WriteStr/ReadStr, etc), but a lot of useful features are missing and seemingly have no equivalent in Borland's proprietary dialect. _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

Sven Barth
to Ryan Joseph: I'm waiting on my patch for implicit function specialization to be reviewed since I did a…

Ryan Joseph via fpc-devel schrieb am Mo.,
6. Juli 2020, 19:04:

Show quoted text 15 lines
> On Jul 4, 2020, at 8:10 PM, Marco van de Voort < > wrote: > > But the syntax will be CARD<settype>(variable), and there are some minor things wrong with it: (anyone?) I'm waiting on my patch for implicit function specialization to be reviewed since I did a redesign (as per Svens request). If there are any other code reviewers available I can finally get it cleaned up and submitted. specialize CARD<settype>(variable) is really verbose in ObjFPC mode so it would be nice to get this cleaned up. https://bugs.freepascal.org/view.php?id=35261

I'm currently busy with other generic bugs and afterwards I want to look at the static array constructor first. Though maybe I'll at least be able to comment on it... 🤷‍♀️

Regards,
Sven

Reply by email