Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] More OCaml+windowing system questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-01-15 (09:40)
From: Walter B. Rader <wrader@O...>
Subject: [Caml-list] More OCaml+windowing system questions

I am using OCaml and SDL (Software DirectMedia Layer, a
cross-platform graphics library) to create a windowing
system that runs on top of the user's existing OS+GUI (e.g.
Windows, MacOS, etc.) and provides similar services.  I
figure that writing it this way allows me to take advantage
of the services that the GUI and OS already offer, while at
the same time extending its capabilities.

The windowing system's capabilities (will) include
portability (offered to some degree by OCaml and to a larger
degree by SDL,) execution of byte-code compiled applications
that use the windowing system, network transparency, the
option to reconfigure at run-time UI behavior (e.g. for
"skins," users with assistive hardware such as screen-
readers, etc.) and so forth.

The project is still in its early stages and as such I don't
have a lot of technical details to add before launching into
my questions.  =)

I apologize if these are RT*M type questions - I am a bit
overwhelmed trying to learn OCaml and choosing THIS as my
first project =).  Feel free just to give me pointers to
information elsewhere on the web.

Question #1: Is OCaml a suitable language for this project?
Based on what others have done, it seems that I "should"
use a language like C or C++.  When enumerating the
advantages OCaml offers, I came up with the following:

o first-class functions (very handy)
o type safety
o automatic garbage collection
o terse source code
o programs that use the windowing system can be distributed
  in byte-code for enhanced portability

However, C and C++ are extremely portable, which is very
appealing to me.  Why would OCaml be more suited for this

Question #2: How portable *is* OCaml?  I see that binaries
are available for Linux, MS Windows, and Macintosh.  Has
there been success in porting OCaml to other platforms?  If
not the native-code compiler, at least the byte-code compiler
and interpreter?

Question #3: As mentioned previously, I will support running
byte-code applications that use the windowing system.  I
would like to be able to load each in its own process space,
so that the OS scheduler can handle scheduling.

(The benefit being that I don't have to employ some kind of
cooperative multi-tasking system, which I would have to do
if the windowing system and all applications executed in it
ran in the same process.)

Is there a "good" (efficient, elegant, etc.) portable way to
handle communication between the windowing system process and
the application process(es)?

Thanks so much for your time!

Walter Rader

Bug reports:  FAQ:
To unsubscribe, mail  Archives: