What could be typical OCaml projects?

drom is able to create full projects in one command. There are currently templates/skeletons, called library, program, mini-lib, mini-prg and ppx_deriver.

For example, drom new ppx_mine --skeleton ppx_deriver will create everything you need (dune, opam, docs, etc.) to create your own ppx by just modifying the generated main.ml file.

THE QUESTION: we are looking to extend this set of skeletons, so: what would be other typical OCaml projects that could be interesting for drom to generate ? Do you have examples of such projects that could be translated into a skeleton ?

The current list with the generated files is described here (for the master branch):

4 Likes

Could drom be updated to use GitHub repositories as templates? That would make it easy to add/remove templates or for anyone to create their own templates. E.g. of how it could work:

drom new --skeleton gh:OCamlPro/drom_library my_lib
2 Likes

I asked myself the same question for Spin.

Here are some templates that are currently implemented that you might be interested in for inspiration:

And non-official ones:

And some that I wanted to build:

  • web (with Opium)
  • desktop-app (with Revery)
  • data-science (with Owl)

As a side note, do you have any interest in re-using Spin to generate Drom’s templates? This would have the benefit of letting drom users benefit from spin templates and vice-versa. I’d be happy to provide any feature you’re missing :slight_smile:

4 Likes

I’d see value in curated templates for OCaml projects that could be either cloned directly from GitHub, or customised via drom. This would make drom optional but it would provide all the renaming that comes with simple cloning.

All of this has a lot to do with personal preferences. Some developers will prefer a minimal setup that they are sure to understand, others will prefer to have a lot of scenarios supported by the skeleton.

I am maintaining my own hello project as a starting point for myself. It’s for simple CLI applications. I expect it to be difficult to find universally loved templates.

1 Like

@yawaramin Indeed, we plan to have this very soon !

@tmattio We didn’t know about spin, it looks interesting. Directly re-using spin templates looks like a very good idea, we will look at the code to see how hard it would be !

@lindig As @yawaramin said, the idea could be for expert users to just have their own skeleton somewhere that drom would instantiate for them. But for new users, or if you want to write a project that you are not used to, it’s still useful to have generic projects to start from.

4 Likes

Using it as a library should be possible. It doesn’t have a very nice dependency profile at the moment, but I’m working on slimming it down.

I’m currently rewriting the DSL decoder part to use dune-lang, to have a template versioning system. This will ensure that changes in the DSL don’t break existing templates. While I’m doing this (large) rewriting, I’ll happily take any feedback you have into account to be included in the next version.

A skeleton with ocamlex and menhir hooked up and ready to go would be great for writing DSLs

1 Like

The same thing but with menhir and sedlex would be great too!

Thanks, ocamllex/menhir and sedlex are very good suggestions. drom has already support for mll/mly files, but having full examples would be great !

This is now available.

1 Like