Nim4Colab is a IPython extension to integrate Nim language on Google Colaboratory.
Copy and paste following code to a cell on Google Colaboratory and run. This code download, install and load Nim4Colab extension.
!pip install git+https://github.com/nehtr/nim4colab.git
%load_ext nim4colab
Then, you can use line and cell magics in Nim4Colab extenson.
%%nims
echo "Nim version ", NimVersion
Nim4Colab downloads and installs latest Nim from Nim nightlies when first time one of Nim4Colab's magic is called.
User code is saved to ~/code.nims
file before nim
command is called.
Compile and run Nim code.
Equivalent to calling nim c --verbosity:0 [options] ~/code.nims
Run the code as a Nim script (without compiling it).
ATTENTION: not all the Nim libraries are supported in Nimscript, though most of them are.
Equivalent to calling nim c --verbosity:0 [options] ~/code.nims
Equivalent to calling nim command [options] ~/code.nims
Same to %%nimc
but uses devel branch Nim.
Same to %%nim
but uses devel branch Nim.
Execute nim [parameters]
.
Execute nim [parameters]
using devel branch Nim.
Execute nimble [parameters]
.
Refer Nim Compiler User Guide.