Re:Go generics may use square brackets [] not parenthesis ()
by doctor_eval on Tuesday July 14, 2020 @11:05PM
(#23840761)
One of the benefits of Go is super fast compilation time. Unlimited look ahead is likely to make the compiler slower. Ergo, itβs not a great idea.
[ Parent
| on HN ]
Re:Go generics may use square brackets [] not parenthesis ()
by estebank on Wednesday July 15, 2020 @01:05PM
(#23848121)
Parser speed is negligible contributor to slowness in any compiler. rustc has a couple of places were it performs bounded lookahead to supply suggestions for incorrect code, but the grammar of the language is regular. 3rd party tools don't have to worry about it, and users get accurate suggestions. The cost is 1) you have to implement a more complex parser while 2) making people go "you already know what I meant, just take it without me using the 'ugly' turbofish". It think this is the correct approach for language design.