From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id C5EE4BC57 for ; Mon, 30 Aug 2010 17:57:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmcCAG5xe0xKfVIuimdsb2JhbACBQ5EygU6DfAGHeggVAQEBCgkMBw8FH6InizoBBY5cAQSFN4Fbgxg X-IronPort-AV: E=Sophos;i="4.56,293,1280700000"; d="scan'208,217";a="68378444" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail4-smtp-sop.national.inria.fr with ESMTP; 30 Aug 2010 17:57:29 +0200 Received: by wwb18 with SMTP id 18so2924634wwb.3 for ; Mon, 30 Aug 2010 08:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:references :in-reply-to:subject:date:organization:message-id:mime-version :content-type:x-mailer:thread-index:content-language; bh=2GtzX9/O9T7pp6hNZ2TCfOmUtVBv+IsUkTWXDHLlaGA=; b=cB2LtGa7hN13XeCwZ+leCczuk2U4mcg2uamfjGd8ctunU5slWIFfUKCNx9PdpoGjXq oRgMcsfWmwE8EPBbeLgBEqNoWpDG3J/r4IvCkh8ry80fDtRRQQjAydb3CGSw/7Xp5rx1 XY4cTTjBDZZlCwlcOW/CQuIoIbe6aYZGiSnTc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:references:in-reply-to:subject:date:organization :message-id:mime-version:content-type:x-mailer:thread-index :content-language; b=MFRpPXeEtHdXGFdSJRTGgMsnOtqUSctd3nZx3Sp+dCFnz+huXA1LI32JZf+c2FQ+7I wWl/8zc9fUvTisw/kcIp6+ugvl5cGklK/evvwVSQ/lLDt6nUCKXBV6vcoiLbUiORLD6F j0wBsnOrOf74zhhauD/wC0duZfSe4t7eMH8nA= Received: by 10.227.208.85 with SMTP id gb21mr4544302wbb.167.1283183847172; Mon, 30 Aug 2010 08:57:27 -0700 (PDT) Received: from WinEight ([87.113.136.121]) by mx.google.com with ESMTPS id w1sm4549152weq.1.2010.08.30.08.57.23 (version=SSLv3 cipher=RC4-MD5); Mon, 30 Aug 2010 08:57:24 -0700 (PDT) From: Jon Harrop To: "'ivan chollet'" , "'Jeremy Bem'" Cc: "'caml-list List'" References: In-Reply-To: Subject: RE: [Caml-list] Llama Light: a simple implementation of Caml Date: Mon, 30 Aug 2010 16:57:04 +0100 Organization: Flying Frog Consultancy Message-ID: <026901cb485b$ff1b8ad0$fd52a070$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_026A_01CB4864.60DFF2D0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: ActIMjODNbUYxsFRRf2gzu8KyGQrCQAKOQVg Content-Language: en-gb X-Spam: no; 0.00; run-time:01 compiler:01 recursion:01 cheers:01 pointers:01 typechecker:01 ocaml:01 typechecker:01 runtime:01 bytecode:01 compiler:01 bug:01 toplevel:01 ocaml:01 ocaml's:01 This is a multi-part message in MIME format. ------=_NextPart_000_026A_01CB4864.60DFF2D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Try to remove all assumptions of uniform run-time representation from the compiler because avoiding boxing gives huge performance gains and makes it much easier to write a performant garbage collector. You'll need to sacrifice polymorphic recursion though, which you probably already have anyway. Cheers, Jon. From: caml-list-bounces@yquem.inria.fr [mailto:caml-list-bounces@yquem.inria.fr] On Behalf Of ivan chollet Sent: 30 August 2010 11:57 To: Jeremy Bem Cc: caml-list List Subject: Re: [Caml-list] Llama Light: a simple implementation of Caml OK. This looks nice and I would be pleased if you could put a few pointers or explanations on your webpage about your typechecker implementation and how it differs with OCaml typechecker. I will get some free time this week and to implement yet another runtime and bytecode compiler from scratch. Not sure if it will be completed at the end of the week, but i'll be definitely interested to know more about the theoretical motivations of works like yours! On Mon, Aug 30, 2010 at 2:37 AM, Jeremy Bem wrote: bluestorm: Thank you for the bug report. The toplevel issue has been fixed in the version now posted. Do you see a nice way to add let-generalization without reintroducing "type levels"? I was pleased to remove those. Ivan: It was originally forked from Caml Light but now includes more code from OCaml. The typechecker is mostly original code at this point; the compiler is OCaml's with minimal changes to accommodate the new typechecker; the runtime is almost identical to OCaml's. -Jeremy On Sun, Aug 29, 2010 at 6:52 AM, bluestorm wrote: When using the toplevel, declaration phrases fail (looks like a linking problem), but expressions work as intented : $ llama Llama Light version 0.0828 # 1 + 1;; - : int = 2 # let x = 1 + 1;; Error: Reference to undefined global `Toploop' I made my tests using "llamac -i foo.ml". I found it startling that the most important difference to my eyes are buried, on the web page, under lines of relatively boring documentation : In Llama Light (and in contrast to other Caml implementations): - let does not generalize. - Phrases are generalized immediately. In particular, "let foo = ref []" does not typecheck. - The value restriction is not relaxed. (This is similar to Caml Light.) These choices simplify the implementation while having relatively little impact on the user. You cite the "Let Should Not Be Generalised" paper. There is however a difference in your application of the maxim : in the paper, local let that have polymorphic type annotations are generalised, while in your system it is not possible to force generalisation. I had a look at the typer, and it's indeed rather simple; it seems it would be quite simple to implement generalized let (when encountering annotations or with a different syntaxic construct : "letg .. = .. in ..."), but the added complexity is equivalent to adding let generalization by default. Is the presence of let-generalization a real issue in your work ? _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs ------=_NextPart_000_026A_01CB4864.60DFF2D0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Try to remove all assumptions of uniform run-time = representation from the compiler because avoiding boxing gives huge performance gains = and makes it much easier to write a performant garbage collector. = You’ll need to sacrifice polymorphic recursion though, which you probably already = have anyway…

 

Cheers,

Jon.

 

From: caml-list-bounces@yquem.inria.fr [mailto:caml-list-bounces@yquem.inria.fr] On Behalf Of ivan = chollet
Sent: 30 August 2010 11:57
To: Jeremy Bem
Cc: caml-list List
Subject: Re: [Caml-list] Llama Light: a simple implementation of = Caml

 

OK.

This looks nice and I would be pleased if you could put a few pointers = or explanations on your webpage about your typechecker implementation and = how it differs with OCaml typechecker.
I will get some free time this week and to implement yet another runtime = and bytecode compiler from scratch. Not sure if it will be completed at the = end of the week, but i'll be definitely interested to know more about the = theoretical motivations of works like yours!


On Mon, Aug 30, 2010 at 2:37 AM, Jeremy Bem <jeremy1@gmail.com> = wrote:

bluestorm:

 

Thank you for the bug report.  The toplevel = issue has been fixed in the version now posted.

 

Do you see a nice way to add let-generalization = without reintroducing "type levels"?  I was pleased to remove = those.

 

Ivan:

 

It was originally forked from Caml Light but now = includes more code from OCaml.  The typechecker is mostly original code at = this point; the compiler is OCaml's with minimal changes to accommodate the = new typechecker; the runtime is almost identical to OCaml's.

 

-Jeremy

 

On Sun, Aug 29, 2010 at 6:52 AM, bluestorm <bluestorm.dylc@gmail.com> wrote:

When using the toplevel, declaration phrases fail = (looks like a linking problem), but expressions work as intented :

$ llama

        Llama Light = version 0.0828

# 1 + 1;;

- : int =3D 2

# let x =3D 1 + 1;;

Error: Reference to undefined global = `Toploop'

 

I made my tests using "llamac -i foo.ml".

 


I found it startling that the most important difference to my eyes are = buried, on the web page, under lines of relatively boring documentation = :

In Llama Light (and in contrast to other Caml implementations):

 

- let does not generalize.

- Phrases are generalized immediately. In = particular, "let foo =3D ref []" does not typecheck.

- The value restriction is not relaxed. (This = is similar to Caml Light.)

 

These choices simplify the implementation while = having relatively little impact on the user.

 

You cite the "Let Should Not Be = Generalised" paper. There is however a difference in your application of the maxim : = in the paper, local let that have polymorphic type annotations are generalised, = while in your system it is not possible to force = generalisation.

 

I had a look at the typer, and it's indeed rather = simple; it seems it would be quite simple to implement generalized let (when = encountering annotations or with a different syntaxic construct : "letg .. =3D = .. in ..."), but the added complexity is equivalent to adding let = generalization by default.

 

Is the presence of let-generalization a real issue = in your work ?

 


_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-lis= t
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

 

------=_NextPart_000_026A_01CB4864.60DFF2D0--