Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-19 Thread Bakul Shah
On Wed, 19 Sep 2018 22:30:11 -0700 Sathish VJ wrote: > > I've been asked this question a few times and I haven't been able to find > an answer. Why does go reverse the order of variable declaration: "i int" > vs "int i" > > Is there anything in the language design that requires this or was it

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-19 Thread 'Axel Wagner' via golang-nuts
There is a full blog article with the answer to this question :) https://blog.golang.org/gos-declaration-syntax It's so good, that I actually use it as a reference to people asking me about C's declaration syntax. On Thu, Sep 20, 2018 at 8:03 AM Tristan Colgate wrote: > But every aspect of that

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-19 Thread Tristan Colgate
But every aspect of that still reads unambiguously in a left to right order. Actually understanding C declarations can be extremely challenging. On Thu, 20 Sep 2018, 06:47 Sathish VJ, wrote: > So, you are saying it is only for readability? > > But even in go we can write convoluted functions lik

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-19 Thread Sathish VJ
So, you are saying it is only for readability? But even in go we can write convoluted functions like: func f(func(*int, *string) *int, []*byte) (func(*int, *float32), error) On Thursday, 20 September 2018 11:09:23 UTC+5:30, kortschak wrote: > > To avoid having to have something like this: > >

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-19 Thread Dan Kortschak
To avoid having to have something like this: http://c-faq.com/decl/spiral.anderson.html On Wed, 2018-09-19 at 22:30 -0700, Sathish VJ wrote: > I've been asked this question a few times and I haven't been able to > find  > an answer.  Why does go reverse the order of variable > declaration:  "i in

[go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-19 Thread Sathish VJ
I've been asked this question a few times and I haven't been able to find an answer. Why does go reverse the order of variable declaration: "i int" vs "int i" Is there anything in the language design that requires this or was it based on readability/writability or related to the parsing proce

[go-nuts] Re: Local variable escapes to heap

2018-09-19 Thread Dave Cheney
If you pass more -m's to the compiler it will explain why Daves-MacBook-Pro(~/src) % go build -gcflags=-m=2 buffer.go # command-line-arguments ./buffer.go:12:6: cannot inline main: function too complex: cost 108 exceeds budget 80 ./buffer.go:15:21: buffer escapes to heap ./buffer.go:15:21: f

Re: [go-nuts] Re: Time Zone changes over time & the standard library

2018-09-19 Thread joe . blubaugh
On Tuesday, September 18, 2018 at 10:18:34 AM UTC-7, Ian Lance Taylor wrote: > > > In any case the answer the original question is the same: when the > timezone files update, Go will automatically adapt. Just like any > other program on a Unix system. > > Thanks for the education - I learne

[go-nuts] bufio.Writer's sticky errors & lost data

2018-09-19 Thread John Floren
If bufio.Writer.Flush() ever sees an error, it sets b.err and will immediately return that error on any future calls to Flush: https://golang.org/src/bufio/bufio.go?s=14569:14599#L558 Writer.Reset(w io.Writer) will clear the error and set the bufio.Writer to use the new io.Writer given, but it

[go-nuts] How much performance will be impacted for GC to be conservative by scanning externally allocated memory (mmap mostly desirable) for pointers ?

2018-09-19 Thread Compl Yue
Hi Gophers, I'm new to Go and excited by it's elegancy and potentials :D I'm investigating into the Go way to serve massive structured data which's backed by few huge files mmap-ed. As I researched so far, boltdb has done similar things pretty successful, but it received criticism about its tr

[go-nuts] Local variable escapes to heap

2018-09-19 Thread alex . bahdanau
Hi all, I've read a lot about escape analysis in golang, but still couldn't find an answer to this question here is the sample : package main type IMeta interface { Index() int } type Builder struct { buf []byte meta IMeta } func main() {

[go-nuts] Re: proposal: generic generics proposal

2018-09-19 Thread alan . fox6
Not really, TBH, though I'll soon be posting a link to my new treatise: "De rebus genericis golangi dvo" to the feedback page. I thought it might gain more attention if the title were written in Latin . Alan On Thursday, September 20, 2018 at 12:59:27 AM UTC+1, kortschak wrote: > > It's pret

[go-nuts] Generic alternatives: new basic types?

2018-09-19 Thread Randall O'Reilly
Given all the challenges associated with generics, it might be productive to follow up on this alternative approach of identifying a (small set) of new primitive containers and functions that would otherwise have been written using generics, that are of sufficiently general applicability as to m

[go-nuts] proposal: generic generics proposal

2018-09-19 Thread Dan Kortschak
It's pretty clear for the flood of emails to golang-nuts and golang-dev regarding the recent generics/contracts proposal that there are many ways to implement generics proposals. Because of this and risks associated with copy pasting generics proposals to modify and re-propose, I would like to pr

Re: [go-nuts] go modules and Dockerfile

2018-09-19 Thread Sotirios Mantziaris
Awesome thanks On Wednesday, September 19, 2018 at 10:40:30 PM UTC+3, Justin Israel wrote: > > > > On Thu, Sep 20, 2018, 6:09 AM Sotirios Mantziaris > wrote: > >> hi, >> >> i am trying to build a container that supports modules and i get the >> following error: >> >> ↳ docker build . -t test

Re: [go-nuts] go modules and Dockerfile

2018-09-19 Thread Justin Israel
On Thu, Sep 20, 2018, 6:09 AM Sotirios Mantziaris wrote: > hi, > > i am trying to build a container that supports modules and i get the > following error: > > ↳ docker build . -t test > >  1 ↵  > 4.91G RAM  0.00K SWP  21:04:0

[go-nuts] go modules and Dockerfile

2018-09-19 Thread Sotirios Mantziaris
hi, i am trying to build a container that supports modules and i get the following error: ↳ docker build . -t test

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Dave Cheney
Thank you to everyone who has contributed to this thread. It is time for everyone to take a break for 48 hours. After this time if you feel strongly that there is a point which you must continue to debate please do so, but be mindful that many words have already been spent in this thread and t

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Wojciech S. Czarnecki
On Wed, 19 Sep 2018 09:32:39 -0500 Robert Engels wrote: > This is not what I am referring to. I am stating that with N generics types > in a method the developer needs to write NxN case methods. Not feasible. Wrong. On two axis. 1. As stated in proposal, CGG has no "generic type" (generic data

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Robert Engels
There is a reason that Google has moved to Angular2 from AngularJS. As applications get larger you need more structure in order to maintain them. Implements is one of the ways to provide the needed structure. I know having structure goes against hacking. Try having a conversation in a room with

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
On Wed, Sep 19, 2018 at 4:04 PM robert engels wrote: > > The opinion that well, since there is no implements I can define my own > interface, and pass some stdlib struct that I can’t control as an > “implementor” is hogwash. Because you also don’t control this code, the API > is free to change -

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
That's a different case than one which "implements" addresses. You don't need "implements" to address that problem, if you think it's a problem. Adding "implements" doesn't help. I understand there are people who think adding generics might help, but that's a different thing. On Wed, Sep 19, 2018

[go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Space A.
+1 Go doesn't need generics, in fact it goes against its philosophy and core values. Lack of generics was one of the reasons I moved to Go, I worked with Java since version 3, and I do believe that generics just made Java worse. Regards. понедельник, 17 сентября 2018 г., 19:04:26 UTC+3 польз

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Robert Engels
This is not what I am referring to. I am stating that with N generics types in a method the developer needs to write NxN case methods. Not feasible. Sent from my iPhone > On Sep 19, 2018, at 9:25 AM, Wojciech S. Czarnecki wrote: > > On Wed, 19 Sep 2018 06:52:09 -0500 > Robert Engels wrote: >

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Wojciech S. Czarnecki
On Wed, 19 Sep 2018 06:52:09 -0500 Robert Engels wrote: > Also, I did read what you wrote. I questioned “what happens when you have N > different generic types in the call signature. The select type statement > has N*N cases. “. You did not respond. The object code (i.e. ssa then machine) is in

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread robert engels
That is not true. Often, due to lack of generics things are passed as interface{} or a sub interface, and then type checked/casted in the method. When you refactor you will get no warnings that X no longer meets the contract. You have no obvious way either by looking at the code to know which in

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
Huh? Type safety is still checked by the compiler. Implements does nothing except put a road-block in the way and prohibit you from making an interface that some other package happens to implement. On Wed, Sep 19, 2018 at 1:40 PM Robert Engels wrote: > Go not having implements is a big problem w

[go-nuts] go apps in Embedded linux - yocto

2018-09-19 Thread R Srinivasan
Anyone here using go apps in the embedded linux world? particularly yocto based systems? If so I am looking for guidance on the same. Thanks, srini -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] Re: http client POST/GET.. will not save cookie before do redirect request

2018-09-19 Thread Weeds Qian
Thanks, that's solve my problem. 在 2018年9月12日星期三 UTC+8下午2:52:20,Volker Dobler写道: > > On Wednesday, 12 September 2018 06:28:12 UTC+2, Weeds Qian wrote: >> >> What did you expect to see? >> >> the cookie in response >> What did you see instead? >> >> no cookie in response >> >> >> --

[go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread prades . marq
Anyone who doesn't want some form of generics is in favor of a bad status quo. Now I'll be fine without user defined generics if Go provided a dozens of built-in compile time safe generic data structures like trees, sets, tuples, ordered maps, weakmaps perhaps WITH a complete set of methods like

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Robert Engels
Also, I did read what you wrote. I questioned “what happens when you have N different generic types in the call signature. The select type statement has N*N cases. “. You did not respond. On Sep 19, 2018, at 4:26 AM, Wojciech S. Czarnecki wrote: >> On Tue, 18 Sep 2018 15:22:01 -0700 (PDT) mhh

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Robert Engels
Go not having implements is a big problem when refactoring large Go systems especially because it doesn’t have generics - all type safety is gone and you fly by the seat of your pants. On Sep 19, 2018, at 4:26 AM, Wojciech S. Czarnecki wrote: >> On Tue, 18 Sep 2018 15:22:01 -0700 (PDT) mhhc..

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread Wojciech S. Czarnecki
> On Tue, 18 Sep 2018 15:22:01 -0700 (PDT) mhhc...@gmail.com wrote: The **stated** goal for adding some kind of generics to Go is and always was "how to not repeat writing same code just for a type". Now above practical goal, in minds of many, somewhat morphed to "Yeah, lets have real true generi