ELIOMC(1)

πŸ“¦ version 9.4.0, in debian bookworm, ubuntu jammy

πŸ’– ELIOMC(1) β€” the eliom build tools πŸ’–

okay bestie, gather round, because this is the ELIOMC(1) manual page and it is giving "General Commands Manual" energy. no cap.


✨ NAME ✨

eliomc, eliomcp, eliomopt, js_of_eliom, eliomdep β€” the eliom build tools. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

eliomc [options] files

eliomcp [options] files

eliomopt [options] files

eliomdep [options] files

eliomdoc [options] files

eliompp [-client|-server] files

js_of_eliom [options] files -o filename.js

πŸ¦‹ DESCRIPTION πŸ¦‹

eliomc, eliomcp and eliomopt are wrappers around the OCaml compiler that make compiling the server part of projects based on the Eliom framework sooo much easier. they respectively accept the same set of options as the ocamlc(1), ocamlcp(1) and ocamlopt(1) compilers, plus the specific ones described down in the OPTIONS section. πŸ’…

js_of_eliom is a wrapper around the OCaml and Js_of_ocaml compilers that makes compiling the client part of Eliom projects easy-peasy. it accepts the same set of options as the ocamlc(1) compiler, plus the specific ones in the OPTIONS section. ✨

eliomdep is a wrapper around ocamldep(1) that handles dependencies of .eliom source files. it accepts the same set of options, plus the specific ones in OPTIONS. heads up: it assumes that server-side compiled modules of OCaml files located in this directory subtree live in a directory called _server (with the same subdirectories structure) β€” and respectively in a directory called _client for client-side compiled modules. πŸ‘€

eliompp is EXPERIMENTAL πŸ”¬ β€” it's a preprocessor that removes specific sections, depending on the option you give it. the option -client will remove all the top-level parts and the server sections, and the option -server will remove only the client sections. slay.

eliomdoc is EXPERIMENTAL πŸ”¬ β€” it's a wrapper around the OCaml documentation generator ocamldoc. it lets you generate documentation from the client side or the server side. it accepts the same set of options as ocamldoc(1), and it automatically extracts the commentaries from the sections you asked for. but fr fr, eliomdoc is currently experimental and you might run into some undefined behaviours. (see http://ocsigen.org/eliom/manual/workflow-compilation). some well known bugs are: 😭

  • your files should always begin with a value and not with a comment. otherwise, camlp4 won't output the commentaries. πŸ’€
  • sometimes, comment nodes are not attached as expected. that's because camlp4 (sometimes) removes extra new lines between value elements. πŸ™ˆ

🌸 COMPILING ELIOM SOURCE FILES 🌸

compiling files with a .eliom extension happens in three steps, bestie:

  1. infer the type of value sent by the server to the client,
  2. compile the server part of the code,
  3. compile the client part.

the first two steps can be done with eliomc, and the last one with js_of_eliom. 🫢

both tools produce a .cmo file named the same as the original .eliom file. and to avoid overwriting the .cmo representing the server part with the .cmo of the client part, files generated by eliomc or eliomopt are stored by default in a subdirectory named _server, and files generated by js_of_eliom are stored in a subdirectory named _client. those default directories can be overridden by the environment variables ELIOM_SERVER_DIR and ELIOM_CLIENT_DIR respectively. iconic. πŸ’…

the types inferred by eliomc for values sent by the server to the client are stored in an intermediate file named the same as the original .eliom file, whose extension is .type_mli. that file is required by js_of_eliom for compiling the client part of the .eliom file. and the eliomdep tool correctly generates dependencies for that intermediate file, for the server .cmo and for the client .cmo. βœ…


⭐ OPTIONS ⭐

  • -eliom-inc <dir> β€” add <dir> to the list of eliom include directories (this one is eliomdep only).
  • -dir <dir> β€” specify the target directory for generated files.
  • -package <name> β€” this is the same option as the ocamlfind one.
  • -predicates <p> β€” this is the same option as the ocamlfind one.
  • -no-autoload β€” do not load commonly used syntax extensions (ppx_deriving, lwt, js_of_ocaml, tyxml).
  • -type-conv β€” use type_conv syntax extensions instead of the deriving one. it has no effect if you use it together with -no-autoload.
  • -ppopt <opt> β€” append <opt> to the preprocessor invocation.
  • -jsopt <opt> β€” append <opt> to the js_of_ocaml invocation (js_of_eliom only).
  • -infer <opt> β€” for a .eliom file, only generate the intermediate .type_mli file (eliomc and eliomopt only).
  • -noinfer <opt> β€” for a .eliom file, do not generate the intermediate .type_mli file (eliomc and eliomopt only).
  • -help or --help β€” display a short usage summary and exit. bye bestie πŸ‘‹

πŸ”₯ EXAMPLES πŸ”₯

say you've got an Eliom project made of a server specific file named server.ml, a client specific file named client.ml, and two common files named base.eliom and main.eliom. you could compile it with these commands, periodt:

eliomc -a -o appl.cma server.ml base.eliom main.eliom
js_of_eliom -o appl.js client.ml base.eliom main.eliom

and to avoid recompiling the whole project every single time, you could split it into multiple steps like this:

eliomc -c server.ml
eliomc -c base.eliom
eliomc -c main.eliom
eliomc -a -o appl.cma _server/server.cmo _server/base.cmo _server/main.cmo
js_of_eliom -c client.ml
js_of_eliom -c base.eliom
js_of_eliom -c main.eliom
js_of_eliom -o appl.js _client/client.cmo _client/base.cmo _client/main.cmo

main character energy, honestly. 🌈


πŸ’œ SEE ALSO πŸ’œ

ocamlc(1), ocamlopt(1), js_of_ocaml(1), ocamlfind(1), ocamlcp(1), ocamldep(1).


πŸ‘‘ AUTHOR πŸ‘‘

eliomc, js_of_eliom, eliomdep and eliomopt were written by Gregoire Henry <gregoire.henry@pps.jussieu.fr>. 🫢

eliomdoc was written by Charly Chevalier <charly.n.chevalier@gmail.com>. 🫢

this manual page was written by Pierre Chambart <chambart@crans.org>. 🫢


and that's the whole page, bestie β€” this version of the manual is from 2012-02-15, part of ELIOMC(1). mwah, go compile something gorgeous πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from