How to contribute
The source code adheres to standards that keep it uniform and demonstrate (what we beleive to be) good programming practice. We kindly ask that all contributions to the repository follow the established pattern, and follow these guidelines:
- The name of the language should also be a valid OCaml module name.
- The language source code for language
lang
resides insrc/lang
. - If the language is an extension of
lang
with featureX
, call itlang_X
. - Language
lang
should have a filesrc/lang/example.lang
which shows how it is used. - Language
lang
should have a filesrc/lang/README.md
which explains briefly what the language is about. You can also put examples in this file, but note that the web page will already link tosrc/lang/example.lang
so there is no point in just copying that to theREADME.md
file. - Instead of making one language with many features, make several languages each demonstrating a feature.
- Use interfaces
.mli
files and comment all entries in the interface using the ocamldoc format(** ... *)
. -
The main program should use the
Zoo.Main
functor:module MyLanguage = Zoo.Main(struct .... end) ;; MyLanguage.main() ;;
This will give your language line-editing capabilities (if
rlwrap
is installed) and a uniform user interface. - Do not use
open
to open modules, there are better solutions (the best one is to just not look for any shortcuts).
Remember: these are guidelines that can be broken for a good enough reason.