📜 ⬆️ ⬇️

Ocaml Tools

Today I will try to tell you about the tools that help programming in Objective CAML.

Objective Caml tools:
* ocamlc
* ocaml interpreter
* ocamlbrowser

ocamlc - the Objective Caml compiler, is essentially a command interface,
accepting and processing arguments sequentially. Arguments ending in .mli
are the source files for the compilation unit interfaces. Here are the names,
exported by compilation units: variable names, data types, etc.
From the A.mli file, the ocamlc compiler will create the A.cmi file with the compiled interface.
Arguments ending in .ml are considered source files for compilation unit implementations.
Implementations contain definitions for names exported by a unit, as well as expressions computed for their third-party effects. From the file A.ml with the help of ocamlc, an object with bytecode in the file A.cmo will be created later.

The main options are ocamlc:
-a
Creates a library (.cma file) from the .cmo object files specified on the command line. The library name can be specified with the -o option. The default name is lib.cma.
-c
Compilation only, no build phase. Files with source text are converted to compiled files, but no executable file is created.
-custom
In the default mode, the linker creates a bytecode intended for execution by the camlrun shared system. In this mode, the resulting file contains both bytecode and runtime system.
-g
Adds debugging information during compilation and linking.
-i
The compiler prints all defined names when compiling
-impl filename
Compile the specified file as an implementation, even if its extension is different from .ml.
-intf filename
Compile the specified file as an interface, even if its extension is different from .mli.
-linkall
Force compiling all modules in libraries.
-noassert
Turns off assertion checking, and assertions are not compiled.
-nolabels
Ignore non-optional labels in types.
-o exec-file
The name of the file created by the linker.
-rectypes
Allows arbitrary recursive types during type checking.
-thread
Compiles or builds multi-threaded programs using the thread library.
-v
Displays the version number of the compiler and the path to the standard library.
-where
Displays the path to the standard library.
')
OCaml Interpreter:
ocaml is an interactive Objective CAML system. In this mode, the system reads Caml phrases from the input, checks the type, compiles and executes, and then displays the recognized type and value of the result, if any.

OCamlBrowser , browser source and compiled interfaces.

OCamlBrowser performs the following functions:

- Navigating Objective Caml modules.

- Editing, type checking and viewing the source text.

Here, in principle, 3 standard tools for programming on Objective Caml.
There are also OCamlDebug and OCamlDoc, a debugger and a document generator. In the following posts
let's go directly to the language.

psOfficial site - Objective Caml

Source: https://habr.com/ru/post/74501/


All Articles