Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: JIT-compilation for OCaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: Re: JIT-compilation for OCaml?
Dave Berry wrote:
> 
> 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?

	No. Unicode was abandoned years ago: there is an 'offical'
ISO Standard: ISO-10646. There are 2^31 code points, unlike
Unicode's 2^16, which is already barely adequate. ISO C and ISO C++
support ISO-10646. Linux runs ISO-10646 (via UTF-8).

> Using C syntax was a strong point -- it made the language familiar to many
> people. 

	This is a selling point: Felix also uses a C like syntax,
but it fixes the worst deficiency in C/C++, namely declarator
syntax, indeed Felix is LR(1) [works with ocamlyacc] and unambiguous 
except for the usual 'dangling else' ambiguity.

	A competent C/C++ programmer had no trouble learning
it in a few minutes. It isn't hard to learn:

	val x: int = 1;
	function f(x:int) { .. }

although I often make the mistake:

	function f(int x) { .. }

myself, being an (ex-)C/C++ programmer :-)

> IMO Java syntax does avoid many of the worst aspects of C syntax
> (e.g. pointers).  

	Really, this is a matter of semantics rather than syntax.
Java uses references and a garbage collector, which I agree can
have advantages over pointers and manual storage control.

	Felix uses pointers, but they cannot be NULL,
and it uses a garbage collector: syntactically you have to
form them by addressing (&variable) and use them with
dereferencing (*pvariable). I don't think the syntax
is that much of an issue -- in Ocaml, you have to dereference
references too.

> It's surely portable: JVMs run on many systems.  

	Sure. With restricted functionality. To get 'many real' programs
to work you need native code extensions.

> It certainly isn't slow to compile, 

	The version of Java I used (1.2) was so slow as to be unusable.
It ran THOUSANDS of times slower than g++. (And ocaml is even faster!)
Perhaps this has changed recently.

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

	Like I said, there goes portability :-)
 
> 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.

	Python and Ocaml also use portable bytecodes. 
Python at least is every bit as good at 'net' programming as Java,
and faster to develop with. I dare say, that with some basic
libraries, Ocaml would be vastly superior at 'net' programming,
simply because it is vastly superior as a programming language :-)

	For example, Ocaml runs on MS's .net platform.

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