Skip to content
/ modern-ocaml Public template

Template for an ocaml project with modern tooling

License

Notifications You must be signed in to change notification settings

Khady/modern-ocaml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

modern-ocaml

Template for an ocaml project with modern tooling.

The setup should be installable as easily as possible.

Getting started

opam switch create . 5.2.0 --no-install
opam install . --deps-only --with-dev-setup

Build system

The current goto build system in ocaml is dune. Version 3 or superior of the dune lang should be used if possible. Unless the goal is to write a library that must be compatible with legacy environements. The base of the project has been generated with dune init project modern_ocaml.

Continuous integration

The CI setup is relying on github actions. It is kept as simple as possible. It checks for compilation of the project, tests, code formatting.

Code formatting

This repository has ocamlformat enabled. With the default configuration. In a modern editor setup, using it should be mostly transparent. It can also be triggered with dune build @fmt.

Editor tooling

Over the past year a very good implementation of a LSP server for ocaml has been developed. It should be automatically installed during the setup of the project.

Running a binary

After running the setting up commands, you can check that it works by running:

$ dune build
$ dune exec bin/main.exe
Hello, World!

License

This repository contains a AGPLv3+ license file. I made this choice because I support free software and I believe that it is the best license to use for personal projects. But this repository is meant to be used as a template. It doesn't contain any original code by itself. So it can't be covered by a license. Feel free to use this template for your projects and pick the license you prefer. It is also totally fine to use it for a closed source project.

If you need help selecting a license, the Free Software Foundation provides a short guide for picking a license.

About

Template for an ocaml project with modern tooling

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •