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 55875BC57 for ; Mon, 30 Aug 2010 12:57:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai8CAB4re0zRVditkGdsb2JhbACScoVKAYd6CBUBAQEBCQkMBxEDH559iSeCE4VHLohUAQEDBYUyBIFXgxiFGg X-IronPort-AV: E=Sophos;i="4.56,292,1280700000"; d="scan'208";a="68362041" Received: from mail-qy0-f173.google.com ([209.85.216.173]) by mail4-smtp-sop.national.inria.fr with ESMTP; 30 Aug 2010 12:57:25 +0200 Received: by qyk5 with SMTP id 5so3356932qyk.18 for ; Mon, 30 Aug 2010 03:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=1aPv9PitwFJVj9Z07Ulp9fI84RriSY55KAgxGBku9SE=; b=WrY92/qNheHzE59ddGL7biGgtBCzB7JpNNX7vzq74bpE0J8xNM/LZU63bsn4TfqhxF QhqM5RqaCCrfVLxBdUFtvIu6ELVOMMXXgfh7tV/nztj5VKs/+VC99tIKp84aAK3Q4IuL XxRGoLy/L9HoktrqAZDeanxeeuaXgN9/zTxQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=OwIf6Y/nBi1c77kIQ2QS9EPGOpaESzOdLxv17re32Qcdducyf6ovh4+iShyXsIIu8F hNnwWqxwTYbr9f3+jV8NHj4uAbdzHIHSqx0ejL14gdtuQ0l4eEowp1qKWfEotgkyYwea RXf5j5xrD974uI5cnOnUIUV79mqBMsjhFbSs4= MIME-Version: 1.0 Received: by 10.229.251.210 with SMTP id mt18mr2949524qcb.151.1283165844039; Mon, 30 Aug 2010 03:57:24 -0700 (PDT) Received: by 10.229.218.19 with HTTP; Mon, 30 Aug 2010 03:57:23 -0700 (PDT) In-Reply-To: References: Date: Mon, 30 Aug 2010 20:57:23 +1000 Message-ID: Subject: Re: [Caml-list] Llama Light: a simple implementation of Caml From: ivan chollet To: Jeremy Bem Cc: bluestorm , caml-list List Content-Type: multipart/alternative; boundary=00163631036f526806048f0854db X-Spam: no; 0.00; pointers:01 typechecker:01 ocaml:01 typechecker:01 runtime:01 bytecode:01 compiler:01 bug:01 toplevel:01 ocaml:01 compiler:01 ocaml's:01 runtime:01 ocaml's:01 toplevel:01 --00163631036f526806048f0854db Content-Type: text/plain; charset=ISO-8859-1 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 > > --00163631036f526806048f0854db Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable OK.

This looks nice and I would be pleased if you could put a few po= inters or explanations on your webpage about your typechecker implementatio= n 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 s= cratch. 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, Jer= emy Bem <jeremy1@= gmail.com> wrote:
bluestorm:

Thank you for the bug report. =A0The to= plevel issue has been fixed in the version now posted.

Do you see a nice way to add let-generalization without reintroducing &q= uot;type levels"? =A0I was pleased to remove those.

Ivan:

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

-Jeremy
<= /div>

On Sun, Aug 29, = 2010 at 6:52 AM, bluestorm <bluestorm.dylc@gmail.com>= wrote:
When using t= he toplevel, declaration phrases fail (looks like a linking problem), but e= xpressions work as intented :
$ llama
=A0=A0 =A0 =A0 =A0Llama Light version 0.0828
# 1 + 1;;
- : int =3D 2
# let x =3D 1 + 1;;
Error: Reference to undefined global `Toploop'

I m= ade my tests using "llamac -i foo.ml".


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

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

- let=A0does not generalize.
- Phrases are generalized immediately. In particular, "let foo =3D ref= []" does not typecheck.
- The value restriction is not=A0relaxed. (This is similar to Caml Light.)<= /blockquote>

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

You cite the "Let Sh= ould Not Be Generalised" paper. There is however a difference in your = application of the maxim : in the paper, local let that have polymorphic ty= pe 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 s= imple; it seems it would be quite simple to implement generalized let (when= encountering annotations or with a different syntaxic construct : "le= tg .. =3D .. in ..."), but the added complexity is equivalent to addin= g let generalization by default.

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


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


--00163631036f526806048f0854db--