From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p38BRPWu015940 for ; Fri, 8 Apr 2011 13:27:28 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8BAHLwnk0SB0Qlm2dsb2JhbACmFRQBAQEBAQgJCwkUJbhqiG2FbQQ X-IronPort-AV: E=Sophos;i="4.63,322,1299452400"; d="scan'208";a="80451607" Received: from dmz-mailsec-scanner-8.mit.edu ([18.7.68.37]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Apr 2011 13:26:48 +0200 X-AuditID: 12074425-b7c8cae00000429f-b9-4d9ef1009aeb Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP id 6D.95.17055.001FE9D4; Fri, 8 Apr 2011 07:26:56 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id p38BQk3f009379; Fri, 8 Apr 2011 07:26:46 -0400 Received: from localhost (CONTENTS-VNDER-PRESSVRE.MIT.EDU [18.9.64.11]) (authenticated bits=0) (User authenticated as jfc@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p38BQfYn021630; Fri, 8 Apr 2011 07:26:45 -0400 (EDT) Message-Id: <201104081126.p38BQfYn021630@outgoing.mit.edu> To: Arthur Peters cc: caml-list@inria.fr In-reply-to: References: Comments: In-reply-to Arthur Peters message dated "Thu, 07 Apr 2011 13:37:15 -0700." X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 23.1.1 Date: Fri, 08 Apr 2011 07:26:41 -0400 From: John Carr X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsUixG6nosvwcZ6vwfTDqhYXNt5ltfi0YwOL A5PHpBeHWDwWrn7NHsAUxWWTkpqTWZZapG+XwJXR/ngeU8Ea1orNDz+yNzBOY+li5OSQEDCR eHp6HiuELSZx4d56ti5GLg4hgX2MEkeOboNy1jNKPDqznxGkSkjgP6PEng9xXYwcHLwCVhIz PpaAhEUENCV2fbsFNpQZaNCrhw/YQWxhgQCJzp4NYK2cAo4Sc79fhBrjIHFl/XF2iPoCiYmf D0IdpCvxcdFMsDiLgKrEgjeL2EBsNgFZiUftXYwTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7M y0st0rXQy80s0UtNKd3ECA4jF9UdjBMOKR1iFOBgVOLhvXZrrq8Qa2JZcWXuIUZJDiYlUd6T 7+f5CvEl5adUZiQWZ8QXleakFh9ilOBgVhLhdbMByvGmJFZWpRblw6SkOViUxHnnS6r7Cgmk J5akZqemFqQWwWRlODiUJHjbPwA1ChalpqdWpGXmlCCkmTg4QYbzAA1/+Q5keHFBYm5xZjpE /hSjLsf/LYf2MQqx5OXnpUqJ884BGSQAUpRRmgc3Bxb/rxjFgd4S5p36HKiKB5g64Ca9AlrC BLRkwjGwJSWJCCmpBsbok5Omv2X5cm3NhGf7WlwfZbla/1rGerLs1mqNg/mnE57UZd+LtGpn qfzrtemR4aIu0cAFHLPdqvoZinV8DV+5/7BoUDzf9EBKoTTrsEXzJn7991H2s8PUCzQP3bsU /zzjy7zHV29xFB38pjdd+Xfc+dmzLX+/Taqb9CW2wf530otJW/SbFmYrsRRnJBpqMRcVJwIA eMW7gNoCAAA= Subject: Re: [Caml-list] Documentation of the OCaml Lambda Intermediate Language >1. How are types represented in the lambda IL? (they seem to be implicit but >it's not clear) This is especially an issue with polymorphic primitives like >"field" and "apply". They are implicit. See "type erasure." The type checker ensures that no IL function operates on a value with the wrong type. Given let f x = 3 lsl !x the compiler generates (function x/1031 (lsl 3 (field 0 x/1031))) It is impossible, if the type system is sound, for x/1031 to be anything other than a pointer to a block and for the value in field 0 of that block to be anything other than an integer. The implementation depends on pointers and integers being the same size.