Re: [go-nuts] Experience report on coming to Go from a C perspective

2018-02-22 Thread Devon H. O'Dell
I like this, thanks for pointing me to it. I think that's a good way to go for about half of it; if make / new can be considered as well, that'd be great. I suppose adg's point still stands in terms of gofmt output and a detailed proposal? I agree such a change should only be considered for Go 2.

Re: [go-nuts] Experience report on coming to Go from a C perspective

2018-02-22 Thread 'Bryan Mills' via golang-nuts
You might be interested in https://golang.org/issue/12854 for maps, slices, and structs. (It wouldn't help with channels, because there is currently no such thing as a channel literal.) On Thursday, February 22, 2018 at 5:32:40 PM UTC-5, Devon H. O'Dell wrote: > > 2018-02-22 14:19 GMT-08:00

BSD Re: [go-nuts] Experience report on coming to Go from a C perspective

2018-02-22 Thread Bakul Shah
On Feb 22, 2018, at 2:16 PM, Devon H. O'Dell wrote: > > (Re-adding list in here with Bakul's okay.) > > 2018-02-22 12:27 GMT-08:00 Bakul Shah : >> On Thu, 22 Feb 2018 12:02:35 -0800 "Devon H. O'Dell" >> wrote: >>> Hi all, >>>

Re: [go-nuts] Experience report on coming to Go from a C perspective

2018-02-22 Thread Devon H. O'Dell
2018-02-22 14:19 GMT-08:00 Caleb Spare : > I occasionally run into this, but in my experience it's exclusively with > maps: I think all of the cases I ran into this were for maps and channels. > - Initializing empty slices is ~never necessary; (in my opinion the > "members:

Re: [go-nuts] Experience report on coming to Go from a C perspective

2018-02-22 Thread Caleb Spare
I occasionally run into this, but in my experience it's exclusively with maps: - Initializing empty slices is ~never necessary; (in my opinion the "members: []int{}" from the blog post is a code smell). - Channels need initialization but that's where the important buffered vs. unbuffered choice

Re: [go-nuts] Experience report on coming to Go from a C perspective

2018-02-22 Thread Devon H. O'Dell
(Re-adding list in here with Bakul's okay.) 2018-02-22 12:27 GMT-08:00 Bakul Shah : > On Thu, 22 Feb 2018 12:02:35 -0800 "Devon H. O'Dell" > wrote: >> Hi all, >> >> It's been some time since I really contributed much of anything to the >> project

[go-nuts] Experience report on coming to Go from a C perspective

2018-02-22 Thread Devon H. O'Dell
Hi all, It's been some time since I really contributed much of anything to the project (sorry!), but after 8 years, I'm finally writing Go outside of the project itself (and outside of porting efforts). I was lamenting to some coworkers about the lack of a comparable feature to C's "malloc idiom"