1
\$\begingroup\$

Since bash scripts (or any other Linux shell scripts) are accepted as a programming language, I wonder what (Linux) programs are accepted as callable from the command line.

It seems that it is concensus that all programs in the coreutils package are allowed to be called from a shell script (several answers can be found in this category). From a certain perspective those programs can be seen as libraries, used by the shell script.

But how about other programs outside the coreutils in a (any) distribution's repository? Are they allowed? And if so, up to what extent?

For example is this question, I could use sipcalc to fabricate a shell script (bash) answer. Is this allowed?

Disclaimer: I searched meta for an answer to this question, but I could not find it. Maybe I missed it. If so, please let me know in the comments.

\$\endgroup\$
6
\$\begingroup\$

I'm not too familiar with Bash, Linux Shell, and other scripting languages. But I don't see why this wouldn't be allowed, as long as you've mentioned it in the title. Similar things are done with internal libraries (Python 3, numpy, scikit, 100% or Bash + Cygwin (or WSL), 21 bytes) as well as with flags (i.e. C# (Visual C# Interactive Compiler) with flag /u:System.Text.RegularExpressions.Regex, 99 bytes or Perl 5 with -nlF/\s|/, 39 bytes).

Here is a relevant meta-answer for flags, for which I'll quote the first sentence:

Rather than dealing with inconsistent schemes for adding flags, let's just consider each separate invocation of a compiler/interpreter/whatever a separate implementation (and thus a separate language by our rules).

I don't see why the same wouldn't apply to external libraries as well. Where a regular Bash answer and a Bash answer with your sipcalc library are just two 'different languages'.

EDIT: Some examples of languages using external libraries (most are pre-2016 however):
- PHP using SimplePHPEasyPlus, 1299;
- Racket using an external library for clearing, 351 bytes;
- JavaScript (using external library Enumerable), 52 bytes;
- R using external library gmp, 52 bytes;
- JavaScript using Node.js with moment + HumanizeDuration, 125 bytes;
- R using lubridate package, 99 bytes.

As long as you clearly mention it, and link to the external library used, it's allowed as far as I know (unless the challenge explicitly forbids it (i.e. "Use of external libraries is forbidden", which also happens pretty often).

I've also posted an answer with an external library once (although I now see I've forgot to link to the library..): Java 7 with JavaFX, 674 bytes

\$\endgroup\$
  • \$\begingroup\$ As long as the ext library isn't just a custom built "FizzBuzz"-type routine to circumvent the challenge. I feel that the library should be reasonably well known or standard for some OS \$\endgroup\$ – roblogic May 5 at 23:51
  • 1
    \$\begingroup\$ @roblogic Assuming one was creating it just to 'cheat' a specific challenge, I would assume the 'no competing answers from languages newer than the challenge' would apply (because your 'language' is 'bash + [wacky utility you made]'). Otherwise, if there's an existing utility out there, is it much different from an esolang with a one- or zero-byte 'Hello, world!' command? One would at least hope it would not get voted up much, for being a trivial/uninteresting solution... \$\endgroup\$ – brhfl May 6 at 16:13

You must log in to answer this question.

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