From: John Carr <jfc@mit.edu>
To: Arthur Peters <amp@singingwizard.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Documentation of the OCaml Lambda Intermediate Language
Date: Fri, 08 Apr 2011 07:26:41 -0400 [thread overview]
Message-ID: <201104081126.p38BQfYn021630@outgoing.mit.edu> (raw)
In-Reply-To: <BANLkTimRSXQ-pRm61eiaNb_sABgdXPmxUw@mail.gmail.com>
>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.
next prev parent reply other threads:[~2011-04-08 11:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 20:37 Arthur Peters
2011-04-08 11:26 ` John Carr [this message]
2011-04-09 14:54 ` Vincent Aravantinos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201104081126.p38BQfYn021630@outgoing.mit.edu \
--to=jfc@mit.edu \
--cc=amp@singingwizard.org \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).