Currently, CD-MOJ sends .cpp problems into SPOJ to be compiled using the C++03 standard of the language, whereas there is an ongoing effort on the spread of Modern C++.
I've discussed the matter a bit with both @bcribas and @maups. Both have brought important points, and I'm opening this issue as an effort to join the discussion and give some ways we could approach the problem.
1 - Send using C++14 by default
The simplest and easier to implement approach. There's two problems with it:
Some SPOJ problems do not accept C++14 (gcc 6.3) as a valid submission alternative. Although from my tests, by simply using the gcc 6.3 option (not to be confused with the previous one), which is available, C++14 code compiles fine. PECA7 is an example of this behaviour. And yes, gcc 6.3 seems to be available everywhere.
@maups likes that the older standard is more strict and gives more error messages, which is useful for Introduction to Programming Logic classes. There would probably be a way to give command line arguments to make the compiler more strict, but yeah, SPOJ does not provide that.
Would be quite cool to see some of those errors in action @maups, would bring more context to this issue.
2 - Identify a new file extension for C++14
Would work but seems quite hacky. An extension not yet used by MOJ but that is quite common is .cxx, we could assign this one to Modern C++. Alternatively, add a new extension like .cpp14 or so.
3 - Specify classic C++ on contest-description.txt
For instance spoj-br PLACAR "Quem vai ser reprovado?" A reprovado.txt would use modern C++, but something like spoj-br PLACAR "Quem vai ser reprovado?" A reprovado.txt c++03 would use the older standard.
That seems complicated to implement now, so that's a cons. Plus doesn't seem to scale to the idea of the contests not specifying a programming language at all.
So that's it. As a student, I'm looking forward to have C++14 available not only in CD-MOJ, but to be gradually exposed to computer science students in general. Some of the features are quite cool and helpful.
Wanna hear some feedback on these approaches and maybe more possible approaches :)
Currently, CD-MOJ sends
.cpp
problems into SPOJ to be compiled using the C++03 standard of the language, whereas there is an ongoing effort on the spread of Modern C++.I've discussed the matter a bit with both @bcribas and @maups. Both have brought important points, and I'm opening this issue as an effort to join the discussion and give some ways we could approach the problem.
1 - Send using C++14 by default
The simplest and easier to implement approach. There's two problems with it:
Would be quite cool to see some of those errors in action @maups, would bring more context to this issue.
2 - Identify a new file extension for C++14
Would work but seems quite hacky. An extension not yet used by MOJ but that is quite common is
.cxx
, we could assign this one to Modern C++. Alternatively, add a new extension like.cpp14
or so.3 - Specify classic C++ on
contest-description.txt
For instance
spoj-br PLACAR "Quem vai ser reprovado?" A reprovado.txt
would use modern C++, but something likespoj-br PLACAR "Quem vai ser reprovado?" A reprovado.txt c++03
would use the older standard.That seems complicated to implement now, so that's a cons. Plus doesn't seem to scale to the idea of the contests not specifying a programming language at all.
So that's it. As a student, I'm looking forward to have C++14 available not only in CD-MOJ, but to be gradually exposed to computer science students in general. Some of the features are quite cool and helpful.
Wanna hear some feedback on these approaches and maybe more possible approaches :)
cc @bcribas cc @maups