Cover fe ature 47 january 2012 Published by the ieee computer Society 0018-9162/12/$31. 00 2012 ieee



Download 1,78 Mb.
Pdf ko'rish
bet5/32
Sana13.01.2022
Hajmi1,78 Mb.
#355100
1   2   3   4   5   6   7   8   9   ...   32
Bog'liq
Software-for-infrastructure

49

JANUARY 2012

Why didn’t the NASA engineers do that? They’re indisput-

ably experts in their field, so there must be good reasons.

No mainstream programming language supports units, 

but every general-purpose language allows a program-

mer to encode a value as a 



{quantity,unit}

 pair. We can 

encode enough of the ISO standard SI units (meters, kilo-

grams, seconds, and so on) in an integer to deal with all 

of NASA’s needs, but we don’t because that would almost 

double the size of our data. Furthermore, checking the 

units in every computation would more than double the 

amount of computation needed.

Space probes tend to be both memory and compute 

limited, so the engineers—just as essentially everyone else 

in their situation has done—decided to keep track of the 

units themselves (in their heads, in the comments, and 

in the documentation). In this case, they lost. Compilers 

read neither documentation nor comments, and a mag-

nitude crossed an interface without its unit and suddenly 

took on a whole new meaning (which was a factor of 4.45 

wrong). One conclusion we can draw is that integers and 

floating-point numbers make for very general but essen-

tially unsafe interfaces—a value can represent anything.

It isn’t difficult to design a language that supports SI 

units as part of its type system. In such a language, all unit 

checking would be done at compile time and only unit-

correct programs would get to execute:


Download 1,78 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   32




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish