Re: [go-nuts] generics draft and specialization

2020-06-21 Thread Jon Reiter
sorry, previous is v unclear as it's assuming a solution to question 1 in clarification on question 2. amended below... On Mon, Jun 22, 2020 at 12:40 PM Jon Reiter wrote: > On Mon, Jun 22, 2020 at 12:00 PM Ian Lance Taylor wrote: > >> On Sat, Jun 20, 2020 at 10:48 PM Jon Reiter wrote: >> >

[go-nuts] [generics] probably should also try inferring from the use of returned values

2020-06-21 Thread b97tsk
https://go2goplay.golang.org/p/QP2REBLl5f5 The code doesn't compile. But I would like to see it does. (I could make it compiles, of course. But then, it wouldn't look nice.) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] generics draft and specialization

2020-06-21 Thread Jon Reiter
On Mon, Jun 22, 2020 at 12:00 PM Ian Lance Taylor wrote: > On Sat, Jun 20, 2020 at 10:48 PM Jon Reiter wrote: > > > > the draft lays out an example function GeneralAbsDifference. these > comments build around that. i wanted to see how far i could get towards > working specialization within

Re: [go-nuts] generics draft and specialization

2020-06-21 Thread Ian Lance Taylor
On Sat, Jun 20, 2020 at 10:48 PM Jon Reiter wrote: > > the draft lays out an example function GeneralAbsDifference. these comments > build around that. i wanted to see how far i could get towards working > specialization within this framework. the baseline assumption is that when >

Re: [go-nuts] Help with code reproducing a change in Go 1.15 CL 229578

2020-06-21 Thread Florin Pățan
Hi Ian, Thank you for your reply. At the moment, I don't have any data about this. The question raised from the fact that the language in the documentation suggests that a compiler error would occur, at least to me as a user with English as a second language. So, when I created some test

Re: [go-nuts] Can you have multiple go routines waiting on a socket?

2020-06-21 Thread Kurtis Rader
On Sun, Jun 21, 2020 at 8:05 PM Robert Engels wrote: > Most webservers use multiple threads per socket - this is commonly > observed with async IO. IO in Go is async behind the scenes so you don’t > need to worry about this. You probably will use a Go routine to read the > socket; and probably

Re: [go-nuts] Re: [generics] how to constraint a type must be a map or a slice?

2020-06-21 Thread Ian Lance Taylor
On Sat, Jun 20, 2020 at 8:08 PM T L wrote: > > > > On Saturday, June 20, 2020 at 3:08:42 PM UTC-4, David Finkel wrote: >> >> >> >> On Sat, Jun 20, 2020 at 11:03 AM T L wrote: >>> >>> >>> >>> On Saturday, June 20, 2020 at 10:21:56 AM UTC-4, Axel Wagner wrote: I would assume it's

Re: [go-nuts] Re: go get with vanity import path and 404: fails

2020-06-21 Thread 'Dan Kortschak' via golang-nuts
As a follow-up to the follow-up, I have filed golang.org/issue/39748; the error is apparently not in minification, but in the go command's handling of html. The workaround remains the same. On Sun, 2020-06-21 at 03:23 +, Dan Kortschak wrote: > Thanks to Tim and Eric Bajumpaa on slack. > >

Re: [go-nuts] [generics] Should convertibility and comparibility of two types be two kinds of constraints?

2020-06-21 Thread Ian Lance Taylor
On Sat, Jun 20, 2020 at 7:30 PM T L wrote: > > On Saturday, June 20, 2020 at 4:48:07 PM UTC-4, Ian Lance Taylor wrote: >> >> On Sat, Jun 20, 2020 at 8:26 AM T L wrote: >> > >> > For example, if there is a builtin convertible(from, to) constraint, >> > We can define a slice conversion function as

Re: [go-nuts] Channel receive operator. Untyped boolean result.

2020-06-21 Thread Ian Lance Taylor
On Sun, Jun 21, 2020 at 2:11 PM Laevus Dexter wrote: >> >> A receive expression used in an assignment or initialization of the special >> form >> >> x, ok = <-ch >> x, ok := <-ch >> var x, ok = <-ch >> var x, ok T = <-ch >> >> yields an additional untyped boolean result reporting whether the >>

Re: [go-nuts] Can you have multiple go routines waiting on a socket?

2020-06-21 Thread Robert Engels
Most webservers use multiple threads per socket - this is commonly observed with async IO. IO in Go is async behind the scenes so you don’t need to worry about this. You probably will use a Go routine to read the socket; and probably another to do the writing - so you can treat the IO as

Re: [go-nuts] Can you have multiple go routines waiting on a socket?

2020-06-21 Thread Kurtis Rader
On Sun, Jun 21, 2020 at 5:11 PM wrote: > Yes, the exact use case I'm thinking of is reading UDP datagrams. I just >> want to read them as fast as possible then hand them off to other >> goroutines for further processing. I was just thinking I would get better >> speed/throughput if I had a

Re: [go-nuts] Can you have multiple go routines waiting on a socket?

2020-06-21 Thread hardconnect . joe
> > Yes, the exact use case I'm thinking of is reading UDP datagrams. I just > want to read them as fast as possible then hand them off to other goroutines for further processing. I was just thinking I would get better speed/throughput if I had a couple of go routines listening, waiting to

[go-nuts] Channel receive operator. Untyped boolean result.

2020-06-21 Thread Laevus Dexter
> > A receive expression used in an assignment > or initialization of the > special form > > x, ok = <-ch > x, ok := <-ch > var x, ok = <-ch > var x, ok T = <-ch > > yields an additional untyped boolean result reporting whether the > communication

Re: [go-nuts] Re: [generics] I think it's better have higher perfomance than lower compiling time

2020-06-21 Thread David Skinner
Tyler Compton is correct. In the early 90s, the plethora of C++ optimization switches resulted in obscure memory errors which resulted in major software houses shipping bad products, declaring bankruptcy, and disappearing from the face of the earth like dinosaurs. I am totally opposed to

Re: [go-nuts] Block-based data structures and the Type Parameters - Draft Design

2020-06-21 Thread Andrew Werner
Thanks for the reply! If I read it correctly, it is already possible to specify a type constraint as an Array of a given size and so the first part of the "What I might have expected" actually does work. I noticed that it works in that it works as a type constraint but I found that types

Re: [go-nuts] Block-based data structures and the Type Parameters - Draft Design

2020-06-21 Thread David Finkel
On Sat, Jun 20, 2020 at 1:22 AM Andrew Werner wrote: > [The body of this email is a duplication of the README in > https://github.com/ajwerner/go2dequeue/ > which also contains the sample implementation] > > Exercise building a dequeue with the go2 Type Parameter Draft > > This project is an

Re: [go-nuts] Reading multi line input from user

2020-06-21 Thread Miguel Angel Rivera Notararigo
Hi! you may try this https://play.golang.org/p/hDDyzm6IfED or this https://play.golang.org/p/MoKAbIbtR_J, but the user cannot edit previous lines and he/she have to hit Ctrl + D when is done -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Reading multi line input from user

2020-06-21 Thread Durga Someswararao G
Hi, I am trying to read multi line user input, which I don't know the count of those lines. Is there any way to do it. Eg: User will give one sample piece of code like below we have to read complete code without skipping content. As it is a piece of code we cannot get number of lines we have

Re: [go-nuts] [design] HTTP server serving heavy computing : Handle HTTP request closed prematurely

2020-06-21 Thread Thomas S
Thank you, that helps a lot. Le vendredi 19 juin 2020 15:49:22 UTC+2, Andrei Tudor Călin a écrit : > > Goroutines can only be stopped if they cooperate. They have no user-facing > identity or a handle by which they can be stopped. To cooperate, they need > to be checking some kind of

Re: [go-nuts] Re: [generics] I think it's better have higher perfomance than lower compiling time

2020-06-21 Thread 'Axel Wagner' via golang-nuts
Why not just build your release-build with gccgo? It often already gives better performance than gc, AIUI. If enough of the people who really care about it would focus their energy on it, that could probably get even more pronounced. There's no reason that gc needs to grow optimization knobs, if