Re: [go-nuts] call of non-function C.testc

2018-09-18 Thread Ian Lance Taylor
On Tue, Sep 18, 2018 at 6:30 PM, wrote: > > Well, that is bad news. I am not sure what to do next either. I am setting > up another Solaris 10 machine from scratch and then re-run this to see if > this can be replicated. Will get back to you if I am able to replicate. > Should I file a big for

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread andrey mirtchovski
thank you. i will definitely consider this in the future! On Tue, Sep 18, 2018 at 8:29 PM Dave Cheney wrote: > > profile.Start() installs a ^C handler to try to make sure profiles are > properly flushed to disk before your process goes to the bit bucket in the > sky. > > > On 19 Sep 2018, at

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Dave Cheney
profile.Start() installs a ^C handler to try to make sure profiles are properly flushed to disk before your process goes to the bit bucket in the sky. > On 19 Sep 2018, at 12:23, andrey mirtchovski wrote: > > you're talking about https://github.com/pkg/profile, presumably. while > i did find

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread andrey mirtchovski
you're talking about https://github.com/pkg/profile, presumably. while i did find that fairly quickly and it appears to be very useful, it wasn't immediately obvious that it would solve my particular issue. unfortunately we're also averse to importing third-party packages without additional

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Dave Cheney
pkg /profile will do the paperwork for you so ^C works when profiling. -- 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.

Re: [go-nuts] call of non-function C.testc

2018-09-18 Thread amandeep
Well, that is bad news. I am not sure what to do next either. I am setting up another Solaris 10 machine from scratch and then re-run this to see if this can be replicated. Will get back to you if I am able to replicate. Should I file a big for this? On Tuesday, September 18, 2018 at 7:45:06 AM

[go-nuts] Re: Binary module and security reasons

2018-09-18 Thread K Davidson
Have you seen cgo? (more here and some examples ) On Friday, September 14, 2018 at 7:39:35 AM UTC-7, Vitold S wrote: > > Hello my friends, > > Right now I review go ui module (

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Eric Raymond
MR and CLA submitted. -- 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

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread andrey mirtchovski
> It's a plausible mistake from any old Unix hand, I think. anecdotally, i ran into this very same issue yesterday when trying to instrument a 1.10 go program that allocated (but never used) more than 512 gigabytes of memory. i put in the memprofile saving code as a deferred closure in main and

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Eric Raymond
On Tuesday, September 18, 2018 at 6:14:54 PM UTC-4, Ian Lance Taylor wrote: > > > Under "Default behavior of signals in Go programs" in the Signals > package > > documentation, the one sentence "Defer hooks are *not* fired after > signal > > receipt." would head off potential confusion on

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

2018-09-18 Thread mhhcbon
I was referring to this code func (x type []K) Sum() (r type K) { for type switch { case K range int64(), uint64(), float64(), complex128(): for _, v := range x { r += v } case K big.Int: for _, v := range x { r.Add(r,v) } break

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

2018-09-18 Thread Michael Jones
the way to explain it is this: *support for using type-specific-but-parameterized written by A by caller B with their own types not anticipated or known by A; the ability for B to easily say, "I want A's excellent feature and I want to use it with my special B-only data type."* this cannot happen

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Ian Lance Taylor
On Tue, Sep 18, 2018 at 2:04 PM, Eric Raymond wrote: > On Tuesday, September 18, 2018 at 4:10:52 PM UTC-4, Ian Lance Taylor wrote: >> >> Signals in Go never interrupt functions. > > > Thank you, that was an admirably clear reply. > > I think this needs to be documented more prominently. Can I

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

2018-09-18 Thread robert engels
If you have type checking / casting / type select, whatever you want to call it in the “generic code”, it is not generic, and not re-usable. You can’t possibly know all the possible types, there may even be more additional primitive types, so the code is not resilient - Go 2.1 and all of your

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Eric Raymond
On Tuesday, September 18, 2018 at 4:10:52 PM UTC-4, Ian Lance Taylor wrote: > > Signals in Go never interrupt functions. > Thank you, that was an admirably clear reply. I think this needs to be documented more prominently. Can I file an MR against the Go documentation? Web search is not

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

2018-09-18 Thread Wojciech S. Czarnecki
On Tue, 18 Sep 2018 10:11:52 -0700 (PDT) mhhc...@gmail.com wrote: > I agree with Robert, this is not re usable. What is not reusable? A generic Sum function allowed by the CGG that can sum any type of any base that accidentally has anything countable in it? > I much prefer this > > func

[go-nuts] Re: Go Webassembly runs out of memory on Android

2018-09-18 Thread Tad Vizbaras
Thank you. Will wait for official fix for this. Go WASM is nice. I have tried it in number of smaller projects. Ability to have single language on both client and server side is awesome. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Ian Lance Taylor
On Tue, Sep 18, 2018 at 12:42 PM, Eric Raymond wrote: > > If interruption of a function with defers is interrupted by an uncaught > signal (say, ^C from the keyboard) do its defer hooks fire? What about defer > hooks in functions up the call stack? If the interrupt happens during a > defer

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

2018-09-18 Thread Michael Jones
Thomas, Good morning old friend. Yes the implementation of axiomized arithmetic has proven difficult. Not that it is too hard, but because (I think) it requires a mindset alien to most developers. It works very well in the symbolic algebra system Axiom which is the acme; A matrix is not just "a

[go-nuts] Re: Go Webassembly runs out of memory on Android

2018-09-18 Thread Agniva De Sarker
https://github.com/golang/go/issues/27462 On Tuesday, 18 September 2018 17:35:42 UTC+5:30, Tad Vizbaras wrote: > > Go Webassembly runs out of memory on Android. Very simple app with just > few event handlers. > I had to use remote debugger to see console. There is resulting screenshot. > >

Re: [go-nuts] Help with bytes/writing to aws

2018-09-18 Thread 'Borman, Paul' via golang-nuts
It is not possible to tell from your code if that is the correct data or not. You code did not display the data it was sending (that might be illuminating). Are you sure that when you are reading the file you are displaying what was actually there? Also, why are you specifying:

[go-nuts] Interaction of signals with defer

2018-09-18 Thread Eric Raymond
If interruption of a function with defers is interrupted by an uncaught signal (say, ^C from the keyboard) do its defer hooks fire? What about defer hooks in functions up the call stack? If the interrupt happens during a defer hook's execution, do the remaining hooks in the implied LIFO queue

Re: [go-nuts] A simplified generics constraint system.

2018-09-18 Thread alan . fox6
Sorry, I was thinking that Foo was an interface (rather than an existing contract), so the second example couldn't be written non-generically. In the third example you could also merge the two contracts into one: contract MapFoo(K, V) { Comparable(K) union{ int,

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

2018-09-18 Thread alan . fox6
Eric, This is the sort of situation where a tool could help. If the tool detects that you've written a generic type/function but only then instantiated it once, that could lead you to rewrite the type/function non-generically for the type(s) actually used in the instantiation. Alan On

Re: [go-nuts] A simplified generics constraint system.

2018-09-18 Thread alan . fox6
Just going through how xingtao zhao's examples would look under my own proposal: The first one would be: contract Foo(T) { union{ int, float64, complex128 }(T) interfaceA(T) } Note though that this could only be satisfied by defined types based on int, float64 or

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

2018-09-18 Thread 'Eric Johnson' via golang-nuts
On Tue, Sep 18, 2018 at 6:21 AM Robert Engels wrote: > I am going to refer everyone involved in this discussion on generics to > this once again. I know it is long, read the summary... but it’s important: > > > https://www.researchgate.net/publication/236644412_Adoption_and_Use_of_Java_Generics

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

2018-09-18 Thread Ian Lance Taylor
On Tue, Sep 18, 2018 at 10:06 AM, Tamás Gulácsi wrote: > > If I read golang.org/src/time/zoneinfo_read.go right, the Go project ships > with the TZInfo file (zip). > > zoneinfo.go has > //go:generate env ZONEINFO=$GOROOT/lib/time/zoneinfo.zip go run genzabbrs.go > -output

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

2018-09-18 Thread mhhcbon
I agree with Robert, this is not re usable. I much prefer this func Sum(some []K, add func(l,r K) K) (ret K) { for _, v := range some { ret = add(ret, v) } return ret } func main(){ total := Sum([]int{1,2,3,4}, func(l,r int) int {return l+r}) } On Tuesday, September 18, 2018 at

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

2018-09-18 Thread Tamás Gulácsi
If I read golang.org/src/time/zoneinfo_read.go right, the Go project ships with the TZInfo file (zip). zoneinfo.go has //go:generate env ZONEINFO=$GOROOT/lib/time/zoneinfo.zip go run genzabbrs.go -output zoneinfo_abbrs_windows.go so it seems to me that it embeds the zone info from the zip

Re: [go-nuts] A simplified generics constraint system.

2018-09-18 Thread Wojciech S. Czarnecki
On Tue, 18 Sep 2018 09:51:03 -0700 (PDT) xingtao zhao wrote: > contract Foo(T) { > int(T) || float64(T) || complex128(T) // underlying type: int, float64, > complex128 > InterfaceA(T)// at the same time, it > should satisfy InterfaceA > } CGG

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

2018-09-18 Thread Wojciech S. Czarnecki
On Tue, 18 Sep 2018 11:10:00 -0500 robert engels wrote: > I’ve said many time, the CGG example you cite here is not generic code. I do not want neither write nor **READ** Go++ code. CGG is called Craftsman's for a reason. Its for writing and **reading** real production code. It disallows, by

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

2018-09-18 Thread joe . blubaugh
How does Go deal with time zone evolution? It seems likely that the EU will stop changing clocks twice a year, starting next year: https://www.dw.com/en/eu-to-stop-changing-the-clocks-in-2019/a-45495680 How does Go update its time handling systems to accomodate these changes? Will releases be

Re: [go-nuts] A simplified generics constraint system.

2018-09-18 Thread xingtao zhao
I have the similar thought as the thread. In terms of a contract, it is mainly to express these: 1. Methods set: this could be easily expressed by interface 2. Operators set: In go, we could not add or remove the existing operator set for a given type, which is completely inherited

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

2018-09-18 Thread robert engels
I’ve said many time, the CGG example you cite here is not generic code. If I want to pass a different user type and use that method I can’t, I need to change the source of Sum(). That is not generic programming... > On Sep 18, 2018, at 10:58 AM, Wojciech S. Czarnecki wrote: > > On Tue, 18 Sep

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

2018-09-18 Thread robert engels
> On Sep 18, 2018, at 9:51 AM, Wojciech S. Czarnecki wrote: > > On Tue, 18 Sep 2018 08:19:13 -0500 > Robert Engels wrote: > >> So even when using generics you still need to be able to write >> understandable code. > > **need to be able to write understandable code** > Yes. This thread is

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

2018-09-18 Thread alan . fox6
One thing I've always liked about Go is the ability to define your own types based on the built-in ones. Although the built-ins don't have methods themselves, you can still add them to your own types and satisfy interfaces in that way. This enables us to define simple collection types such as

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

2018-09-18 Thread Wojciech S. Czarnecki
On Tue, 18 Sep 2018 08:19:13 -0500 Robert Engels wrote: > So even when using generics you still need to be able to write > understandable code. **need to be able to write understandable code** Yes. This thread is about whether within Go generics proposal this is possible and if not possible -

Re: [go-nuts] call of non-function C.testc

2018-09-18 Thread Ian Lance Taylor
Thanks for sending this. Unfortunately, I have no idea what is going wrong. Everything that you sent looks as expected. At this point I don't have any suggestions. Ian On Fri, Sep 14, 2018 at 6:42 PM, wrote: > Hi Ian, >I did you told, but I could not find --debug=all option for readelf.

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

2018-09-18 Thread Robert Engels
I am going to refer everyone involved in this discussion on generics to this once again. I know it is long, read the summary... but it’s important: https://www.researchgate.net/publication/236644412_Adoption_and_Use_of_Java_Generics > On Sep 18, 2018, at 7:52 AM, Wojciech S. Czarnecki wrote: >

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

2018-09-18 Thread Robert Engels
Here is a very common problem with generics... Everyone understands the concept of a tuple/pair. Pretty easy, you have getElement0 and getElement1 methods. Now a piece of code needs a KeyValue pair used in a map. So, with generics someone says, oh, I already have this pair class, I’ll just

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

2018-09-18 Thread Wojciech S. Czarnecki
On Tue, 18 Sep 2018 04:38:55 -0700 (PDT) ffm2...@web.de wrote: > Every average Joe Java boilerplate coder gets along with generics. Barely, if at all, understanding whats under. "Smart Copy Paste ... A book for normal programmers"

[go-nuts] Re: A test for generics

2018-09-18 Thread antonio . troina
I agree especially on the last part of your comment. I feel like generics should be used only to solve specific problems that cannot be solved otherwise, and I personally would prefer not to use them unless absolutely needed. We should always remember that with great power come great

[go-nuts] Re: reverse proxy returns Not found or Forbidden Errors

2018-09-18 Thread Dean Wang
I ran your code and it seems ok. [image: 1.PNG] 在 2018年9月18日星期二 UTC+8上午6:08:34,Nizar AYARI写道: > > I'm trying to create a reverse proxy that takes all requests and redirect > them into a target url, like google.com or any other API. Unfortunately, > all targets returns errors like page Not

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

2018-09-18 Thread 'Thomas Bushnell, BSG' via golang-nuts
On Tue, Sep 18, 2018 at 1:04 PM wrote: > It would be nice, for example, to have a full range of collection types in > the standard library without the need to use interface{}, type assertions > and the performance overhead of 'boxing'. > >From the earliest days of Object Oriented Programming,

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

2018-09-18 Thread Hoo Luu
在 2018年9月18日星期二 UTC+8下午7:29:37,Chris Hopkins写道: > > Pondering this, my concern is that it might become too powerful. I'm > scared this will make it harder to work out what someone has done if > there's too much indirection and magic added on top. It feels like it could > be a really *really*

[go-nuts] Go Webassembly runs out of memory on Android

2018-09-18 Thread Tad Vizbaras
Go Webassembly runs out of memory on Android. Very simple app with just few event handlers. I had to use remote debugger to see console. There is resulting screenshot. Device is Samsung Galaxy S7 edge, model: SM-G935T. Used Go 1.11 windows/amd64. Simply used go build with GOOS=js and

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

2018-09-18 Thread ffm2002
Am Dienstag, 18. September 2018 13:29:37 UTC+2 schrieb Chris Hopkins: > > Pondering this, my concern is that it might become too powerful. I'm > scared this will make it harder to work out what someone has done if > there's too much indirection and magic added on top. It feels like it could >

[go-nuts] ACCU 2019 Call for Proposals next month

2018-09-18 Thread Russel Winder
Hi, Just an announcement that ACCU 2019 call for proposals will be next month for a three week period. ACCU generally has about 50% C and C++, but also lots of other languages are represented. It would be great to get some good Go material into the schedule, especially stuff aimed at trying to

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

2018-09-18 Thread Chris Hopkins
Pondering this, my concern is that it might become too powerful. I'm scared this will make it harder to work out what someone has done if there's too much indirection and magic added on top. It feels like it could be a really *really* big hammer. I don't buy the argument " those who prefer to

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

2018-09-18 Thread Chris Hopkins
+1 IMO the place generics would be useful is reducing the use of the empty interface and then a type switch. Otherwise I don't see quite what people are doing that wouldn't be better done with interfaces. In the past I mistakenly tried to declare local methods on the builtin types. Revisiting

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

2018-09-18 Thread alan . fox6
Although I respect the opinions expressed here, I think you might be pleasantly surprised by how the proposed design would dovetail with the rest of Go and make a number of things much more convenient than they are at present. It would be nice, for example, to have a full range of collection

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

2018-09-18 Thread Christopher Sebastian
When I was a new Go user and didn't fully understand how to use the language, I really wanted Generics. But the more Go experience I gained, the more I realized that Generics wouldn't have helped nearly as much as I had assumed; in fact, they would have added significant complexity and

Re: [go-nuts] Run time error

2018-09-18 Thread akshita babel
*Thanks for reverting back. I solved that by reinstalling go-ipfs* On Tue, Sep 18, 2018 at 12:38 PM Agniva De Sarker < agniva.quicksil...@gmail.com> wrote: > You have to check the Send() method on RequestBuilder and find out where > the nil pointer is coming from. > > There are no repro steps,

[go-nuts] Re: Tour Of go Page 8 in Basics does not work.

2018-09-18 Thread Dave Cheney
It looks like the playground has cached this error. Please raise an issue, https://golang.org/issue/new and someone with admin powers will delete the faulty entry. On Tuesday, 18 September 2018 17:03:00 UTC+10, Reinhard Luediger wrote: > > Hey List, > > is this the right place to get the tour

[go-nuts] Re: Run time error

2018-09-18 Thread Dave Cheney
Assuming you are using the master branch of go-ifps-api, this request is failing because RequestBuilder.shell is nil. This could happen for a variety of reasons, perhaps the lack of error handling in NewLocalShell. I recommend you handle this with the ipfs developers on

Re: [go-nuts] Run time error

2018-09-18 Thread Agniva De Sarker
You have to check the Send() method on RequestBuilder and find out where the nil pointer is coming from. There are no repro steps, nor the full stack trace, nor enough code for us to understand what is really happening. Without that it is hard to conclude why it is working on windows and not

[go-nuts] Tour Of go Page 8 in Basics does not work.

2018-09-18 Thread 'Reinhard Luediger' via golang-nuts
Hey List, is this the right place to get the tour of go fixed? The example on the following page https://tour.golang.org/basics/8 terminates unexpected with error process took to long. kind regards Reinhard Lüdiger -- You received this message because you are subscribed to the Google