eliom icon indicating copy to clipboard operation
eliom copied to clipboard

Templates: nomenclature slightly confusing?

Open OnkV opened this issue 7 months ago • 0 comments

This is not a bug report, but a pointer to some terms which could confuse beginners (IMHO).

On the manual page Ocsigen Server: A full featured extensible Web server in OCaml the reader is presented with two opions for using ocsigenserver:

  1. Use as a library: "To include a Web server in your OCaml program, just add package ocsigenserver to your Dune file, together with all the extensions you need. [...]".
  2. Use as an executable: "Alternatively, you can run command ocsigenserver with a configuration file [...]".

Further down, the manual teaches us in Compiling a client-server app:

If you don't want to use Ocsigen Start, you can use one of the basic templates:

eliom-distillery -template app.exe -name myapp

(to build a static executable without config file) or

eliom-distillery -template app.lib -name myapp

(to build your app as a library that will be loaded dynamically in Ocsigen Server using a config file).

So there are the two terms library and executable.

  • If you want to follow the procedure as advertised in Use as a library, you are supposed to start your project with the template app.exe.
  • On the other hand, to follow Use as an executable, the correct template to use is app.lib. While I don't think the manual is incorrect, it could be a source of confusion for new users.

The first part of the manual takes the perpective of ocsigenserver (which uses the programmer's code as a library vs. acts as a library for the programmer) while eliom-distillery takes the perspective of the programmer's code (which uses ocsigenserver as a library vs. an executable).

IMHO it would be clearer to present ocsigen as a framework (which calls the user's code) versus a library (which is called by the user's code) and to use these terms consistently. The terms library and executable are generic and their meanings change with the programmer's perspective.

I hope this isn't too confusing. Thank you for a stunning piece of software.

OnkV avatar Apr 13 '25 14:04 OnkV