About Web Development

This category is for discussing web development in OCaml, with some of the major pieces of this puzzle being:

Frameworks

opium is a Sinatra-like framework built on cohttp.

Eliom is a more full-featured framework for server or client-server Web and mobile app development, from the Ocsigen project. It turns OCaml (or Reason) into a multitier language, which simplifies a lot the communication between client and server. It makes it possible to write both the Web and mobile apps (Android, iOS …) with the exact same code. It contains an advanced session mechanism and provides functional reactive interface programming using React.

ocaml-webmachine is a port of webmachine built on top of cohttp, and particularly well-suited for writing RESTful APIs.

JavaScript transpilers

js_of_ocaml compiles OCaml bytecode to JavaScript, focusing on interoperability with opam and the OCaml ecosystem.

BuckleScript compiles a more high-level intermediate representation of OCaml into decently readable JavaScript and focuses more on interoperability with JavaScript and the npm ecosystem.

js_of_ocaml ecosystem

incr_dom is an MVC-like front-end framework based on virtual-dom and using js_of_ocaml.

ocaml-vdom is an implementation of the Elm Architecture for js_of_ocaml.

gen_js_api Easy OCaml bindings for Javascript libraries.

BuckleScript ecosystem

reason-react is high-level BuckleScript bindings to React (Reason is, as the name suggests, recommended but not actually required.)

bucklescript-tea is an implementation of the Elm Architecture for BuckleScript.

Ocsigen ecosystem

Ocsigen Toolkit a client-server toolkit taking advantage of Eliom’s multitier language.

Ocsigen Start a template for easily build your first multi-platform (Web and mobile) app.

Ocsigen Tyxml a library for building statically correct HTML5 and SVG documents.

Ocsigen Server a full featured and extensible Web server, with CGI, authentication, access control, reverse proxy, user pages, etc. Now based on cohttp.

Template languages

ocaml-mustache is an implementation of the mustache logic-less template language.

Snabela is a logic-less template language that is heavily inspired by mustache, but makes a few improvements on it.

Companions

Reason is a Facebook-backed project that aims to provide OCaml with friendlier syntax, tools and workflow. It takes a lot of inspiration from JavaScript and its ecosystem, and has formed a strong and growing community around itself in combination with BuckleScript and reason-react.

9 Likes

A headsup for Cohttp users: there is a significant packaging rearrangement incoming in order to simplify its many backends. Details on @rgrinberg’s blog at: http://rgrinberg.com/posts/cohttp-breakage-ahead/

You might want to add incr_dom to your list of frameworks:

And LexiFi’s ocaml-vdom, which is an Elm-style architecture implemented in OCaml, is also a reasonable thing to mention.

Done. Also added a few BuckleScript frameworks as counterweight :slight_smile:

Also template languages :

The upstream link for cohttp in your post should probably be corrected to https://github.com./mirage/ocaml-cohttp and not my personal fork.

Thanks for collating this list!

Oops, apparently I just blindly copied the cohttp link from opium, which I guess is also wrong. Submitted a PR there as well.

Added the template languages.

1 Like

the Web category has been replaced by a tag instead and this post is linked to from the central FAQ.

Would you like to edit the original post here to direct users to the web tag? Alternatively, we can also turn this topic into a wiki page that makes it editable by other users to make it easier to maintain the list of resources above.