I was wondering if it were possible to use multiple languages in the same submission. Not a polyglot, but using each of the languages. I have two thoughts on this.
- One language invokes the other. Let's say we have a Ruby + JavaScript solution. Then, you could have, say,
puts %x(node a)
inrun.rb
andconsole.log(x=>x)
ina
, and haverub.rb
be the main solution. - Alternatively, each language could read the output of the previous language as input. E.g., invoke like
<input> | <language a> | <langauge b>
.
How would these be scored? How would it be consistent, concerning the usage of langs (e.g. multiple usages of the same lang)? How would it compare with each of its component languages? Should it be allowed at all? If not, why not?
Here is an example of a multi-language submission, using method 2:
J + Ruby, idk bytes
Ruby, ruby.rb
:
p gets.split.map(&:to_i).map{|s|s+4}
J, j.ijs
:
exit echo 1+i.10
Invoke like:
j.ijs | ruby.rb
Output:
[5, 6, 7, 8, 9, 10, 11, 12, 13, 14]