Sign in Join

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

Mailing lists / fpc-devel / 2012-12

Please include gmp.dll in Win32 distribution of FPC 2.6.2 and later

24 messages · 10 people · –

Reply by email Subscribe to this list Your subscription

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

Alexander Klenin

In my ongoing efforts to prevent elimination of Pascal/FPC from a set of languages used to teach programming, I have recently encountered another problem:
although FPC does include "gmp" unit for arbitrary-precision calculations, programs compiled with it require "gmp" dynamic library. This library currently is a separate download, which outlaws its usage in programming competitions, forcing participants to use Java or Python instead.

Alexander S. Klenin

Reply by email

Sven Barth
to Alexander Klenin
Alexander Klenin wrote 8 lines
In my ongoing efforts to prevent elimination of Pascal/FPC from a set of languages used to teach programming, I have recently encountered another problem: although FPC does include "gmp" unit for arbitrary-precision calculations, programs compiled with it require "gmp" dynamic library. This library currently is a separate download, which outlaws its usage in programming competitions, forcing participants to use Java or Python instead.

We can not bundle such libaries as different (Linux) distributions will have different dependencies like different versions of the libc and then this library would not load anyway (and Free Pascal would be accused for being crap because of this). This is why we rely on the distros themselves to supply such dynamic libraries.

Regards,
Sven

Reply by email

Michael Van Canneyt
to Alexander Klenin: In my ongoing efforts to prevent elimination of Pascal/FPC from a set of languages used…
Alexander Klenin wrote 8 lines
In my ongoing efforts to prevent elimination of Pascal/FPC from a set of languages used to teach programming, I have recently encountered another problem: although FPC does include "gmp" unit for arbitrary-precision calculations, programs compiled with it require "gmp" dynamic library. This library currently is a separate download, which outlaws its usage in programming competitions, forcing participants to use Java or Python instead.

That is a bit of a difficult one. gmp just provides just the interface of an external library. If we do it fo this one, we should do it for all the libraries for which we provide headers.

Is there not a native pascal solution for arbitrary precision math ? I seem to remember that there are several ones floating around, maybe we should simply include one of them.

Michael.

Reply by email

Alexander Klenin
to Sven Barth: We can not bundle such libaries as different (Linux) distributions will have different…
Sven Barth wrote 5 lines
We can not bundle such libaries as different (Linux) distributions will have different dependencies like different versions of the libc and then this library would not load anyway (and Free Pascal would be accused for being crap because of this). This is why we rely on the distros themselves to supply such dynamic libraries.

Please note the message title -- I am aware of Linux distro problem, so specifically talked about Windows only.

Alexander S. Klenin

Reply by email

Alexander Klenin
to Michael Van Canneyt: That is a bit of a difficult one. gmp just provides just the interface of an external…
Michael Van Canneyt wrote
That is a bit of a difficult one. gmp just provides just the interface of an external library. If we do it fo this one, we should do it for all the libraries for which we provide headers.

For marketing purposes, mostly. I speak about real Russian schools, where Pascal usage has fallen from about 80% to about 40% in recent few years, and continues to decline rapidly.
In Russia, Pascal is Internet Explorer of programming languages :)

Is there not a native pascal solution for arbitrary precision math ? I seem to remember that there are several ones floating around, maybe we should simply include one of them.

Writing high-quality arbitrary precision arithmetics is hard. The fact that Free Pascal uses GMP instead of homegrown solution has actually earned some praise.
Of course, if good enough native solution does exist, I am all for including it. In short term, however, adding gmp.dll in 2.6.2 release will make it available at least
for upcoming Russian Olympiad in Informatics.

Alexander S. Klenin

Reply by email

Michael Van Canneyt
to Alexander Klenin
Alexander Klenin wrote 12 lines
On Sun, Dec 2, 2012 at 2:08 PM, Michael Van Canneyt wrote: > That is a bit of a difficult one. gmp just provides just the interface of an > external library. > If we do it fo this one, we should do it for all the libraries for which we > provide headers. For marketing purposes, mostly. I speak about real Russian schools, where Pascal usage has fallen from about 80% to about 40% in recent few years, and continues to decline rapidly. In Russia, Pascal is Internet Explorer of programming languages :)

Globally, it's more like opera or iceweasel :-)

Show quoted text 7 lines
> Is there not a native pascal solution for arbitrary precision math ? I seem > to remember that there are several ones floating around, maybe we should > simply include one of them. Writing high-quality arbitrary precision arithmetics is hard. The fact that Free Pascal uses GMP instead of homegrown solution has actually earned some praise.

Define homegown ?
GMP most likely also is homegrown, as a lot of open source was started homegrown :-)

Of course, if good enough native solution does exist, I am all for including it.

I did a search. There seem to be at least 2, bigint and MPArith. The latter seems still maintained. The former may be easier to pick up and include.

If you can agree with the authors that it can be included under LGPL or modified LGPL, I will do the work to include one of them.

In short term, however, adding gmp.dll in 2.6.2 release will make it available at least for upcoming Russian Olympiad in Informatics.

Well, 2.6.2 is at RC1 stage, so that will not happen, I suppose.

In the short term, it might be easier to convince them to install the library on the machines that are used for the Olympiad. You can explain the problem to them as well, I suppose. If they allow pascal and know that they will be asking an arbitrary math question, they could decide to play fair and put the library on the machine.

In the long term, I think it is better to include a native solution with a more pascal-like interface.

Michael.

Reply by email

Alexander Klenin
to Michael Van Canneyt
Michael Van Canneyt wrote 6 lines
> Writing high-quality arbitrary precision arithmetics is hard. > The fact that Free Pascal uses GMP instead of homegrown solution has > actually earned some praise. Define homegown ? GMP most likely also is homegrown, as a lot of open source was started homegrown :-)

GMP is widely used, well known and tested, it also has good performance. Of course, this does not prevent us from writing our own implementation of similar quality,
but it is not simple at all -- for example, Python went this way and their implementation
is often criticized as too slow even for interpreted language.

I did a search. There seem to be at least 2, bigint and MPArith. The latter seems still maintained. The former may be easier to pick up and include.

I have found several pascal libraries named "bigint", but they all turned out to be complete garbage.
MPArith on the other hand makes a very good impression. It has Zlib license which is GPL-compatible.
I have found some Intel-specific inline assembler in the source, but it seems a workaround would be simple.
MPArith also lacks operator overloads, but those are also simple to add. So I think that there is no obstacle for including it. I Cc'ed the author to get his opinion.

> In short term, however, adding gmp.dll in 2.6.2 release will make it > available at least > for upcoming Russian Olympiad in Informatics. Well, 2.6.2 is at RC1 stage, so that will not happen, I suppose.

This is a simple file addition, it has zero chance of breaking existing functionality.

Show quoted text 5 lines
In the short term, it might be easier to convince them to install the library on the machines that are used for the Olympiad. You can explain the problem to them as well, I suppose. If they allow pascal and know that they will be asking an arbitrary math question, they could decide to play fair and put the library on the machine.

No chance, the rules are very strict in this regard. As for fairness, the usual argument is "just solve problems in Java/Python", which is exactly what I am trying to prevent :)

Alexander S. Klenin

Reply by email

Tomas Hajny
to Alexander Klenin
Alexander Klenin wrote
On Sun, Dec 2, 2012 at 2:42 PM, Michael Van Canneyt wrote:

.
.

Show quoted text 20 lines
>> In short term, however, adding gmp.dll in 2.6.2 release will make it >> available at least >> for upcoming Russian Olympiad in Informatics. > Well, 2.6.2 is at RC1 stage, so that will not happen, I suppose. This is a simple file addition, it has zero chance of breaking existing functionality. > In the short term, it might be easier to convince them to install the > library on the machines that are used for the Olympiad. You can explain > the > problem to them as well, I suppose. If they allow pascal and know that > they > will be asking an arbitrary math question, they could decide to play > fair > and put the library on the machine. No chance, the rules are very strict in this regard. As for fairness, the usual argument is "just solve problems in Java/Python", which is exactly what I am trying to prevent :)

Who defines what is the right file to choose if there are multiple options? We could probably create a special distribution package with a 'gmp' suffix including that library on our FTP server. It would not become part of our standard ("mainstream") distribution, but maybe it solves your issue anyway?

Tomas

Reply by email

Alexander Klenin
to Tomas Hajny
Tomas Hajny wrote 6 lines
> As for fairness, the usual argument is "just solve problems in > Java/Python", > which is exactly what I am trying to prevent :) Who defines what is the right file to choose if there are multiple options?

I am not sure which options do you mean,
I refer to the dll mentioned here: http://wiki.freepascal.org/gmp

We could probably create a special distribution package with a 'gmp' suffix including that library on our FTP server. It would not become part of our standard ("mainstream") distribution, but maybe it solves your issue anyway?

Unlikely. Even if I persuade the jury of the final stage to use non-standard distribution,
all preliminary stages (with approx. total of 5000 pupils participating) will still use standard distribution.

Alexander S. Klenin

Reply by email

Tomas Hajny
to Alexander Klenin
Alexander Klenin wrote 9 lines
On Sun, Dec 2, 2012 at 4:52 PM, Tomas Hajny wrote: >> As for fairness, the usual argument is "just solve problems in >> Java/Python", >> which is exactly what I am trying to prevent :) > > Who defines what is the right file to choose if there are multiple > options? I am not sure which options do you mean, I refer to the dll mentioned here: http://wiki.freepascal.org/gmp

I meant multiple 2.6.2 installers (in particular, if we as the official FPC site provide also an alternative special package including the DLL in addition on our FTP).

Show quoted text 8 lines
> We could probably create a special distribution package with a > 'gmp' suffix including that library on our FTP server. It would not become > part of our standard ("mainstream") distribution, but maybe it solves your > issue anyway? Unlikely. Even if I persuade the jury of the final stage to use non-standard distribution, all preliminary stages (with approx. total of 5000 pupils participating) will still use standard distribution.

Do the preliminary stages also watch if the pupil hasn't downloaded an additionally required DLL? Moreover, if the pupils don't know GMP themselves, would they be able to use it without additional documentation, etc. If they know it, they'd probably know also where to get it from, right (and if the official jury doesn't stand in the way, what is the problem)?

Anyway, if the pupils are taught that open source programming implies using just the official distribution package of your programming language, something is wrong in the setup anyway...

Tomas

Reply by email

Alexander Klenin
to Tomas Hajny
Tomas Hajny wrote 7 lines
On 2 Dec 12, at 16:45, Alexander Klenin wrote: > I am not sure which options do you mean, > I refer to the dll mentioned here: http://wiki.freepascal.org/gmp I meant multiple 2.6.2 installers (in particular, if we as the official FPC site provide also an alternative special package including the DLL in addition on our FTP).

As I said, IMHO it would be simpler to just include gmp.dll in the "bin" directory, which already contains significant number of utilities like "rm.exe" and "make.exe" for quite similar reasons.

Show quoted text 15 lines
> Even if I persuade the jury of the final stage to use > non-standard distribution, > all preliminary stages (with approx. total of 5000 pupils > participating) will still use standard distribution. Do the preliminary stages also watch if the pupil hasn't downloaded an additionally required DLL? Moreover, if the pupils don't know GMP themselves, would they be able to use it without additional documentation, etc. If they know it, they'd probably know also where to get it from, right (and if the official jury doesn't stand in the way, what is the problem)? Anyway, if the pupils are taught that open source programming implies using just the official distribution package of your programming language, something is wrong in the setup anyway...

Heh, you underestimate organization level and seriousness of programming contests.
Participants use computers with fully identical, carefully chosen software setup.
Internet connection is off, participants are strictly forbidden to bring any kind of information
storage, from books to non-empty sheets of paper to flash drives, and any electronic devices.
Any participant who is caught HAVING (not even using) a phone is immediately disqualified.
The rules are partially mandated and checked by government agencies. The prizes, for high school contests, are usually free education in any Russian university,
and for student contests -- basically immediate employment in any software company,
from Google and Facebook to IBM and Yandex (the latter is the top Russian search engine provider).

Alexander S. Klenin

Reply by email

Florian Klämpfl
to Alexander Klenin
Alexander Klenin wrote 12 lines
On Sun, Dec 2, 2012 at 9:47 PM, Tomas Hajny wrote: > On 2 Dec 12, at 16:45, Alexander Klenin wrote: >> I am not sure which options do you mean, >> I refer to the dll mentioned here: http://wiki.freepascal.org/gmp > > I meant multiple 2.6.2 installers (in particular, if we as the > official FPC site provide also an alternative special package > including the DLL in addition on our FTP). As I said, IMHO it would be simpler to just include gmp.dll in the "bin" directory, which already contains significant number of utilities like "rm.exe" and "make.exe" for quite similar reasons.

I guess we can create an extra "install component" for win32/win64 containing popular dlls but I doubt that we get this into 2.6.2. It would require at least another rc.

Reply by email

Hans-Peter Diettrich
to Michael Van Canneyt: That is a bit of a difficult one. gmp just provides just the interface of an external…
Is there not a native pascal solution for arbitrary precision math ? I seem to remember that there are several ones floating around, maybe we should simply include one of them.

I'm not really happy with ports of sophisticated C libraries. When working on the Abbrevia sourcecode I came across a problem in one of the decompression modules. After I found the problem inherited from the C code, I notified the maintainer of that library. Oh wonder, he had fixed just that bug a few weeks ago, after the module had been in use for more than ten years! That's why I think that such libraries should be maintained by their own developers, so that all bug fixes and improvements become available immediately to the FPC users.

<OT>
I bet that beforementioned bug also is in the FPC (gzip?) libraries, but I cannot remember where it's located. It's related to an illegal double ungetc() in C code, which can occur in very rare situations, and thus had survived for many years.
</OT>

DoDi

Reply by email

Tomas Hajny
to Alexander Klenin: As I said, IMHO it would be simpler to just include gmp.dll in the "bin" directory, which…
Alexander Klenin wrote 11 lines
On Sun, Dec 2, 2012 at 9:47 PM, Tomas Hajny wrote: > On 2 Dec 12, at 16:45, Alexander Klenin wrote: >> I am not sure which options do you mean, >> I refer to the dll mentioned here: http://wiki.freepascal.org/gmp > > I meant multiple 2.6.2 installers (in particular, if we as the > official FPC site provide also an alternative special package > including the DLL in addition on our FTP). As I said, IMHO it would be simpler to just include gmp.dll in the "bin" directory, which already contains significant number of utilities like "rm.exe" and "make.exe" for quite similar reasons.

The reasons are different. These utilities are included because they are used for building the compiler, not because someone using FPC may use them too.

Show quoted text 18 lines
>> Even if I persuade the jury of the final stage to use >> non-standard distribution, >> all preliminary stages (with approx. total of 5000 pupils >> participating) will still use standard distribution. > > Do the preliminary stages also watch if the pupil hasn't downloaded > an additionally required DLL? Moreover, if the pupils don't know GMP > themselves, would they be able to use it without additional > documentation, etc. If they know it, they'd probably know also where > to get it from, right (and if the official jury doesn't stand in the > way, what is the problem)? > > Anyway, if the pupils are taught that open source programming implies > using just the official distribution package of your programming > language, something is wrong in the setup anyway... Heh, you underestimate organization level and seriousness of programming contests.

.
.

Frankly, I don't know how the contest is organized in detail, but I certainly don't get the point why just this particular DLL should make any considerable difference. Programmers should find efficient solutions for given tasks. Once they know the task, they should decide about the best suiting tools for tackling the particular task. In the real world, this certainly involves potential use of available 3rd party libraries which allow concentrating on the real issue rather than reinventing the wheel. If the contest rules and the particular task(s) make Java more advantageous than Pascal, then the contest participants will probably decide accordingly and adding one particular library won't change the picture much most probably. As simple as that - FPC will never be able to provide such a breadth of own libraries as a programming environment continously sponsored and directly contributed by some of the world's largest corporations for many years. Pascal should be promoted due to its own strengths (good readability, better protection from programmer's faults, good compilation speed coupled with reasonable execution speed, etc.), not due to bundling of hundreds of megabytes of 3rd party libraries (I'm sure that all the libraries for which Pascal bindings exist would easily exceed this size and it would be probably doable, but it makes no sense).

Just my 2 cents (my private opinion)

Tomas

Reply by email

Craig Peterson
to Hans-Peter Diettrich: I'm not really happy with ports of sophisticated C libraries. When working on the…
Hans-Peter Diettrich wrote
I'm not really happy with ports of sophisticated C libraries. When working on the Abbrevia sourcecode I came across a problem in one of the decompression modules.

Abbrevia's DEFLATE engine isn't a port of zlib, it's an implementation of RFC 1951. It may have had a similar bug, but it was not a C-to-Pascal rewrite. Any similarities would have been due to following the algorithm laid out in the RFC.

Among other things, Abbrevia's implementation supports the Deflate64 variant, which Zlib does not.

after the module had been in use for more than ten years!

Zlib's most recent release (1.2.7) is dated May 2012 and fixes bugs of its own. Since they are *different* implementations, it's equally likely that Abbrevia's version would have avoided bugs that the C version had.

That's why I think that such libraries should be maintained by their own developers, so that all bug fixes and improvements become available immediately to the FPC users.

Zlib is stable, not because it's maintained by "their own developers", but because the community contributes fixes and bug reports. Likewise, Abbrevia is much better now than a few years ago because I started maintaining and fixing it. If you'd done that rather than badmouthing it and trying to reimplement it from scratch it would be even further along than it is.

Craig Peterson Scooter Software Abbrevia Project Admin

Reply by email

Hans-Peter Diettrich
to Craig Peterson
On 12/2/2012 4:31 PM, Hans-Peter Diettrich wrote:

[...]

Show quoted text 6 lines
> That's why I think that such libraries should be maintained by their > own developers, so that all bug fixes and improvements become > available immediately to the FPC users. Zlib is stable, not because it's maintained by "their own developers", but because the community contributes fixes and bug reports.

...which go into the C code, not automagically into any (Pascal...) port. This was one of the reasons why I discontinued the work on my ToPas converter.

Show quoted text 5 lines
Likewise, Abbrevia is much better now than a few years ago because I started maintaining and fixing it. If you'd done that rather than badmouthing it and trying to reimplement it from scratch it would be even further along than it is.

We can discuss this topic somewhere else. Look how e.g. 7zip allows to add new de/compression methods, and you'll understand that this the most efficient way to go.

DoDi

Reply by email

Nikolay Nikolov
to Tomas Hajny: The reasons are different. These utilities are included because they are used for…

As an ex-competitive programmer and multiple IOI and BOI medalist, let me try to explain, although I realize it might be difficult for "normal" programmers to understand, but let's just say that:

- the people who setup the programming environment for these competitions are not the same people who compete in them. and the people who compete have no control over what programming tools are installed, because they don't have any kind of internet connection, nor are they allowed to install any packages, etc, during the competition. So it's all about making it easy for people who don't have a clue about pascal to setup a pascal environment easily so that the actual pascal programmers can use their language to the full extent without any disadvantages compared to the C++ (for example) programmers. In other words, the more these people need to take special care about setting about the pascal environment, i.e. installing extra dlls, etc, etc, the more likely it is that they'll:

1) hate the language
2) not bother installing the extra dlls and thus putting the Pascal programmers at a disadvantage
and even
3) push for dropping any kind of pascal support, because it's an "outdated language".

Just to make it clear how these people usually think, I was part of the IOI2009 technical committee and I was responsible for setting up the pascal environment (fpc & lazarus under ubuntu) to work. In that year, Henadzi Karatkevitch from Belarus won the competition and I boasted about it on the fpc mailing list, because he wrote his solutions in pascal and his achievements are unique in the history of the IOI:

http://www.eng.chula.ac.th/index.php?q=en/node/4368

It even made it to the FPC front page. However, in that very same year something else happened that I didn't mention and that wasn't very nice news for the Pascal was *banned* from the
Bulgarian National Olympiad in Informatics, which means that people who want to make it to the national team are required to write in C++ even though Pascal is officially supported in the actual International Olympiad. This is all because people here believe strongly that C++ and its STL give you a tremendous advantage in these competitions and Pascal (obviously) is a dead language and nobody should be taking it seriously and should be discouraged of writing any code in it. Yes, it's all driven by ignorance, but we must combat it.

I'm writing all of this because I've seen the writing on the wall and this has already happened in Bulgaria, so I'd be sad to see this happen in Russia too (which is btw one of the countries in the world with a significant number of Pascal programmers, including FPC contributors).

Having a library for arbitrary-precision arithmetic like gmp is a huge advantage in these competitions and making it easy to setup by people who are clueless idiots and know only how to press "next", "next", "next" so people who chose to compete and write their solutions in Pascal can use it is a must if we want to keep Pascal as a serious option for these competitions. And we want to keep Pascal as a serious option at least in the countries where it still is, because without that, Pascal would be dropped even as a teaching language and FPC contributors would eventually dry up and in the long run FPC cannot survive without contributors. It's great that we have old people contributing to FPC and keeping it alive (no offence about age to anybody, including me ;-) ), but we must also think about the future generations, otherwise we are doomed :)

So I'm all for adding a simple dll in the default windows install for political reasons, even though it might not seem to be the right thing to do to people who aren't involved in competitive programming.

Reply by email

Alexander Klenin
to Nikolay Nikolov
Nikolay Nikolov wrote 6 lines
Just to make it clear how these people usually think, I was part of the IOI2009 technical committee and I was responsible for setting up the pascal environment (fpc & lazarus under ubuntu) to work. In that year, Henadzi Karatkevitch from Belarus won the competition and I boasted about it on the fpc mailing list, because he wrote his solutions in pascal and his achievements are unique in the history of the IOI

I have just returned from Russian stage of students' programming compeition. Gennadiy Korotkevich is now a student in a Russian university, and he won again: http://neerc.ifmo.ru/information/standings.html
He has a good chance to win world finals this year. Sadly, he does not use Pascal any more, since Pascal is banned from students' championship for a few years already.

So I'm all for adding a simple dll in the default windows install for political reasons, even though it might not seem to be the right thing to do to people who aren't involved in competitive programming.

+1

Alexander S. Klenin

Reply by email

Hans-Peter Diettrich
to Nikolay Nikolov: As an ex-competitive programmer and multiple IOI and BOI medalist, let me try to explain,…
Show quoted text 9 lines
As an ex-competitive programmer and multiple IOI and BOI medalist, let me try to explain, although I realize it might be difficult for "normal" programmers to understand, but let's just say that: - the people who setup the programming environment for these competitions are not the same people who compete in them. and the people who compete have no control over what programming tools are installed, because they don't have any kind of internet connection, nor are they allowed to install any packages, etc, during the competition.

So how do the competitors know how to use e.g. gmp, if it has been installed for them? Are the available packages announced before, so that everybody has time to study them?

[...]

Show quoted text 11 lines
It even made it to the FPC front page. However, in that very same year something else happened that I didn't mention and that wasn't very nice news for the Pascal was *banned* from the Bulgarian National Olympiad in Informatics, which means that people who want to make it to the national team are required to write in C++ even though Pascal is officially supported in the actual International Olympiad. This is all because people here believe strongly that C++ and its STL give you a tremendous advantage in these competitions and Pascal (obviously) is a dead language and nobody should be taking it seriously and should be discouraged of writing any code in it. Yes, it's all driven by ignorance, but we must combat it.

This sounds more like they feared that FPC will win one more trophy, and that the C++ promotors agreed to lock out such an too powerful competitor :-]

I'm writing all of this because I've seen the writing on the wall and this has already happened in Bulgaria, so I'd be sad to see this happen in Russia too (which is btw one of the countries in the world with a significant number of Pascal programmers, including FPC contributors).

In such totalitary countries/competitions you cannot do anything to FPC, to make it accepted. Unless you cripple and throttle it so much, that even the best Pascal coder cannot win any more, and this certainly is *not* what we want to do.

We only could organize our own Free Language Olympiad, and *invite* people with other languages and development systems.

Show quoted text 6 lines
Having a library for arbitrary-precision arithmetic like gmp is a huge advantage in these competitions and making it easy to setup by people who are clueless idiots and know only how to press "next", "next", "next" so people who chose to compete and write their solutions in Pascal can use it is a must if we want to keep Pascal as a serious option for these competitions.

Well, knowing how to use such a library does not say anything about the overall skills of an participant or his development system. How will your "clueless idiot" use such a library?

Show quoted text 8 lines
And we want to keep Pascal as a serious option at least in the countries where it still is, because without that, Pascal would be dropped even as a teaching language and FPC contributors would eventually dry up and in the long run FPC cannot survive without contributors. It's great that we have old people contributing to FPC and keeping it alive (no offence about age to anybody, including me ;-) ), but we must also think about the future generations, otherwise we are doomed :)

Perhaps we should spread Pascal more aggressively, not only by reports about news *inside* the language and IDE, but also about its easy and efficient use, compared with other languages and development systems?

E.g. ask in prominent places, why Pascal has been banned from the Bulgarian Olympiad, after its success in a similar prior event?

[But I fear that in Bulgaria or Russia you'll be jailed for spreading such nonconforming wisdom :-]

DoDi

Reply by email

Jonas Maebe
to Nikolay Nikolov: As an ex-competitive programmer and multiple IOI and BOI medalist, let me try to explain,…
Nikolay Nikolov wrote 6 lines
Having a library for arbitrary-precision arithmetic like gmp is a huge advantage in these competitions and making it easy to setup by people who are clueless idiots and know only how to press "next", "next", "next" so people who chose to compete and write their solutions in Pascal can use it is a must if we want to keep Pascal as a serious option for these competitions.

If a major problem is really the lack of standard support for arbitrary-precision arithmetic, does that not mean that C and C++ are no longer serious options either?

Jonas

Reply by email

Marco van de Voort
to Jonas Maebe

In our previous episode, Jonas Maebe said:

Show quoted text 10 lines
> Having a library for arbitrary-precision arithmetic like gmp is a > huge advantage in these competitions and making it easy to setup by > people who are clueless idiots and know only how to press "next", > "next", "next" so people who chose to compete and write their > solutions in Pascal can use it is a must if we want to keep Pascal > as a serious option for these competitions. If a major problem is really the lack of standard support for arbitrary-precision arithmetic, does that not mean that C and C++ are no longer serious options either?

In the standard install, not the language standard.

A full mingw install comes with GMP

Reply by email

Alexander Klenin
to Jonas Maebe: If a major problem is really the lack of standard support for arbitrary-precision…
Jonas Maebe wrote
If a major problem is really the lack of standard support for arbitrary-precision arithmetic, does that not mean that C and C++ are no longer serious options either?

Actually, this is considered a drawback of C++ (nobody uses pure C in competitions).
Top competitors often learn Java just in case they need BigInteger or more efficient HashMap.

Note that there is nothing magic in long arithmetics itself, I do not expect Pascal's downward trend to be suddenly reversed by inclusion of a single library.
However, it would be a good start -- I have already persuaded some teachers to take a second look
on the language based in this and recent STL support.

Alexander S. Klenin

Reply by email

Hans-Peter Diettrich
to Jonas Maebe: If a major problem is really the lack of standard support for arbitrary-precision…
If a major problem is really the lack of standard support for arbitrary-precision arithmetic, does that not mean that C and C++ are no longer serious options either?

IMO that leaves the domain of general purpose languages.

Here I see the boundary at operator level. A language with classes and operator overloading deserves no modifications, in order to make use of such data types and libraries.

DoDi

Reply by email

Florian Klämpfl
to Alexander Klenin: Actually, this is considered a drawback of C++ (nobody uses pure C in competitions). Top…
Alexander Klenin wrote 10 lines
On Thu, Dec 6, 2012 at 8:29 PM, Jonas Maebe wrote: > If a major problem is really the lack of standard support for > arbitrary-precision arithmetic, does that not mean that C and C++ are no > longer serious options either? Actually, this is considered a drawback of C++ (nobody uses pure C in competitions). Top competitors often learn Java just in case they need BigInteger or more efficient HashMap.

Are there any other usefull libs besides gmp we should include?

Reply by email