Re: [go-nuts] [generics] generic types join through pipes

2020-11-20 Thread Ian Lance Taylor
On Fri, Nov 20, 2020 at 2:58 PM Reindert Vetter wrote: > > First of all, thank you for everything you do with Go! > > I've had an idea for generic for Go for some time. If it makes no sense, > please ignore my email. > > The idea is to join the different types through a pipe. This means you do

[go-nuts] Estimating blockers for supporting gollvm on RISC-V (qemu). Fedora 33

2020-11-20 Thread Ivan Serdyuk
Hello. It is just a brief survey - but I am currently dealing with a messy setup, for qemu. I have upgraded, after bootstrapping( the manual ) and I am able to boot > Fedora (5.8.0-1.0.riscv64.fc33.riscv64) 33 (Rawhide)

Re: [go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread Alexey Melezhik
Ahh, ok ... ))) пятница, 20 ноября 2020 г. в 20:01:22 UTC-6, kortschak: > That's not an error. > > > > https://github.com/rsc/quote/blob/754f68430672776c84704e2d10209a6ec700cd64/quote.go#L22-L24 > > On Fri, 2020-11-20 at 17:49 -0800, Alexey Melezhik wrote: > > Thanks. I receive " Don't

Re: [go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread 'Dan Kortschak' via golang-nuts
That's not an error. https://github.com/rsc/quote/blob/754f68430672776c84704e2d10209a6ec700cd64/quote.go#L22-L24 On Fri, 2020-11-20 at 17:49 -0800, Alexey Melezhik wrote: > Thanks. I receive " Don't communicate by sharing memory, share memory > by communicating. " error (?) when run the example

Re: [go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread Aston Motes
Maybe confusingly, that's the expected output: https://github.com/rsc/quote/blob/master/quote_test.go :) On Fri, Nov 20, 2020 at 5:49 PM Alexey Melezhik wrote: > Thanks. I receive " Don't communicate by sharing memory, share memory by > communicating. " error (?) when run the example > >

Re: [go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread Alexey Melezhik
Hi Paul! Thanks for pointing play-with-do service. It's cool. But I'd want something less lowlevelish. I only want user to fill a form with code to run, plus some dependencies declaration if needed. Boom! Dependencies are installed, code is executed. You've got your report to share. You could

Re: [go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread Alexey Melezhik
Thanks. I receive " Don't communicate by sharing memory, share memory by communicating. " error (?) when run the example пятница, 20 ноября 2020 г. в 17:22:44 UTC-6, kortschak: > It does, but it depends on how big of a dependency set is imported due > to timeout. The example below does work. >

[go-nuts] Re: Carting int to bool and the reverse for bit hacking ?

2020-11-20 Thread silas poulson
On Friday, November 20, 2020 at 11:01:01 AM UTC b.ca...@pobox.com wrote: >I think the moral is: don't waste your time trying to outsmart the compiler. Would like to reiterate this - Godblot is an amazing tool for showing just how much you're compiler does for you -- You

Re: [go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread 'Dan Kortschak' via golang-nuts
It does, but it depends on how big of a dependency set is imported due to timeout. The example below does work. https://play.golang.org/p/WL-OhWYsx68 On Fri, 2020-11-20 at 22:45 +, Paul Jolly wrote: > Hi, > > > Hi go devs. I am thinking about brining up a service that would > > execute Go

[go-nuts] [generics] generic types join through pipes

2020-11-20 Thread Reindert Vetter
Good evening, First of all, thank you for everything you do with Go! I've had an idea for generic for Go for some time. If it makes no sense, please ignore my email. The idea is to join the different types through a pipe. This means you do not have to introduce a 'type' in the interface. It

Re: [go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread Paul Jolly
Hi, > Hi go devs. I am thinking about brining up a service that would execute Go > code with support of third party modules, so that both Go modules developers > and users could play with a code and get immediate results without having any > Go environment, through a browser. > I've noticed

[go-nuts] Online service to run Go code with Go modules support

2020-11-20 Thread Alexey Melezhik
Hi go devs. I am thinking about brining up a service that would execute Go code with support of third party modules, so that both Go modules developers and users could play with a code and get immediate results without having any Go environment, through a browser. I've noticed that there are

Re: [go-nuts] Alignment requirements for 64-bit atomics on 386

2020-11-20 Thread Ian Lance Taylor
On Fri, Nov 20, 2020 at 1:03 PM 'Kevin Chowski' via golang-nuts wrote: > > Thanks Ian for the very quick reply! > > I see you're referencing this: > > > On ARM, x86-32, and 32-bit MIPS, it is the caller's responsibility to > > arrange for 64-bit alignment of 64-bit words accessed atomically. The

Re: [go-nuts] Alignment requirements for 64-bit atomics on 386

2020-11-20 Thread 'Kevin Chowski' via golang-nuts
Thanks Ian for the very quick reply! I see you're referencing this: > On ARM, x86-32, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a variable or in an allocated struct, array, or slice can be relied

Re: [go-nuts] How to detect if transport connection break

2020-11-20 Thread Amit Saha
On Sat, 21 Nov 2020, 2:12 am Afriyie Abraham Kwabena, < afriyie.abra...@gmail.com> wrote: > Hi, > > Yes, that is what intend to implement. Can you help with some information > about how > I could implement it. > If possible some libraries or example code. > The standard library's http client as

Re: [go-nuts] Alignment requirements for 64-bit atomics on 386

2020-11-20 Thread Ian Lance Taylor
On Fri, Nov 20, 2020 at 12:48 PM 'Kevin Chowski' via golang-nuts wrote: > > I am debugging an issue in which we are seeing a crash on an atomic access; > on go 1.14.7 and 1.15.2 this reproduces with the following error: > > > panic: runtime error: invalid memory address or nil pointer

[go-nuts] Alignment requirements for 64-bit atomics on 386

2020-11-20 Thread 'Kevin Chowski' via golang-nuts
I am debugging an issue in which we are seeing a crash on an atomic access; on go 1.14.7 and 1.15.2 this reproduces with the following error: > panic: runtime error: invalid memory address or nil pointer dereference > [signal

Re: [go-nuts] Ballooning Executable Sizes

2020-11-20 Thread stephen.t....@gmail.com
Yes. Thanks for your help. I've been reflecting on this and I have a couple of observations: 1) In some ways, the suddenly bloated executable is useful because, as in this case, it points to a design flaw in the program. 2) However, it was some weeks before I noticed that a problem had arisen

Re: [go-nuts] How to detect if transport connection break

2020-11-20 Thread Afriyie Abraham Kwabena
Hi, Yes, that is what intend to implement. Can you help with some information about how I could implement it. If possible some libraries or example code. Abraham On Friday, November 20, 2020 at 1:07:12 PM UTC+2 Afriyie Abraham Kwabena wrote: > Hi, > > Am new to programming and if you could

Re: [go-nuts] How to detect if transport connection break

2020-11-20 Thread Afriyie Abraham Kwabena
Hi, Am new to programming and if you could explain further what you mean by long lived process. On Friday, November 20, 2020 at 11:41:42 AM UTC+2 amits...@gmail.com wrote: > > > On Fri, 20 Nov 2020, 7:51 pm Afriyie Abraham Kwabena, < > afriyie...@gmail.com> wrote: > >> >> Hi, >> >> My basic

[go-nuts] Re: Carting int to bool and the reverse for bit hacking ?

2020-11-20 Thread b.ca...@pobox.com
On Friday, 20 November 2020 at 09:26:57 UTC christoph...@gmail.com wrote: > The use case I have to test if an integer is in a quite small constant set > of integers. With bool <-> int conversion, we can use binary operation like > this for instance which would be valid in C > > r :=

[go-nuts] Re: Carting int to bool and the reverse for bit hacking ?

2020-11-20 Thread b.ca...@pobox.com
On Friday, 20 November 2020 at 09:26:57 UTC christoph...@gmail.com wrote: > A handy feature of bool <-> int conversion is that true is converted to 1 > and any integer different of zero to true. As a consequence, when we write > int(bool(x)) we get 0 when x is 0, and 1 when x is not 0. > I

Re: [go-nuts] How to detect if transport connection break

2020-11-20 Thread Amit Saha
On Fri, 20 Nov 2020, 7:51 pm Afriyie Abraham Kwabena, < afriyie.abra...@gmail.com> wrote: > > Hi, > > My basic understanding of HTTP protocol is that an HTTP client sent > request, get response from the HTTP server and then the connection is > closed. > > My question is how can an HTTP client

[go-nuts] Carting int to bool and the reverse for bit hacking ?

2020-11-20 Thread christoph...@gmail.com
Go has a strict type separation between int and bool. For a normal usage this is OK. I guess it also ease assembly portability because there is not always a machine instruction to do so. For bit hacking, this is an unfortunate limitation. A handy feature of bool <-> int conversion is that

[go-nuts] How to detect if transport connection break

2020-11-20 Thread Afriyie Abraham Kwabena
Hi, My basic understanding of HTTP protocol is that an HTTP client sent request, get response from the HTTP server and then the connection is closed. My question is how can an HTTP client detect if the underling transport connection break. For example if the HTTP server shutdown, is there a