Yes! You can mix as many languages as you want in the same capsule. Simply pick the first language, and then install the second language via apt-get by adding the appropriate package to your Run Environment, e.g.:

  • build-essential  for the C/C++ toolchain (gcc/g++, make, etc.)
  • r-base  for R
  • python  for Python (add python-pip  for pip installer support)
  • perl  for Perl (add cpanm  if needed)
  • luajit  for Lua (add luarocks  if needed)
  • default-jdk  for Java
  • gfortran  for Fortran.

What if I use GPU-accelerated code?

Start from the language that utilizes GPU acceleration and build from there. See this help article for a list of languages with GPU support and more information. 

How should I combine proprietary languages, or proprietary and non-proprietary languages?

In general, start from the proprietary language, i.e. MATLAB or Stata.

To combine MATLAB and Stata,  Start from Stata and switch the base environment to "Stata with MATLAB 2016b." See "Selecting a base environment" for more information. 

See Setting up new or additional languages on Code Ocean for more information.

Did this answer your question?