On D in competitive programming

Ivan Kazmenko gassa at mail.ru
Tue Jul 31 10:53:51 UTC 2018


On Tuesday, 31 July 2018 at 00:52:22 UTC, 9il wrote:
> Are competitors allowed to use mir-algorithm and mir-random? 
> The libraries can be used for graphs (Tarjan algorithm), 
> matrices/tensors, nd-iteration, RNGs, interpolation, and 
> distributions?

Sadly, no: most of the time, language compilers on the server 
side are provided as they are out-of-the-box.  I'll try to 
explain why.

When a language is added to a competition, one of the goals for 
the organizers is to keep the whole thing fair.  Different 
languages have different pros and cons already as they are, and 
what is an implementation-heavy problem for one language is 
solved in a couple lines with another.  So, the availability of 
several programming languages already puts some burden on the 
problemsetters: at least for important competitions, they have to 
come up with problems which don't play too much into the 
strengths of any particular language, and that means knowing what 
to generally expect of all the languages.  For example, most 
problems don't rely on number crunching with integers above 64 
bits, since C++ is notoriously lacking in this regard.

This all gets a new dimension if a platform decides to supply 
additional libraries.  Once it's done for one language, there are 
no clear boundaries: if we get mir-algorithm for D, we will have 
to at least install Boost for C++, and numpy for Python, and the 
users of other languages also ask for their favourite libraries, 
which are in turn more powerful than Boost, and so on.  And it 
would take significant expertise to balance such requests so that 
no language has too much of an unfair advantage or disadvantage.  
It takes a bit of expertise too to keep the libraries in all 
languages working and up-to-date.  All the way, the 
problemsetters now have to avoid a different set of topics, 
changing with new libraries being added.

Yet another factor is that there are central competitions 
perceived as the most important, which are currently ACM ICPC 
World Finals for university teams, and their regional contests.  
Many platforms strive to act as training grounds for the 
important competitions.  So when the World Finals, which are 
understandably conservative, don't do X, it's a disincentive to 
do X for the training grounds too.

So, the default approach is to keep each language at a bare 
minimum.

> It would be nice to have this feature, as mir-algorithm can be 
> a good default library for competitive programming. Plus 
> competitors can add additional graph algorithms.

It may still be reasonable to ask for additional libraries on the 
platforms where the focus is not some big competition: e.g., 
perhaps no for ACM ICPC archives, perhaps yes for interview 
training sites.  For a particular platform and a particular cause 
(e.g., a training course for a learning platform), it's entirely 
possible to have D with mir-algorithm installed on the platform.

Ivan Kazmenko.



More information about the Digitalmars-d-announce mailing list