Re: [go-nuts] Build kubernetes with gollvm

2019-07-19 Thread Yuan Ting
OK, I will check out the reflect2 package and take a look. Thanks a lot for your direction! Best, Ting On Friday, July 19, 2019 at 10:30:32 PM UTC+8, Ian Lance Taylor wrote: > > On Fri, Jul 19, 2019 at 1:11 AM Yuan Ting > > wrote: > > > > Sorry to have troubled you again, I found that many f

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Robert Engels
You are beginning to touch on why modern compacting collectors are beneficial in a large class of applications. Not all application profiles benefit from this and it comes at a cost, but it is far simpler than rolling your own. > On Jul 19, 2019, at 8:47 PM, Andrey Tcherepanov > wrote: > > T

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Andrey Tcherepanov
Thanks Ian, But just to be clear - I do not want to discard _a part_. I want to discard a _whole big one_, copying a small needed part that is still "alive" aside. Allocator perform it's duties as usual - allocate a new small array, and discard an old one. It is just that compiler invokes thi

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Ian Lance Taylor
On Fri, Jul 19, 2019 at 5:17 PM Andrey Tcherepanov wrote: > > I understand that it is very easy on application level... if programmer even > thought about it. But my assumption is that compiler has some sort of > liveness analysis, and it could be utilized here just to help with disposal > of a

Re: [go-nuts] How to safely convert a pointer to *unsafe.Pointer

2019-07-19 Thread Ian Lance Taylor
On Fri, Jul 19, 2019 at 4:33 PM wrote: > > I would like to make sure that the following line of Go is a defined behavior: > > addr := (*unsafe.Pointer)((unsafe.Pointer)(&ptr)) > > I use it to perform atomic loads and stores to addr such as in this simple > example: https://play.golang.org/p/DpDr

Re: [go-nuts] Re: Build issues on FreeBSD ZoF "unexpected stale targets"

2019-07-19 Thread mat . macy
On Friday, July 19, 2019 at 2:24:30 PM UTC-7, Steven Hartland wrote: > > Mat is actually running a non-standard kernel, with the ZFS filesystem > from the core OS replaced with a ZFS version derived from Linux ZFS port. > > I've not looked at the details of the port, but one suggestion would be

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Andrey Tcherepanov
I understand that it is very easy on application level... if programmer even thought about it. But my assumption is that compiler has some sort of liveness analysis, and it could be utilized here just to help with disposal of a bitten part. Andrey On Friday, July 19, 2019 at 2:48:57 PM UTC-6,

[go-nuts] How to safely convert a pointer to *unsafe.Pointer

2019-07-19 Thread julio
Hello, I would like to make sure that the following line of Go is a defined behavior: addr := (*unsafe.Pointer)((unsafe.Pointer)(&ptr)) I use it to perform atomic loads and stores to addr such as in this simple example: https://play.golang.org/p/DpDrRvTYMG8 It allows me not to use atomic.Valu

[go-nuts] Re: Need help to learn go lang

2019-07-19 Thread Ronny Bangsund
Brian's list is good. I started with the tour and picked relatively simple tools I wanted to write, then looked up what I needed as projects advanced. My list of GitHub Go projects is getting unwieldy now, a few years later. It's an addiction. Just start with simple projects and set some increa

Re: [go-nuts] Re: Build issues on FreeBSD ZoF "unexpected stale targets"

2019-07-19 Thread Steven Hartland
Mat is actually running a non-standard kernel, with the ZFS filesystem from the core OS replaced with a ZFS version derived from Linux ZFS port. I've not looked at the details of the port, but one suggestion would be do you see the same behaviour if you build on UFS volume while still running

[go-nuts] Re: Build issues on FreeBSD ZoF "unexpected stale targets"

2019-07-19 Thread B Carr
What does this part mean? "...with the ZFS rebased to ZFS on Linux..." On Friday, July 19, 2019 at 1:37:02 PM UTC-6, mat...@gmail.com wrote: > > I'm not sure where to ask this since this isn't actually a Go bug. Go > 1.12, 1.1, etc build fine on FreeBSD with ZFS in base. However, with the > ZF

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Michael Jones
Yes! That always works at the application level. Write an “inspector” that examines things, duplicating and copying the live parts. I do that in several of my long running math apps, where my pool of big.Ints end up with 50-100 thousand digit allocations in a big because of one giant multiply...I

[go-nuts] Re: About the Google logo on the new Go website

2019-07-19 Thread Cassandra Salisbury
I encourage everyone to take a look at the code of conduct . I have had multiple reports from this particular thread. I understand the desire to express opinions and thoughts, but please note that you should be doing this* within the bounds of our Code of Conduct <

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Andrey Tcherepanov
My suggestion was not to make "the kitchen" work harder by marking parts of the hamburger to be good for the consumption, no. My suggestion was to recycle bitten hamburger out and put just the bitten piece aside in a doggy bag, sorry. A. On Friday, July 19, 2019 at 1:08:51 PM UTC-6, Michael Jo

[go-nuts] Build issues on FreeBSD ZoF "unexpected stale targets"

2019-07-19 Thread mat . macy
I'm not sure where to ask this since this isn't actually a Go bug. Go 1.12, 1.1, etc build fine on FreeBSD with ZFS in base. However, with the ZFS rebased to ZFS on Linux I'm seeing issues that I can only reproduce building Go. I either see: from one run: go install encoding/gob: copying /tmp/g

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-19 Thread Michael Jones
You sure seem eager to post negative things from your gmail account. Do you troll only, or is there anything of substance? If there is something about the Go language or computer programming that you wish to share it would be welcome: perhaps open source software you’ve written and want developers

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Michael Jones
There is a difference in the meanings of terms in this discussion, maybe that’s confusing to some. (That is, Ian went right to the heart of the matter but maybe a simpler fact needs to be made plain to others.) When you think of the memory used by a slice and of maybe using less of it and “returni

Re: [go-nuts] Need help to learn go lang

2019-07-19 Thread Michael Jones
Veeresh, Welcome to the world of programming. It is a beautiful world and has been my joy for fifty years. It is magical to have a robot friend to multiply your abilities by millions of times. Learning about programming at the very start is a small group of tasks: learning a few details like “whe

Re: [go-nuts] Need help to learn go lang

2019-07-19 Thread Veeresh Reddy
Thanks much . To be honest I have not wrote any code so far but I wanted to start of with Go Lang . Pleade suggest me some accordingly . On Fri, 19 Jul 2019, 7:15 pm Brian Hatfield, wrote: > Hi Veereshreddy! > > Welcome to Go! > > Here's a collection of links that I put together for some of my t

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-19 Thread Space A.
Unless there are financial reports published for passed years, my personal opinion is that accurate term could be "use of official position or office for personal gain". Quite common thing to such a big companies, tbh. Oh, and don't forget "If you are independent artist tried to make something f

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Ian Lance Taylor
I'm not sure what to say. If someone wants to write up and work on a detailed implementation proposal, that is fine. Go for it. As I said earlier, I think it would be hard. I'll add that I don't think that the difficulty would pay off in terms of the amount of real code that it would help. The

Re: [go-nuts] Build kubernetes with gollvm

2019-07-19 Thread Ian Lance Taylor
On Fri, Jul 19, 2019 at 1:11 AM Yuan Ting wrote: > > Sorry to have troubled you again, I found that many famous Go projects also > import github.com/modern-go/reflect2 , such as kubernetes and moby. According > to the second paragraph in your explanation, these popular projects will also > fai

Re: [go-nuts] Need help to learn go lang

2019-07-19 Thread Brian Hatfield
Veeresh, Out of the links I provided, The Little Go Book is the closest to a "new programmer" book, but I don't think it really meets that need. Hopefully others on this list are aware of a good resource for "new to programming and want to try Go" and can link you to one! Good luck, Brian On Fri

Re: [go-nuts] Need help to learn go lang

2019-07-19 Thread Brian Hatfield
Hi Veereshreddy! Welcome to Go! Here's a collection of links that I put together for some of my teammates who are new to Go: Basics / Introduction to Go GoByExample is a great resource if you've got experience with 2+ programming languages already. It quickly showcase

[go-nuts] Need help to learn go lang

2019-07-19 Thread veereshreddy . r
would anyone help me out how to learn go lang more practically , may be some resources . I want to understand go lang more practically , with some great examples. thank you! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from t

Re: [go-nuts] gomobile wiki empty

2019-07-19 Thread Ian Lance Taylor
On Fri, Jul 19, 2019 at 5:48 AM Johan Torås Halseth wrote: > > Not sure if it has moved, but I noticed that the gomobile wiki on GitHub > (which plenty of docs link to) is empty: > https://github.com/golang/go/wiki/Mobile > > Deleted by mistake? Thanks. Someone deleted the page yesterday. I r

[go-nuts] gomobile wiki empty

2019-07-19 Thread Johan Torås Halseth
Not sure if it has moved, but I noticed that the gomobile wiki on GitHub (which plenty of docs link to) is empty: https://github.com/golang/go/wiki/Mobile Deleted by mistake? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] ioutil.ReadDir error

2019-07-19 Thread Steven Hartland
If you want this behavior you'll need to use the lower level methods in the os package .     Regards     Steve On 19/07/2019 11:54, rob wrote: I have this in my code   files, err := ioutil.ReadDir(CleanDirName)   if err != nil {     log.Println(

[go-nuts] ioutil.ReadDir

2019-07-19 Thread rob
I forgot to say that this is on linuxmint 19.1, 64 bit -- 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. To view this disc

[go-nuts] ioutil.ReadDir error

2019-07-19 Thread rob
I have this in my code   files, err := ioutil.ReadDir(CleanDirName)   if err != nil {     log.Println(err)   } Occasionally I have a symlink to another computer that goes stale, with this error:   lstat [symlinkname] stale NFS file handle When this happens, ReadDir does not return any oth

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Michel Levieux
Hello everyone, I might be saying something stupid but I found this topic really interesting and I was wondering: Instead of trying to get the notion of "slice" to replace that of "pointer" in the compiler/runtime reference frame, wouldn't it be possible / less complex to keep track of the larges

Re: [go-nuts] Build kubernetes with gollvm

2019-07-19 Thread Yuan Ting
Sorry to have troubled you again, I found that many famous Go projects also import github.com/modern-go/reflect2 , such as kubernetes and moby. According to the second paragraph in your explanation, these popular projects will also failed in compilation. I think this may be a big challenge for