caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] unsigned 64-bit integers
@ 2015-09-28  6:18 Keiko Nakata
  2015-09-28  6:28 ` Andreas Rossberg
  0 siblings, 1 reply; 6+ messages in thread
From: Keiko Nakata @ 2015-09-28  6:18 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

Hi,

What would be best ways to compute with unsigned 64-bit integers?
I would like to perform 64-bit address space computations.


Best regards,
Keiko

[-- Attachment #2: Type: text/html, Size: 243 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] unsigned 64-bit integers
  2015-09-28  6:18 [Caml-list] unsigned 64-bit integers Keiko Nakata
@ 2015-09-28  6:28 ` Andreas Rossberg
       [not found]   ` <CALVfURzG+osS8LofguLi5F+wtjzAAarQukXxKpyFJuvK8Abutg@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Rossberg @ 2015-09-28  6:28 UTC (permalink / raw)
  To: Keiko Nakata; +Cc: caml-list

On Sep 28, 2015, at 08:18 , Keiko Nakata <keikonkt@gmail.com> wrote:
> 
> What would be best ways to compute with unsigned 64-bit integers?
> I would like to perform 64-bit address space computations. 

See e.g. how unsigned int64 operators are implemented here:

https://github.com/WebAssembly/spec/blob/master/ml-proto/src/spec/i64.ml

/Andreas


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] unsigned 64-bit integers
       [not found]   ` <CALVfURzG+osS8LofguLi5F+wtjzAAarQukXxKpyFJuvK8Abutg@mail.gmail.com>
@ 2015-09-28  6:47     ` Keiko Nakata
  2015-09-28  7:12       ` Andreas Rossberg
  0 siblings, 1 reply; 6+ messages in thread
From: Keiko Nakata @ 2015-09-28  6:47 UTC (permalink / raw)
  To: Andreas Rossberg; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

Keiko Nakata wrote:

> Why do you not make your unsigned int64 an abstract type (to make sure
> singed and unsigned int64 won't be mixed up)?
>

Well, since I don't use singed int64 in my code, this is not a problem for
me though.


Keiko

[-- Attachment #2: Type: text/html, Size: 562 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] unsigned 64-bit integers
  2015-09-28  6:47     ` Keiko Nakata
@ 2015-09-28  7:12       ` Andreas Rossberg
  2015-09-28  7:40         ` Keiko Nakata
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Rossberg @ 2015-09-28  7:12 UTC (permalink / raw)
  To: Keiko Nakata; +Cc: caml-list

On Sep 28, 2015, at 08:47 , Keiko Nakata <keikonkt@gmail.com> wrote:
> Why do you not make your unsigned int64 an abstract type (to make sure singed and unsigned int64 won't be mixed up)?

Well, because that wouldn’t match the design being implemented there. For an assembly-like language, you don’t want to factor that way. For other purposes a separate ADT would make a lot of sense, of course. In any case, I was only pointing to this for the implementation of individual operators, not necessarily for the module as a whole.

/Andreas


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] unsigned 64-bit integers
  2015-09-28  7:12       ` Andreas Rossberg
@ 2015-09-28  7:40         ` Keiko Nakata
  2015-09-28 13:44           ` Travis
  0 siblings, 1 reply; 6+ messages in thread
From: Keiko Nakata @ 2015-09-28  7:40 UTC (permalink / raw)
  To: Andreas Rossberg; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

On Andreas Rossberg <rossberg@mpi-sws.org> wrote:

> On Keiko Nakata <keikonkt@gmail.com> wrote:
> > Why do you not make your unsigned int64 an abstract type (to make sure
> singed and unsigned int64 won't be mixed up)?
>
> Well, because that wouldn’t match the design being implemented there. For
> an assembly-like language, you don’t want to factor that way. For other
> purposes a separate ADT would make a lot of sense, of course. In any case,
> I was only pointing to this for the implementation of individual operators,
> not necessarily for the module as a whole.
>

Sure, I was just curious.

I'll play around with your library. I am porting some low level C++ code to
OCaml. Thanks!


Best regards,
Keiko

[-- Attachment #2: Type: text/html, Size: 1167 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] unsigned 64-bit integers
  2015-09-28  7:40         ` Keiko Nakata
@ 2015-09-28 13:44           ` Travis
  0 siblings, 0 replies; 6+ messages in thread
From: Travis @ 2015-09-28 13:44 UTC (permalink / raw)
  To: Keiko Nakata; +Cc: Andreas Rossberg, O Caml

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

It may also be worth having a look at this library
https://github.com/andrenth/ocaml-uint

On Mon, Sep 28, 2015 at 2:40 AM, Keiko Nakata <keikonkt@gmail.com> wrote:

> On Andreas Rossberg <rossberg@mpi-sws.org> wrote:
>
>> On Keiko Nakata <keikonkt@gmail.com> wrote:
>> > Why do you not make your unsigned int64 an abstract type (to make sure
>> singed and unsigned int64 won't be mixed up)?
>>
>> Well, because that wouldn’t match the design being implemented there. For
>> an assembly-like language, you don’t want to factor that way. For other
>> purposes a separate ADT would make a lot of sense, of course. In any case,
>> I was only pointing to this for the implementation of individual operators,
>> not necessarily for the module as a whole.
>>
>
> Sure, I was just curious.
>
> I'll play around with your library. I am porting some low level C++ code
> to OCaml. Thanks!
>
>
> Best regards,
> Keiko
>

[-- Attachment #2: Type: text/html, Size: 1709 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-28 13:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28  6:18 [Caml-list] unsigned 64-bit integers Keiko Nakata
2015-09-28  6:28 ` Andreas Rossberg
     [not found]   ` <CALVfURzG+osS8LofguLi5F+wtjzAAarQukXxKpyFJuvK8Abutg@mail.gmail.com>
2015-09-28  6:47     ` Keiko Nakata
2015-09-28  7:12       ` Andreas Rossberg
2015-09-28  7:40         ` Keiko Nakata
2015-09-28 13:44           ` Travis

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).