I tried to follow the instructions on this page : https://ocsigen.org/tuto/6.2/manual/start
and the installation instructions for debian based (I’m on linux mint 19) did not permit me to install ocsigen.
I’m totally new to ocaml. A sudo apt-get install ocaml seems to be missing.
I issued the following commands :
But this is not enough, eliom-distillery -name myapp -template os.pgocaml does not work.
And I checked du -sh ~/.opam/ : 720M !
In such circumstances, my natural reflex is to think “ok, this techno is not mature, ciao”.
The “first app” is the first impression one has on a new techno, so I think it should be very carefully written and tested.
I can’t talk about ocsigen but I found Opam not to be space efficient. If you look around, it keeps installed packages as source trees and all compilation artefacts. My own ~/.opam with a single switch and 300 or so packages consumes 3.7GB.
Just a side note: at current disk prices, 1GB of storage is either $0.03 worth of spinning rust or about $0.15 worth of SSD. Worrying about a couple of gigs of storage is literally worrying about the amount of money a minimum wage earner makes in well under a minute, and indeed, far less than any programmer should ever care about. If “wasting” a few gigs of storage saves you even a minute or two of your life, it’s economically more than paid for itself.
If Opam just sits in your $HOME I would agree. But when you use Opam in containers and in build environments that are frequently re-created and torn down, you start to feel the volume transferred over the network. I think Opam is the best thing that happened to the community but this does not mean it is ideal for all scenarios.
Re-building a container from scratch using a source based build system is probably a mistake. If people really want to construct deployment binaries for containers using opam (which is not an unreasonable desire), we should probably come up with a method for constructing pre-compiled binary packages in a clean build container using opam as the build system, and then people can just blat the built packages in to the destination containers.
I tried to add to add in ~/.bashrc :
export PATH=$PATH:$OCAML_TOPLEVEL_PATH
and
source ~/.bashrc
I see ~/.opam/system/bin in $PATH
but still :
eliom-distillery -name myapp -template os.pgocaml
eliom-distillery : command not found
In ~/.opam/system/bin there are ocaml and ocsigen binaries but no eliom
The only place I find traces of “eliom” in ~/.opam is
.opam/repo/default/archives/eliom.6.3.0+opam.tar.gz
.opam/repo/default/packages/eliom
.opam/repo/default/packages/eliom/eliom.2.2.2
Thanks for your helps. I tried several things, but it still doesn’t work. I will uninstall for the moment. I’m following the mooc at fun-mooc.fr (Introduction to Functional Programming in OCaml) and it’s possible to use the online REPL. I tried to install ocmal locally to test ocsigen.
The main reason is the question of space, the “side note” of perry.
First, if I want more space on my local machine, I need to buy a 512 SSD, which is 100 euros, so money is a concern.
But more important is the fact that these 721 Mo are stored in my home, so they will be included in backups, and I try to backup only things that need to be backuped.
At least for me, the location of .opam is blocking ; I tried haskell this summer and could write small programs locally. Maybe it was also 700 Mo but I didn’t notice it as it was stored in /usr and other system locations.
It’s very likely that your opam installation is not properly initialized. I recommend following the installation instructions included in Real World OCaml: https://dev.realworldocaml.org/install.html
ok, I removed ~/.opam and followed the instructions from realworldocaml.org and it worked.
I fixed the problem of space occupied by ~/.opam in my home doing something ugly : cd ~ sudo mv .opam /usr/opam ln -s /usr/opam .opam
It seems to work
Ocsigen install still doesn’t work because some packages installation failed (conf-gmp.1 conf-libpcre.1 sqlite3.4.3.2) but it’s not important for the moment. I’m just a newbie, a programmer used to imperative languages who starts to realize that functional programming can’t be neglected anymore. I’ll come back to ocsigen when I’m more familiar with opam and ocaml ecosystem.