new instantiation design alternatives

Andreas Rossberg rossberg at google.com
Thu Sep 18 10:09:05 PDT 2014


On 15 September 2014 19:20, Brendan Eich <brendan at mozilla.org> wrote:
> Andreas Rossberg wrote:
>> Want to safe the colon for type annotations.:)
>
> Someone building a compile-to-JS language (not LLJS) pointed out to me what
> LLJS already did: C-style `type declarator` annotations, with [no
> LineTerminator here] in between.

This obviously is off-topic for this thread but I can't resist...

C-style (actually, Algol-style) declaration syntax is an evolutionary
dead end. It does not scale. It quickly becomes unreadable (to both
humans and parsers) when types have more structure than just being
names. It buries the most important piece of information (_what_ is
being declared) behind/inside a random pile of type syntax. It has the
wrong scoping order for e.g. functions (which is why C++11 needed to
introduce an alternative syntax for function types). And so on and so
forth.

I'm really glad that TypeScript and others broke with this unfortunate
C tradition and adopted a better, also well-established notation
(while other competition showed less taste). I rather not regress
behind that. ;)

/Andreas


More information about the es-discuss mailing list