can we use the OCaml programming language with VPL?

can we use the OCaml programming language with VPL?

by crémos MOUSLI -
Number of replies: 1
Dear Juan Carlos,

I hope you are well.
There are teachers who ask me if we can use the OCaml programming language with the Virtual Programming Lab (VPL) module of Moodle.

Best regards,
Cremos
Average of ratings: -
In reply to crémos MOUSLI

Re: can we use the OCaml programming language with VPL?

by Regis Smith -

First you must install Ocaml and a build system for Ocaml (On Ubuntu the package "ocaml-native-compilers" provides ocamlc.opt, but I can't figure out which Ubuntu package provides dune--I use Debian but my VPL server is Ubuntu).

Once you have Ocaml and your build tools installed, you can just edit vpl_run.sh with something like

#!/bin/sh
cat > vpl_execution <<EOF
#! /bin/bash
ocamlc.opt main.ml -o main
./main
EOF
chmod +x vpl_execution

Ocaml Compiler in VPL


This is just to get you started.  You should do this with a dune file, which you can save in the VPL Activity, I think.  You can read the examples for other languages in the VPL source code.