I am trying to use the aantron/luv library to try to build something and I ran into all kinds of build system issues mostly because I still haven't grokked the reason-native build system yet. That's ok. This note is my way of getting better and having a reference I understand when I need to come back to it. The
reason-native build environment has a list of great tools you can use. Most prominent among them are
Spin. The last two use
dune so you end up learning about
dune whatever you do.
Let's start with
dune. Assuming you have
dune installed this is easy. Go here if you don't then head back.
Make a directory and
cd into it.
mkdir straight-dune-luv && cd straight-dune-luv
.gitignore file for
ocaml using the gitignore-cli.
gi ocaml > .gitignore
Create a switch with
luv requires at least that.
opam switch create . ocaml-base-compiler.4.08.1
dune will tell you nicely if you forget to do this.
opam install reason luv
dune file and run install.
touch dune && dune install
Makefile, optional. I just copied the one from a previous post here.
Which didn't work because of the tabs being off from the paste. Ran
cat -e -t -v Makefile which I found on
Add the code from aantron/luv/example/progress.ml.
Convert it to
.re and delete the
bsrefmt --parse ml progress.ml --print re > progress.re rm progress.ml
make to build it.
dune exec ./progress.exe
❯ dune exec ./progress.exe 33% 66% Done
Honestly, that was very easy. This has to be your go to build for a simple project. Source can be found here
Let's try with