CSS vs. Javascript

John Cowan cowan at ccil.org
Fri Jan 5 15:09:27 PST 2007


Brendan Eich scripsit:

> See http://www.mozilla.org/js/language/js20/rationale/units.html -- I  
> used to encourage Waldemar to fit this into his JS2 spec, and it  
> still seems like it would be appreciated in browser-like embeddings  
> (more useful than # for hex :-P).  We left it out of ES4 as part of a  
> triage, to fit ES4 work into a schedule that converges in the first  
> half of this year.  I could see implementations experimenting with it  
> and a follow-on spec emerging.

Strongly typed dimensioned numbers are a horrible rathole that projects
go down but don't emerge from.  A small indication of the difficulty of
the effort is the fact that "kg m^2 / s^2" is the unit of both torque
and energy, yet adding them makes no sense; another indication is that
length, width, and height are all measured in meters, but adding them
makes no physical sense either (except when you are checking packages
to see if they meet parcel-post regulations, which require that L+2W+2H
<= 3m).  Then there is the problem of having multiple scales, sometimes
multiplicative (like feet instead of meters), sometimes additive (like
degrees Celsius instead of kelvins), and sometimes both.

I could go on, but I won't.  I have read a 400-odd-page report by one
group of language designers who spent several years trying to solve these
and many, many other problems.  They failed, and published their notebooks
as-is in hope that someone else would be able to work on the problem.

> Anyone think it's really important to do in ES4?

*shudder*

No, indeed.

-- 
John Cowan <cowan at ccil.org>             http://www.ccil.org/~cowan
It's like if you meet an really old, really rich guy covered in liver
spots and breathing with an oxygen tank, and you say, "I want to be
rich, too, so I'm going to start walking with a cane and I'm going to
act crotchety and I'm going to get liver disease. --Wil Shipley



More information about the Es4-discuss mailing list