Re: [go-nuts] Type parameters syntax... Can it be improved?

2021-03-25 Thread Martin Leiser
Ian Lance Taylor schrieb am Dienstag, 23. März 2021 um 23:22:51 UTC+1: > On Tue, Mar 23, 2021 at 3:19 PM atd...@gmail.com > wrote: > > > > Since, we also know the type of v, It would be infered from it. > > > > There is no variance, no dependent type... Meaning that the type of a Go > var

Re: [go-nuts] Type parameters syntax... Can it be improved?

2021-03-25 Thread at diar
Yes that too. To differentiate between MinFloat and MinInt for instance. :) On Thu, Mar 25, 2021, 8:18 AM Martin Leiser wrote: > > > Ian Lance Taylor schrieb am Dienstag, 23. März 2021 um 23:22:51 UTC+1: > >> On Tue, Mar 23, 2021 at 3:19 PM atd...@gmail.com >> wrote: >> > >> > Since, we also

Re: [go-nuts] Re: unexpected fault address 0xfffffff800000019

2021-03-25 Thread Amnon
I would check if it reproduces on Go 1.16.2 On Thursday, 25 March 2021 at 05:50:24 UTC Kurtis Rader wrote: > On Wed, Mar 24, 2021 at 8:25 PM Kurtis Rader wrote: > >> On Wed, Mar 24, 2021 at 7:05 PM awer...@gmail.com >> wrote: >> >>> Oh, we've got another confirmed case of the scary runtime er

Re: [go-nuts] Re: A message from the CoC committee

2021-03-25 Thread Jesper Louis Andersen
On Wed, Mar 24, 2021 at 8:18 PM ben...@gmail.com wrote: > I'm comparing to various legal systems, in which there is almost always > the possibility of appeal, even for heinous crimes. > It's somewhat the other way around. The worse the crime, the more argument for an appeal process because you c

Re: [go-nuts] Re: A message from the CoC committee

2021-03-25 Thread 'Axel Wagner' via golang-nuts
Comparisons to legal systems are misguided. Legal systems are a) almost impossible to escape (barring an international move), b) regulate all aspects of your lives and c) wield the almost unlimited monopoly of violence by the state against its citizens. Thus, they have an easily justified very high

[go-nuts] Re: Parallel Matrix Multiplication

2021-03-25 Thread Gabriel Pcklub
Hello, what is Threshold constant in code for? I wanted to try your code, but with Threshold 1 it take all of 16GB RAM I have and crash on sigkill. When I use Threshold 8 it seems ok, but when I use 64, it again take a lot of RAM... I thought it's count of Threads that program will use, while r

Re: [go-nuts] Re: Parallel Matrix Multiplication

2021-03-25 Thread jasmuth
Blast from the past so it's hard to be sure, but I think that was how many rows or columns to pick for parallel sub matrices to multiply. On Thu, Mar 25, 2021, 1:17 PM Gabriel Pcklub wrote: > Hello, what is Threshold constant in code for? I wanted to try your code, > but with Threshold 1 it take

Re: [go-nuts] Re: Parallel Matrix Multiplication

2021-03-25 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2021-03-25 at 14:20 -0400, jasm...@gmail.com wrote: > Blast from the past so it's hard to be sure, but I think that was how > many rows or columns to pick for parallel sub matrices to multiply. > > On Thu, Mar 25, 2021, 1:17 PM Gabriel Pcklub < > gabrielpckl...@gmail.com> wrote: > > Hello,

[go-nuts] syscall.NewCallback, floats and Windows

2021-03-25 Thread Marco Ronchese
Hello, I am calling certain Windows API from Go code (without CGO), everything works flawlessly, but now I bumped into this issue. I want to register a callback that accepts (also) a float as argument ( https://docs.microsoft.com/en-us/windows/win32/api/audiopolicy/nf-audiopolicy-iaudiosessione

[go-nuts] What explains this 6x slowdown ?

2021-03-25 Thread 'Isaac Gouy' via golang-nuts
( Yeah, it's a tiny tiny program from someone's language comparison but this is a hugely bigger slowdown than gcc or java? The code change is compile time const

[go-nuts] Re: What explains this 6x slowdown ?

2021-03-25 Thread Didier Spezia
I believe this is simply due to the 64 bits integer division. 1. Contrary to Java or most C implementations int is 64 bits with Go on AMD64, and not 32 bits. Integer division on 64 bits is more expensive than for 32 bits. 2. When array_length is known at compile time, the compiler can replace th

[go-nuts] Re: What explains this 6x slowdown ?

2021-03-25 Thread Alex
On my AMD 5950x I get 1m26.273s vs 2m30.918s The huge time difference (3m vs 18m) in your times could be due to thermal throttling or core clock boost strategy e.g. The CPU may boost clocks high for a short while and then drop down. You can disable intel turbo boost and set a static core clock to

Re: [go-nuts] syscall.NewCallback, floats and Windows

2021-03-25 Thread Ian Lance Taylor
On Thu, Mar 25, 2021 at 11:38 AM Marco Ronchese wrote: > > I am calling certain Windows API from Go code (without CGO), everything works > flawlessly, but now I bumped into this issue. > > I want to register a callback that accepts (also) a float as argument > (https://docs.microsoft.com/en-us/w

[go-nuts] Re: Question on module versioning expected behavior

2021-03-25 Thread Sean Liao
go1.16 defaults to `-mod=readonly`, so a build will fail with: ``` fix/kin-51-compat » go build ./... pkg/chi-middleware/oapi_validate.go:14:2: no required module provides package github.com/getkin/kin-openapi/routers; to add it: go get github.com/getkin/kin-openapi/routers pkg/chi-middleware/oa

Re: [go-nuts] upgrade golang to 1.1.5 in vscode not showing

2021-03-25 Thread Dr. Lincy Jim
Hi Kurtis, I reinstalled vscode,ubuntu and wsl as the cache kept holding onto previous installations of go. Now it correctly shows go 15 at the bottom of the vscode window. I typed 'which-a go' now it shows usr/local/go/bin/go Now the issue has been resolved.Thanks again. On Thursday, March 25,

[go-nuts] Re: What explains this 6x slowdown ?

2021-03-25 Thread 'Isaac Gouy' via golang-nuts
> I believe this is simply due to the 64 bits integer division. > > 1. Contrary to Java or most C implementations int is 64 bits with Go on > AMD64, and not 32 bits. Integer division on 64 bits is more expensive than > for 32 bits. > 2. When array_length is known at compile time, the compiler c

[go-nuts] Re: What explains this 6x slowdown ?

2021-03-25 Thread 'Isaac Gouy' via golang-nuts
On Thursday, March 25, 2021 at 12:31:25 PM UTC-7 Didier wrote: > I believe this is simply due to the 64 bits integer division. > > 1. Contrary to Java or most C implementations int is 64 bits with Go on > AMD64, and not 32 bits. Integer division on 64 bits is more expensive than > for 32 bits.

Re: [go-nuts] Re: What explains this 6x slowdown ?

2021-03-25 Thread Kurtis Rader
On Thu, Mar 25, 2021 at 4:21 PM 'Isaac Gouy' via golang-nuts < golang-nuts@googlegroups.com> wrote: > compile-time-constant program > int3m3.225s > int322m43.404s > int643m3.240s > > run-time-value program > int18m20.737s > int326m57.880s > int6418m21.020s > > Hmmm what exp

Re: [go-nuts] Re: What explains this 6x slowdown ?

2021-03-25 Thread 'Isaac Gouy' via golang-nuts
On Thursday, March 25, 2021 at 4:45:31 PM UTC-7 Kurtis Rader wrote: > On Thu, Mar 25, 2021 at 4:21 PM 'Isaac Gouy' via golang-nuts wrote: > >> compile-time-constant program >> int3m3.225s >> int322m43.404s >> int643m3.240s >> >> run-time-value program >> int18m20.737s >> int32

Re: [go-nuts] syscall.NewCallback, floats and Windows

2021-03-25 Thread Marco Ronchese
Thanks for the explanation. I did some reading and I see there is some work going to switch to register-based calling convention (https://github.com/golang/go/issues/40724). This could be a good occasion to try to fix this. In that issue is discussed which kind of SysCallbacks are needed, I wil

[go-nuts] Go compiler typechecker - why are there two ways to test type equality(checker.identical0() and unifier)?

2021-03-25 Thread messi...@gmail.com
Hi, While reading the source code of typechecker, I found there're two ways to check type equality: 1. Method checker.identical(x, y Type) bool {}, defined in predicates.go, used by many places to see if two types are identical during typecheck process; 2. Method unifier.unify(x, y Type) bool {

Re: [go-nuts] Go compiler typechecker - why are there two ways to test type equality(checker.identical0() and unifier)?

2021-03-25 Thread Ian Lance Taylor
On Thu, Mar 25, 2021 at 8:21 PM messi...@gmail.com wrote: > > While reading the source code of typechecker, I found there're two ways to > check type equality: > 1. Method checker.identical(x, y Type) bool {}, defined in predicates.go, > used by many places to see if two types are identical duri

Re: [go-nuts] Re: unexpected fault address 0xfffffff800000019

2021-03-25 Thread Kurtis Rader
On Thu, Mar 25, 2021 at 7:34 AM Amnon wrote: > I would check if it reproduces on Go 1.16.2 > Testing whether a problem exists with the most release of a particular command (or project/ecosystem) is generally good advice. However, I don't see how your reply is useful, @Amnon Baron Cohen , in this