Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Aleksey Tulinov
I'm not sure if i understood everything correctly. type structField(type T) struct { a int x T } But this is a generic type, not a constraint for a type, isn't it? Constraint is this: type Custom interface{ type int, float64, uint64 } type structField(type T Custom) interface {

[go-nuts] Generics syntax: declaring a generic type

2020-07-22 Thread burak serdar
This is a suggestion about the declaration of a generic type. There is something unnatural in the syntax: type SomeIntf(type T) interface { ... } type SomeStruct(type T) struct { ... } func SomeFunc(type T)(...) {...} In all of the above, the names SomeIntf, SomeStruct, and SomeFunc are

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Steven Blenkinsop
On Wed, Jul 22, 2020 at 8:02 PM, Russ Cox wrote: > So it sounds like everyone is in favor of the entire generics proposal and > all the semantics, and all we have left to hammer out is the bracket > characters? Do I have that right? > > Best, > Russ > I think this thread is specifically about

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread lx . gulak
Hey! I would like to join the discussion and add my 5 cents here, since I have been criticizing the contracts draft and I would like to show what were my points in order to support the current design draft. I believe the original problem for the generics is to allow the same function to

[go-nuts] Fuzzing design doc from Go team

2020-07-22 Thread Liam
The Go team has released a design doc for a Fuzzing API. https://golang.org/s/draft-fuzzing-design The original proposal is https://github.com/golang/go/issues/19109 Discussion is on Reddit, which I don't wish to use for technical feedback or debate. I haven't seen an announcement; I

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Ian Lance Taylor
On Wed, Jul 22, 2020 at 5:12 PM Aleksey Tulinov wrote: > > Hmm. I must have read the previous version, but it probably was some > time ago. I have to say that i like the previous version more than the > current one. > > I definitely don't like this: > > type structField interface { > type

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Kent Sandvik
[ ] is nice. Nim also uses [ ] for generics. --Kent On Wed, Jul 22, 2020 at 4:41 PM Denis Cheremisov wrote: > Lesser and greater signs never were a good choice. They were chosen > because of C syntax restrictions. Go creators would do *slice[T]* (or may > be just *[T]*), *map[K,V]*,* chan[T]*,

[go-nuts] Generic symbol metaproposal

2020-07-22 Thread Michael Jones
One interesting fact of go is that semicolons are required at the end of statements. A fact forgotten perhaps because of the automatic ‘we’ll insert one for you’ process. This duality, required but auto-supplied in nearly every case is a delightful outcome. Another delight is the uppercase signal

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Michael Jones
So it seems! nothing substantive on the hard part. On Wed, Jul 22, 2020 at 5:02 PM Russ Cox wrote: > So it sounds like everyone is in favor of the entire generics proposal and > all the semantics, and all we have left to hammer out is the bracket > characters? Do I have that right? > > Best, >

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Aleksey Tulinov
Hmm. I must have read the previous version, but it probably was some time ago. I have to say that i like the previous version more than the current one. I definitely don't like this: type structField interface { type struct { a int; x int }, struct { b int; x float64 }, struct { c int;

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread David Riley
On Jul 22, 2020, at 8:02 PM, Russ Cox wrote: > > So it sounds like everyone is in favor of the entire generics proposal and > all the semantics, and all we have left to hammer out is the bracket > characters? Do I have that right? We haven't covered what the bike shed roof is going to be made

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Michal Strba
Very correct! At least from my perspective. On Thu, 23 Jul 2020 at 02:02 Russ Cox wrote: > So it sounds like everyone is in favor of the entire generics proposal and > all the semantics, and all we have left to hammer out is the bracket > characters? Do I have that right? > > Best, > Russ > > >

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread David Riley
On Jul 15, 2020, at 4:59 PM, Ian Lance Taylor wrote: > > On Wed, Jul 15, 2020 at 5:44 AM Jan Mercl <0xj...@gmail.com> wrote: >> >> My 2c - Alternative type parameters syntax (ab)using @$: >> https://docs.google.com/document/d/1AoU23DcNxYX2vYT20V2K16Jzl7SP9taRRhIT8l_pZss/edit?usp=sharing > >

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Russ Cox
So it sounds like everyone is in favor of the entire generics proposal and all the semantics, and all we have left to hammer out is the bracket characters? Do I have that right? Best, Russ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Denis Cheremisov
Lesser and greater signs never were a good choice. They were chosen because of C syntax restrictions. Go creators would do *slice[T]* (or may be just *[T]*), *map[K,V]*,* chan[T]*, etc if they had generics in mind. Because, if you have managed not to notice it, Go barely inherited anything from

Re: [go-nuts] What should be a silly protoc golang question

2020-07-22 Thread burak serdar
On Wed, Jul 22, 2020 at 4:32 PM John wrote: > > Mathew + Burak, > > That was it. > > Out of curiosity, where did you find that option. I didn't see it in > protoc's help. google search for "protoc --go_opt" did not yield good > results. It did find:

[go-nuts] Go Present slide syntax supported by talks.godoc.org

2020-07-22 Thread Tong Sun
Hi, I want to use the new Markdown Syntax instead of the old Legacy Present Syntax when writing my new Go Present slides. However I found that the new Markdown Syntax is not supported by talks.godoc.org yet, right? E.g., for the new Markdown Syntax Go Present slide at

Re: [go-nuts] What should be a silly protoc golang question

2020-07-22 Thread John
Mathew + Burak, That was it. Out of curiosity, where did you find that option. I didn't see it in protoc's help. google search for "protoc --go_opt" did not yield good results. It did find: https://grpc.io/docs/languages/go/quickstart/, but I'd like to bookmark the definite list if you

Re: [go-nuts] Using GTSM with GRPC

2020-07-22 Thread Robert Engels
Your network is setup wrong... if you are relying on a router to enforce ttl decrement for security. You can more easily prevent IP spoofing on the local net (or at the router) and then just verify the IP network portion is correct. Easier with a simple IP table rather than doing it in user

Re: [go-nuts] What should be a silly protoc golang question

2020-07-22 Thread Matthew Walster
John, On Wed, 22 Jul 2020 at 23:02, John wrote: > I then enter that directory and do: > > /usr/local/bin/protoc -I =./ ./name.proto --go_out=plugins=grpc:./ > --proto_path=/home/user/go/src > > This works, however it doesn't generate the go files in that directory, it > generates it inside the

Re: [go-nuts] What should be a silly protoc golang question

2020-07-22 Thread burak serdar
On Wed, Jul 22, 2020 at 4:02 PM John wrote: > > In essence, I'm switching over to the new go protocol buffer lib and protoc > libraries. > > In the new version, you are told to specify go_package option in the .proto > file. So I updated all mine to have that: > > go_package =

[go-nuts] What should be a silly protoc golang question

2020-07-22 Thread John
In essence, I'm switching over to the new go protocol buffer lib and protoc libraries. In the new version, you are told to specify go_package option in the .proto file. So I updated all mine to have that: go_package = "path/to/my/proto"; I use a script that finds all my proto files and the

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Sahas Subramanian
With angled brackets, do we really need the colon or dot on both sides? Wouldn't it be enough to just have it on the left to eliminate the parse time ambiguities? Like f<:int> or f<.int>? On Wed, 22 Jul 2020, 22:46 Евгений Кошевой, wrote: > Maybe something like this: > using <.Type.> > func

Re: [go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Ian Lance Taylor
On Wed, Jul 22, 2020 at 1:46 PM Aleksey Tulinov wrote: > > I'm not really a language designer and i don't use Go extensively, so > please take my words with a grain of salt. But I like Go and would > like to use it, and I'd like to put my 2 cents into the jar. I'm sorry > if this was already

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread Евгений Кошевой
Maybe something like this: using <.Type.> func f(T<.int.>) struct{ T<.int.> } interface{ T<.int.> } []T<.int.>{} среда, 22 июля 2020 г. в 01:12:32 UTC+3, Steven Blenkinsop: > On Tue, Jul 21, 2020 at 3:12 PM, Michal Strba wrote: > >> I'd say a dot is necessary when instantiating a function call

[go-nuts] [Generics] Feedback on updated draft

2020-07-22 Thread Aleksey Tulinov
Hi, I'm not really a language designer and i don't use Go extensively, so please take my words with a grain of salt. But I like Go and would like to use it, and I'd like to put my 2 cents into the jar. I'm sorry if this was already discussed, I checked the mailing list but didn't find this. I've

Re: [go-nuts] template

2020-07-22 Thread Lutz Horn
I am running a website for which we use templates. Do you use https://golang.org/pkg/html/template/? If yes, how do you use them? If no, this question is off-topic for this mailing list. Lutz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] Re: module questions

2020-07-22 Thread 'K Richard Pixley' via golang-nuts
Thank you! I hadn't run into any references to that one in any of the doc. On 7/21/20 23:56, Amnon wrote: [External Email. Be cautious of content] GOPRIVATE is your friend. https://golang.org/cmd/go/#hdr-Module_configuration_for_non_public_modules

[go-nuts] Using GTSM with GRPC

2020-07-22 Thread Matthew Walster
One of the projects I'm playing with at the moment is going to have long-lived low-traffic streaming sessions with GRPC, having both the client and the server on the same subnet. To prevent an attacker from sending spurious TCP RSTs etc from across the internet, there is a mechanism called GTSM

Re: [go-nuts] Allocating lots (e.g. a million) objects on the heap

2020-07-22 Thread Jesper Louis Andersen
On Mon, Jul 20, 2020 at 7:34 PM wrote: > I have an application where I will be allocating millions of data > structures, all of the same size. My program will need to run continuously > and be pretty responsive to > its network peers. > > I'd recommend quantifying "pretty responsive" in this

[go-nuts] Re: Allocating lots (e.g. a million) objects on the heap

2020-07-22 Thread Amnon
Try a naive solution, and see if it is good enough, before optimising. On Monday, 20 July 2020 18:35:14 UTC+1, netconn...@gmail.com wrote: > > I have an application where I will be allocating millions of data > structures, all of the same size. My program will need to run continuously > and

[go-nuts] Re: module questions

2020-07-22 Thread Amnon
GOPRIVATE is your friend. https://golang.org/cmd/go/#hdr-Module_configuration_for_non_public_modules On Monday, 20 July 2020 20:40:19 UTC+1, K Richard Pixley wrote: > > I'm think I understand the go-1.14 downloadable module workflow. But I'm > not getting how to use modules in an enterprise