Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SML datatypes in 32 bit linux and 64 bit linux

Tags:

sml

I presume that in Standard ML :

  • int is 32 bit on 32bit linux

On 64 bit linux is int also 32 bit? Furthermore is there a place (url) where the size of different datatypes is outlined, for Standard ML? Thanks

like image 258
artella Avatar asked Dec 11 '25 17:12

artella


1 Answers

The size of integers is implementation-specific - it's not specified by the standard. In MoscowML uses 31-bit integers on 32-bit platforms and 63-bit integers on 64-bit platforms according to its documentation.

SML/NJ apparently uses 31-bit integers on both 64-bit and 32-bit systems (I say apparently because I didn't find this documented anywhere - I just tested it on my 64-bit machine).

In MLton the size of Int can even be set using the -default-type command line argument to the compiler.

like image 94
sepp2k Avatar answered Dec 14 '25 06:12

sepp2k



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!