Type Parameters are Completely Unnecessary

Brendan Eich brendan at mozilla.org
Tue Mar 4 23:39:53 PST 2008


On Mar 4, 2008, at 11:20 PM, Darryl wrote:

> I'm not saying it's an ideal way of doing things,
> maybe you could do something like
>
> Class TypedSet(contentType){
>
> 	function add(obj:contentType){
> 		...
> 	}
> 	
> }
>
> Oh sure, JS2 as-is might not be able to cope with
> this, but there's no reason at all why you couldn't
> make it cope.

Please read the links I sent in the public reply to your message,  
originally sent only to me. We considered exactly syntax like what  
you show above, but we rejected it, since we want a deterministic  
type system that supports both (a) optional and (b) cheap-enough-to- 
be-practical static checking.

> << Have you read the overview doc at
> http://ecmascript.org/ yet? >>
>
> Oh I've tried, but it's not the most user friendly
> website out there.

I meant this document:

http://www.ecmascript.org/es4/spec/overview.pdf

It's linked from the front page with "overview" in the link text.

> Listen, I understand that this isn't going to change
> your mind about the issue, because you're well on your
> way to making this thing finished.

We can change syntax (do you have an alternative syntax?), but if you  
can't see beyond it, or grapple with the semantic reasons for  
distinguishing type parameters from ordinary call parameters, we are  
not going to get anywhere.

> You've said many
> times before that the spec has been finalized.

No, I've never said that. We're obviously not done because there is  
no consolidated spec, even a draft spec, for the whole language. My  
post here:

https://mail.mozilla.org/pipermail/es4-discuss/2008-February/001927.html

says explicitly that we don't yet have a finalized spec.

> But
> it's worth pointing out that the language is still
> designed in less than ideal ways. It's only by virtue
> of the fact that JavaScript is the only language
> natively executable by web browsers that makes this
> sort of thing even remotely possible. If multiple
> languages were available I think you'd end up worrying
> that JavaScript might go out of fashion like Fortran
> regardless of what it can do.

I doubt it, since I've worked to get other languages supported in  
Mozilla, and on Tamarin.

At this point, you're not arguing rationally and veering toward  
personal attack, so I'll stop trying to respond with rational argument.

/be




More information about the Es4-discuss mailing list