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 4AA1BBC57 for ; Fri, 6 Aug 2010 15:51:31 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvACAJuwW0zRVdW0kGdsb2JhbACgNggVAQEBAQkJDAcRAx+paYkLghCGLC6IVAEBAwWFNQSEIIUX X-IronPort-AV: E=Sophos;i="4.55,328,1278280800"; d="scan'208";a="67356226" Received: from mail-yx0-f180.google.com ([209.85.213.180]) by mail4-smtp-sop.national.inria.fr with ESMTP; 06 Aug 2010 15:50:59 +0200 Received: by yxm8 with SMTP id 8so3443969yxm.39 for ; Fri, 06 Aug 2010 06:50:58 -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=/sl2C+uw4m04PUvl6Gdb3Reo10aG+LusY8bPiOvkT5g=; b=bLiBQ7osJqgaPAIStVFdZLY8d7Un68tc1b8eOY81xpbc4pYfZxZi62K/te1F/ezux2 QztFLIdxl5PU84+AWkQit13kck0fidatjLGElj1gZKBMu1g3No0No7L7HlHHH+QS2HwN Xf6Jr8x6+BmWg/2o9K8G8zR9CRKCGxhTiiN1c= 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=QXGPogITQNqRsPWdKjaBVWozroPCX/2QCIOLDznpzZ5xo5dzXBQX3wiDgTMHKWbX9r Hj129WlrPxuqemtEhcEqKhoAoNEjJvOiERnLSNAUwQorH2nC6iSaVXRSes5DPUVGBDgY 8zVoU7GVr3Gikpu6ezqgjv4dtTPetWTgpe6c4= MIME-Version: 1.0 Received: by 10.101.18.16 with SMTP id v16mr7413763ani.160.1281102657874; Fri, 06 Aug 2010 06:50:57 -0700 (PDT) Received: by 10.231.158.77 with HTTP; Fri, 6 Aug 2010 06:50:57 -0700 (PDT) In-Reply-To: References: Date: Fri, 6 Aug 2010 16:50:57 +0300 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Eray Ozkural To: Jeremy Bem Cc: caml-list List Content-Type: multipart/alternative; boundary=005045017050d7f8de048d27f416 X-Spam: no; 0.00; eray:01 ozkural:01 eray:01 wrote:01 wrote:01 experimental:01 experimental:01 caml-list:01 theorem:02 theorem:02 caml:02 namely:02 namely:02 programming:03 programming:03 --005045017050d7f8de048d27f416 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Aug 6, 2010 at 7:04 AM, Jeremy Bem wrote: > > My plans now call for adding features to replace the ones I've removed, > namely experimental ones related to assisted theorem proving and inductive > programming. > Dear Jeremy, What have you got on inductive programming? Best, -- Eray --005045017050d7f8de048d27f416 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Fri, Aug 6, 2010 at 7:04 AM, Jeremy Bem <jeremy1@gmail.com= > wrote:
My plans now call for adding features to replace the ones I've rem= oved, namely experimental ones related to assisted theorem proving and indu= ctive programming.=A0

Dear Jeremy,

What have you got on inductive programming?
<= br>
Best,

--
Eray
--005045017050d7f8de048d27f416-- 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 2AAAEBBAF for ; Sun, 8 Aug 2010 19:59:43 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An8EAEKNXkxXaqLJgWdsb2JhbACgRBUBARYiIsAZhToE X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="56861510" Received: from ka.mail.enyo.de ([87.106.162.201]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 08 Aug 2010 19:59:42 +0200 Received: from [172.17.135.4] (helo=deneb.enyo.de) by ka.mail.enyo.de with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) id 1OiA9s-0003wQ-Eg; Sun, 08 Aug 2010 19:59:40 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.72) (envelope-from ) id 1OiA9s-0007dJ-7R; Sun, 08 Aug 2010 19:59:40 +0200 From: Florian Weimer To: Jeremy Bem Cc: caml-list List Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? References: Date: Sun, 08 Aug 2010 19:59:40 +0200 In-Reply-To: (Jeremy Bem's message of "Fri, 6 Aug 2010 00:04:34 -0400") Message-ID: <877hk1m1df.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; ocaml:01 typechecker:01 mutable:01 type-safe:01 owing:98 equality:01 polymorphic:01 caml-list:01 strings:01 modules:02 modules:02 caml:02 caml:02 rewritten:02 supported:02 * Jeremy Bem: > To support my research, I've developed an implementation ("Llama Light") of > the core Caml language. Modules, objects, labels etc are not supported > (except for file-level modules). The system strongly resembles OCaml, > however the completely rewritten typechecker is not only much smaller in > terms of lines-of-code; it has a genuinely simpler design owing especially > to the lack of first-class modules. How do you deal with strings (are they mutable?) and polymorphic equality (is it type-safe?)? 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 8C9FDBBAF for ; Sun, 8 Aug 2010 20:44:12 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnMCAM+XXkzRVdY0kGdsb2JhbACBRJ54CBUBAQEBCQkMBxEDH6ZgiRCCEYUTLohUAQEDBYU1BIk7 X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="67401289" Received: from mail-bw0-f52.google.com ([209.85.214.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Aug 2010 20:44:12 +0200 Received: by bwz17 with SMTP id 17so1032932bwz.39 for ; Sun, 08 Aug 2010 11:44:11 -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=5MmqYs2dDm0GaQgVbFpD/YJePKd27/uaz3QRw4vlCIk=; b=PLEPEfDDMrI1k++cg+huZntM3VQm0ASvsND93Qmx8J9iwleYauRyUZV0lvDUiHg1/P JVvN+3pTlGSMQYGbPU1dROh09AuATJvTer48O96BA8fLbwPXN+FcuHRuixcXkcxOeZ5L Vm1SHTeGDDRTR7hF030B/vANxO2SX4x74+5hk= 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=pbGwUjKg+BJmLLvbUcOlGK6dr2+dp8yfgPfzaX8nGtSKigFwdGxdeTM7XZDGycXbdJ srmKXuwd3i7R+FxouRJaFOs/XsEpO8gzgCiWomCWiCRaA0sOdZ+OX1q59sPhGT9kFoB4 2BctJa8YKvYpdvDRnttlopbLpTu3vdRlztYk8= MIME-Version: 1.0 Received: by 10.204.19.83 with SMTP id z19mr2227370bka.43.1281293051483; Sun, 08 Aug 2010 11:44:11 -0700 (PDT) Received: by 10.204.54.68 with HTTP; Sun, 8 Aug 2010 11:44:11 -0700 (PDT) In-Reply-To: <877hk1m1df.fsf@mid.deneb.enyo.de> References: <877hk1m1df.fsf@mid.deneb.enyo.de> Date: Sun, 8 Aug 2010 14:44:11 -0400 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Jeremy Bem To: Florian Weimer Cc: caml-list List Content-Type: multipart/alternative; boundary=00032555a3da2fd677048d5449e3 X-Spam: no; 0.00; ocaml:01 typechecker:01 mutable:01 type-safe:01 ocaml:01 typechecker:01 mutable:01 type-safe:01 owing:98 owing:98 equality:01 equality:01 polymorphic:01 polymorphic:01 wrote:01 --00032555a3da2fd677048d5449e3 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Aug 8, 2010 at 1:59 PM, Florian Weimer wrote: > * Jeremy Bem: > > > To support my research, I've developed an implementation ("Llama Light") > of > > the core Caml language. Modules, objects, labels etc are not supported > > (except for file-level modules). The system strongly resembles OCaml, > > however the completely rewritten typechecker is not only much smaller in > > terms of lines-of-code; it has a genuinely simpler design owing > especially > > to the lack of first-class modules. > > How do you deal with strings (are they mutable?) and polymorphic > equality (is it type-safe?)? > Yes and no, respectively. In other words, nothing new here. Strings can be made immutable (in both Llama and OCaml) by disabling String.set in the standard library (the s.[i] <- c construct is just sugar for a call to that function). Is there a better approach to polymorphic equality floating around? -Jeremy --00032555a3da2fd677048d5449e3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sun, Aug 8, 2010 at 1:59 PM, Florian = Weimer <fw@deneb.e= nyo.de> wrote:
* Jeremy Bem:

> To support my research, I've developed an implementation ("Ll= ama Light") of
> the core Caml language. Modules, objects, labels etc are not supported=
> (except for file-level modules). The system strongly resembles OCaml,<= br> > however the completely rewritten typechecker is not only much smaller = in
> terms of lines-of-code; it has a genuinely simpler design owing especi= ally
> to the lack of first-class modules.

How do you deal with strings (are they mutable?) and polymorphic
equality (is it type-safe?)?

Yes and no= , respectively. =A0In other words, nothing new here.

Strings can be made immutable (in both Llama and OCaml) by=A0disabling String.set in the standard libr= ary (the s.[i] <- c construct is just sugar for a call to that function)= .

Is there a bett= er approach to polymorphic equality floating around?

-Jeremy
--00032555a3da2fd677048d5449e3-- 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id EA24CBBAF for ; Sun, 8 Aug 2010 20:52:55 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An8EAHOZXkxXaqLJgWdsb2JhbACgRBUBARYiIr95hToE X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="55210102" Received: from ka.mail.enyo.de ([87.106.162.201]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 08 Aug 2010 20:52:55 +0200 Received: from [172.17.135.4] (helo=deneb.enyo.de) by ka.mail.enyo.de with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) id 1OiAzN-00047b-Sk; Sun, 08 Aug 2010 20:52:53 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.72) (envelope-from ) id 1OiAzN-0007qR-L9; Sun, 08 Aug 2010 20:52:53 +0200 From: Florian Weimer To: Jeremy Bem Cc: caml-list List Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? References: <877hk1m1df.fsf@mid.deneb.enyo.de> Date: Sun, 08 Aug 2010 20:52:53 +0200 In-Reply-To: (Jeremy Bem's message of "Sun, 8 Aug 2010 14:44:11 -0400") Message-ID: <87bp9dkkca.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam: no; 0.00; equality:01 polymorphic:01 syntactic:01 caml-list:01 caml:02 florian:03 overhead:04 fix:05 comparison:05 simpler:05 matching:05 probably:07 respectively:07 classes:08 function:08 * Jeremy Bem: > Yes and no, respectively. In other words, nothing new here. Oh. I just happen to think that those two are very high on the list of things you want to fix once you can start with a clean slate. > Is there a better approach to polymorphic equality floating around? Besides type classes? I'm not sure. It's probably possible to remove this feature from the language, with a little bit of syntactic overhead to pass around a matching comparison function. 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id E3053BBAF for ; Sun, 8 Aug 2010 21:39:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0CAHekXkzRVdY0kGdsb2JhbACfZlYIFQEBAQEJCQwHEQMfpm6JEIIRhQouiFQBAQMFhTUEiTs X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="65165539" Received: from mail-bw0-f52.google.com ([209.85.214.52]) by mail1-smtp-roc.national.inria.fr with ESMTP; 08 Aug 2010 21:39:29 +0200 Received: by bwz17 with SMTP id 17so1049813bwz.39 for ; Sun, 08 Aug 2010 12:39:29 -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=HROEuIn5yRNp9OoPaXvnouHnB7A6GH5lC8/NuJdqS/A=; b=Mz9G+IUbcCVVebVkpjUBfZkg/4K7Ke3SveLF2oshEpjq6QbLodHwg1yq7j4OfIxFeb uHLYFh1zsGon94MZlXam/YqJ1yAvGUG63RkIgZehIJEID8MiElunCNTN5Pdhe4Ao9C0V vqS1Yul5vj2WRjqtMczQnx+hMDgOyJ7kfGvRA= 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=aUKeUJOVIxPAK5qTQ1udIUcOnFz3RQS/lnQigojOnaGNLwiVsg+0rgeBPzhkXHHHVy npOi9RAw3SOaA0Gn8KCkQ2eb0tmIDVl1SsaV48sH0KIIgpOSmMtSzRSRoWM5+AkEVkpA bhY1kKfncaQyl3cMEhC+PnR6kxW2I6vo8csXQ= MIME-Version: 1.0 Received: by 10.204.19.83 with SMTP id z19mr2270358bka.43.1281296369035; Sun, 08 Aug 2010 12:39:29 -0700 (PDT) Received: by 10.204.54.68 with HTTP; Sun, 8 Aug 2010 12:39:28 -0700 (PDT) In-Reply-To: <87bp9dkkca.fsf@mid.deneb.enyo.de> References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> Date: Sun, 8 Aug 2010 15:39:28 -0400 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Jeremy Bem To: Florian Weimer Cc: caml-list List Content-Type: multipart/alternative; boundary=00032555a3daedab7d048d550e19 X-Spam: no; 0.00; ocaml's:01 omitting:01 caml's:01 lexer:01 syntax:01 variants:01 syntax:01 ocaml:01 foo:01 foo:01 hashing:01 marshalling:01 ocaml's:01 omitting:01 caml's:01 --00032555a3daedab7d048d550e19 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Aug 8, 2010 at 2:52 PM, Florian Weimer wrote: > * Jeremy Bem: > > > Yes and no, respectively. In other words, nothing new here. > > Oh. I just happen to think that those two are very high on the list > of things you want to fix once you can start with a clean slate. > > > Is there a better approach to polymorphic equality floating around? > > Besides type classes? I'm not sure. It's probably possible to remove > this feature from the language, with a little bit of syntactic > overhead to pass around a matching comparison function. > Maybe I should clarify that my main goal has been to bring Caml Light up-to-date with OCaml's improvements, while keeping the type-checking code very simple, not to try to make further improvements. In fact, I wouldn't necessarily claim that omitting the module and object systems is an improvement, just that it is a simplification. But actually, now that you mention it, I did briefly explore the idea of removing Caml's polymorphic comparison functions. One issue I ran into was syntactic. How would you write: if 'A' <= c && c <= 'Z' then ... where c is a char, without polymorphic comparison, and without more radical changes such as type classes? Ideally the solution would generalize to int64s, etc. I briefly had lexer support for a syntax along the lines of if 'A' <=`c` c && c <=`c` 'Z' then ... In general, the backquote is available since I don't support variants. However, this syntax didn't feel elegant enough to warrant expanding the Llama project's more conservative scope. Currently OCaml can compile Llama code, a feature which doesn't seem like it should be discarded too lightly. I also found multiple instances of a pattern like type foo = Foo of int | Goo of string if myfoo = Foo 3 then ... It felt tedious and perhaps destructive to re-code all of these. Finally, on what theoretical basis do we disallow polymorphic comparison but retain polymorphic hashing and marshalling? Perhaps we just want all these functions to be less convenient, e.g. isolated in their own "Polymorphic" module. After all, Llama retains even the "Obj" module. Once the current system is posted, I could consider making these changes after all. Suggestions to smooth the syntax are more than welcome. Perhaps a bit more time to re-code things carefully is all that is really needed. If there is a broad consensus for immutable strings, I could make that change as well, again with a bit of delay as I'll need to port things like the relocation mechanism in the Llama linker, in order to remain self-hosting. Thanks, Jeremy --00032555a3daedab7d048d550e19 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



=A0=A0if 'A' <=3D c && c <=3D 'Z' then .= ..
where c is a char, without polymorphic comparison, and without= more radical changes such as type classes? =A0Ideally the solution would g= eneralize to int64s, etc.

I briefly had lexer support for a syntax along the line= s of
=A0=A0if 'A' <=3D`c` c && c <=3D`c` &#= 39;Z' then ...
In general, the backquote is available since I= don't support variants. =A0However, this syntax didn't feel elegan= t enough to warrant expanding the Llama project's more conservative sco= pe. =A0Currently OCaml can compile Llama code, a feature which doesn't = seem like it should be discarded too lightly.

I also found multiple instances of a pattern like
=
=A0=A0type foo =3D Foo of int | Goo of string
=A0=A0if myfoo= =3D Foo 3 then ...
It felt tedious and perhaps destructive to re= -code all of these.

Finally, on what theoretical basis do we disallow polym= orphic comparison but retain polymorphic hashing and marshalling? Perhaps w= e just want all these functions to be less convenient, e.g. isolated in the= ir own "Polymorphic" module. =A0After all, Llama retains even the= "Obj" module.

Once the current system is posted, I could consider mak= ing these changes after all. =A0Suggestions to smooth the syntax are more t= han welcome. =A0Perhaps a bit more time to re-code things carefully is all = that is really needed.

If there is a broad consensus for immutable strings, I = could make that change as well, again with a bit of delay as I'll need = to port things like the relocation mechanism in the Llama linker, in order = to remain self-hosting.

Thanks,
Jeremy

--00032555a3daedab7d048d550e19-- 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 1E9F3BBAF for ; Sun, 8 Aug 2010 22:52:23 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisCAJy1XkxKfVIukGdsb2JhbACgPAgVAQEBAQkJDAcRAx+nR4kQghGFAC6IVAEBAwWFNQSEJg X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="55211567" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Aug 2010 22:52:22 +0200 Received: by wwb17 with SMTP id 17so505860wwb.3 for ; Sun, 08 Aug 2010 13:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:subject :to:cc:in-reply-to:references:mime-version:content-type:content-id; bh=Ldxyy2T/V6L3+lL4YIkUdU8ag4XfOaply4wmwwXBdMQ=; b=wpRf8INTuVMdS/V32X96z/NKHib4zbpiz/99D68IW8/HW8aYRZN06yKn7KUIbb9Xjn DhdZBz3qxo3gsHXKhwcQeGecwWwtUTe/v75bWF1AxuBwKzikgda7oPGUvmqY6WSXtaGJ IuFTjrMrSL1Uua+9EChZgFL30nrofhTlrEp3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:subject:to:cc:in-reply-to:references :mime-version:content-type:content-id; b=xyT9sNb7zQBTiFM1IpWWYqLpbT1/YNyd7+qn9fP6onJeXk/qKta/zNN5djeBTksKjs NTze+JhNQ4nZ9qioc41qsTjwnifc8KQ1RdivPN1qLlY0Ye66FXvolOhFOrU3aI5IphkX 4RXPvtYeoPCOh6Gw8+qBhaVNFwf7liXIo9fYU= Received: by 10.216.0.76 with SMTP id 54mr1859798wea.38.1281300742231; Sun, 08 Aug 2010 13:52:22 -0700 (PDT) Received: from localhost (sk.feydakins.org [94.23.4.142]) by mx.google.com with ESMTPS id e8sm2165501wej.22.2010.08.08.13.52.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Aug 2010 13:52:21 -0700 (PDT) Message-ID: <4c5f1905.888cd80a.7152.651b@mx.google.com> Date: Sun, 08 Aug 2010 13:52:21 -0700 (PDT) From: Nicolas Pouillard Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? To: Jeremy Bem , Florian Weimer Cc: caml-list List In-Reply-To: References: <877hk1m1df.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7499.1281300740.1@sk.feydakins.org> X-Spam: no; 0.00; ocaml:01 typechecker:01 mutable:01 type-safe:01 ocaml:01 owing:98 equality:01 equality:01 polymorphic:01 polymorphic:01 wrote:01 wrote:01 caml-list:01 functions:01 immutable:01 On Sun, 8 Aug 2010 14:44:11 -0400, Jeremy Bem wrote: > On Sun, Aug 8, 2010 at 1:59 PM, Florian Weimer wrote: > > > * Jeremy Bem: > > > > > To support my research, I've developed an implementation ("Llama Light") > > of > > > the core Caml language. Modules, objects, labels etc are not supported > > > (except for file-level modules). The system strongly resembles OCaml, > > > however the completely rewritten typechecker is not only much smaller in > > > terms of lines-of-code; it has a genuinely simpler design owing > > especially > > > to the lack of first-class modules. > > > > How do you deal with strings (are they mutable?) and polymorphic > > equality (is it type-safe?)? > > > > Yes and no, respectively. In other words, nothing new here. > > Strings can be made immutable (in both Llama and OCaml) by disabling > String.set in the standard library (the s.[i] <- c construct is just sugar > for a call to that function). And removing the other functions of String module which mutates strings (actually I've made an experiment in which I removed string mutability). > Is there a better approach to polymorphic equality floating around? Type classes! -- Nicolas Pouillard http://nicolaspouillard.fr 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 95893BBAF for ; Sun, 8 Aug 2010 22:53:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisCAJy1XkxKfVK0kGdsb2JhbACgPAgVAQEBAQkJDAcRAx+nR4kQghGFAC6IVAEBAwWFNQSEJg X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="55211592" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Aug 2010 22:53:35 +0200 Received: by wya21 with SMTP id 21so11045479wya.39 for ; Sun, 08 Aug 2010 13:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:subject :to:cc:in-reply-to:references:mime-version:content-type:content-id; bh=Pn1qqILp4mZapfIeTIsgRzCmhesViV/gn8by7whKivI=; b=lIB0CCSciv64MEFPHFFvBcA9G1U0fdnfZYSfX5BCJBTlCxkpPPNeopMbygvr+PtbaN 7gAvJjSxEKPFdVMhJkCjqZZEd3K5Ij9qxOG1zFi52n9EAUrcM8Y6UucAfma5b3Vlg0F7 0DhWDfbxRya+GsDBtEg6ifoesYlsAZYW4WqaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:subject:to:cc:in-reply-to:references :mime-version:content-type:content-id; b=kHHj3X1QJfbf+G0NUndIGU1PDdtXIpjNPHkAM4QrDvYPPExcA5+xpqv3eiXEY9y8oq K026XmrXpmHcEXZhz+11WaqgaRQdOCaH9yyT1FpmTseOGQlmmeiNcCMVqdpVLEnd91IN 7SP/KpSodC3z09ox3WGADMRLsllX82PvOpJ0Y= Received: by 10.227.133.66 with SMTP id e2mr12977375wbt.132.1281300814936; Sun, 08 Aug 2010 13:53:34 -0700 (PDT) Received: from localhost (sk.feydakins.org [94.23.4.142]) by mx.google.com with ESMTPS id l6sm2165202wed.25.2010.08.08.13.53.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Aug 2010 13:53:34 -0700 (PDT) Message-ID: <4c5f194e.8644d80a.7fef.69e6@mx.google.com> Date: Sun, 08 Aug 2010 13:53:34 -0700 (PDT) From: Nicolas Pouillard Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? To: Florian Weimer , Jeremy Bem Cc: caml-list List In-Reply-To: <87bp9dkkca.fsf@mid.deneb.enyo.de> References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7535.1281300813.1@sk.feydakins.org> X-Spam: no; 0.00; 0200,:01 notation:01 equality:01 polymorphic:01 wrote:01 syntactic:01 caml-list:01 int:01 caml:02 florian:03 overhead:04 fix:05 comparison:05 simpler:05 matching:05 On Sun, 08 Aug 2010 20:52:53 +0200, Florian Weimer wrote: > * Jeremy Bem: > > > Yes and no, respectively. In other words, nothing new here. > > Oh. I just happen to think that those two are very high on the list > of things you want to fix once you can start with a clean slate. > > > Is there a better approach to polymorphic equality floating around? > > Besides type classes? I'm not sure. It's probably possible to remove > this feature from the language, with a little bit of syntactic > overhead to pass around a matching comparison function. Yes for instance the very concise local opening notation comes in handy here: if Int.(x = 42) then ... else ... -- Nicolas Pouillard http://nicolaspouillard.fr 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 06479BBAF for ; Sun, 8 Aug 2010 22:59:52 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisCAHO3XkzRVdY0kGdsb2JhbACgPAgVAQEBAQkJDAcRAx+nS4kQghGFAC6IVAEBAwWFNQSJOw X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="56864462" Received: from mail-bw0-f52.google.com ([209.85.214.52]) by mail2-smtp-roc.national.inria.fr with ESMTP; 08 Aug 2010 22:59:51 +0200 Received: by bwz17 with SMTP id 17so1074289bwz.39 for ; Sun, 08 Aug 2010 13:59:51 -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=sBVko6jktvot2TMcklXj4YOvbZxIHPAyGnV+AWX1kmo=; b=Cet9K/xPwhgMqXH23n0wNl9LyETTQ0yC56T5URRLgN0ZXXCNahBrRMMZQzBGmtgGOA QVkAbkz99cBPgWpReSkqqzwudDKZZ9q86uG4WY2O4Hhdj0cLr/6VaO2CPjru0uSrFpHB 729cHCQnL5aRmyXCmQGEPZqt3tIqI86R7EeZ4= 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=n/87teOmPcqhp/khExqG591Ed++FTo9rr/b2nYapOf5UawC2kXkMEofAJZW0VOMpoN KYUY2JKslZQf+9WzWUnaV28ApzdrZb8DFeAnQ4qEWi/2yfC0TZai4Ghg8eAxssgqYhMb zzajNAmd1pGVYfG37AuUZ4gk1C1/Pgv0M7vyo= MIME-Version: 1.0 Received: by 10.204.54.193 with SMTP id r1mr2283625bkg.123.1281301191283; Sun, 08 Aug 2010 13:59:51 -0700 (PDT) Received: by 10.204.54.68 with HTTP; Sun, 8 Aug 2010 13:59:51 -0700 (PDT) In-Reply-To: <4c5f194e.8644d80a.7fef.69e6@mx.google.com> References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> Date: Sun, 8 Aug 2010 16:59:51 -0400 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Jeremy Bem To: Nicolas Pouillard Cc: Florian Weimer , caml-list List Content-Type: multipart/alternative; boundary=001636c5b0185b5437048d562e56 X-Spam: no; 0.00; 0200,:01 notation:01 ocaml:01 0200,:01 notation:01 ocaml:01 equality:01 equality:01 polymorphic:01 polymorphic:01 wrote:01 wrote:01 syntactic:01 syntactic:01 caml-list:01 --001636c5b0185b5437048d562e56 Content-Type: text/plain; charset=ISO-8859-1 On Sun, Aug 8, 2010 at 4:53 PM, Nicolas Pouillard < nicolas.pouillard@gmail.com> wrote: > On Sun, 08 Aug 2010 20:52:53 +0200, Florian Weimer > wrote: > > * Jeremy Bem: > > > > > Yes and no, respectively. In other words, nothing new here. > > > > Oh. I just happen to think that those two are very high on the list > > of things you want to fix once you can start with a clean slate. > > > > > Is there a better approach to polymorphic equality floating around? > > > > Besides type classes? I'm not sure. It's probably possible to remove > > this feature from the language, with a little bit of syntactic > > overhead to pass around a matching comparison function. > > Yes for instance the very concise local opening notation comes in handy > here: > > if Int.(x = 42) then ... else ... > That's very nice. I don't think type classes are conservative enough for this project, but this comes very close indeed. I haven't really had a chance to explore OCaml 3.12 yet, as it came out while I was working on this, but I will give this serious consideration. -Jeremy --001636c5b0185b5437048d562e56 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Sun, Aug 8, 2010 at 4:53 PM, Nicolas Pouillar= d <nico= las.pouillard@gmail.com> wrote:
On Sun, 08 Aug 2010 20:52:53 +0200, Flori= an Weimer <fw@deneb.enyo.de> = wrote:
> * Jeremy Bem:
>
> > Yes and no, respectively. =A0In other words, nothing new here. >
> Oh. =A0I just happen to think that those two are very high on the list=
> of things you want to fix once you can start with a clean slate.
>
> > Is there a better approach to polymorphic equality floating aroun= d?
>
> Besides type classes? =A0I'm not sure. =A0It's probably possib= le to remove
> this feature from the language, with a little bit of syntactic
> overhead to pass around a matching comparison function.

Yes for instance the very concise local opening notation comes = in handy here:

if Int.(x =3D 42) then ... else ...

Tha= t's very nice. =A0I don't think type classes are conservative enoug= h for this project, but this comes very close indeed.

I haven't really had a chance to explore OCaml 3.12 yet, as it cam= e out while I was working on this, but I will give this serious considerati= on.

-Jeremy
--001636c5b0185b5437048d562e56-- 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 B60F1BBAF for ; Sun, 8 Aug 2010 23:47:42 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisCACvDXkzRVdg0kGdsb2JhbACgPAgVAQEBAQkJDAcRAx+nNYkQghGEfC6IVAEBAwWFNQSJO4gI X-IronPort-AV: E=Sophos;i="4.55,338,1278280800"; d="scan'208";a="67403263" Received: from mail-qw0-f52.google.com ([209.85.216.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Aug 2010 23:47:42 +0200 Received: by qwf7 with SMTP id 7so7980220qwf.39 for ; Sun, 08 Aug 2010 14:47:41 -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:content-transfer-encoding; bh=z07xYnn/qVSxpgZQpBxRX9bQOs/6KV+ZRkifhHaOwZQ=; b=pPhr31hOskx8s2E1hamJC39vIs1TMb053B1UFfkCA1vVUolbo+UQsUM83emQAcFWVK Pm4swTD/wD/bjC2OW8HRP43HJVfc0/s/Fucs2cp6rBM17VdZTNuqdpTNrZ0dMSnaiNZv MYG3eielYgICeea8OfyJe4gSq5yR/jjehtSYs= 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 :content-transfer-encoding; b=TN5i8s/55hcfOd4k37kl3k1aXMhhn1cv+u3uqAegzbP9DC9qyB2nT6E6M/QiiHGBXn LnD7/evwhRMLFMM1oHW06n/B7YG5RE3V4XXIAx40Pn3qqJDFs/SCllXNhEJQpQpDPQnz R+K7kQTVZ3nxX05gOFU6oozRS3TQsA8AjfM20= Received: by 10.224.112.209 with SMTP id x17mr7959945qap.304.1281304061108; Sun, 08 Aug 2010 14:47:41 -0700 (PDT) MIME-Version: 1.0 Sender: gabriel.scherer@gmail.com Received: by 10.229.46.204 with HTTP; Sun, 8 Aug 2010 14:47:20 -0700 (PDT) In-Reply-To: References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> From: bluestorm Date: Sun, 8 Aug 2010 23:47:20 +0200 X-Google-Sender-Auth: 7XBJR4H9qW8OIGrg3mpJbfpEHP8 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? To: Jeremy Bem Cc: Nicolas Pouillard , caml-list List , Florian Weimer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; notation:01 ocaml:01 infix:01 val:01 bool:01 infix:01 haskell:01 polluting:01 submodule:01 unqualified:98 equality:01 polymorphic:01 char:01 char:01 syntactic:01 >> > > Is there a better approach to polymorphic equality floating around? >> > >> > Besides type classes? =A0I'm not sure. =A0It's probably possible to re= move >> > this feature from the language, with a little bit of syntactic >> > overhead to pass around a matching comparison function. >> >> Yes for instance the very concise local opening notation comes in handy >> here: >> >> if Int.(x =3D 42) then ... else ... > > That's very nice. =A0I don't think type classes are conservative enough f= or > this project, but this comes very close indeed. > I haven't really had a chance to explore OCaml 3.12 yet, as it came out > while I was working on this, but I will give this serious consideration. This approach is very nice indeed, but to make it practical you have to have one of the two following features : - a more restricted form of "open" statement that does not blindly import *all* the module values - nested modules If you don't have any of these, you have to declare infix operators directly inside the module. You'd have a "val (=3D) : int -> int -> bool" in the "int.ml" file for example. That's notoriously painful to handle if you use the "open" statement : a bunch of "open" statements in a non-careful order and your infix operators become unusable because you don't know anymore where they come from. What you really need is some form of "explicit open", =E0 la Python or Haskell, such as "from Int import (mod, of_char, to_char)" instead of the full open : only a few identifiers are unqualified, and you still use Int.(=3D), Int.(+) instead of polluting the global namespace. The other way to solve the problem is to put the dangerous infix operators into a submodule, eg. Infix or Ops. You have a Int module with int-specific functions that are not likely to silently conflict with values of other modules, and an Int.Infix module meant to be used in that "local open" form : Int.Infix(x + 1 =3D 2). 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 3F382BBAF for ; Mon, 9 Aug 2010 01:00:28 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8EAJLTXkzUNQXamWdsb2JhbACTUoxyFQEBAQEBCAsKBxEiBAMBArMQAY19BYU6iT8 X-IronPort-AV: E=Sophos;i="4.55,339,1278280800"; d="scan'208";a="67404032" Received: from relay03ant.iops.be ([212.53.5.218]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Aug 2010 01:00:27 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by relay03ant.iops.be (Postfix) with ESMTP id B83C46BF009E; Mon, 9 Aug 2010 01:00:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iops.be; h= content-transfer-encoding:content-type:content-type:mime-version :x-mailer:organization:references:in-reply-to:from:from:subject :subject:message-id:date:date:received:received:received; s= scooby; i=postadmin@iops.be; t=1281308423; bh=4mOaMAfgz0MUcTQilW awJCYZvpL8aMMwr2hIoWzlwS0=; b=ViU9twAux+P3+Yhv3IyU0jRpumELd9+z3D wU4BRTMziOQH1sFaP7S5rLyCWQxyNJopkzcCqQ4hsXbVvXxs70N6onRGV3KL0fN1 DImd200mdqsmMoHivJQ8p2US0fI9n8KKQzHIcvEjvsKVg6ajhrpo2AqdOvDnkMxb SfShzuGJA= X-Virus-Scanned: amavisd-new at iops.be Received: from relay03ant.iops.be ([127.0.0.1]) by localhost (bdell028.dcn.iops.be [127.0.0.1]) (amavisd-new, port 10026) with LMTP id Tlv+lve-MUAR; Mon, 9 Aug 2010 01:00:23 +0200 (CEST) Received: from poincare (cust-12-218-109-94.dyn.as47377.net [94.109.218.12]) by relay03ant.iops.be (Postfix) with ESMTP id 9B8706BF0096; Mon, 9 Aug 2010 01:00:18 +0200 (CEST) Received: from localhost ([::1]) by poincare with esmtp (Exim 4.72) (envelope-from ) id 1OiEqo-0008Kz-9T; Mon, 09 Aug 2010 01:00:18 +0200 Date: Mon, 09 Aug 2010 01:00:18 +0200 (CEST) Message-Id: <20100809.010018.162167882947021471.Christophe.Troestler+ocaml@umons.ac.be> To: bluestorm.dylc@gmail.com Cc: jeremy1@gmail.com, caml-list@yquem.inria.fr, fw@deneb.enyo.de Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Christophe TROESTLER In-Reply-To: References: <4c5f194e.8644d80a.7fef.69e6@mx.google.com> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons Return-Receipt-To: Christophe.Troestler@umons.ac.be Disposition-Notification-To: Christophe.Troestler@umons.ac.be X-Mailer: Mew version 7.0.50 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 0200,:01 notation:01 ocaml:01 delimited:01 overloading:01 infix:01 submodule:01 infix:01 submodule:01 equality:01 On Sun, 8 Aug 2010 23:47:20 +0200, bluestorm wrote: >=20 > >> > > Is there a better approach to polymorphic equality floating arou= nd? > >> > > >> > Besides type classes? =A0I'm not sure. =A0It's probably possible t= o remove > >> > this feature from the language, with a little bit of syntactic > >> > overhead to pass around a matching comparison function. > >> > >> Yes for instance the very concise local opening notation comes in ha= ndy > >> here: > >> > >> if Int.(x =3D 42) then ... else ... > > > > That's very nice. =A0I don't think type classes are conservative enou= gh for > > this project, but this comes very close indeed. > > I haven't really had a chance to explore OCaml 3.12 yet, as it came o= ut > > while I was working on this, but I will give this serious considerati= on. >=20 > This approach is very nice indeed, but to make it practical you have > to have one of the two following features : > - a more restricted form of "open" statement that does not blindly > import *all* the module values This is possible to do with Delimited Overloading (pa_do): http://pa-do.forge.ocamlcore.org/ > - nested modules >=20 > The other way to solve the problem is to put the dangerous infix > operators into a submodule, eg. Infix or Ops. You have a Int module > with int-specific functions that are not likely to silently conflict > with values of other modules, and an Int.Infix module meant to be used > in that "local open" form : Int.Infix(x + 1 =3D 2). This is possible to "import" the overloaded functions form a submodule but has to be done by hand for the moment because there is no consensus on what the name of the submodule should be. My 0.02=A4, C. 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 45A38BBAF for ; Mon, 9 Aug 2010 01:29:44 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgEDAGDaXkzRVdY0kGdsb2JhbACYNIgICBUBAQEBCQkMBxEDH6gfiRCCEYR5LohUAQEDBYU1BIk7 X-IronPort-AV: E=Sophos;i="4.55,339,1278280800"; d="scan'208";a="65169034" Received: from mail-bw0-f52.google.com ([209.85.214.52]) by mail1-smtp-roc.national.inria.fr with ESMTP; 09 Aug 2010 01:29:43 +0200 Received: by bwz17 with SMTP id 17so1119906bwz.39 for ; Sun, 08 Aug 2010 16:29:43 -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=KqjpQwIblOw4KrwDniojWruGz4euyyPF6Cd+4ySALDY=; b=KK+U/OYT2A5QKCvml510RlwtNuB6T1pSVvfuvEM0y3GhoQXqU04i/bum528lTC5cq2 v5/B2cYZhBAl7Exo0VAhVUo6jxaGyR0ZFi9VavgFd9UjYM5F9eOJCU7n2nyHs5c2qhnq wiIMzkF0JCQhBoDOM/TxSISpPlf2WvSXMtGA0= 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=x0/uTwAsWdDWtWJRlBXHTGbya6p/tqR6q0jg/7vR4kF9+LKynw4Ix67hgeKvtfkSJr tBosUWAoE/D9ViovwY0oPtFmqUgWHx+HLftnSuuMI2UJi6AXj7vMu4JcEVkt7cfGPgtq DCBmVCjm59gZjqdrbQdfSDhoqfYb9czV3vGxc= MIME-Version: 1.0 Received: by 10.204.160.146 with SMTP id n18mr2437088bkx.116.1281310182863; Sun, 08 Aug 2010 16:29:42 -0700 (PDT) Received: by 10.204.54.68 with HTTP; Sun, 8 Aug 2010 16:29:42 -0700 (PDT) In-Reply-To: References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> Date: Sun, 8 Aug 2010 19:29:42 -0400 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Jeremy Bem To: bluestorm Cc: Nicolas Pouillard , caml-list List , Florian Weimer Content-Type: multipart/alternative; boundary=0015175cd4504bf391048d5846c1 X-Spam: no; 0.00; notation:01 ocaml:01 infix:01 val:01 bool:01 infix:01 haskell:01 polluting:01 iter:01 notation:01 ocaml:01 haskell:01 polluting:01 unqualified:98 unqualified:98 --0015175cd4504bf391048d5846c1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Aug 8, 2010 at 5:47 PM, bluestorm wrote: > >> > > Is there a better approach to polymorphic equality floating around= ? > >> > > >> > Besides type classes? I'm not sure. It's probably possible to remo= ve > >> > this feature from the language, with a little bit of syntactic > >> > overhead to pass around a matching comparison function. > >> > >> Yes for instance the very concise local opening notation comes in hand= y > >> here: > >> > >> if Int.(x =3D 42) then ... else ... > > > > That's very nice. I don't think type classes are conservative enough f= or > > this project, but this comes very close indeed. > > I haven't really had a chance to explore OCaml 3.12 yet, as it came out > > while I was working on this, but I will give this serious consideration= . > > This approach is very nice indeed, but to make it practical you have > to have one of the two following features : > - a more restricted form of "open" statement that does not blindly > import *all* the module values > - nested modules > > If you don't have any of these, you have to declare infix operators > directly inside the module. You'd have a "val (=3D) : int -> int -> > bool" in the "int.ml" file for example. That's notoriously painful to > handle if you use the "open" statement : a bunch of "open" statements > in a non-careful order and your infix operators become unusable > because you don't know anymore where they come from. What you really > need is some form of "explicit open", =E0 la Python or Haskell, such as > "from Int import (mod, of_char, to_char)" instead of the full open : > only a few identifiers are unqualified, and you still use Int.(=3D), > Int.(+) instead of polluting the global namespace. > I don't believe there is really any issue here. Certain modules are simply not intended to opened to be opened globally. This is already the case: witness the many standard library modules that define "length", "map", "iter", etc. -Jeremy --0015175cd4504bf391048d5846c1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sun, Aug 8, 2010 at 5:47 PM, bluestor= m <bluesto= rm.dylc@gmail.com> wrote:
>> > > Is there a better approach to polymorp= hic equality floating around?
>> >
>> > Besides type classes? =A0I'm not sure. =A0It's probab= ly possible to remove
>> > this feature from the language, with a little bit of syntacti= c
>> > overhead to pass around a matching comparison function.
>>
>> Yes for instance the very concise local opening notation comes in = handy
>> here:
>>
>> if Int.(x =3D 42) then ... else ...
>
> That's very nice. =A0I don't think type classes are conservati= ve enough for
> this project, but this comes very close indeed.
> I haven't really had a chance to explore OCaml 3.12 yet, as it cam= e out
> while I was working on this, but I will give this serious consideratio= n.

This approach is very nice indeed, but to make it practical you have<= br> to have one of the two following features :
- a more restricted form of "open" statement that does not blindl= y
import *all* the module values
- nested modules

If you don't have any of these, you have to declare infix operators
directly inside the module. You'd have a "val (=3D) : int -> in= t ->
bool" in the "int.ml<= /a>" file for example. That's notoriously painful to
handle if you use the "open" statement : a bunch of "open&qu= ot; statements
in a non-careful order and your infix operators become unusable
because you don't know anymore where they come from. What you really need is some form of "explicit open", =E0 la Python or Haskell, s= uch as
"from Int import (mod, of_char, to_char)" instead of the full ope= n :
only a few identifiers are unqualified, and you still use Int.(=3D),
Int.(+) instead of polluting the global namespace.

-Jeremy

--0015175cd4504bf391048d5846c1-- 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 7188DBBAF for ; Mon, 9 Aug 2010 08:37:38 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4BACc/X0zRVdi0kGdsb2JhbACTUIxsCBUBAQEBCQkMBxEDH6hUiRCCEYUiLohUAQEDBYU1BIRPhGw X-IronPort-AV: E=Sophos;i="4.55,340,1278280800"; d="scan'208";a="65175755" Received: from mail-qy0-f180.google.com ([209.85.216.180]) by mail1-smtp-roc.national.inria.fr with ESMTP; 09 Aug 2010 08:37:37 +0200 Received: by qyk31 with SMTP id 31so6610651qyk.18 for ; Sun, 08 Aug 2010 23:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=GhrK3UhpKog3aM3UBOxrWI5HRdd+VUwMOyA9Y9MHaJw=; b=mbVRgYiGDziBWbmAUYX3BOZv9T9SiykBi4We8iWmmwXYf9ZQVnPNKoLSSsyTDfbB0d +ZOJlPEIbBTkNxBatLYzxhQ0BIBZTExcxtCq5PC4Gf5Ls762RKfpLJDsGI/cSXyNN2T/ g7etmees82KH9915z+5iBIsbMXBKFNzBShlKo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=IC722jzJqYWV4W4Dwy78rc5BAgKFN85bO8j2LUOXMqfQuAE9NnYpM17ElqwNNvaFvc 4Ihtaa6XpnoPVNZL2nHI+9Xj7ZFD+FiIBlXDmtoVOZuIJh+sWRYbF5WVBGS/TF4VqhWN dkQvL3bJUNWtj9b+medhu2BoVy+JwHVXR+K/w= MIME-Version: 1.0 Received: by 10.224.122.234 with SMTP id m42mr8042146qar.235.1281335856870; Sun, 08 Aug 2010 23:37:36 -0700 (PDT) Received: by 10.229.217.71 with HTTP; Sun, 8 Aug 2010 23:37:36 -0700 (PDT) Date: Mon, 9 Aug 2010 16:37:36 +1000 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: ivan chollet To: caml-list@yquem.inria.fr Cc: jeremy1@gmail.com Content-Type: multipart/alternative; boundary=00c09f89939b963994048d5e405a X-Spam: no; 0.00; ocaml:01 jocaml:01 runtimes:01 ocaml:01 runtime:01 jocaml:01 runtimes:01 runtime:01 caml-list:01 caml:02 caml:02 namely:02 namely:02 simpler:05 implement:06 --00c09f89939b963994048d5e405a Content-Type: text/plain; charset=ISO-8859-1 I have noted that there are now many implementation of OCaml. Namely : - caml light - jocaml - mincaml - your implementation ? etc. which means there is a lot of interest in implementing tools and runtimes for ML. I'm just saying this because I was planning to implement another VM for ML to address my own needs. Well, now I'm thinking that the community should start a project like Parrot (with JIT optionally) but dedicated to ML. The existing ocaml runtime is amazing but it's definitely not very community friendly and is in my opinion a bit hard to understand given the scarcity of design documents. A real community project with real documentation might be interesting for teaching purposes but also in production environments. If enough people are interested, I'll be happy to contribute or to start such a project. What do you think? --00c09f89939b963994048d5e405a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have noted that there are now many implementation of OCaml. Namely :
= - caml light
- jocaml
- mincaml
- your implem= entation ?
etc.

which means there is a l= ot of interest in implementing tools and runtimes for ML.=A0
I'm just saying this because I was planning to implement another V= M for ML to address my own needs.
Well, now I'm thinking that= the community should start a project like Parrot (with JIT optionally) but= dedicated to ML. The existing ocaml runtime is amazing but it's defini= tely not very community friendly and is in my opinion a bit hard to underst= and given the scarcity of design documents. A real community project with r= eal documentation might be interesting for teaching purposes but also in pr= oduction environments.
If enough people are interested, I'll be happy to contribute or to= start such a project.
What do you think?


--00c09f89939b963994048d5e405a-- 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 BDFC2BBAF for ; Mon, 9 Aug 2010 12:54:53 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlcDACZ7X0zUGyoFkWdsb2JhbACTUIx0FQEBAQEJCwoHEQMfwR+FOgSET4dK X-IronPort-AV: E=Sophos;i="4.55,341,1278280800"; d="scan'208";a="67417668" Received: from smtp5-g21.free.fr ([212.27.42.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Aug 2010 12:54:52 +0200 Received: from apc.happyleptic.org (unknown [82.67.194.89]) by smtp5-g21.free.fr (Postfix) with ESMTP id 102C7D48065 for ; Mon, 9 Aug 2010 12:54:45 +0200 (CEST) Received: from ccellier.rd.securactive.lan (extranet.securactive.org [82.234.213.170]) by apc.happyleptic.org (Postfix) with ESMTP id 42EBC3355B for ; Mon, 9 Aug 2010 12:59:47 +0200 (CEST) Received: from rixed by ccellier.rd.securactive.lan with local (Exim 4.71) (envelope-from ) id 1OiQ0C-0001vk-JP for caml-list@yquem.inria.fr; Mon, 09 Aug 2010 12:54:44 +0200 Date: Mon, 9 Aug 2010 12:54:44 +0200 From: Cedric Cellier To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? Message-ID: <20100809105444.GA24481@securactive.net> Mail-Followup-To: Cedric Cellier , caml-list@yquem.inria.fr References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam: no; 0.00; ocaml:01 runtime:01 runtime:01 caml-list:01 caml:02 simpler:05 profitable:94 teaching:08 real:10 real:10 aug:10 environments:10 bit:11 cedric:11 might:12 -[ Mon, Aug 09, 2010 at 04:37:36PM +1000, ivan chollet ]---- > The existing ocaml runtime is > amazing but it's definitely not very community friendly and is in my opinion > a bit hard to understand given the scarcity of design documents. A real > community project with real documentation might be interesting for teaching > purposes but also in production environments. > If enough people are interested, I'll be happy to contribute or to start > such a project. Don't you think it would be a more profitable work to document the existing runtime instead ? 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 6E749BBAF for ; Mon, 9 Aug 2010 13:55:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4CADaJX0xKfVIukGdsb2JhbACgPAgVAQEBAQkJDAcRAx+nOIkQghGFSS6IVAEBAwWFNQSEJg X-IronPort-AV: E=Sophos;i="4.55,341,1278280800"; d="scan'208";a="67419271" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Aug 2010 13:55:29 +0200 Received: by wwb17 with SMTP id 17so1023287wwb.3 for ; Mon, 09 Aug 2010 04:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:subject :to:cc:in-reply-to:references:mime-version:content-type:content-id; bh=DhR6IB98cFng/F8XHkH9MK+gxNGbRjsHWcqFDQ5BE64=; b=MLiHpoVhLRBhTeTm0MVH/PDRzK5i027R2AW9LtkfBtPwm5LQ94K47C0Mx5kSLkMlms mDctNZRuZlm+oc7SzoqCxYgT3Ht+VUjks0XJs4oYDOvC9pe73aVF/fB2H3b7ub9Lq1Tz UKOljipK3gWs3rzYWhMEjrASf7/SllVY6GD0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:subject:to:cc:in-reply-to:references :mime-version:content-type:content-id; b=xBhDFdRWex4NysLpPZrmLVFqszcEGRO/s9RQHljgp+1o/IT8DRVvlyMaV9gnN/BN/a rbzxxB0D6xUMVk4Jy9owZQgcIv1q6zgLptxIivMgwUWiTOFOpqP88NxzPk79Ppm+8XzE deANf1cpWydQ0dX4056a02/PkNa6r3dQElyYE= Received: by 10.227.133.142 with SMTP id f14mr13317453wbt.2.1281354928344; Mon, 09 Aug 2010 04:55:28 -0700 (PDT) Received: from localhost (sk.feydakins.org [94.23.4.142]) by mx.google.com with ESMTPS id i25sm4284639wbi.16.2010.08.09.04.55.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Aug 2010 04:55:27 -0700 (PDT) Message-ID: <4c5fecaf.d908e30a.01a0.ffffa6da@mx.google.com> Date: Mon, 09 Aug 2010 04:55:27 -0700 (PDT) From: Nicolas Pouillard Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? To: Jeremy Bem , Florian Weimer Cc: caml-list List In-Reply-To: References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23898.1281354926.1@sk.feydakins.org> X-Spam: no; 0.00; ocaml's:01 omitting:01 caml's:01 foo:01 foo:01 hashing:01 marshalling:01 hash:01 marshalling:01 variants:01 hashing:01 literals:01 mutable:01 clases:98 sml:01 On Sun, 8 Aug 2010 15:39:28 -0400, Jeremy Bem wrote: > On Sun, Aug 8, 2010 at 2:52 PM, Florian Weimer wrote: > > > * Jeremy Bem: > > > > > Yes and no, respectively. In other words, nothing new here. > > > > Oh. I just happen to think that those two are very high on the list > > of things you want to fix once you can start with a clean slate. > > > > > Is there a better approach to polymorphic equality floating around? > > > > Besides type classes? I'm not sure. It's probably possible to remove > > this feature from the language, with a little bit of syntactic > > overhead to pass around a matching comparison function. > > > > Maybe I should clarify that my main goal has been to bring Caml Light > up-to-date with OCaml's improvements, while keeping the type-checking code > very simple, not to try to make further improvements. In fact, I wouldn't > necessarily claim that omitting the module and object systems is an > improvement, just that it is a simplification. > > But actually, now that you mention it, I did briefly explore the idea of > removing Caml's polymorphic comparison functions. > > One issue I ran into was syntactic. How would you write: > if 'A' <= c && c <= 'Z' then ... > where c is a char, without polymorphic comparison, and without more radical > changes such as type classes? Ideally the solution would generalize to > int64s, etc. As said in my previous email local opening can help here: if Char.('A' <= c && c <= 'Z') then ... > I also found multiple instances of a pattern like > type foo = Foo of int | Goo of string > if myfoo = Foo 3 then ... > It felt tedious and perhaps destructive to re-code all of these. Having to recode them sure is tedious but very simple as well in these case: match myfoo with Foo 3 -> ... | ... > Finally, on what theoretical basis do we disallow polymorphic comparison but > retain polymorphic hashing and marshalling? Perhaps we just want all these > functions to be less convenient, e.g. isolated in their own "Polymorphic" > module. After all, Llama retains even the "Obj" module. With type clases you would have a class for each of them. For sure it make sense to keep them all like you keep the Obj module the difference is the intended usage if they are called Unsafe_generic_equality.(=), unsafe_generic_hash, and unsafe_generic_marshalling then its fine. For sure we then want to expose safer variants of those to the user. Another idea that can help would be to have only one builtin type class (no not the equality one as in SML), the Typeable class. This class simply expose a value to represent a type. In these three cases (equality, marshalling, and hashing) we will even don't look at these values, the purpose is to give us the right to behave in a non-parametric way. However it does not fix the equality for abstract types, so I don't know if the gain worth the added complexity. > If there is a broad consensus for immutable strings, I could make that > change as well, again with a bit of delay as I'll need to port things like > the relocation mechanism in the Llama linker, in order to remain > self-hosting. For sure it would a lot nicer to have at least a type for immutable strings and make the literals immutable. Then having a second type for mutable strings and two copying functions (freeze and thaw) to convert them would help you a lot in adapting existing code. Regards, -- Nicolas Pouillard http://nicolaspouillard.fr 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 4907DBBAF for ; Mon, 9 Aug 2010 15:10:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4CAFCbX0zRVdc0kGdsb2JhbACgPQgVAQEBAQkJDAcRAx+nYokQghGFXy6IVAEBAwWFNQSJOw X-IronPort-AV: E=Sophos;i="4.55,342,1278280800"; d="scan'208";a="55230430" Received: from mail-ew0-f52.google.com ([209.85.215.52]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Aug 2010 15:10:44 +0200 Received: by ewy20 with SMTP id 20so3997933ewy.39 for ; Mon, 09 Aug 2010 06:10:44 -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 :content-transfer-encoding; bh=po36rTIC3aS1/AroG+hayt8waXKZI2rA9PVJqnutMHU=; b=Odq+P5vgdcVeXMjaA4QBjReMDC4Ld880zE+tFpX3393Qaw97MkYwe6X/DPCdeTpQMZ LWsC9BH0vssmui6JqjERXQg5sE/yKd9TSD3gwpVEA5JJSdnenVP796nWS7e+pEKVYOC0 FwOC55TvsNWTGrRhsRj9e2FME/23PAXggTQxs= 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:content-transfer-encoding; b=Nil9EmjusIvqs2OTS29oVNSFLl62f7SuHOgZGo2W0AKn1aoiumN/CS7L3Thhwqpqmy Dwp7DJhb88DImNgz7N6JZPC5qav7h4s4Wt0wA7/9V8bBHdKF7QHaAW9Rb6muRLeJinmq lsZOOJfIJCxD8Ke0XfMiavp26ciB6mpreQTp4= MIME-Version: 1.0 Received: by 10.213.19.211 with SMTP id c19mr11997808ebb.93.1281359444229; Mon, 09 Aug 2010 06:10:44 -0700 (PDT) Received: by 10.14.121.16 with HTTP; Mon, 9 Aug 2010 06:10:43 -0700 (PDT) In-Reply-To: References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> Date: Mon, 9 Aug 2010 09:10:43 -0400 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: David House To: bluestorm Cc: Jeremy Bem , caml-list List , Florian Weimer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; infix:01 val:01 bool:01 infix:01 haskell:01 polluting:01 unqualified:98 char:01 char:01 wrote:01 caml-list:01 int:01 int:01 explicitly:02 caml:02 On 8 August 2010 17:47, bluestorm wrote: > If you don't have any of these, you have to declare infix operators > directly inside the module. You'd have a "val (=3D) : int -> int -> > bool" in the "int.ml" file for example. That's notoriously painful to > handle if you use the "open" statement : a bunch of "open" statements > in a non-careful order and your infix operators become unusable > because you don't know anymore where they come from. What you really > need is some form of "explicit open", =E0 la Python or Haskell, such as > "from Int import (mod, of_char, to_char)" instead of the full open : > only a few identifiers are unqualified, and you still use Int.(=3D), > Int.(+) instead of polluting the global namespace. If you're willing to explicitly name the things you wish to import then this doesn't seem to be a hard problem to solve: let mod =3D Int.mod let of_char =3D Int.of_char let to_char =3D Int.tochar Or even, in 3.12, let mod, of_char, to_char =3D Int.(mod, of_char, to_char) 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 70538BBAF for ; Mon, 9 Aug 2010 16:03:31 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8CAHSnX0xKfVK0kGdsb2JhbACDFZ0oCBUBAQEBCQkMBxEDH6gLiFQ8ghGFZS6IVAEBAwWBIYMhcwSEJg X-IronPort-AV: E=Sophos;i="4.55,343,1278280800"; d="scan'208";a="65191817" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail1-smtp-roc.national.inria.fr with ESMTP; 09 Aug 2010 16:03:31 +0200 Received: by wya21 with SMTP id 21so11738218wya.39 for ; Mon, 09 Aug 2010 07:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:subject :to:cc:in-reply-to:references:mime-version:content-type:content-id :content-transfer-encoding; bh=eX8I9u8Vfm9R91eymftpcBLeuidITR0qLKCmWRKI8ZE=; b=lAgs/9c6aanvrIDSqCP38cSsHs9KsctN3W1ypi7A18SOQ2MRglU22LizUkJtVnQbeC bP4udnEk+MdVuBelfG37L/m1Q32i6dYXHpG1+uqK21HSNuaVgpsCZyrtVDvTpolZDOTo IjHeoOSa4j/sTCzw/xrsWRtz3ZLZZV6mlI7L8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:subject:to:cc:in-reply-to:references :mime-version:content-type:content-id:content-transfer-encoding; b=Jkius/4qGjOvJxbYqiBESTe7Cbnx/eAYAEMjoFf7y4OXcYDuxBG/tyxcnL91S+wkcK 1e32xvLsLs2IjSYj1gqYsOBvmcCSvbnB8nFHelin5yoyO3g+A9/O94/OuSVEFyhTxyAv 0sMSNSqrV6ZaDuGt2tE0lqvqIaJsfyL3bjLFw= Received: by 10.227.128.201 with SMTP id l9mr14116209wbs.22.1281362610704; Mon, 09 Aug 2010 07:03:30 -0700 (PDT) Received: from localhost (sk.feydakins.org [94.23.4.142]) by mx.google.com with ESMTPS id u32sm2576903weq.35.2010.08.09.07.03.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Aug 2010 07:03:30 -0700 (PDT) Message-ID: <4c600ab2.a0ebd80a.5159.77be@mx.google.com> Date: Mon, 09 Aug 2010 07:03:30 -0700 (PDT) From: Nicolas Pouillard Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? To: David House , bluestorm Cc: Jeremy Bem , caml-list List , Florian Weimer In-Reply-To: References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <29686.1281362609.1@sk.feydakins.org> Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; infix:01 val:01 bool:01 infix:01 haskell:01 polluting:01 constructors:01 constructors:01 afaik:01 unqualified:98 char:01 char:01 wrote:01 wrote:01 caml-list:01 On Mon, 9 Aug 2010 09:10:43 -0400, David House wrote: > On 8 August 2010 17:47, bluestorm wrote: > > If you don't have any of these, you have to declare infix operators > > directly inside the module. You'd have a "val (=3D) : int -> int -> > > bool" in the "int.ml" file for example. That's notoriously painful to > > handle if you use the "open" statement : a bunch of "open" statements > > in a non-careful order and your infix operators become unusable > > because you don't know anymore where they come from. What you really > > need is some form of "explicit open", =C3=A0 la Python or Haskell, suc= h as > > "from Int import (mod, of_char, to_char)" instead of the full open : > > only a few identifiers are unqualified, and you still use Int.(=3D), > > Int.(+) instead of polluting the global namespace. > = > If you're willing to explicitly name the things you wish to import > then this doesn't seem to be a hard problem to solve: > = > let mod =3D Int.mod > let of_char =3D Int.of_char > let to_char =3D Int.tochar You may want to import types, data constructors, exceptions, modules as well... While some of them can be mitigated data constructors cannot AFAIK= . -- = Nicolas Pouillard http://nicolaspouillard.fr 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 67132BBAF for ; Mon, 9 Aug 2010 17:00:29 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4CAM+0X0zRVdi0kGdsb2JhbACgPQgVAQEBAQkJDAcRAx+oX4kQghGFcy6IVAEBAwWFNQSET4Rs X-IronPort-AV: E=Sophos;i="4.55,343,1278280800"; d="scan'208";a="56891260" Received: from mail-qy0-f180.google.com ([209.85.216.180]) by mail2-smtp-roc.national.inria.fr with ESMTP; 09 Aug 2010 17:00:28 +0200 Received: by qyk31 with SMTP id 31so6995656qyk.18 for ; Mon, 09 Aug 2010 08:00:28 -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=wIWOC1KkNcijAY+PkMWgYcBSwqhoIhv0myXhReYfUvI=; b=iM8cJGb1UmDSy9Awl1Tbk3d9Gfk6UVgAak/8bhiZ5bValobUja20Gv8uXBtCMPhc33 mqI1rl0PO2lCVb7fiKCUJwm/11Au0gTflN9I9J1CcxRVNXJqPJJxzqsVo00Uc4FYZMjT W8zxFQZpwCbF8P9txKGh+6OI8o7Kg89mXR67Y= 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=t67V22DbfP7hN6Z1GYRJYgQxjECNxKtRClsZfuBfdDLFVbdROfNG4ecIxQUrNJ+B7b aXIIQ9CXmUeSUvgYqpC+1h+jSOX2IdPYzDoK4X660TAWDdqnOhYNS+J+J8SapzQkhYRL sX3sVVp3aDjVBxa+LVbDI+zo3IVAAH4XpiWYU= MIME-Version: 1.0 Received: by 10.229.87.74 with SMTP id v10mr2562539qcl.38.1281366028000; Mon, 09 Aug 2010 08:00:28 -0700 (PDT) Received: by 10.229.217.71 with HTTP; Mon, 9 Aug 2010 08:00:26 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Aug 2010 01:00:26 +1000 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: ivan chollet To: caml-list@yquem.inria.fr, Cedric Cellier Cc: jeremy1@gmail.com Content-Type: multipart/alternative; boundary=0016364ef503ed2190048d6546f2 X-Spam: no; 0.00; ocaml:01 runtime:01 ocaml:01 runtime:01 caml-list:01 caml:02 caml:02 seems:03 seems:03 guess:04 guess:04 simpler:05 profitable:94 profitable:94 teaching:08 --0016364ef503ed2190048d6546f2 Content-Type: text/plain; charset=ISO-8859-1 It guess it would, but it seems to me that such a task would be far too ambitious. Speaking for myself, I could relatively quickly write a VM for caml, but writing the ocaml runtime design documents is something that would take me way too much time. Most of ML users don't have access to the original caml designers so we have no way to understand their design choices fully. -[ Mon, Aug 09, 2010 at 04:37:36PM +1000, ivan chollet ]---- > The existing ocaml runtime is > amazing but it's definitely not very community friendly and is in my opinion > a bit hard to understand given the scarcity of design documents. A real > community project with real documentation might be interesting for teaching > purposes but also in production environments. > If enough people are interested, I'll be happy to contribute or to start > such a project. Don't you think it would be a more profitable work to document the existing runtime instead ? > > --0016364ef503ed2190048d6546f2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It guess it would, but it seems to me that such a task would be far too amb= itious.
Speaking for myself, I could relatively quickly write a VM for c= aml, but writing the ocaml runtime design documents is something that would= take me way too much time. Most of ML users don't have access to the o= riginal caml designers so we have no way to understand their design choices= fully.


-[=
 Mon, Aug 09, 2010 at 04:37:36PM +1000, ivan chollet ]----
> The exis= ting ocaml runtime is
> amazing but it's definitely not very comm= unity friendly and is in my opinion
> a bit hard to understand given the scarcity of design documents. A rea= l
> community project with real documentation might be interesting fo= r teaching
> purposes but also in production environments.
> If= enough people are interested, I'll be happy to contribute or to start<= br> > such a project.

Don't you think it would be a more profitab= le work to document the
existing runtime instead ?



--0016364ef503ed2190048d6546f2-- 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id BE62FBBAF for ; Mon, 9 Aug 2010 17:03:36 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4CAAq1X0zRVdg0kGdsb2JhbACgPQgVAQEBAQkJDAcRAx+oX4kQghGFcy6IVAEBAwWFNQSET4Rs X-IronPort-AV: E=Sophos;i="4.55,343,1278280800"; d="scan'208";a="55234382" Received: from mail-qw0-f52.google.com ([209.85.216.52]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Aug 2010 17:03:36 +0200 Received: by qwf7 with SMTP id 7so8699346qwf.39 for ; Mon, 09 Aug 2010 08:03:35 -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:content-type; bh=FBqFapNtWz+N4J6pTcbRKnb2nalzawPkSuiSEhF4k3o=; b=poP3T9hbafMmHue0pTPX1UvVcLgVqNvhUrs0wwG0AmdfVJtDG1GmMB0R9AhHEgxyAG j1snAxMsGOwubpaUWXOcPYAiik+8TyXc/2qr2lqLE/y/dv/Gf7mgBY/r/th7F010k8A8 KQlUauryBwwx6WmpxvdGrbvIKET+AFtCyUTFQ= 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 :content-type; b=WqXZZl4SfbJDN6FXQ8qK1JkklaOI2a2de7f9DSOQaFguX9toCqWsMB9u8hRJMHqR7p 1UpNii+BOEk2K96ejTVL3qg5FyRbuJh0xcz+oZs1+a4xTlXECt/4BMrkkkqL15z3QHEa cO89e882J1zfaB2UIkgQ11HEhM/Rv6S9XKmZA= MIME-Version: 1.0 Received: by 10.229.1.163 with SMTP id 35mr7181364qcf.299.1281366215503; Mon, 09 Aug 2010 08:03:35 -0700 (PDT) Received: by 10.229.217.71 with HTTP; Mon, 9 Aug 2010 08:03:34 -0700 (PDT) In-Reply-To: References: Date: Tue, 10 Aug 2010 01:03:34 +1000 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: ivan chollet To: caml-list@yquem.inria.fr, Cedric Cellier Content-Type: multipart/alternative; boundary=0016367d5bd81a2fef048d65520a X-Spam: no; 0.00; ocaml:01 runtime:01 ocaml:01 runtime:01 caml-list:01 caml:02 caml:02 seems:03 seems:03 guess:04 guess:04 simpler:05 profitable:94 profitable:94 teaching:08 --0016367d5bd81a2fef048d65520a Content-Type: text/plain; charset=ISO-8859-1 It guess it would, however it seems to me that such a task would be far too ambitious. Speaking for myself, I could relatively quickly write a VM for caml, but writing the ocaml runtime design documents is something that would take me way too much time. Most of ML users don't have access to the original caml designers so we have no way to understand their design choices fully. Having said that, the two tasks are non exclusive so we can definitely start a project with all these goals in mind. -[ Mon, Aug 09, 2010 at 04:37:36PM +1000, ivan chollet ]---- > The existing ocaml runtime is > amazing but it's definitely not very community friendly and is in my opinion > a bit hard to understand given the scarcity of design documents. A real > community project with real documentation might be interesting for teaching > purposes but also in production environments. > If enough people are interested, I'll be happy to contribute or to start > such a project. Don't you think it would be a more profitable work to document the existing runtime instead ? > > --0016367d5bd81a2fef048d65520a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It guess it would, however it seems to me that such a task would be far too= ambitious.
Speaking for myself, I could relatively quickly write a VM for caml, but writing the ocaml runtime design documents is something that would take me way=20 too much time. Most of ML users don't have access to the original caml= =20 designers so we have no way to understand their design choices fully.
H= aving said that, the two tasks are non exclusive so we can definitely start= a project with all these goals in mind.

-[ Mon, Aug 09, 2010 at 04:37:36PM +1=
000, ivan chollet ]----
> The existing ocaml runtime is
> amazi= ng but it's definitely not very community friendly and is in my opinion=
> a bit hard to understand given the scarcity of design documents. A rea= l
> community project with real documentation might be interesting fo= r teaching
> purposes but also in production environments.
> If= enough people are interested, I'll be happy to contribute or to start<= br> > such a project.

Don't you think it would be a more profitab= le work to document the
existing runtime instead ?



--0016367d5bd81a2fef048d65520a-- 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 659D5BBAF for ; Wed, 11 Aug 2010 14:57:04 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4BAHM7YkxKfVIukGdsb2JhbACUPotdCBUBAQEBCQkMBxEDH6BPiyEBBY8lAQSFOg X-IronPort-AV: E=Sophos;i="4.55,352,1278280800"; d="scan'208";a="67497886" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail4-smtp-sop.national.inria.fr with ESMTP; 11 Aug 2010 14:56:55 +0200 Received: by wwb18 with SMTP id 18so49283wwb.3 for ; Wed, 11 Aug 2010 05:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:organization:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; bh=ejRtArmQP6JmnfB2Y7Jml9qB7/Sm8C9/qSIRohCD9pM=; b=Ctb5efmZ9qWCaDs2LNd22pgFbek4f7vNc3SGwWgx1PZyI7bWxiJ108ysS/DowuMWYQ V3AVCtxa/sHnM4zvDdNxlKwGXmInU7ojDeeX+yVEaUglDMkaAfyoVk28CZZ60D8Y0mIz U3VvNH34/sRmalqUnFoM56z8sZMQ1nfJFITHg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:organization:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; b=iGNV63BW7LC17X3sQn+e1oEc2oRxvs9Q9uI7iVS4stFNkQOn7a6OgTD4k9EUuvPASu 5A99d0QHyhP9Jr4/fMj68G7/qIe1pcYn/NcI7jcL3x9yLq3CvsPHNKhq/jopePY8AHJj ZWArYQlGwKZL+5uB0vS1nsoUIq8uSVUZrh4oE= Received: by 10.227.68.145 with SMTP id v17mr16664663wbi.159.1281531415144; Wed, 11 Aug 2010 05:56:55 -0700 (PDT) Received: from WinEight ([87.113.155.108]) by mx.google.com with ESMTPS id u32sm53938weq.11.2010.08.11.05.56.52 (version=SSLv3 cipher=RC4-MD5); Wed, 11 Aug 2010 05:56:53 -0700 (PDT) From: Jon Harrop To: "'Jeremy Bem'" , "'caml-list List'" References: <877hk1m1df.fsf@mid.deneb.enyo.de> In-Reply-To: Subject: RE: [Caml-list] interest in a much simpler, but modern, Caml? Date: Wed, 11 Aug 2010 13:56:26 +0100 Organization: Flying Frog Consultancy Message-ID: <03f901cb3954$9d052fb0$d70f8f10$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acs3Kb+587SLA7zMREyp7Hec3qXkFwCKqOUg Content-Language: en-gb X-Spam: no; 0.00; ocaml's:01 hashing:01 cheers:01 equality:01 equality:01 polymorphic:01 polymorphic:01 caml-list:01 caml:02 types:05 types:05 comparison:05 simpler:05 simpler:05 uses:07 > Is there a better approach to polymorphic equality floating around? SML's equality types are simpler than type classes and more robust than OCaml's polymorphic equality (and comparison, and hashing). F# uses equality types. Cheers, Jon. 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id EE62ABBAF for ; Wed, 11 Aug 2010 15:00:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4BAOs7YkxKfVIukGdsb2JhbACUPotdCBUBAQEBCQkMBxEDH6BMiyEBBY8lAQSFOg X-IronPort-AV: E=Sophos;i="4.55,352,1278280800"; d="scan'208";a="55306941" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail3-smtp-sop.national.inria.fr with ESMTP; 11 Aug 2010 15:00:33 +0200 Received: by wwb18 with SMTP id 18so53456wwb.3 for ; Wed, 11 Aug 2010 06:00:33 -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:content-transfer-encoding:x-mailer:thread-index :content-language; bh=+lIHrrx19NYmAa4+ggNJZ3uYF1BgXtEmT1p4bfBlCSE=; b=nXvJcYfVQpXpG7EFi1k/IlNfzHOo/dpipOsMoogAgrvT1dr7BWps+2a+sbEY2Mh5wO II6b2KBWDpxv5hyDKLrorVZHJa8gZPyGyxesVlIRP3nXRjaC8VxO47BVKaXGKqVlVa+A lFJvE/Ee8XWqhXQq8OkGeRohyi/4tOAUNFGaE= 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:content-transfer-encoding :x-mailer:thread-index:content-language; b=Y8i7eSI+2T0lG74+aeAqxIQjc5GpnoAjDEetzI8BD6MY5jSmZkLRE4x/E6YNe2Nqxn tzU74vKrE/kqM9ceqbc0W7pSk3Z8BtVkQ64m1M/EdxwnFSAWnQk+FfoV7icA7V2DlVfk 96hG9eXvRmlE5pB2p9bP9B3W07/3Ipn1sKLRc= Received: by 10.216.177.205 with SMTP id d55mr5262291wem.76.1281531633354; Wed, 11 Aug 2010 06:00:33 -0700 (PDT) Received: from WinEight ([87.113.155.108]) by mx.google.com with ESMTPS id n40sm57205weq.5.2010.08.11.06.00.32 (version=SSLv3 cipher=RC4-MD5); Wed, 11 Aug 2010 06:00:32 -0700 (PDT) From: Jon Harrop To: "'Jeremy Bem'" , "'Florian Weimer'" Cc: "'caml-list List'" References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> In-Reply-To: Subject: RE: [Caml-list] interest in a much simpler, but modern, Caml? Date: Wed, 11 Aug 2010 14:00:05 +0100 Organization: Flying Frog Consultancy Message-ID: <03fa01cb3955$1f98ebb0$5ecac310$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acs3MXqZ3ArSp5V7SMmCIYySwcU30gCI16jg Content-Language: en-gb X-Spam: no; 0.00; ad-hoc:01 polymorphism:01 compiler:01 run-time:01 cheers:01 polymorphic:01 char:01 syntactic:01 ints:01 caml-list:01 caml:02 floats:02 back-end:02 primitive:02 primitive:02 > One issue I ran into was syntactic. How would you write: > if 'A' <= c && c <= 'Z' then ... > where c is a char, without polymorphic comparison, and without more radical changes such as type > classes? SML's ad-hoc polymorphism. Would also be nice if you could fill out the primitive types with 32-bit floats, ints of different sizes and so on. Also, would be excellent if you could make the compiler agnostic with regard to the run-time representation of these types so a new back-end could unbox all primitive types. Cheers, Jon. 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3ADFBBBAF for ; Wed, 11 Aug 2010 15:02:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4BAOs7YkxKfVK0kGdsb2JhbACUPotdCBUBAQEBCQkMBxEDH6BMiyEBBY8lAQSFOg X-IronPort-AV: E=Sophos;i="4.55,352,1278280800"; d="scan'208";a="56970051" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail2-smtp-roc.national.inria.fr with ESMTP; 11 Aug 2010 15:02:58 +0200 Received: by wya21 with SMTP id 21so112646wya.39 for ; Wed, 11 Aug 2010 06:02:58 -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:content-transfer-encoding:x-mailer:thread-index :content-language; bh=f4ec4Rw+7CtwlKrhzquBIL9cYrXYMvqPqOmMSxSggIg=; b=u3QuX389uXwWqVDhu9ZRbMUkYkr0RWHv3EoIlheJjTng1ROZn92EyD8JaGesKytgl9 fBzPjCejdvslujNXFu0UtWVNDzsmIUyM9fxxGh2FfjjG+OYRPVAF4/sesMmcEQRhbC1D kwsxnU3G6DDQKukLdrx5rUdRw6HFe48WV1hKw= 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:content-transfer-encoding :x-mailer:thread-index:content-language; b=e4Dw+Yhx87z6F4nlzeHPsgjRGP1qG4HDDlBPYPH8tZU8+CzUIdxFB+MrXezRmVGbSz UnGL4m/JktkNK9/47JiAnfOQJEfoYNqaFjcIzR1mVuFJyQkmKMKsUtLoKSVnZACjt7TU yfN99sglafUSgKNQ4s9NlObDz4tT0/kXw7vRQ= Received: by 10.227.153.15 with SMTP id i15mr16355436wbw.211.1281531778379; Wed, 11 Aug 2010 06:02:58 -0700 (PDT) Received: from WinEight ([87.113.155.108]) by mx.google.com with ESMTPS id l55sm54534weq.41.2010.08.11.06.02.57 (version=SSLv3 cipher=RC4-MD5); Wed, 11 Aug 2010 06:02:57 -0700 (PDT) From: Jon Harrop To: "'Jeremy Bem'" , "'bluestorm'" Cc: "'caml-list List'" , "'Florian Weimer'" References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> In-Reply-To: Subject: RE: [Caml-list] interest in a much simpler, but modern, Caml? Date: Wed, 11 Aug 2010 14:02:31 +0100 Organization: Flying Frog Consultancy Message-ID: <03fb01cb3955$76093770$621ba650$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acs3UaYspL+x22R0Sn2U0vLgMVIP5QCA43SA Content-Language: en-gb X-Spam: no; 0.00; cheers:01 ints:01 caml-list:01 int:01 int:01 caml:02 types:05 simpler:05 indeed:07 approach:08 refers:08 assumption:08 inventing:09 might:12 happens:13 > > if Int.(x = 42) then ... else ... > This approach is very nice indeed What happens when you do: if Int.(x = 42 || x = 45) then ... else ... Presumably it either barfs on the assumption that "||" refers to bitwise-or between ints, or we're back to inventing progressively more absurd operator names for each individual combination of types over which they might work. Cheers, Jon. 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 097CABBAF for ; Wed, 11 Aug 2010 15:19:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4BAJtAYkxKfVIukGdsb2JhbACUPoteCBUBAQEBCQkMBxEDH6B7iyEBBY8nAQSFOoRfhBM X-IronPort-AV: E=Sophos;i="4.55,352,1278280800"; d="scan'208";a="55307698" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail3-smtp-sop.national.inria.fr with ESMTP; 11 Aug 2010 15:19:34 +0200 Received: by wwb18 with SMTP id 18so76147wwb.3 for ; Wed, 11 Aug 2010 06:19:34 -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:content-transfer-encoding:x-mailer:thread-index :content-language; bh=rf6fb/5Lz5q8Fr1cjVxrltjBDUOM7jFMdIk1zVBk6RQ=; b=Ati3OwPFEj5YnKyYTfNpEQvXR33PFLInMliMir7rOq6sn11UqPh/Iz+nar4QJiCQ9a keS1RCGVVdhZv+nj34/jA5UdLBjcXHHw4870K7hXI0MtJlwvaH6oL7utDl0y8wXnmbBF MtI2FUqmCUaAoiBeprm9CuHbikdnkf3aQD94A= 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:content-transfer-encoding :x-mailer:thread-index:content-language; b=qTrlKyeAZLy7tMF/NsQeTCMI8k0wSTTrl8S4b6+YOrJHz5/ieD7tnsIPqaJa3Tbtwu 1MtkDnGoEHfjadbcJ+yuWB4WHHYVbKiaf9JY4g5w3kVD2ivxZhyzmBhwlSnZhEjnSeHp ptUKFTNefngSE6fHno7LOJTTjapMchmUNzt6w= Received: by 10.227.128.82 with SMTP id j18mr16512331wbs.36.1281532774447; Wed, 11 Aug 2010 06:19:34 -0700 (PDT) Received: from WinEight ([87.113.155.108]) by mx.google.com with ESMTPS id a1sm81540wbb.2.2010.08.11.06.19.33 (version=SSLv3 cipher=RC4-MD5); Wed, 11 Aug 2010 06:19:33 -0700 (PDT) From: Jon Harrop To: "'ivan chollet'" , Cc: References: In-Reply-To: Subject: RE: [Caml-list] interest in a much simpler, but modern, Caml? Date: Wed, 11 Aug 2010 14:19:06 +0100 Organization: Flying Frog Consultancy Message-ID: <03fc01cb3957$c79e2800$56da7800$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acs3jW0RrWcQWK9TSamOdZqs8P6BKQByFXUQ Content-Language: en-gb X-Spam: no; 0.00; ocaml:01 jocaml:01 runtimes:01 ocaml:01 runtime:01 kloc:01 compilation:01 native-code:01 cheers:01 3.5:98 garbage:01 wrote:01 caml-list:01 caml:02 caml:02 Ivan wrote: > I have noted that there are now many implementation of OCaml. Namely : > - caml light > - jocaml > - mincaml > - your implementation ? > etc. > > which means there is a lot of interest in implementing tools and = runtimes for ML.=A0 I'm not sure 3.5 implementations over 25 years is a "lot" of interest = but maybe if you add HLVM... ;-) > Well, now I'm thinking that the community should start a project like Parrot (with JIT optionally) > but dedicated to ML. I already did something like this called HLVM: http://www.ffconsultancy.com/ocaml/hlvm/ > The existing ocaml runtime is amazing but it's definitely not very community friendly and is in my > opinion a bit hard to understand given the scarcity of design = documents. Feel free to ask me anything about HLVM's design. We have a dedicated mailing list: https://lists.forge.ocamlcore.org/pipermail/hlvm-list/ > A real community project with real documentation might be interesting = for teaching purposes but also > in production environments. HLVM might be interesting for teaching purposes because it is tiny = (2kLOC) and comprehensible whilst providing advanced features like JIT = compilation (for a native-code REPL!) and a multicore-capable garbage collector (in = only 100LOC!). HLVM should also be suitable for production environments. I had actually forgotten about the mincaml project but mincaml's = front-end with HLVM's back-end sounds like a match made in heaven... Cheers, Jon. 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 33161BBAF for ; Wed, 11 Aug 2010 18:12:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8CACdpYkzRVdc0kGdsb2JhbACTJYx7CBUBAQEBCQkMBxEDH6IxiRCCEYYjLohUAQEDBYU1BIlQ X-IronPort-AV: E=Sophos;i="4.55,354,1278280800"; d="scan'208";a="67505071" Received: from mail-ew0-f52.google.com ([209.85.215.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 11 Aug 2010 18:12:58 +0200 Received: by ewy20 with SMTP id 20so188357ewy.39 for ; Wed, 11 Aug 2010 09:12:58 -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:content-type; bh=KZiT14rxTY6YWGVY/HhQ2FqlCIOSNSNa69mAP5q3kHE=; b=WXCUFc1XpoEc+wgNzV5W22ffNeGpWlc1u3XG1ObtK3PTpLkxzmepEHISu8Rojh3vGV rmxvAVOYfFDQSHacIs48gTmzIWhfWlo7Lvhv0kK8eAzaUG+y+7+LuB8v9s3EESDsSfnA IIGmqoblNerKvRSw4n89R6ob3+6kLQXQ37oV0= 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 :content-type; b=x/Ts4uv0AFKH/1XVQtWWsh8QLixi6h2tmubAzBegJnDS7z2zggmmG52VaaJyVyPr06 Lg2sRuLaYyqJe0EmSGuLmQJvnDd9t07C2esj0PmlF65vf4yP81etxf11VNysgUK6h1eZ VZTbWS7xwfkDfTzzbf5ZwwkRmCofXnpTjntsw= MIME-Version: 1.0 Received: by 10.213.15.82 with SMTP id j18mr6056662eba.78.1281543178183; Wed, 11 Aug 2010 09:12:58 -0700 (PDT) Received: by 10.14.22.1 with HTTP; Wed, 11 Aug 2010 09:12:58 -0700 (PDT) In-Reply-To: <03fc01cb3957$c79e2800$56da7800$@com> References: <03fc01cb3957$c79e2800$56da7800$@com> Date: Wed, 11 Aug 2010 18:12:58 +0200 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: philippe To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; compiler:01 ocaml:01 computations:01 sig:01 ocaml:01 caml-list:01 cornell:01 caml:02 numerical:03 ved:03 simpler:05 devel:06 i'm:09 philippe:11 source:12 I'm really far from beeing a compiler expert, but an ocaml user geared toward numerical applications devel. while doing a net search, I found this paper about array computations optimizations which may be of interest to you: http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBIQFjAA&url=http%3A%2F%2Fwww.cs.cornell.edu%2Fcourses%2Fcs612%2F2001sp%2Fprojects%2Focaml-arrays%2FOCaml.pdf&ei=YstiTOPeIpCFOMfEkIAK&usg=AFQjCNGT7H1DLo3_I0e_61j1KXLrqFSXjg&sig2=79dGgmdIe-aH1aSqC8CWVQ or google/whatever... and search "Array Optimizations in OCaml" -- Ph. Strauss 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id D5A64BBAF for ; Thu, 12 Aug 2010 02:21:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsBAMPbYkzRVdY0kGdsb2JhbACgMQgVAQEBAQkJDAcRAx+iFYkQghGGGi6IVAEBAwWFNQSJUA X-IronPort-AV: E=Sophos;i="4.55,355,1278280800"; d="scan'208";a="65297506" Received: from mail-bw0-f52.google.com ([209.85.214.52]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Aug 2010 02:21:44 +0200 Received: by bwz17 with SMTP id 17so585034bwz.39 for ; Wed, 11 Aug 2010 17:21:44 -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=HSC2ggGX7Fq4/90PF0J2JBnm5UioUk62vuTT8GuB4tA=; b=JZsnfLlhtpQANfEdtuRb8Q1XuKnnh25bLNVzr+XQvTHMWOgNUHn4Yn7wB3mP4332An rT0H0MtxEA9Z3wfAqm0HOskqachE69lWWxGBskemubvESfA6bvDBQOJzuSUZeBEOTSzI RWewoSFEftZM8MFnaItpcCUgLPnDuk7WrGfIM= 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=M73z59K0kul/4uMftf03FbR6/jrL3RCM93DCL8R1Vq8MQt1PhTMuXLKWxr6bJyvJKq VXZWdXTybvwiu4plU+VJFb+z4t6lEwa3U1n622zBpWjKF5azXBvIJaAsgUeIcdWicr31 BmeYDbuRe3cr3ysWOrWXy2M7+xFKEAbB15JII= MIME-Version: 1.0 Received: by 10.204.22.74 with SMTP id m10mr72775bkb.63.1281572503991; Wed, 11 Aug 2010 17:21:43 -0700 (PDT) Received: by 10.204.54.68 with HTTP; Wed, 11 Aug 2010 17:21:43 -0700 (PDT) In-Reply-To: <03fb01cb3955$76093770$621ba650$@com> References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> <03fb01cb3955$76093770$621ba650$@com> Date: Wed, 11 Aug 2010 20:21:43 -0400 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: Jeremy Bem To: Jon Harrop Cc: bluestorm , caml-list List , Florian Weimer Content-Type: multipart/alternative; boundary=000325555ec6dac3c5048d9559c9 X-Spam: no; 0.00; ocaml's:01 runtime:01 abstraction:01 ocamllex:01 pervasives:01 syntax:01 ocaml:01 overloading:01 minimalist:01 higher-order:01 pervasives:01 foo:01 foo:01 runtime:01 lacks:01 --000325555ec6dac3c5048d9559c9 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Aug 11, 2010 at 9:02 AM, Jon Harrop < jonathandeanharrop@googlemail.com> wrote: > > What happens when you do: > > if Int.(x = 42 || x = 45) then ... else ... > > Presumably it either barfs on the assumption that "||" refers to bitwise-or > between ints, or we're back to inventing progressively more absurd operator > names for each individual combination of types over which they might work. > How so? I think this is a borderline case (even in C++, "||" does not refer to bitwise-or). But even if Int.(||) *were* defined as some sort of integer operation, one could simply write: if Int.(x = 42) || Int.(x = 45) Also, I think the discussion has shifted. For me, the local open is a reasonably appealing way to stop using OCaml's exotic polymorphic operators whose behavior depends on the runtime representation and which don't respect type abstraction. (For example, ocamllex uses Pervasives.(=) to test whether Map's are empty, but this breaks if the Map representation changes.) Moreover the syntax even maintains OCaml compatibility thanks to the recent update. But now we seem to be talking about operator overloading, and I'm just not convinced it's necessary at all in a system with a minimalist aesthetic. Back to the local opens, I find that I'm hesitant to add so many of them, especially for equality. Polymorphic equality is hardly unnatural, after all (cf. higher-order logic). I wonder, do any practical languages use quotient types to implement custom equality predicates? In principle, Pervasives.(=) ought to be the "finest" reasonable equivalence relation on a type, which could then be coarsened: type foo = Foo of int | Goo of string let _ = assert (Foo 3 <> Goo "3") (* duh *) let foo_equiv x y = match x, y with Foo a, Foo b -> a=b | Goo a, Goo b -> a=b | Foo a, Goo b | Goo b, Foo a -> string_of_int a = b type goo = foo / foo_equiv (* automatically creates goo_of_foo *) let _ = assert (goo_of_foo (Foo 3) = goo_of_foo (Goo "3")) This would require runtime support. I envision that every "goo" is a block whose tag is "Quotient_tag" and which stores a "foo_equiv" closure in its first Obj field. As it happens, this approach would dovetail with my plans for an integrated proof assistant. Of course it lacks the "conservatism" I've been promoting :) -Jeremy --000325555ec6dac3c5048d9559c9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Aug 11, 2010 at 9:02 AM, Jon Harrop <
jonathandeanharrop@googlemail= .com> wrote:

What happens when you do:

=A0if Int.(x =3D 42 || x =3D 45) then ... else ...

Presumably it either barfs on the assumption that "||" refers to = bitwise-or
between ints, or we're back to inventing progressively more absurd oper= ator
names for each individual combination of types over which they might work.<= br>

How so? =A0I think this is a borderline= case (even in C++, "||" does not refer to bitwise-or). =A0But ev= en if Int.(||) *were* defined as some sort of integer operation, one could = simply write:
=A0=A0if Int.(x =3D 42) || Int.(x =3D 45)

Also, I think the discussion has shifted. =A0For me, the local open is a= reasonably appealing way to stop using OCaml's exotic polymorphic oper= ators whose behavior depends on the runtime representation and which don= 9;t respect type abstraction. =A0(For example, ocamllex uses Pervasives.(= =3D) to test whether Map's are empty, but this breaks if the Map repres= entation changes.) =A0Moreover the syntax even maintains OCaml compatibilit= y thanks to the recent update. =A0But now we seem to be talking about opera= tor overloading, and I'm just not convinced it's necessary at all i= n a system with a minimalist aesthetic.

Back to the local opens, I find that I'm hesitant t= o add so many of them, especially for equality. =A0Polymorphic equality is = hardly unnatural, after all (cf. higher-order logic). =A0I wonder, do any p= ractical languages use quotient types to implement custom equality predicat= es? =A0In principle, Pervasives.(=3D) ought to be the "finest" re= asonable equivalence relation on a type, which could then be coarsened:

type foo =3D Foo of int | Goo of string
let foo_equiv x y =3D
=A0=A0match x, y with
=A0=A0 =A0Foo a, Foo b -> a=3Db
=A0=A0| Goo a, Goo b -> a=3Db
=A0=A0| Foo a, Goo b=
= =A0=A0| Goo b, Foo a ->=A0string_of_int a =3D b
type go= o =3D foo / foo_equiv (* automatically creates goo_of_foo *)
let _ =3D assert (goo_of_foo (Foo 3) =3D goo_of_foo (Goo "3"= ))

This would require runtime support. =A0I= envision that every "goo" is a block whose tag is "Quotient= _tag" and which stores a "foo_equiv" closure in its first Ob= j field.

As it happens, this approach would dovetail with my pla= ns for an integrated proof assistant. =A0Of course it lacks the "conse= rvatism" I've been promoting :)

-Jeremy

--000325555ec6dac3c5048d9559c9-- 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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 3B1A3BBAF for ; Thu, 12 Aug 2010 08:57:00 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsMBAFc4Y0zRVdg0kGdsb2JhbACgMQgVAQEBAQkJDAcRAx+fMokQghKGGS6IVAEBAwWFNQSEXoQbYw X-IronPort-AV: E=Sophos;i="4.55,356,1278280800"; d="scan'208";a="65304838" Received: from mail-qw0-f52.google.com ([209.85.216.52]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Aug 2010 08:56:59 +0200 Received: by qwj8 with SMTP id 8so1281014qwj.39 for ; Wed, 11 Aug 2010 23:56:58 -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=Qf4VARG4Vh80Y33UKHRgfqBKxi5A6Y299E9AkOcuRnc=; b=KqyNatK9IDCVYeqFKmeqmvkDywiOmpF5nWT/q5LvnIH8w7aZL+I5oGAgxtyTbBX4jd JewSFFU6MEXhrHsz3lXo3JkfPzZz9cOPjAbhHpjrGtKc1SI2BXxEefD6mMNIpSA3eiXa liXedW8iGVw4fTUZ9RWDNeblOkhpCHcHhB3wE= 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=UHD8F6EQbfXU2b8H/gr0ltTKEcgESlJMliQPevwkFWlXRKL3bG6c3QkJ07eHUlEfqD YPGJf8yPZboeNePsNhJ3l9ggDAQvROE6DyiQiGqRLMgppx8Krj+g+5ablZll4WCKauJN nMm6YuEx/JKxJB4ThsKB7ullKBtMhmyCSAOgc= MIME-Version: 1.0 Received: by 10.229.189.211 with SMTP id df19mr10711547qcb.146.1281596218507; Wed, 11 Aug 2010 23:56:58 -0700 (PDT) Received: by 10.229.217.71 with HTTP; Wed, 11 Aug 2010 23:56:58 -0700 (PDT) In-Reply-To: <03fc01cb3957$c79e2800$56da7800$@com> References: <03fc01cb3957$c79e2800$56da7800$@com> Date: Thu, 12 Aug 2010 16:56:58 +1000 Message-ID: Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? From: ivan chollet To: Jon Harrop Cc: caml-list@yquem.inria.fr, jeremy1@gmail.com Content-Type: multipart/alternative; boundary=0016363b887c5982e2048d9adf44 X-Spam: no; 0.00; bytecode:01 bytecode:01 ocaml:01 runtime:01 runtime:01 ocaml:01 coupling:01 compiler:01 jocaml:01 runtimes:01 kloc:01 compilation:01 native-code:01 cheers:01 coupling:01 --0016363b887c5982e2048d9adf44 Content-Type: text/plain; charset=ISO-8859-1 + HLVM, Moscow ML, MLTon, etc. Not too bad in my opinion. I checked your HLVM and it looks like a really nice project. I had heard about it before but to be honest it's hard to find information about its design. Maybe you should release the design documents publicly. It could be also an good incentive for people to subscribe to your journal. I looked at the source and I have to say i like it for its simplicity. What I dislike is that your bytecode runs on LLVM, which is a general purpose virtual machine, and because it's general purpose, the bytecode and thus the JIT is a lot more complicated than if the whole infrastructure was for ML and ML only. My personal opinion is that the idiosyncrasies of ML deserve more elegant than this complicated piece of code. And what i dislike is to debug big pieces of code like this myself (especially when there is no documentation like with OCaml). So after reading a few things about HLVM, what I have in mind is basically the same thing as you did, with only a few minor differences : - the project should have it's own runtime (with runtime i mean interpreter + garbage collector only) - no need for a JIT at the beginning - less emphasis on performance at the beginning - less emphasis on features (your project looks very ambitious in terms of supported features) - more emphasis on code safety (than ocaml at least, i don't like to see segmentation faults). LLVM is not that strong on debugging and code safety than some other VMs are. (that's just what i've heard and I might be plain wrong here, but i'm unable to check it myself because LLVM source code is too complicated for me) - more emphasis on simplicity and interfaces loosely coupling - a LOT more emphasis on being community friendly and providing design documents (for free...) Now I have to say that LLVM is an amazing project (so is HLVM), and if you need to have an ML implementation up quickly with good performance and lots of features supported, then I would admit that this is the only way to go at the moment. There is no way the community around ML in general and OCaml specifically would ever come up in the next 10 years with such a feature-rich runtime and compiler infrastructure. But now that VMs are becoming a commodity and there is a lot of literature and resources on the topic, it is also not very time consuming to pull something from the ground up. I would be interested to hear your opinion on this. On Wed, Aug 11, 2010 at 11:19 PM, Jon Harrop < jonathandeanharrop@googlemail.com> wrote: > Ivan wrote: > > I have noted that there are now many implementation of OCaml. Namely : > > - caml light > > - jocaml > > - mincaml > > - your implementation ? > > etc. > > > > which means there is a lot of interest in implementing tools and runtimes > for ML. > > I'm not sure 3.5 implementations over 25 years is a "lot" of interest but > maybe if you add HLVM... ;-) > > > Well, now I'm thinking that the community should start a project like > Parrot (with JIT optionally) > > but dedicated to ML. > > I already did something like this called HLVM: > > http://www.ffconsultancy.com/ocaml/hlvm/ > > > The existing ocaml runtime is amazing but it's definitely not very > community friendly and is in my > > opinion a bit hard to understand given the scarcity of design documents. > > Feel free to ask me anything about HLVM's design. We have a dedicated > mailing list: > > https://lists.forge.ocamlcore.org/pipermail/hlvm-list/ > > > A real community project with real documentation might be interesting for > teaching purposes but also > > in production environments. > > HLVM might be interesting for teaching purposes because it is tiny (2kLOC) > and comprehensible whilst providing advanced features like JIT compilation > (for a native-code REPL!) and a multicore-capable garbage collector (in > only > 100LOC!). HLVM should also be suitable for production environments. > > I had actually forgotten about the mincaml project but mincaml's front-end > with HLVM's back-end sounds like a match made in heaven... > > Cheers, > Jon. > > > --0016363b887c5982e2048d9adf44 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable + HLVM, Moscow ML, MLTon, etc.
Not too bad in my opinion.

I check= ed your HLVM and it looks like a really nice project. I had heard about it = before but to be honest it's hard to find information about its design.= Maybe you should release the design documents publicly. It could be also a= n good incentive for people to subscribe to your journal.
I looked at the source and I have to say i like it for its simplicity. What= I dislike is that your bytecode runs on LLVM, which is a general purpose v= irtual machine, and because it's general purpose, the bytecode and thus= the JIT is a lot more complicated than if the whole infrastructure=A0 was = for ML and ML only. My personal opinion is that the idiosyncrasies of ML de= serve more elegant than this complicated piece of code.
And what i dislike is to debug big pieces of code like this myself (especia= lly when there is no documentation like with OCaml).

So after readin= g a few things about HLVM, what I have in mind is basically the same thing = as you did, with only a few minor differences :
- the project should have it's own runtime (with runtime i mean interpr= eter + garbage collector only)
- no need for a JIT at the beginning
-= less emphasis on performance at the beginning
- less emphasis on featur= es (your project looks very ambitious in terms of supported features)
- more emphasis on code safety (than ocaml at least, i don't like to se= e segmentation faults). LLVM is not that strong on debugging and code safet= y than some other VMs are. (that's just what i've heard and I might= be plain wrong here, but i'm unable to check it myself because LLVM so= urce code is too complicated for me)
- more emphasis on simplicity and interfaces loosely coupling
- a LOT mo= re emphasis on being community friendly and providing design documents (for= free...)


Now I have to say that LLVM is an amazing project (so = is HLVM), and if you need to have an ML implementation up quickly with good= performance and lots of features supported, then I would admit that this i= s the only way to go at the moment. There is no way the community around ML= in general and OCaml specifically would ever come up in the next 10 years = with such a feature-rich runtime and compiler infrastructure.
But now that VMs are becoming a commodity and there is a lot of literature = and resources on the topic, it is also not very time consuming to pull some= thing from the ground up.
I would be interested to hear your opinion on = this.


On Wed, Aug 11, 2010 at 11:19 PM, Jon Ha= rrop <jonathandeanharrop@googlemail.com> wrote:
Ivan wrote:
> I have noted that there are now many implementation of OCaml. Namely :=
> - caml light
> - jocaml
> - mincaml
> - your implementation ?
> etc.
>
> which means there is a lot of interest in implementing tools and runti= mes
for ML.=A0

I'm not sure 3.5 implementations over 25 years is a "lot&quo= t; of interest but
maybe if you add HLVM... ;-)

> Well, now I'm thinking that the community should start a project l= ike
Parrot (with JIT optionally)
> but dedicated to ML.

I already did something like this called HLVM:

=A0= http://www.ffconsultancy.com/ocaml/hlvm/

> The existing ocaml runtime is amazing but it's definitely not very=
community friendly and is in my
> opinion a bit hard to understand given the scarcity of design document= s.

Feel free to ask me anything about HLVM's design. We have a dedic= ated
mailing list:

=A0https://lists.forge.ocamlcore.org/pipermail/hlvm-list/

> A real community project with real documentation might be interesting = for
teaching purposes but also
> in production environments.

HLVM might be interesting for teaching purposes because it is tiny (2= kLOC)
and comprehensible whilst providing advanced features like JIT compilation<= br> (for a native-code REPL!) and a multicore-capable garbage collector (in onl= y
100LOC!). HLVM should also be suitable for production environments.

I had actually forgotten about the mincaml project but mincaml's front-= end
with HLVM's back-end sounds like a match made in heaven...

Cheers,
Jon.



--0016363b887c5982e2048d9adf44-- 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id D1C17BBAF for ; Fri, 13 Aug 2010 01:14:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkMCAJkdZExKfVIqmGdsb2JhbACBRJMJi2AIFQEBAQEBCAkMBxEiokqLIgEFjyMBBIU6 X-IronPort-AV: E=Sophos;i="4.55,360,1278280800"; d="scan'208,217";a="57028372" Received: from mail-ww0-f42.google.com ([74.125.82.42]) by mail2-smtp-roc.national.inria.fr with ESMTP; 13 Aug 2010 01:14:25 +0200 Received: by wwf26 with SMTP id 26so21767wwf.3 for ; Thu, 12 Aug 2010 16:14:25 -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=YA1BKs9tEuftCpXbCvoG7AdapU4ISZMboBExSWzdXi0=; b=AdTd7HAohsmmzZ+T4SzZkput4CUwwjiQ4CFKjt193XXeAni9fqk3ucoTelDAIq4ucX UXME8d07hF98ufNEYGKxso59yYOWx73a6js2hlqQFe2hFhx5lfg9Hf8RckjD/yYSk1Iy 097aZG+GxdzeZEKX7QBV8vfOHRRVQfdKqnAZE= 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=w3nBfYWrSwg6FeGRIm8XjQ8oXmFnv9awBKAcjA2Z2kT25i1+1gedjhYL9ZntP4or3/ Ra4sHz9+LzpGdOtUjv1vXDcgmG6r8OxJXBoiyfoBCoD8kJS5CxPxAqzP7h1JGs1nOCSj gk7ri+VSj8Teb9plwplj9vDTLBXDW8jmq/8+M= Received: by 10.227.143.12 with SMTP id s12mr705127wbu.125.1281654865558; Thu, 12 Aug 2010 16:14:25 -0700 (PDT) Received: from WinEight ([87.113.155.108]) by mx.google.com with ESMTPS id a1sm1695569wbb.2.2010.08.12.16.14.21 (version=SSLv3 cipher=RC4-MD5); Thu, 12 Aug 2010 16:14:23 -0700 (PDT) From: Jon Harrop To: "'Jeremy Bem'" , "'Jon Harrop'" Cc: "'bluestorm'" , "'caml-list List'" , "'Florian Weimer'" References: <877hk1m1df.fsf@mid.deneb.enyo.de> <87bp9dkkca.fsf@mid.deneb.enyo.de> <4c5f194e.8644d80a.7fef.69e6@mx.google.com> <03fb01cb3955$76093770$621ba650$@com> In-Reply-To: Subject: RE: [Caml-list] interest in a much simpler, but modern, Caml? Date: Fri, 13 Aug 2010 00:14:19 +0100 Organization: Flying Frog Consultancy Message-ID: <009e01cb3a74$193f5770$4bbe0650$@com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_009F_01CB3A7C.7B03BF70" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acs5tFhja6ItLvdwTMqDPpU5/IodeAAvmn7A Content-Language: en-gb X-Spam: no; 0.00; bool:01 delimited:01 overloading:01 hashing:01 cheers:01 ocaml's:01 runtime:01 abstraction:01 ocamllex:01 pervasives:01 syntax:01 ocaml:01 overloading:01 minimalist:01 higher-order:01 This is a multi-part message in MIME format. ------=_NextPart_000_009F_01CB3A7C.7B03BF70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Presumably, in general, that would need to be: If Bool.(Int.(x=42) || Int.(x=45)) . At which point things start to look hairy. To be honest, I see this delimited overloading as the best of a bad job in the absence of equality types or per-type functionality. I think what we really want is to be able to define custom equality, comparison and hashing on types when structural versions are not applicable. F#'s solution is pretty good. Type classes are a generalization but I do not see that they buy you much for the added complexity. I'd have thought this (at least equality types) would be worth putting in a minimalistic language because it is so useful. Cheers, Jon. From: Jeremy Bem [mailto:jeremy1@gmail.com] Sent: 12 August 2010 01:22 To: Jon Harrop Cc: bluestorm; caml-list List; Florian Weimer Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml? On Wed, Aug 11, 2010 at 9:02 AM, Jon Harrop wrote: What happens when you do: if Int.(x = 42 || x = 45) then ... else ... Presumably it either barfs on the assumption that "||" refers to bitwise-or between ints, or we're back to inventing progressively more absurd operator names for each individual combination of types over which they might work. How so? I think this is a borderline case (even in C++, "||" does not refer to bitwise-or). But even if Int.(||) *were* defined as some sort of integer operation, one could simply write: if Int.(x = 42) || Int.(x = 45) Also, I think the discussion has shifted. For me, the local open is a reasonably appealing way to stop using OCaml's exotic polymorphic operators whose behavior depends on the runtime representation and which don't respect type abstraction. (For example, ocamllex uses Pervasives.(=) to test whether Map's are empty, but this breaks if the Map representation changes.) Moreover the syntax even maintains OCaml compatibility thanks to the recent update. But now we seem to be talking about operator overloading, and I'm just not convinced it's necessary at all in a system with a minimalist aesthetic. Back to the local opens, I find that I'm hesitant to add so many of them, especially for equality. Polymorphic equality is hardly unnatural, after all (cf. higher-order logic). I wonder, do any practical languages use quotient types to implement custom equality predicates? In principle, Pervasives.(=) ought to be the "finest" reasonable equivalence relation on a type, which could then be coarsened: type foo = Foo of int | Goo of string let _ = assert (Foo 3 <> Goo "3") (* duh *) let foo_equiv x y = match x, y with Foo a, Foo b -> a=b | Goo a, Goo b -> a=b | Foo a, Goo b | Goo b, Foo a -> string_of_int a = b type goo = foo / foo_equiv (* automatically creates goo_of_foo *) let _ = assert (goo_of_foo (Foo 3) = goo_of_foo (Goo "3")) This would require runtime support. I envision that every "goo" is a block whose tag is "Quotient_tag" and which stores a "foo_equiv" closure in its first Obj field. As it happens, this approach would dovetail with my plans for an integrated proof assistant. Of course it lacks the "conservatism" I've been promoting :) -Jeremy ------=_NextPart_000_009F_01CB3A7C.7B03BF70 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Presumably, in general, that would need to = be:

 

  If Bool.(Int.(x=3D42) || Int.(x=3D45)) = …

 

At which point things start to look hairy. To be honest, = I see this delimited overloading as the best of a bad job in the absence of = equality types or per-type functionality. I think what we really want is to be = able to define custom equality, comparison and hashing on types when structural versions are not applicable. F#’s solution is pretty good. Type = classes are a generalization but I do not see that they buy you much for the = added complexity.

 

I’d have thought this (at least equality types) = would be worth putting in a minimalistic language because it is so = useful.

 

Cheers,

Jon.

 

From: Jeremy Bem = [mailto:jeremy1@gmail.com]
Sent: 12 August 2010 01:22
To: Jon Harrop
Cc: bluestorm; caml-list List; Florian Weimer
Subject: Re: [Caml-list] interest in a much simpler, but modern, = Caml?

 

On Wed, Aug 11, 2010 at 9:02 AM, Jon Harrop <jonathandeanharrop@goog= lemail.com> wrote:

 

What happens when you do:

 if Int.(x =3D 42 || x =3D 45) then ... else ...

Presumably it either barfs on the assumption that "||" refers = to bitwise-or
between ints, or we're back to inventing progressively more absurd = operator
names for each individual combination of types over which they might = work.

 

How so?  I think this is a borderline case = (even in C++, "||" does not refer to bitwise-or).  But even if = Int.(||) *were* defined as some sort of integer operation, one could simply = write:

  if Int.(x =3D 42) || Int.(x =3D = 45)

 

Also, I think the discussion has shifted.  For = me, the local open is a reasonably appealing way to stop using OCaml's exotic polymorphic operators whose behavior depends on the runtime = representation and which don't respect type abstraction.  (For example, ocamllex uses Pervasives.(=3D) to test whether Map's are empty, but this breaks if the = Map representation changes.)  Moreover the syntax even maintains OCaml compatibility thanks to the recent update.  But now we seem to be = talking about operator overloading, and I'm just not convinced it's necessary at = all in a system with a minimalist aesthetic.

 

Back to the local opens, I find that I'm hesitant = to add so many of them, especially for equality.  Polymorphic equality is = hardly unnatural, after all (cf. higher-order logic).  I wonder, do any = practical languages use quotient types to implement custom equality predicates? =  In principle, Pervasives.(=3D) ought to be the "finest" = reasonable equivalence relation on a type, which could then be = coarsened:

 

type foo = =3D Foo of int | Goo of string

let _ =3D = assert (Foo 3 <> Goo "3") (* duh *)

let = foo_equiv x y =3D

  match x, y with

    Foo a, Foo b -> a=3Db

  | Goo a, Goo b -> a=3Db

  | Foo a, Goo b

  | Goo b, Foo a -> string_of_int a =3D b

type goo = =3D foo / foo_equiv (* automatically creates goo_of_foo *)

let _ =3D = assert (goo_of_foo (Foo 3) =3D goo_of_foo (Goo = "3"))

 

This would require runtime support.  I = envision that every "goo" is a block whose tag is "Quotient_tag" = and which stores a "foo_equiv" closure in its first Obj = field.

 

As it happens, this approach would dovetail with my = plans for an integrated proof assistant.  Of course it lacks the "conservatism" I've been promoting :)

 

-Jeremy

 

------=_NextPart_000_009F_01CB3A7C.7B03BF70--