I’ve been TA-ing a course on functional programming in OCaml at ENSEEIHT, Toulouse, since September and it’s just over now. Students, 4th year students after the “baccalauréat” (how do you call them? graduates? postgraduates?), had to follow several lectures as well as roughly 10 seminars and 10 lab sessions. The whole course was completely revamped this year, so we also decided to use Jbuilder (not Dune, as we had to set up an infrastructure long before Dune 1.0) for our lab sessions.
Overall, the experience has been very nice, so kudos to Dune developers!
However, we also had a few issues that I would like to report for the record (Cc: @jeremiedimino @rgrinberg ), and perhaps to foster a few evolutions of Dune (or to be shown how to solve them easily : we may have missed some information in the documentation).
jbuilder runtestsometimes just hangs while running, I’ll try to devise an MWE later but I’m still reporting this in case this is already a known issue.
Sometimes we wanted to have a program open a file whose path would be relative to the source code itself and harcoded in the ML file. For instance, the OCaml file contained something like
open_in "./foo". Unfortunately, it seems Jbuilder doesn’t run
utopfrom the same working directory, hence depending on the path written in the ML file, one of these commands failed. Is there an easy way to solve this? (We know we could use an absolute path to some location, but we have dozens of PCs running on a university network, so the configuration is not as flexible as one could expect. We’d also like to avoid passing the path on the commandline.)
I already spoke about this in another post ( [Dune] Link against cmo / cmi without source? ) but I’m writing this here too: we sometimes like to provide students with a .cmi/.cmo file pair but no source code. AFAIK there’s no simple, straightforward way to do this with Dune alone…
Well that’s about it. We met a couple of other problems but they could be solved in a reasonably easy way. The only trouble now is that, sometimes, students would like to create their own
jbuild file or update one we have provided, and it’s a bit hard for them to know how to proceed (and the Dune documentation is good but perhaps more aimed at regular developers than students). I expect future versions of Dune or some Dune plugins, or even other tools, to ease setting up basic projects without writing the dune file yourself (e.g. something like
dune new-lib mylib or
dune add-dep mylib core_kernel).