caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "forum@x9c.fr" <forum@x9c.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] [ANN] OCaml-Java project: 1.1 release
Date: Wed, 12 Nov 2008 13:29:28 +0100	[thread overview]
Message-ID: <CBDAF2E1-5BB0-479D-9E75-BAC407A68455@x9c.fr> (raw)
In-Reply-To: <84762F8F-9615-47D8-A5A1-BBAA7982E6B3@metaweb.com>


Le 12 nov. 08 à 03:21, Warren Harris a écrit :

>
> On Nov 11, 2008, at 8:17 AM, forum@x9c.fr - forum@x9c.fr wrote:
>
>>
>> Your (dual) suggestion of compilation of Java sources
>> into either OCaml sources of OCaml binaries for ocamlrun
>> (or even interpretation of Java bytecode) is interesting.
>> The Java language is clearly easy to parse, type, and
>> compile. However, the runtime support library would
>> be quite large (listing only the first items that come to
>> mind):
>> - implementation of a 'native' method from the JDK;
>
> As the original designer of the Java native method mechanism (JRI at  
> netscape which became JNI at Sun)... I'll be the first to say that  
> I'd be very happy to write all my native methods using ocaml's  
> methodology.

I understand that it would make you happy !
In fact, my point was that it would be a long job, not that it would a  
painful job.


>> - explicit encoding of the algorithm for message dispatch;
>> - explicit encoding of elements need by the reflection
>>   mechanism.
>
> Reflection is another feature of Java that one could get pretty far  
> without. Certainly when porting an application to a new VM this  
> would be a consideration, but when developing a new application,  
> there are simple alternatives that avoid much of the need for  
> reflection.

I second that (even if I occasionally use reflection).
However, some existing Java framework rely on reflection.
As an example, the SPI mechanism is based on reflection and is
then used at various places such as script engines, image loaders,
charset converters, etc.
These frameworks would be unavailable if you do not port the reflection
mechanism.


>> At the opposite, the Java compiler performs the bare minimum
>> checks. Then, at runtime the bytecode is verified before
>> execution. More, through the security manager some
>> checks are done at runtime to verify if the JVM is allowed
>> to access a file, open a network connection, etc.
>> All these runtime checks are obiously needed to grant the
>> user that some code will not harm its computer (e.g. inside
>> applets).
>
> Java's focus on downloaded applet security and JIT compilation made  
> a lot of sense in the browser world, but is somewhat useless in a  
> server context, which is where most java applications are deployed  
> today. I think that a server-only subset of Java could make a lot of  
> sense, particularly in conjunction with a VM such as ocaml's that  
> provides superior performance and footprint. I think many developers  
> would happily sacrifice a few language features for performance.

Well, I mostly agree but see scenarii where the sandbox model is  
useful on the server side.
The sandbox allows to fine-tune the execution permissions for an  
application.
Some of the permission can of course be enforced by the OS (e.g.  
filesystem permissions,
firewall rules, etc.) but it can be handy to be able to specify them  
on an application basis.


Xavier

      reply	other threads:[~2008-11-12 12:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-09 20:05 forum
2008-11-09 20:38 ` [Caml-list] " Warren Harris
2008-11-11 16:17   ` forum
2008-11-12  2:21     ` Warren Harris
2008-11-12 12:29       ` forum [this message]

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=CBDAF2E1-5BB0-479D-9E75-BAC407A68455@x9c.fr \
    --to=forum@x9c.fr \
    --cc=caml-list@inria.fr \
    /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).