<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/57655e1257a623e2d3dcd339dcbca36b"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-11-15T18:54:53"
  subject="Re: [Caml-list] Executable size?"
  prev="2003/11/8e54b37131353301445586d42c53db53"
  next="2003/11/91e68e552501a942264ea37d0b52fa8d"
  prev-in-thread="2003/11/dcb13375990280267975422d95eb17bd"
  next-in-thread="2003/11/3caf9264583e81a6c34b9092df597891"
  prev-thread="2003/11/6e7b16172669003eddadf343f60fb496"
  next-thread="2003/11/8f2ee87fc20d2eebce952ca4abe9d3be"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Executable size?">
<msg 
  url="2003/11/e8fd0dfd31a596714c76d480bdfae207"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T16:15:01"
  subject="[Caml-list] Executable size?">
<msg 
  url="2003/11/0ececf4654a552e0efdc76ebdb05a19f"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-12T17:35:37"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/bda9330dde477c713c11ca12756d241f"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-12T18:07:12"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/2862f492e5c858822827730fa8eafeac"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-11-12T18:32:39"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/e3564502e6692e2148d9f1b60d6f0c22"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T18:51:16"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/c68f377e1fbdd825192dd31b8efbff7d"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-11-13T09:10:27"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/71a0c66034a92266bac0f272cebaf5ca"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-13T13:47:02"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/25d3eec7ad9a818f1f2a5aede8703ba9"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-11-13T14:28:05"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/dd378fd18d2cba0deb5cf6916002b2ab"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-11-12T18:07:23"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/dc67149a7d78ca2c79f2c1ec5ff756ee"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-11-12T18:39:43"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/75a43061468c8402d71028fd7a43ec6b"
  from="Karl Zilles &lt;zilles@1...&gt;"
  author="Karl Zilles"
  date="2003-11-12T18:58:51"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/8fe1648602c0b38c615182f558e3dba1"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-11-12T20:30:37"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
<msg 
  url="2003/11/8d3470473c76d4d737a32634cf2fd9f6"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-11-12T19:05:32"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/30fcc60dbf2162cf992eed578ede5bb8"
  from="Kamil Shakirov &lt;kamils@i...&gt;"
  author="Kamil Shakirov"
  date="2003-11-13T04:10:33"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/cf321eb53140a3017c46f5d61f7d405c"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-13T09:06:42"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
<msg 
  url="2003/11/713cebbf306ed0c2ba9eb576f7a36c77"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-11-13T09:18:36"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</msg>
<msg 
  url="2003/11/0e23cd4114467c85799878b5f0ff09f5"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T18:47:00"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/f031112a371b21ef7253bc2a605c9b87"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-11-12T19:44:11"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/22901198363d2fec6aeb0a21290445ef"
  from="Basile Starynkevitch &lt;basile.starynkevitch@i...&gt;"
  author="Basile Starynkevitch"
  date="2003-11-12T20:10:42"
  subject="Re: [Caml-list] Executable size?">
</msg>
<msg 
  url="2003/11/5d8ed462d90ff736b6f0c01518ef3b65"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T20:35:40"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/dced1efd242ca0c9b43c3768982ddd9e"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-11-12T20:52:56"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/3e1c995e35cec5998236f414bdc223f4"
  from="David Brown &lt;caml-list@d...&gt;"
  author="David Brown"
  date="2003-11-12T21:36:14"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
<msg 
  url="2003/11/b93b426cc0b10e3d9bd024af470742a9"
  from="Eric Dahlman &lt;edahlman@a...&gt;"
  author="Eric Dahlman"
  date="2003-11-12T22:18:18"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/e1480d57477bc32caa3fb64e225ca6ff"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-11-12T22:34:15"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/ad98f40f9ebd9794d97fa0f0a67f32a5"
  from="Eric Dahlman &lt;edahlman@a...&gt;"
  author="Eric Dahlman"
  date="2003-11-12T22:54:51"
  subject="Re: [Caml-list] Executable size?">
</msg>
<msg 
  url="2003/11/ba636ecd1fb724781a975f3a6976f883"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T23:36:05"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
<msg 
  url="2003/11/eeb28a6005d16b393316f3f003de65eb"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T23:59:39"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/f00e08180a1ab731de0fc4fa8c9330bb"
  from="Karl Zilles &lt;zilles@1...&gt;"
  author="Karl Zilles"
  date="2003-11-13T00:20:42"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/7ab9775da554c1df94ee536ef27992e3"
  from="Oleg Trott &lt;oleg_trott@c...&gt;"
  author="Oleg Trott"
  date="2003-11-13T01:30:16"
  subject="[Caml-list] F-sharp (was: Executable size?)">
<msg 
  url="2003/11/e9e72661772b71fc00ec1280a727a273"
  from="Christophe Raffalli &lt;Christophe.Raffalli@u...&gt;"
  author="Christophe Raffalli"
  date="2003-11-14T06:04:05"
  subject="[Caml-list] float_of_num">
</msg>
</msg>
</msg>
<msg 
  url="2003/11/d7f8f4a36c2e046d4c4290c8d9d6bb34"
  from="Eric Dahlman &lt;edahlman@a...&gt;"
  author="Eric Dahlman"
  date="2003-11-13T15:44:21"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/b2d16db3d208c5971fbd1e85af468ff6"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-13T19:58:27"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/7346e7f962264608c3236055c3d16d75"
  from="Eric Dahlman &lt;edahlman@a...&gt;"
  author="Eric Dahlman"
  date="2003-11-13T20:37:22"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/757884e18af7a172b305ded316e2c1c1"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-13T22:16:51"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
<msg 
  url="2003/11/8e7e66067004e33ecc5251b3f21af44b"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-11-15T14:42:35"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/63aa341439daef5caf6c5ed8adc998ec"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-15T15:13:30"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/91e68e552501a942264ea37d0b52fa8d"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-11-15T19:08:30"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/de5255c5acfd45e09ecc91f76e024031"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-11-15T14:37:54"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/dcb13375990280267975422d95eb17bd"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-15T15:01:31"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/57655e1257a623e2d3dcd339dcbca36b"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-11-15T18:54:53"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/3caf9264583e81a6c34b9092df597891"
  from="Florian Hars &lt;hars@b...&gt;"
  author="Florian Hars"
  date="2003-11-13T13:37:59"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/a3e1a27ce18316f5d944af8c9358d941"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T18:21:43"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/9a9bf0df20ce6a3fe0dcb9546d8a7a14"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-12T22:53:10"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/1317209bcb631533835b0907a9c5f3b9"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T23:50:20"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
<msg 
  url="2003/11/e35875dbb026d72841763b2af8639f74"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-11-15T13:51:02"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/ecb981b603d7c1c84f940c2730d1d87b"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-15T15:26:00"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/afc0ed6c2b331f867381141361e9d310"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-12T18:05:21"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/f7653abab4587d67e4f3c0f44e21c202"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T18:37:00"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/032882a4c4c4265f4b7b297c83bcf603"
  from="Vitaly Lugovsky &lt;vsl@o...&gt;"
  author="Vitaly Lugovsky"
  date="2003-11-12T19:01:51"
  subject="Re: [Caml-list] Executable size?">
</msg>
<msg 
  url="2003/11/fe090eb4633f25a5bb774320daad1dfa"
  from="Dustin Sallings &lt;dustin@s...&gt;"
  author="Dustin Sallings"
  date="2003-11-12T19:05:09"
  subject="Re: [Caml-list] Executable size?">
<msg 
  url="2003/11/0b34d659fe0041366bc2ff6e67c2c1a1"
  from="John J Lee &lt;jjl@p...&gt;"
  author="John J Lee"
  date="2003-11-12T20:17:51"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2003/11/5dd5cba6e148291f19fdcc39b61364ba"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-11-13T01:24:47"
  subject="Re: [Caml-list] Executable size?">
</msg>
<msg 
  url="2003/11/ac5d222a4bbe17cc4b0accf0cdc88148"
  from="skaller &lt;skaller@o...&gt;"
  author="skaller"
  date="2003-11-15T13:10:47"
  subject="Re: [Caml-list] Executable size?">
</msg>
</msg>
</thread>

<contents>
On Sun, 2003-11-16 at 02:01, John J Lee wrote:
&gt; On Sat, 16 Nov 2003, skaller wrote:
&gt; [...]
&gt; &gt; A very large number of people do in fact build C all the
&gt; &gt; time without any runtime library at all: embedded systems
&gt; &gt; typically don't use any runtime.
&gt; 
&gt; When you say "runtime", do you mean stuff like libc.so, or libgcc.a, or
&gt; both?

Neither, crt0 is the key. It isn't a library, but initialisation
code.

&gt; When, if ever, can you avoid linking with libgcc.a (or its equivalent)?
&gt; What do you lose by not linking with it?

You cannot make a traditional 'main' program without some
runtime support. This does things like pass command line
arguments to 'main'. It also sets up registers for the
generated code. For example on the x86 it is common
to set all the segment registers equal. The startup
code may also set up the floating point unit, signal
handlers, etc.

However, no 'library' code is ever required by ISO C
programs unless you actually call the functions or
refer to some variable. Still, if you consider
say 'errno', evil as it is, you might refer to it
even if you never do any file IO, so it had better
be correctly initialised.

Finally, even if you don't do IO, something like
an 'assert' macro might, so perhaps *some* initialisation
of some thing might be done in case you use them,
with the compiler not really knowing if it is necessary or not.

In C++, some initialisation for exception handling, RTTI,
and other stuff may be needed .. even if you don't use it,
it may be included *in case* you use it. In particular,
this may be necessary if you dynamically link to a shared
library that does use these features, and they're global
and have to be set up on startup (RTTI and exception handling
spring to mind here ..)

Even on embedded systems, there is usually initialisation
code, though it is often hand written by the client 
(in assembler).

Finally, there is a special case where you must NOT
use a runtime library, even on a hosted machine.

And that is when bootstrapping the compiler and compiling
the run time :-)

&gt; I don't ask for any practical reason, just to try and sort out how O'Caml,
&gt; C and C++ differ here.

Well, for Ocaml the gc must be set up. In addition, signal and
thread handling might have to be initialised. Perhaps some
data such as command line arguments is fetched by startup
code, whether or not you actually try to access it.

The principal difference between Ocaml and C is that
C is designed to be able to generate things like Linux
kernels, and you certainly don't want to use the standard C
library doing that: you're trying instead to build particular
machine code in a 'high level way', and need to actually
write all the functions you need yourself... since it is
this kernel that actually provides some of the resources
accessed by user space C libraries :-)

Ocaml doesn't try to be a systems programming language,
that's the difference.


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

