please upgrade your FreePascal compiler
Posted: Tue Jun 13, 2006 12:18 pm
I found that UVA uses FreePascal (FPC) v.2.0.0 as the pascal compiler. Since now FPC has upgrade to v.2.0.2 which contains tons of bugs fixed, I recommend UVA to upgrade FPC as well.
I also have some suggestions for FPC users here...
1. FPC is very slow on I/O operation. That's why in some cases, pascal solutions got TLE. Actually it's not about language issues. Because basically FPC and gcc is very close on compiled code speed. The slowness is becaused FPC only allocates 256 bytes for I/O buffer by default. Compare it to gcc which allocates 4 KB for I/O buffer. Because of this, obviously, C's I/O will be faster by a large factor. To overcome this buffer limit, we need to override the default FPC buffer allocation. Here's the example:
With this "optimization", your pascal program will perform about 4-5 times faster on I/O operation.
2. About editor or IDE for FPC. Though FPC provides text-based IDE that looks like Turbo Pascal 7 IDE, but for some people, especially Delphi people, that default text-IDE is not good enough. Delphians demand GUI IDE with great editor and easy debugging feature. Actually, there's a Delphi-like IDE for FPC. It's called Lazarus (http://www.lazarus.freepascal.org) that now become de-facto FPC IDE, both for GUI and console programming. As like FPC, Lazarus is also available natively on most platforms that supported by FPC (win32, linux, bsd, mac-os, etc running upon win32 widget, gtk1, gtk2, qt, carbon, etc). Lazarus is almost like Delphi, most Delphi features are also available in Lazarus. So, it's time to "write once, compile everywhere" using FPC and Lazarus.
Here's the screenshot Lazarus running on MacOS X...

And I also have a question... why FPC and pascal is no longer allowed in world finals contest? Are there any technical reasons for this decision? Because I don't think it's fair since pascal as language is still very popular on many countries, especially on educational field. And it's too bad to know that ACM-ICPI 2006 is using (Borland) Kylix instead of FPC/Lazarus as pascal compiler/IDE. And the worst is... pascal is no longer supported on the next ACM-ICPI event.
Thank you.
---
PS: I've submitted a same topic on Pascal forum, but I think it is more apropriate to post here. I'm sorry for this mistake, and I hope someone would remove my post on Pascal forum. Thank you.
I also have some suggestions for FPC users here...
1. FPC is very slow on I/O operation. That's why in some cases, pascal solutions got TLE. Actually it's not about language issues. Because basically FPC and gcc is very close on compiled code speed. The slowness is becaused FPC only allocates 256 bytes for I/O buffer by default. Compare it to gcc which allocates 4 KB for I/O buffer. Because of this, obviously, C's I/O will be faster by a large factor. To overcome this buffer limit, we need to override the default FPC buffer allocation. Here's the example:
Code: Select all
program Test;
const
MaxBuf = 4 * 1024; // 4KB buffer
var
I: Integer;
BufRead, BufWrite: array[0..MaxBuf-1] of Char;
begin
SetTextBuf(Input, BufRead, MaxBuf);
SetTextBuf(Output, BufWrite, MaxBuf);
repeat
Readln(I);
if I = 0 then Break;
Writeln(I);
until False;
Flush(Output);
end.
2. About editor or IDE for FPC. Though FPC provides text-based IDE that looks like Turbo Pascal 7 IDE, but for some people, especially Delphi people, that default text-IDE is not good enough. Delphians demand GUI IDE with great editor and easy debugging feature. Actually, there's a Delphi-like IDE for FPC. It's called Lazarus (http://www.lazarus.freepascal.org) that now become de-facto FPC IDE, both for GUI and console programming. As like FPC, Lazarus is also available natively on most platforms that supported by FPC (win32, linux, bsd, mac-os, etc running upon win32 widget, gtk1, gtk2, qt, carbon, etc). Lazarus is almost like Delphi, most Delphi features are also available in Lazarus. So, it's time to "write once, compile everywhere" using FPC and Lazarus.

Here's the screenshot Lazarus running on MacOS X...

And I also have a question... why FPC and pascal is no longer allowed in world finals contest? Are there any technical reasons for this decision? Because I don't think it's fair since pascal as language is still very popular on many countries, especially on educational field. And it's too bad to know that ACM-ICPI 2006 is using (Borland) Kylix instead of FPC/Lazarus as pascal compiler/IDE. And the worst is... pascal is no longer supported on the next ACM-ICPI event.

Thank you.
---
PS: I've submitted a same topic on Pascal forum, but I think it is more apropriate to post here. I'm sorry for this mistake, and I hope someone would remove my post on Pascal forum. Thank you.