Re: [go-nuts] Are float64 and float32 exact in Golang (like strictfp in Java)

2020-09-25 Thread Rob Pike
There is more than one Go compiler and the use of fused-multiply-add is not guaranteed. The Go spec permits FMA but does not require it. I suggest reading the "Floating-point operators" section of the specification for clarity here. -rob On Sat, Sep 26, 2020 at 9:23 AM Ian Lance Taylor

Re: [go-nuts] global goroutine data / thread local storage?

2020-09-25 Thread Alex Besogonov
On Friday, September 25, 2020 at 4:43:45 PM UTC-7 Ian Lance Taylor wrote: > On Fri, Sep 25, 2020 at 10:35 AM Alex Besogonov > wrote: > > > > Inheritable goroutine-locals would actually work just fine in Go. > Moreover, Go actually has them in the form of pprof labels. > What should happen

Re: [go-nuts] global goroutine data / thread local storage?

2020-09-25 Thread Alex Besogonov
If you mutate the value, then only the current goroutine is affected (not even its existing children). Basically, the goroutine-local context is copied on new goroutine launch. That's how pprof labels work right now, btw. On Friday, September 25, 2020 at 4:43:45 PM UTC-7 Ian Lance Taylor

Re: [go-nuts] global goroutine data / thread local storage?

2020-09-25 Thread Ian Lance Taylor
On Fri, Sep 25, 2020 at 10:35 AM Alex Besogonov wrote: > > Inheritable goroutine-locals would actually work just fine in Go. Moreover, > Go actually has them in the form of pprof labels. What should happen if one goroutine changes an inherited goroutine-local variable? Ian > On Wednesday,

Re: [go-nuts] Are float64 and float32 exact in Golang (like strictfp in Java)

2020-09-25 Thread Ian Lance Taylor
On Fri, Sep 25, 2020 at 4:03 PM Ryan Keppel wrote: > > Does golang generate the SSE2 over the x87 floating point instructions on > x64? In Java terms, it's always using strictfp? You could check the assembly > I suppose. On amd64 the Go compiler uses SSE2. It does not use x87. However, the

[go-nuts] Are float64 and float32 exact in Golang (like strictfp in Java)

2020-09-25 Thread Ryan Keppel
Does golang generate the SSE2 over the x87 floating point instructions on x64? In Java terms, it's always using strictfp? You could check the assembly I suppose. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

[go-nuts] Unexpected Issue Debugging Go From VSCode

2020-09-25 Thread jlfo...@berkeley.edu
windows 10 x86_64 go version go1.15.1 windows/amd64 vscode 1.49.2 vscode go extension 0.17.0 I learned something disappointing about debugging Go from VS Code. Consider the following trivial program extracted from a larger program: package main var gvar int func main() { var lvar int

Re: [go-nuts] EC crypto: Equivalent of EC_POINT_invert() in go?

2020-09-25 Thread Anatol Pomozov
Hi On Fri, Sep 25, 2020 at 10:51 AM Joop Kiefte wrote: > https://www.openssl.org/docs/man1.1.0/man3/EC_POINT_invert.html I found > this, that might help you on the way... > > It's defined in this file: >

Re: [go-nuts] Evaluation order of return

2020-09-25 Thread Michael Jones
Another way to understand the general topic is by comparison to Lindenmayer systems. The compiler is an iterated rewrite framework and the exact code that you get can be a surprise the same way L-System graphics vary. On Thu, Sep 24, 2020 at 10:36 PM cs.ali...@gmail.com < cs.alikoyu...@gmail.com>

Re: [go-nuts] EC crypto: Equivalent of EC_POINT_invert() in go?

2020-09-25 Thread Joop Kiefte
https://www.openssl.org/docs/man1.1.0/man3/EC_POINT_invert.html I found this, that might help you on the way... It's defined in this file: https://github.com/openssl/openssl/blob/67ecd65cc4fdaa03fbae5fcccf53ebca7d785554/crypto/ec/ec_lib.c [Joop Kiefte - Chat @

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-25 Thread Joop Kiefte
The browser tries to put a nice icon to the side of the link. Usually this can be accomplished with a meta tag, but the browser also tries the well-known location favicon.ico to retrieve it if there is no meta-tag. That's why you see two requests. [Joop Kiefte - Chat @

[go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-25 Thread gaurav...@gmail.com
First request must be OPTION and second must be GET/ POST , This is default browser behaviour. On Friday, 25 September 2020 at 15:22:27 UTC+5:30 smartaq...@gmail.com wrote: > Team, > > Hi all, hope you are doing good. > > I've made a hosted a small api on my windows 10 enterprise machine: > >

[go-nuts] EC crypto: Equivalent of EC_POINT_invert() in go?

2020-09-25 Thread Anatol Pomozov
Hi I am trying to port some of EC crypto code to golang. And I have a call in C if (EC_POINT_invert(grp, p, bnc) < 0) return NULL; that I need to port to golang. I checked the crypto lib docs and did not find any mention of EC point inversion operation. Could

Re: [go-nuts] global goroutine data / thread local storage?

2020-09-25 Thread Alex Besogonov
Inheritable goroutine-locals would actually work just fine in Go. Moreover, Go actually has them in the form of pprof labels. On Wednesday, September 23, 2020 at 5:55:50 PM UTC-7 Ian Lance Taylor wrote: > On Wed, Sep 23, 2020 at 5:46 PM Alex Mills wrote: > > > > There appears to be a way to

Re: [go-nuts] Go API receive calls twice when hit through browser

2020-09-25 Thread Gregor Best
One of the requests is likely the browser looking for /favicon.ico. In cases like this (wondering "what are these requests?") it's usually a good idea to log things like the actual request URI used and the request method. On 25.09.20 11:30, smartaq...@gmail.com wrote: Team, Hi all, hope

[go-nuts] Go API receive calls twice when hit through browser

2020-09-25 Thread smartaq...@gmail.com
Team, Hi all, hope you are doing good. I've made a hosted a small api on my windows 10 enterprise machine: ``` func main() { srv := {Addr: ":8000", Handler: http.HandlerFunc(handle)} log.Fatal(srv.ListenAndServeTLS("certificate.crt", "certificate.key")) } func handle(w

[go-nuts] Go API receive calls twice when hit through browser

2020-09-25 Thread smartaq...@gmail.com
Team, Hi all, hope you are doing good. I've made a small poc api on my windows 10 enterprise machine ``` func main() { srv := {Addr: ":8000", Handler: http.HandlerFunc(handle)} log.Fatal(srv.ListenAndServeTLS("certificate.crt", "certificate.key")) } func handle(w http.ResponseWriter, r

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread saurav deshpande
I will try to install it again. Thank you [saurav deshpande - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=p6sjx) [p6sjx] On September 25, 2020 at 8:41 GMT, saurav deshpande wrote: Okay [saurav deshpande - Chat @

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread saurav deshpande
Okay [saurav deshpande - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=p6si4) [p6si4] On September 25, 2020 at 8:40 GMT, Joop Kiefte wrote: So I suspect then that some environment variables are not configured correctly -- the problem from the errors is the

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread Joop Kiefte
So I suspect then that some environment variables are not configured correctly -- the problem from the errors is the files not being found, this doesn't necessarily mean that they are not there... [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=p6sgx)

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread saurav deshpande
Tried with that but got same results On Friday, September 25, 2020 at 1:21:00 PM UTC+5:30 b.ca...@pobox.com wrote: > I think he meant "really old", like go 1.8 (which was the version that the > author of that project used). > -- You received this message because you are subscribed to the

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread Joop Kiefte
Yep, that's basically what it comes down to: using the same Go version as the original author. I think making it work with the latest version would be possible, but might need adaptations. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=p6sdb) [p6sdb]

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread Brian Candler
I think he meant "really old", like go 1.8 (which was the version that the author of that project used). -- 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

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread saurav deshpande
Thank you for the reply, I downloaded : *go1.14.9 linux/amd64* and tried to make again but this time it gives me: *[go] compiling go sources into a standalone .o file* * | ./fma.go:7:8: can't open import: "math/bits": open $WORK/b003/_pkg_.a: no such file or directory* *make: *** [Makefile:36: