[CakeML-dev] [CakeML-Dev] targeting word literal constructors in AST

Ramana Kumar Ramana.Kumar at cl.cam.ac.uk
Mon Nov 28 07:36:20 UTC 2016


I doubt we want to go down that path...

Here's a (somewhat random) suggestion: word literals (0w3 etc.) are mapped
to Word64.word, and to get bytes via parser you need to use Word8.fromInt.

On 28 November 2016 at 15:35, <Michael.Norrish at data61.csiro.au> wrote:

> Presumably SML allows type inference to figure out the width in the same
> way that numeric operations get overload-resolved:
>
>
>
> (* Poly/ML *)
>
> > Word8.+(0w3, 0w4);
>
> val it = 0wx7: Word8.word
>
> > Word64.+(0w3, 0w4);
>
> val it = 0wx7: Word64.word
>
>
>
> Michael
>
>
>
> *From: *Ramana Kumar <Ramana.Kumar at cl.cam.ac.uk>
> *Date: *Monday, 28 November 2016 at 11:46
> *To: *"Norrish, Michael (Data61, Canberra City)" <
> Michael.Norrish at data61.csiro.au>
> *Cc: *"developers at cakeml.org" <developers at cakeml.org>
> *Subject: *Re: [CakeML-Dev] targeting word literal constructors in AST
>
>
>
> SML does not distinguish syntactically. I guess we might have to invent
> some syntax...?
>
>
>
> On 28 November 2016 at 11:03, <Michael.Norrish at data61.csiro.au> wrote:
>
> There are both Word8 and Word64 constructors for word literals in the AST
> type. How are the parser or lexer meant to figure out which any piece of
> syntax corresponds to?
>
> Michael
>
> _______________________________________________
> Developers mailing list
> Developers at cakeml.org
> https://lists.cakeml.org/listinfo/developers
>
>
>
> _______________________________________________
> Developers mailing list
> Developers at cakeml.org
> https://lists.cakeml.org/listinfo/developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cakeml.org/pipermail/developers/attachments/20161128/0bcd87b6/attachment.html>


More information about the Developers mailing list