On Tue, Jun 16, 2020 at 8:12 PM Pee Jai <p...@pjebs.com.au> wrote:
>
> I read the proposal and am very impressed by it. I have 3 concerns however.
>
> 1. `F(type T)(p T) { ... }`
>
> To me, having 2 or 3 sets of parentheses is very weird. All mainstream 
> programming languages have only 1 set of parentheses for the function's 
> arguments. I've never seen 2 before. I know the proposal says the authors of 
> the draft considered other common symbols including colon. I still think `::` 
> seems nicest.

Let's get some experience with this syntax before we decide to change it.


> 2. Expanding interfaces to include fields
>
> Currently interfaces can dictate methods only. The proposal also adds type 
> lists.
> I propose that for the purposes of generics, the interface also defines 
> fields. This has been rejected numerous times for interfaces (as it is now), 
> but for generics, I think it will greatly enhance the power given to 
> developers whilst honouring the intention/spirit of the proposal.

Thanks.  While it's always interesting to discuss extensions, I don't
see a major need for this one.  It seems that it can be done later if
there is a need.  I'd prefer to keep this design draft as simple as
possible--and it's already very complicated!


> 3. Compile time.
>
> I started using Go around Go1.3 (the C compiler days). Back then compiling 
> was blink-of-an-eye fast. I used it as a selling point to everyone I met at 
> meetups (there was minimal uptake of Go back then so it was meetups for other 
> languages). Now the compiler is fast but for moderate size projects, it's no 
> longer blink-of-an-eye fast. I don't bother hyping this feature any more.
>
> Obviously based on how generics is implemented, the compiler will again be 
> slower.
>
> I propose a compile flag so that when developing all the generic type 
> checking etc is done at run-time (default behaviour). When ready to build for 
> production, a compile flag can use used to move the type checking to happen 
> at compile time.

Thanks, we have a ways to go before we discuss implementation.
Certainly if we do adopt this design draft we will pay close attention
to compile time.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVdO0%3Dr%3DfgfJ14BH3C5nWcE0CZayjc1HgEztdkVGXa2DQ%40mail.gmail.com.

Reply via email to