caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: Erol Akarsu <eakarsu_33@yahoo.com>, caml-list@inria.fr
Subject: Re: [Caml-list] Real Time Ocaml
Date: Wed, 14 Apr 2004 19:07:39 +0200	[thread overview]
Message-ID: <20040414170739.GA21643@ours.starynkevitch.net> (raw)
In-Reply-To: <20040414161227.14830.qmail@web12404.mail.yahoo.com>

On Wed, Apr 14, 2004 at 09:12:27AM -0700, Erol Akarsu wrote:

> I am evaluating Ocaml for the implementation language
> to build Semantic Web-based services.
> 
> I would like to run the required Ocaml application on
> a Real Time Operating System. 

You did not define what you call a real-time OS. Given your
objectives, I guess it does not mean hard real time system.

> I think Ocaml generates an intermediate C code and compile it into
> binary code or maybe directly into binary one.

No. Ocaml comes in two flavors:

   a compiler "ocamlc" generating bytecode (not JVM bytecode, but Ocaml
   bytecode) for a specific VM designed for Ocaml. Thr VM is a fast
   bytecode interpreter coded in C (I am coding is an experimental,
   unsopported, JIT version of it - see my home page at INRIA on
   http://cristal.inria.fr/~bstarynk - this JIT translator uses GNU
   lightning and is still a little buggy - beta stage).

   a compiler "ocamlopt" generating machine code (via assembler, like most C or
   C++ compilers do) for several architectures and systems.

> We have so many real time OSs that support C language.
> In this case, I don't know Ocaml can compile on Real
> time OS. This issue is very critical for the project.

> Have we tried to run Ocaml application on any real
> time os?

Several Ocaml applications are very interactive (e.g. advi... and some
servers). But since you did not define what you mean by real time, it
is hard to guess what exactly are your needs.

Some points (but other collegues could give more details)

  1. The OCaml runtime, in particular its garbage collector, is not
  real time (in the sense, for example, of being able to react thru
  Ocaml code to external events in a stricty bounded & controlled
  manner). However, it can be suited to react in small bounded time
  e.g. less that 100 milliseconds [and perhaps even much less, I
  don't know exactly] on today's >1GHz x86 processors in most of the
  cases. However, on some occasion, a full compacting garbage
  collection is triggered, which may need some significant delay
  (depending upon your memory consumption).

  2. The garbage collector can be tuned for good interactive
  performance. See the Gc module for details, and look into the
  mailing list archives for more.


  3. Porting the core of Ocaml runtime to non-Posix realtime systems
  should be doable (I believe some people did it, ...) but requires a
  significant amount of work.

In a few words, you did not define what you mean by real-time system;
Ocaml is not really real-time, but suitable for interactive programs
(with some tuning of its GC). I think that Ocaml could be used for
servers, including Web servers.


Please note that even standard C is not real-time: there is no
real-time guarantee (or even specification) of the behavior of
essential C library functions like malloc or fprintf.


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Faïencerie, 92340 Bourg La Reine, France

-------------------
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


  reply	other threads:[~2004-04-14 17:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 16:12 Erol Akarsu
2004-04-14 17:07 ` Basile STARYNKEVITCH [this message]
2004-04-15  6:51   ` Kenneth Knowles
2004-04-15 18:44     ` Brian Hurt
2004-04-16  7:55       ` Basile Starynkevitch
2004-04-16 12:33         ` Erol Akarsu
2004-04-16 15:12           ` skaller
2004-04-20  0:20         ` Brian Hurt
2004-04-20  0:31           ` Karl Zilles
2004-04-20  1:50             ` skaller
2004-04-14 18:21 ` Jon Harrop
2004-04-15  8:17 ` Hendrik Tews
2004-04-15 22:33   ` Erol Akarsu
2004-04-20  8:04     ` Hendrik Tews
2004-04-20 13:44       ` Eric Dahlman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040414170739.GA21643@ours.starynkevitch.net \
    --to=basile@starynkevitch.net \
    --cc=caml-list@inria.fr \
    --cc=eakarsu_33@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).