caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* JIT-compilation for OCaml?
@ 2001-01-02 16:07 Markus Mottl
  2001-01-02 18:16 ` Mattias Waldau
  2001-01-05  5:48 ` Vitaly Lugovsky
  0 siblings, 2 replies; 37+ messages in thread
From: Markus Mottl @ 2001-01-02 16:07 UTC (permalink / raw)
  To: OCAML

Hello,

one thing I just wondered about is whether there are any intentions
concerning a JIT-compiler for OCaml byte code similar to what Java
offers. This would allow much faster execution while still retaining
full portability of the byte code. Is this a goody we might expect in the
(near? far?) future?

- Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl



^ permalink raw reply	[flat|nested] 37+ messages in thread
* RE: JIT-compilation for OCaml?
@ 2001-01-03 15:24 Jerry Jackson
  2001-01-04 14:12 ` Alan Schmitt
  0 siblings, 1 reply; 37+ messages in thread
From: Jerry Jackson @ 2001-01-03 15:24 UTC (permalink / raw)
  To: 'Alain Frisch', Markus Mottl; +Cc: OCAML



-----Original Message-----
From: Alain Frisch [mailto:frisch@clipper.ens.fr]
Sent: Wednesday, January 03, 2001 5:15 AM
To: Markus Mottl
Cc: Mattias Waldau; OCAML
Subject: Re: JIT-compilation for OCaml?


Hello,

Compiling the code really during runtime opens the door to further
optimizations (I guess this is how Java JIT compilers work, but I have no
idea). For instance, it is possible to watch conditionnal jumps and
reorganize the code so that the most taken branches don't need any jump.
The GC and the memory allocator have the opportunity to adapt themselves
to the application. Of course, this only makes sense for long running
applications. The user should be able to record the optimization
information collected. Actually, there are two operations involved: a
profiler (a bytecode interpreter that also collects optimization
information) and a bytecode-to-nativecode converter as in the previous
paragraph. I don't see the advantage of mixing them in a complex JIT
compiler (which will be slow for a long time after startup if the
optimizations are non trivial).

[JRJ] There are many other sorts of optimizations that can be done by
compiling at runtime.  A simple case is that processor-specific instructions
can be generated instead of generic ones (e.g. Pentium III instructions
rather than generic 486).  A more interesting example is used by Sun's
current JIT compiler...  Aggressive inlining and direct dispatch are done
for all sorts of method calls (that could potentially be overloaded).  If a
class is later loaded that extends one of the inlined or directly called
methods, the JIT compiler goes back and "unoptimizes" the code it had
previously optimized!



^ permalink raw reply	[flat|nested] 37+ messages in thread
* RE: JIT-compilation for OCaml?
@ 2001-01-09 17:09 Dave Berry
  2001-01-11  6:38 ` John Max Skaller
  0 siblings, 1 reply; 37+ messages in thread
From: Dave Berry @ 2001-01-09 17:09 UTC (permalink / raw)
  To: John Max Skaller, Markus Mottl; +Cc: OCAML

Dynamic libraries would be useful, but there are other areas where OCaml
(and most if not all other FLs) falls short.  See below.

Regarding C/C++ interfacing, this should be do-able, it's just a lot of
work.  What might be useful would be if all the implementors of advanced
programming languages (OCaml, SML, Dylan,...) got together and wrote a tool
for generating IDL from C/C++ header files.  Then each implementor could
write a language-specific IDL translator.  I know the Dylan community made
some headway with parsing header files.

Here are some application areas to consider:

1.  Huge numbers of commercial programs are simple UIs on top of simple
databases.  Hence the success of VB.  A UI builder and simple DB interface
would meet this need.  (This is easier said than done).

2.  A smaller number of commercial programs are complex UIs on top of
complex databases.  Here a UI builder is less important, but a UI toolkit
and a sophisticated DB interface are essential.

3.  Web programs require interfacing to web browsers.  Perhaps someone could
add the OCaml VM to Mozilla?

4.  A growing number of commercial offerrings are based on component
technology (ActiveX controls or Javabeans).  Support for these (or perhaps a
native equivalent) would be very useful.  (Again, this is easier said than
done).

5.  There are many embedded programs out there.  These are tricky to write
with a GC.

Dave.

-----Original Message-----
From: John Max Skaller [mailto:skaller@ozemail.com.au]
Sent: Tuesday, January 09, 2001 6:40
To: Markus Mottl
Cc: Mattias Waldau; OCAML
Subject: Re: JIT-compilation for OCaml?


Markus Mottl wrote:

> > If Ocaml had a decent GUI API that worked on just X- and MS- Windows
> > systems, it would be a killer. 

> I expected that people would mention GUI-libraries, but I don't write
> GUIs. Is this really everything people are missing?

	Actually, no, there are some other significant
problems (apart from education) with Ocaml. 

	1. The lack of dynamic loading virtually wipes it out 
as a serious commercial language (IMHO). 
This can probably be fixed.

	2. The difficulty of interfacing to existing
C/C++ code. This probably cannot be fixed. [For example,
consider the sheer volume of work required to map GTK
to Ocaml]

	There are, of course, many other problems, such as
the lack of intermodule recursion, but all languages have
various difficulties which can usually either be fixed
or worked around. 

	But clearly the biggest problem is one of education,
both of the virtues of functional programming, and the details
of the ocaml syntax/semantics (much of which escapes me, after
several years usage).

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net



^ permalink raw reply	[flat|nested] 37+ messages in thread
* RE: JIT-compilation for OCaml?
@ 2001-01-09 17:18 Dave Berry
  2001-01-11  7:00 ` John Max Skaller
  0 siblings, 1 reply; 37+ messages in thread
From: Dave Berry @ 2001-01-09 17:18 UTC (permalink / raw)
  To: John Max Skaller, Markus Mottl; +Cc: OCAML

This view seems extreme to me.  Certainly the Java type system has faults --
lack of generics being one, lack of enumerated types another, and various
other points as well.  But surely Unicode is a useful de facto standard?
Using C syntax was a strong point -- it made the language familiar to many
people.  IMO Java syntax does avoid many of the worst aspects of C syntax
(e.g. pointers).  It's surely portable: JVMs run on many systems.  It
certainly isn't slow to compile, and a previous poster suggested that with
modern compilers run-time performance is not too bad.  You can access C or
C++ functions from Java using JNI (although you seem to be in two minds as
to whether C compatibility is desirable or irrelevant).

And this omits it's plus points, especially its utility in net programming.
Its security model is not the last word, but it's better than C, C++ or
Eiffel!  And its use of byte code ensures portability of compiled apps.

Dave.

-----Original Message-----
From: John Max Skaller [mailto:skaller@ozemail.com.au]
Sent: Tuesday, January 09, 2001 6:50
To: Markus Mottl

	It has a serious faulty static
type system, idiotic object orientation, no generics, isn't
compatible with C, uses the worst features of C/C++ syntax,
is inefficient to compile, load, and run, doesn't interface
well, uses Unicode instead of ISO-10646, has a hodge podge library,
is less portable than C, C++ or Eiffel, stuffed up finalisation ...

	Surely, Java is the worst modern language around.
It is an inexcusably travesty, when so much good theory is
around, and C compatibility is not required.



^ permalink raw reply	[flat|nested] 37+ messages in thread
* RE: JIT-compilation for OCaml?
@ 2001-01-11 12:45 Dave Berry
  2001-01-12  8:23 ` John Max Skaller
  0 siblings, 1 reply; 37+ messages in thread
From: Dave Berry @ 2001-01-11 12:45 UTC (permalink / raw)
  To: John Max Skaller, Dave Berry; +Cc: Markus Mottl, OCAML

By "component", I mean an object with methods, asynchronous events, and
settable properties, working in containers that know how to embed these
components.  The origin of this approach was (I think) the Andrew project at
CMU, many years ago.  ML modules are different.

As for whether these are "right" or "wrong", this depends on whether you
want to work in a small purist community or interact with the wider world.
To date, OCaml has emphasised interoperability (e.g. with C), which is one
of the reasons that its been successful.

Dave.

-----Original Message-----
From: John Max Skaller [mailto:skaller@ozemail.com.au]
Sent: Thursday, January 11, 2001 6:38
To: Dave Berry
Cc: Markus Mottl; OCAML
Subject: Re: JIT-compilation for OCaml?


> 4.  A growing number of commercial offerrings are based on component
> technology (ActiveX controls or Javabeans).  Support for these (or perhaps
a
> native equivalent) would be very useful.  (Again, this is easier said than
> done).

	I guess these things have the wrong kinds of 'component'.
Ocaml already has the 'right' kind of component: the module.
What is needed is to dynamically load them (i.e. some module
conforming to some statically specified interface).
 



^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2001-01-12  9:17 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-02 16:07 JIT-compilation for OCaml? Markus Mottl
2001-01-02 18:16 ` Mattias Waldau
2001-01-02 19:30   ` Markus Mottl
2001-01-03 12:15     ` Alain Frisch
2001-01-04  8:37       ` Fabrice Le Fessant
2001-01-04  9:04         ` Alain Frisch
2001-01-03 13:23     ` Mattias Waldau
2001-01-03 14:25       ` Markus Mottl
2001-01-03 14:40       ` STARYNKEVITCH Basile
2001-01-03 15:51     ` John Max Skaller
2001-01-03 17:50       ` Markus Mottl
2001-01-05  0:30         ` Michael Hicks
2001-01-08  9:59           ` Xavier Leroy
2001-01-09  6:40         ` John Max Skaller
2001-01-03 17:49     ` Joseph R. Kiniry
2001-01-03 18:19       ` Markus Mottl
2001-01-03 18:38         ` Joseph R. Kiniry
2001-01-03 18:58           ` Markus Mottl
2001-01-03 19:06             ` Joseph R. Kiniry
2001-01-04 22:32               ` Jonathan Coupe
2001-01-07  0:16                 ` Chris Hecker
2001-01-05 12:52               ` Sven LUTHER
2001-01-05 20:08                 ` Joseph R. Kiniry
2001-01-09  7:14             ` John Max Skaller
2001-01-09  6:50         ` John Max Skaller
2001-01-05 12:39   ` Sven LUTHER
2001-01-05  5:48 ` Vitaly Lugovsky
2001-01-03 15:24 Jerry Jackson
2001-01-04 14:12 ` Alan Schmitt
2001-01-09 17:09 Dave Berry
2001-01-11  6:38 ` John Max Skaller
2001-01-09 17:18 Dave Berry
2001-01-11  7:00 ` John Max Skaller
2001-01-11 10:01   ` Alain Frisch
2001-01-12  7:55     ` John Max Skaller
2001-01-11 12:45 Dave Berry
2001-01-12  8:23 ` John Max Skaller

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