Re: [go-nuts] would it be good a go runtime support both GC (garbage collection) and ARC (automatic reference counting)?

2017-05-12 Thread T L
On Saturday, May 13, 2017 at 1:26:31 PM UTC+8, Tamás Gulácsi wrote: > > Reference counting does not come without unforseen stalls - dereference a > huge structure with millions of objects! Programmers can choose use ARC pointers or not. -- You received this message because you are

Re: [go-nuts] would it be good a go runtime support both GC (garbage collection) and ARC (automatic reference counting)?

2017-05-12 Thread Tamás Gulácsi
Reference counting does not come without unforseen stalls - dereference a huge structure with millions of objects! -- 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

Re: [go-nuts] would it be good a go runtime support both GC (garbage collection) and ARC (automatic reference counting)?

2017-05-12 Thread T L
On Saturday, May 13, 2017 at 12:02:39 AM UTC+8, JuciÊ Andrade wrote: > > Any memory management strategy costs time. Reference counting is not > cheap. Incrementing and decrementing millions of reference counters costs > time. Please consider caching issues as well. > > Go GC, as it currently

[go-nuts] Re: Reading stdlib for education about go?

2017-05-12 Thread Scott Pakin
On Friday, May 12, 2017 at 4:39:54 AM UTC-6, Steve Mynott wrote: > > What parts of the go stdlib are particularly useful for self education > in general go? > It's been a while since I looked, but I recall image/png (or any of its file-format siblings) and

[go-nuts] Re: map[X]Y or map[X]*Y ?

2017-05-12 Thread jmontgomery
In addition to the god points that others have made, there is a difference in the way that memory will be allocated. See https://play.golang.org/p/l6d4lODiDx and pay attention to the "delta" lines. In this particular example, using a map to a pointer does a Malloc for every map item, whereas

Re: [go-nuts] would it be good a go runtime support both GC (garbage collection) and ARC (automatic reference counting)?

2017-05-12 Thread ojucie
Any memory management strategy costs time. Reference counting is not cheap. Incrementing and decrementing millions of reference counters costs time. Please consider caching issues as well. Go GC, as it currently stands, is very effective, as other people in this forum can confirm to you.

[go-nuts] Re: would it be good a go runtime support both GC (garbage collection) and ARC (automatic reference counting)?

2017-05-12 Thread T L
On Friday, May 12, 2017 at 10:42:24 PM UTC+8, feilengcui008 wrote: > > If there are ARCs like shared_ptr in C++, I think there must be some kind > of raw pointers not managed by gc, this means bringing more "unsafe". > Yes. But "unsafe" != "not safe" > > 在 2017年5月5日星期五 UTC+8上午12:00:18,T

Re: [go-nuts] would it be good a go runtime support both GC (garbage collection) and ARC (automatic reference counting)?

2017-05-12 Thread T L
On Thursday, May 11, 2017 at 8:48:05 PM UTC+8, JuciÊ Andrade wrote: > > Maybe a 100µs GC would be fast enough for you to be at easy with your game > FPS. > > >

Re: [go-nuts] Re: adding context.Context to new code

2017-05-12 Thread Henrik Johansson
With the whole "Reactive" movement thread locals have started to vanish at least in the Java ecosystem. I agree with Sameer that, while convenient, it comes with a whole set of obscure bugs. On Fri, May 12, 2017, 14:57 Sameer Ajmani wrote: > Hmm, I'm not finding good

Re: [go-nuts] Reading stdlib for education about go?

2017-05-12 Thread Wojciech S. Czarnecki
Dnia 2017-05-12, o godz. 11:39:40 Steve Mynott napisał(a): > What parts of the go stdlib are particularly useful for self education > in general go? Ones that you got deep understanding in other languages you use. If you thought about general understanding of go just

Re: [go-nuts] Reading stdlib for education about go?

2017-05-12 Thread Michael Jones
The file IO routines are good examples of go factoring/structuring. In particular, the blend of real and direct actions and the abstracted/indirect use of readers/writers makes for a good IO feature set with high reuse, efficiency, natural extensibility, and testability. On the downside, it grew

Re: [go-nuts] Re: adding context.Context to new code

2017-05-12 Thread Sameer Ajmani
Hmm, I'm not finding good open-source examples of ThreadLocal context propagation in C++ and Java. My experience with this is based on what Google uses internally. Perhaps someone more familiar with context use (tracing?) outside Google can chime in? +Jaana Burcu Dogan On Thu,

[go-nuts] Re: map[X]Y or map[X]*Y ?

2017-05-12 Thread howardcshaw
> > type Y struct { > //some fields > } > > This rather depends on what those some fields ARE, and whether type Y is conceptually mutable or immutable. For example, I might make a lightweight struct just to group a pair of values; X/Y coordinates, or Latitude and Longitude: type LatLon

Re: [go-nuts] Reading stdlib for education about go?

2017-05-12 Thread Steve Mynott
Perhaps not the most informative reply ever and implying go is like the Curate's egg? :-) I'd imagine that perhaps "unsafe" isn't what I want and there other more suitable packages to start studying? Which do people think the "good parts" (for this task) are? On 12 May 2017 at 11:48, Aram

Re: [go-nuts] map[X]Y or map[X]*Y ?

2017-05-12 Thread 'Axel Wagner' via golang-nuts
There is a difference, given that in the former, values stored in the map are not addressable, so if you need to modify them, you need to read, modify, write them, whereas in the latter, you can simply do someMap[k].doSomeThings. As you noted, there is also the issue that you can't call methods on

[go-nuts] Re: Delve v1.0.0-rc.1 release

2017-05-12 Thread Ged Wed
Derek, can the RR be used with golang on AMD64 and ARM ? If so this is pretty huge ged On Monday, 8 May 2017 20:42:43 UTC+2, Derek Parker wrote: > > Hey all, > > Just wanted to make some noise about the latest Delve > release, v1.0.0-rc.1 >

[go-nuts] map[X]Y or map[X]*Y ?

2017-05-12 Thread aktungmak
Setting aside the receiver types of methods for the moment, if we consider the following declaration: type Y struct { //some fields } Which of the following would be "better" (from a speed and storage usage viewpoint)? map[X]Y map[X]*Y If we consider that this map could be handed between

Re: [go-nuts] Reading stdlib for education about go?

2017-05-12 Thread Aram Hăvărneanu
The good parts. -- Aram Hăvărneanu -- 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. For more options, visit

[go-nuts] Reading stdlib for education about go?

2017-05-12 Thread Steve Mynott
I've often seen advice that a good way of increasing language understanding is to read parts of the stdlib written in that language. What parts of the go stdlib are particularly useful for self education in general go? -- 4096R/EA75174B Steve Mynott -- You received

[go-nuts] Java to Golang converter

2017-05-12 Thread Simon Ritchie
I think the problem is testing. If you use a tool to convert one language to another, you have to check that the result works, which involves a lot of testing, possibly as much as you had to do to get the original working in the first place. So it's expensive. It will usually be cheaper to