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 BD1C7BC57 for ; Sun, 29 Aug 2010 12:52:47 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AggCADbYeUzRVditkGdsb2JhbACYPQGIBAgVAQEBAQkJDAcRAx+dZ4knghOFHC6IVAEBAwWFMgSEb4UaiE8 X-IronPort-AV: E=Sophos;i="4.56,286,1280700000"; d="scan'208";a="68331997" Received: from mail-qy0-f173.google.com ([209.85.216.173]) by mail4-smtp-sop.national.inria.fr with ESMTP; 29 Aug 2010 12:52:47 +0200 Received: by qyk5 with SMTP id 5so2511099qyk.18 for ; Sun, 29 Aug 2010 03:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=2HAolr9X7nig9a9LaEvzS9SQu5/13Bh7ba3MKGG98YI=; b=nqFz/pku7grmbrrUMEBU0UQlEX9xIdWiLuUwAvQJugrbRZXUeqrGQ9ve/wmrif9OaX Ji9GduoL5wtDGA4qp0RqqZYJ3dKGJ6PLE0U6oPxtZ0fSAvpwTvVe0lQxAHkTE56QYyDR 5A7z7kX2F0uuindVYUz4TUlhwJrRJGpX7ta8s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=medhroKTg18TyjWQ/M4Gf5kHGjODsHZyTvbXmnf/+qFmO0pwSxSNQgzOoZwaZugOme ICfdhB3tBZ1dVSM80elQpmbTO3yqQ4eth1fnXtk+Tdggii1J619Dt88RBFW/8ozsyeef TJDgtwAJqcq3gYzsAis90rJwgaQcdyMaDp2s8= Received: by 10.229.213.131 with SMTP id gw3mr849526qcb.9.1283079162159; Sun, 29 Aug 2010 03:52:42 -0700 (PDT) MIME-Version: 1.0 Sender: gabriel.scherer@gmail.com Received: by 10.229.185.206 with HTTP; Sun, 29 Aug 2010 03:52:22 -0700 (PDT) In-Reply-To: References: From: bluestorm Date: Sun, 29 Aug 2010 12:52:22 +0200 X-Google-Sender-Auth: N_6XUaxfevQrG8jxDv-nZKu835g Message-ID: Subject: Re: [Caml-list] Llama Light: a simple implementation of Caml To: Jeremy Bem Cc: caml-list List Content-Type: multipart/alternative; boundary=0016361e8270adeaae048ef425a5 X-Spam: no; 0.00; toplevel:01 foo:01 foo:01 typecheck:01 annotations:01 typer:01 annotations:01 toplevel:01 typecheck:01 typer:01 maxim:98 maxim:98 polymorphic:01 polymorphic:01 caml-list:01 --0016361e8270adeaae048ef425a5 Content-Type: text/plain; charset=ISO-8859-1 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 ? --0016361e8270adeaae048ef425a5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
When using the toplevel, declaration phrases fail (looks like a linkin= g problem), but expressions 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&quo= t;.


I found it startling that the most importa= nt difference to my eyes are buried, on the web page, under lines of relati= vely 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 ?
--0016361e8270adeaae048ef425a5--