3
\$\begingroup\$

Most Java interpreters have a predefined memory limit. However, it's a -X setting - an implementation specific setting.

With C, the call stack is usually heavily limited. There's usually a compiler setting to increase this limit. This is implementation-specific and as far as the C spec is concerned, there's no call stack limit.

Should implementation-specific options to increase the memory limit count towards the byte/character count? In other words, should limitations of the physical world count towards the byte count?

| |
\$\endgroup\$
  • 1
    \$\begingroup\$ In many C implementations, the stack limit can be set at runtime (it's specified by the operating system, and there's often a way to tune it). That means that it wouldn't need to be set at compile time. Java is similar; the -X flag isn't given to javac (the compiler), but rather to java (the runtime). In this sense it's a bit different from the typical compiler flag. \$\endgroup\$ – user62131 Dec 3 '16 at 2:23
6
\$\begingroup\$

It depends.

We usually require submissions to work only up to the limits of the compiler/hardware, as long as the underlying algorithm works for arbitrary input.

Unless the challenge specifically says otherwise, if a solution requires a wider integer type, a higher recursion limit, a bigger stack limit, more bytes of RAM than there are atoms in the observable universe, etc. for some/most/all of the test cases, you don't even need the -X flag, so you don't have to add it to your byte count.

However, if the challenge spec requires your solution to work for specific test cases, the extra flags should count, as would the required import statements to work with arbitrary-precision integers.

| |
\$\endgroup\$
  • \$\begingroup\$ But they're implementation-specific flags! E.g. a different JVM or a different compiler would work just fine without the flags. Do I use the friendlier compiler/interpreter as the language, rather than the language itself? (e.g. "GCC - 240 bytes" rather than "C - 240 bytes") \$\endgroup\$ – SoniEx2 Dec 3 '16 at 2:08
  • 6
    \$\begingroup\$ As far as PPCG is concerned, the implementation is the language. If there is a compiler that doesn't require the flag, you don't need it in your submission. Just mention the compiler you used and you'll be fine. \$\endgroup\$ – Dennis Dec 3 '16 at 2:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .