mosml icon indicating copy to clipboard operation
mosml copied to clipboard

Int64 and Word64

Open athas opened this issue 3 years ago • 7 comments

The SML Basis library specifies Int64 and Word64 structures. These are really handy and it would be swell if MosML supported them.

athas avatar Jun 24 '21 09:06 athas

There is now a stop-gap implementation of Word64 on the devel branch.

Is there anything in particular that you need, or is the stop-gap implementation good enough for your needs?

kfl avatar Jul 06 '21 08:07 kfl

The Word64 structure is not loaded with -P full, but has to be loaded manually after startup.

Any hope of Int64 as well?

athas avatar Jul 08 '21 19:07 athas

Overloaded word constant (e.g. 0w255) don't work with Word64.

athas avatar Jul 08 '21 19:07 athas

Neither does any other overloaded operation, I think.

athas avatar Jul 08 '21 19:07 athas

But beyond that, I think it works!

athas avatar Jul 08 '21 19:07 athas

Thanks for checking. The flaws you have found are mostly why I call it a stop-gap implementation, fixing them are a more invasive chance than what I'd like right now. (Loading Word64 in the full set should be easy to do though)

In addition to the flaws you mention, I think that the biggest flaw in the stop-gap implementation is that Word64.word is not an eqtype.

All the flaws should be properly documented.

A stop-gap implementation of Int64 is comming Real Soon:tm:, I just need to check that I get the overflow semantics right.

kfl avatar Jul 11 '21 20:07 kfl

The devel branch now contains a stop-gap implementation of Int64 as well.

Again, the implementation does not follow the Basic Library spec 100% Let me know if something crucial is missing for your use case.

kfl avatar Jul 13 '21 20:07 kfl