From: Ralf Treinen Date: Thu, 22 Jun 2006 20:28:22 +0000 (+0000) Subject: put explanation on bytecode vs. native code first, and expand on this X-Git-Tag: archive/raspbian/4.08.1-4+rpi1~3^2~634 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=af9342feb59025caaf4b5af2261d1fb297ff5338;p=ocaml.git put explanation on bytecode vs. native code first, and expand on this language improvements include myself as author --- diff --git a/debian/policy/authors.xml b/debian/policy/authors.xml index 26819dd7..3c8cef37 100644 --- a/debian/policy/authors.xml +++ b/debian/policy/authors.xml @@ -21,6 +21,14 @@ The NM Debian Project
sylvain.le-gall@polytechnique.org
+ + + Ralf + Treinen + + The NM Debian Project +
treinen@debian.org
+
diff --git a/debian/policy/chapter-generalities.xml b/debian/policy/chapter-generalities.xml index db03cc6e..28faa5c4 100644 --- a/debian/policy/chapter-generalities.xml +++ b/debian/policy/chapter-generalities.xml @@ -1,12 +1,131 @@ +
+ Bytecode and Native Code + +
+ Bytecode and Native Code Executables + + + The OCaml compiler can produce two kinds of executables: bytecode + and native. Native executables (produced by the compiler + ocamlopt) are generally faster than bytecode + executables since they are compiled specifically for an + architecture. Bytecode executables (produced by the compiler + ocamlc) have the advantage of being portable, + which means that a bytecode executable can be run on any + architecture without having to be recompiled. Bytecode executables + are smaller than native code executables. If considering only one + process the advantage in size is annihilated by the need for the + OCaml run time system for executing bytecode, however there is an + advantage when running several bytecode processes in parallel + since the runtime system can then be shared. It should be noted + that OCaml compilers to native code are not provided for every + architecture. Only the following ones are supported: + &supported-archs;. + + + Packages providing both native and bytecode versions of a program + prog usually name them respectively + prog.opt and prog.byte + and provide a symbolic link prog to the best + available version (generally prog.opt). + +
+ +
+ Bytecode and Native Code Compilers + + + The ocaml-native-compilers package contains + the OCaml compiler executables built in native mode: + ocamlc.opt, which produces bytecode, and + ocamlopt.opt, which produces native + code. Since the OCaml compilers are themselves written in OCaml + this package exists only on architectures where compilation to + native code is supported. + + + + The ocaml-nox package contains the OCaml + compiler executables built in bytecode mode: + ocamlc, which produces bytecode, and on + architectures where compilation to native code is supported the + compiler ocamlopt, which produces native + code. It is important to understand that on architectures where + compilation to native code is supported both + packages contain compilers from OCaml to both bytecode and native + code, the difference lies in the nature (installation size and + execution speed) of the compiler executables. + + + + OCaml Compilers + + + + + Compiles to bytecode + Compiles to native code + + + + + Compiler executable in bytecode + ocamlc + ocamlopt + + + Compiler executable in native code + ocamlc.opt + ocamlopt.opt + + + +
+ + + + Compiling with native code versions of the compilers is generally + faster than with compilers in bytecode. Unfortunately, the + ocaml-native-compilers package is not + available on every architecture. Packages should + therefore never depend directly on this package. In + order to build big programs and benefit from this natively built + compiler, packages should depend on + ocaml-best-compilers which itself depends on + ocaml-native-compilers where available and on + ocaml elsewhere. Since it is a virtual + package, it cannot (yet) be a versioned dependency. The version + dependency should thus be carried by the + ocaml dependency. Note that dependency on + ocaml-best-compilers is only necessary for + real big programs for which compilation takes a lot of + resources. For most small programs the compilers from the + ocaml-nox package are perfectly sufficient, + and faster to install in a build environment than compiler executables + in native code. + +
+
+
OCaml in Debian + - At the time of this writing, the latest version of OCaml in Debian is &ocaml-version;. - + At the time of this writing, the latest version of OCaml in + Debian is &ocaml-version;. - The ocaml package depends on all the basic packages needed to develop programs with OCaml. More specifically, the packaging of OCaml is split into smaller packages. The packages with suffix -nox contain libraries which don't need X (i.e., for the programs which don't use the Graphics or LablTk modules) in order to avoid dependencies on big packages for users who do not need to run graphical applications. Here is the list of binary packages in which OCaml is split: - + The ocaml package depends on all the basic + packages needed to develop programs with OCaml. More specifically, + the packaging of OCaml is split into smaller packages. The + packages with suffix -nox contain libraries + that don't need X (i.e., for programs that don't use the + Graphics or LablTk modules) in order to + avoid dependencies on big packages for users who do not need to + run graphical applications. Here is the list of binary packages into + which OCaml is split: + + The ocaml and ocaml-nox packages contain the compiler and its libraries. @@ -27,7 +146,7 @@ - The ocaml-interp package contains the toplevel system for OCaml (ocaml), that enables interactive use of the language. + The ocaml-interp package contains the toplevel system for OCaml (ocaml) which provides for an interactive interpreter of the language. @@ -49,46 +168,38 @@ - Since libraries produced by OCaml are binary incompatible when compiled with different releases of OCaml, versioned virtual packages are also provided by packages at items (1) and (2): ocaml-&ocaml-version;, ocaml-nox-&ocaml-version;, ocaml-base-&ocaml-version;, ocaml-base-nox-&ocaml-version;. + Since libraries produced by OCaml are binary incompatible when + compiled with different releases of OCaml, versioned virtual + packages are also provided by packages at items (1) and (2): + ocaml-&ocaml-version;, + ocaml-nox-&ocaml-version;, + ocaml-base-&ocaml-version;, + ocaml-base-nox-&ocaml-version;.
- OCaml location + OCaml Location The root of all installed OCaml libraries is the OCaml standard library directory, which is /usr/lib/ocaml/VERSION/, at the time of writing - &ocaml-sys-dir;. It can be output - by the OCaml compiler invoking it as ocamlc -where. + &ocaml-sys-dir;. This location can be obtained + from the OCaml compiler by invoking it as ocamlc -where.
-
- Bytecode and native programs - - - The OCaml compiler can produce two kinds of executables: bytecode and native. The native executables (compiled with ocamlopt) are generally faster since they are compiled specifically for an achitecture. The bytecode executables (compiled with ocamlc) have the advantage of being portable, which means that a bytecode program can be run on any achitecture without needing to be rebuilt. It should be noted that native OCaml compilers are not provided for every achitecture. Only the following are suported: &supported-archs;. - - - - Packages providing both native and bytecode versions of a program prog usually name them respectively prog.opt and prog.byte and provide a symbolic link prog to the best available version (generally prog.opt). - - - The ocaml-native-compilers package contains the OCaml compiler built in native mode (ocamlc.opt, which outputs bytecode, and ocamlopt.opt, which output native code). Compiling with those versions of the compilers is generally faster. Unfortunately the ocaml-native-compilers package is not available on every architecture. Packages should therefore never depend directly on this package. In order to build big programs and benefit from this natively built compiler, packages should depend on ocaml-best-compilers which itself depends on ocaml-native-compilers where available and on ocaml elsewhere. Since it is a virtual package, it cannot (yet) be a versioned dependency. The version dependency should thus be carried by the ocaml dependency. - -
- Files used by the OCaml compiler + Files Used and Produced by the OCaml Compiler The &ocaml-name; compiler can produce or use the following kind of files: - bytecode executables (they can be recognised since they start with the shebang line #!/usr/bin/ocamlrun) + bytecode executables (they can be recognized since they start with the shebang line #!/usr/bin/ocamlrun) bytecode executables linked in custom mode. They are generated by ocamlc (or ocamlc.opt), when the -custom flag is given at link time. Those executables are in ELF format and include both the final bytecode and the bytecode interpreter. strip should never be invoked on them, since it will remove the bytecode part. @@ -109,7 +220,7 @@
- Locally installing OCaml programs and libraries + Locally Installing OCaml Programs and Libraries Installation and use of locally installed OCaml related programs is out of the scope of this document. However, in order to have it work with a standard Debian installation, you should follow some guidelines. diff --git a/debian/policy/legal.xml b/debian/policy/legal.xml index a1d3f782..32b66347 100644 --- a/debian/policy/legal.xml +++ b/debian/policy/legal.xml @@ -1,6 +1,7 @@ 20022003200420052006 - Sylvain LE GALL, Sven LUTHER, Samuel MIMRAM and Stefano ZACCHIROLI + Sylvain LE GALL, Sven LUTHER, Samuel MIMRAM, Ralf TREINEN, + and Stefano ZACCHIROLI