Re: [go-nuts] Generics: after type lists

2020-08-11 Thread Ian Lance Taylor
On Tue, Aug 11, 2020 at 8:47 PM robert engels wrote: > > Isn’t the example with big.Float only a problem because of the pointer based > design - which is much harder to write code with than a immutable value based > one. > > Then you have > > D = A.Add(B).Add(C) > > with > > (Number n) func

Re: [go-nuts] Generics: after type lists

2020-08-11 Thread robert engels
Isn’t the example with big.Float only a problem because of the pointer based design - which is much harder to write code with than a immutable value based one. Then you have D = A.Add(B).Add(C) with (Number n) func Add(a Number) Number Which is straightforward, and the compiler creates the

Re: [go-nuts] Generics: after type lists

2020-08-11 Thread Ian Lance Taylor
On Tue, Aug 11, 2020 at 4:19 PM Patrick Smith wrote: > > On Sun, Aug 9, 2020 at 6:29 PM Ian Lance Taylor wrote: > > If we accept this argument, then in Go it wouldn't be appropriate to > > write a single function that works on both builtin and user-defined > > types. > > This I disagree with;

Re: [go-nuts] Generics: after type lists

2020-08-11 Thread Patrick Smith
Ian, thanks for taking the time to read and respond to my post. On Sun, Aug 9, 2020 at 6:29 PM Ian Lance Taylor wrote: > If we accept this argument, then in Go it wouldn't be appropriate to > write a single function that works on both builtin and user-defined > types. This I disagree with; what

[go-nuts] [ANN] baraka: a library for handling file uploads memory-friendly

2020-08-11 Thread Enes Furkan Olcay
Hi, I released a library for handling file uploads memory-friendly, simple than ParseMultipartForm. You can block unwanted files from getting into memory. You can get JSON data with files check it out! https://github.com/xis/baraka -- You received this message because you are subscribed to

[go-nuts] Go 1.15 is released

2020-08-11 Thread Andrew Bonventre
Hello gophers, We just released Go 1.15 To find out what has changed in Go 1.15, read the release notes: https://golang.org/doc/go1.15 You can download binary and source distributions from our download page: https://golang.org/dl/ If you have Go installed already, an easy way to try go1.15 is

Re: [go-nuts] generics go2go Type List in Interface - Struct Type

2020-08-11 Thread 'Axel Wagner' via golang-nuts
Yes, it's intended. From the draft: More precisely, the underlying type of the type argument must be identical > to the underlying type of one of the types in the type list. Type-lists match by underlying type of both argument and the types in the type-list. As SantaHappy and SantaSad both have

[go-nuts] generics go2go Type List in Interface - Struct Type

2020-08-11 Thread Rich Moyse
Attempting to use a Type List in an Interface to restrict the types allowed to instantiate a generic function (example in go2go

Re: [go-nuts] How do disable vDSO for i386 and use linker script?

2020-08-11 Thread Ian Lance Taylor
On Tue, Aug 11, 2020 at 12:26 PM wrote: > > I also have a quick follow up question based on #1 here: > > >> 1. Is it possible to completely disable use of the vDSO for i386/Linux > >> programs? If so, is this done at build time, or automatically by the go > >> runtime? > > >There is no way to

Re: [go-nuts] How do disable vDSO for i386 and use linker script?

2020-08-11 Thread evan . mesterhazy
Thanks, Ian - this is very helpful. To address your question - the VDSO references all appear to be associated with libc. There are 284 `call *%gs:0x10` instructions in the binary. I haven't looked at all of them, but the ones that I have reviewed are inside libc symbols. Stepping over the

[go-nuts] [generics] Violates beauty ethos

2020-08-11 Thread Oliver Smith
I recognize the hefty constraints in introducing generics, but for me the most egregious part is the cognitive and visual overhead it introduces by pushing more and more stuff off-screen-right and the processing overhead of so many sequences of parens on the same line. My key thought is "the

[go-nuts] Raw http2 with TLS

2020-08-11 Thread Ian Gudger
I am trying to use the http2.Server directly. I can't use the standard library http.Server because it has a hard dependency on receiving a *tls.Conn for http2 and I would like to use a wrapper. For now though, I am trying to get http2.Server working with the bare tls types. I am using what seems

Re: [go-nuts] How do disable vDSO for i386 and use linker script?

2020-08-11 Thread Ian Lance Taylor
On Tue, Aug 11, 2020 at 8:12 AM wrote: > > I am attempting to build a simple hello-world go program for a custom > operating system that provides compatibility with a subset of Linux syscalls > through the INT 0x80 syscall inferface. > > My understanding is that go uses the Linux vDSO for time

Re: [go-nuts] Sum type experiment

2020-08-11 Thread Sina Siadat
Thanks for the link, Ian. I will have a look at it :) -- 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

[go-nuts] How do disable vDSO for i386 and use linker script?

2020-08-11 Thread evan . mesterhazy
I am attempting to build a simple hello-world go program for a custom operating system that provides compatibility with a subset of Linux syscalls through the INT 0x80 syscall inferface. My understanding is that go uses the Linux vDSO for time functions

Re: [go-nuts] Sum type experiment

2020-08-11 Thread Ian Davis
On Tue, 11 Aug 2020, at 3:38 PM, Sina Siadat wrote: > Hi golang-dev :) > > I was wondering what would be an idiomatic Go way > to implement a basic sum type in Go. After several > iterations I came up with 2 approaches I will share here. You may be interested in the discussions on

[go-nuts] Sum type experiment

2020-08-11 Thread Sina Siadat
Hi golang-dev :) I was wondering what would be an idiomatic Go way to implement a basic sum type in Go. After several iterations I came up with 2 approaches I will share here. (1) Group types in an interface The first approach does not require any new tools and is statically checked by Go1

Re: [go-nuts] Why gollvm not support race detector?

2020-08-11 Thread 'Than McIntosh' via golang-nuts
>>Could I simply add race.go to gofrontend then link the target programs by the TSAN shared library to make the race detector enabled? The race detector implementation also includes a compiler component (look for flag_race in the cmd/compile source code), so that would have to be ported to gccgo

[go-nuts] Regarding this hash is worth solving, why is the result of shifting right by 5 bits better than the result of shifting right by 12 bits?

2020-08-11 Thread Heisenberg
The modification in this patch, why is the performance after shifting 5 bits to the right better than the performance of shifting 12 bits to the right? Can someone tell me something for me? https://go-review.googlesource.com/c/go/+/245177 -- You received this message because you are

[go-nuts] Regarding this hash is worth solving, why is the result of shifting right by 5 bits better than the result of shifting right by 12 bits?

2020-08-11 Thread Heisenberg
The modification in this patch, why is the performance after shifting 5 bits to the right better than the performance of shifting 12 bits to the right? Can someone tell me something for me? https://go-review.googlesource.com/c/go/+/245177 -- You received this message because you are

[go-nuts] Re: I made casual file transfer tool. and wana know your opinion.

2020-08-11 Thread 加藤泰隆
Hi. I researched "syncthing" and analyze this. My tool didn't have enough feature. - View synchronization status on both servers and clients - directory support - Synchronized settings can be saved. I implemented that. https://github.com/yasutakatou/andoukie2

Re: [go-nuts] Why gollvm not support race detector?

2020-08-11 Thread Ting Yuan
Thanks for your reply, If I'm not confused, the implementation of Go race detector is written in go/src/runtime/race.go and its TSAN implementation (in C/C++) is dynamic linked to target programs by a shared library. Could I simply add race.go to gofrontend then link the target programs by the

Re: [go-nuts] Re: [generics] How to use maps in generic structs?

2020-08-11 Thread Markus Heukelom
On Mon, Aug 10, 2020 at 8:25 PM Ian Lance Taylor wrote: > On Mon, Aug 10, 2020 at 7:08 AM Markus Heukelom > wrote: > > > > Just a quick thought, instead of "comparable" (and type lists) maybe we > could use a single operator to specify the required "operators" interface: > > > > type BiMap[type

Re: [go-nuts] Gollvm failed to build hugo

2020-08-11 Thread Yuan Ting
Thanks for direction, I think the root cause of this issue is exactly the same in #38728 but I afraid the patch in #38728 only fix the building of gollvm (i.e. add -fcd-branch=none to the build flags). In the above case, gollvm uses /usr/bin/cc to compile gccgo_c.o during the building of hugo