Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Yuval Lifshitz
(1) I understand the issue of limited precision, this is why I did not try anything above F(59) But my concern was not the difference between algebra and the go implementation it was the different results I got with the C/C++ implementation (gcc 7.3.1): #include const double sqrt_5 = sqrt(5.0

[go-nuts] Re: Question about int inside json

2018-04-29 Thread T L
On Saturday, April 28, 2018 at 11:52:24 PM UTC-4, Milo Pickard wrote: > > > Hallo all, > > I've a "stupid" question about the type "int" when used inside json. > Almost every documentation I've found says int is 32 bit long, so that I > expect a range from -2.147.483.648 to 2.147.483.647. > >

Re: [go-nuts] Question about int inside json

2018-04-29 Thread Jan Mercl
On Sun, Apr 29, 2018 at 5:52 AM wrote: > Almost every documentation I've found says int is 32 bit long, so that I expect a range from -2.147.483.648 to 2.147.483.647. Can you please share an example of such incorrect documentation? -- -j -- You received this message because you are subscrib

[go-nuts] gomobile bind "skipped function" error in xcode

2018-04-29 Thread Elias Naur
Only byte slices ([]byte) are supported by gomobile bind. Try replacing your int slices with byte slices and it should appear in ObjC. -- 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

Re: [go-nuts] [ANN] gomacro v2.6 - interactive Go interpreter, now with debugger

2018-04-29 Thread Max
Done and documented :) As I also wrote in README.md, see https://github.com/cosmos72/gomacro/blob/master/fast/cmd.go#L37 for the documentation and API to define new special commands. The TL;DR summary is: choose a name for the new command, write a function with signature func(interp *fast.Int

Re: [go-nuts] [ANN] gomacro v2.6 - interactive Go interpreter, now with debugger

2018-04-29 Thread Max
About the "other languages extensions": it's obviously easier than modifying the official Go compiler, but it's usually still a major task, especially if it involves modifying the "poor man's compiler" fast.Comp which converts a parsed ast.Node into a tree of function closures for execution. If

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Michael Jones
yes. truncation and round-up are important differences between your c/c++ code and the go code. On Sun, Apr 29, 2018 at 12:08 AM Yuval Lifshitz wrote: > (1) I understand the issue of limited precision, this is why I did not try > anything above F(59) But my concern was not the difference between

Re: [go-nuts] [ANN] gomacro v2.6 - interactive Go interpreter, now with debugger

2018-04-29 Thread Louki Sumirniy
So, the fastest way on the compile-side for making collections of functions (optionally, tied to some common data type) is using closures? I thought so also, that's the direction I went instead of interfaces in my own work for the same reason. On Sunday, 29 April 2018 16:52:44 UTC+3, Max wrote:

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Yuval Lifshitz
Thanks Michael. Is this "by design"? Does it worth an issue here ? On Sunday, 29 April 2018 18:06:23 UTC+3, Michael Jones wrote: > > yes. truncation and round-up are important differences between your c/c++ > code and the go code. > > On Sun, Apr 29, 2018 at

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Louki Sumirniy
I could be wrong but float64 is 'float' and 'double float' is float128. I dunno, I have not tinkered with these imprecise math types. That's just, essentially, what they were back in the olden days, like 20 years ago. 64 bit was basic float, 128 was double. I have been out of the loop for way t

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Yuval Lifshitz
in C/C++ (at least on my system) "float" 4 has 4 bytes (32bits) and double has 8 bytes (64bits). according to this: https://golang.org/pkg/math/ its is the same thing with go. On Sunday, 29 April 2018 22:27:23 UTC+3, Louki Sumirniy wrote: > > I could be wrong but float64 is 'float' and 'double f

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Michael Jones
Not sure what you mean with "by design." The design here is the IEEE Standard for Floating-Point Arithmetic (IEEE 754). It is authoritative for Intel, AMD, IBM, Sun, etc. Typical (universal?) C and C++ implementations map 'float' to 32-bit IEEE 754 binary floating point and 'double' to the related

Re: [go-nuts] [ANN] gomacro v2.6 - interactive Go interpreter, now with debugger

2018-04-29 Thread Maxim Khitrov
I didn't have anything specific in mind, just curious about what is possible and how much work is required. Sounds like it's something I'll probably avoid for now. Thanks for the API and info about adding special commands! I can't offer much feedback about Mozilla Public License because it's not o

[go-nuts] Failure to build syzkaller in a build chroot

2018-04-29 Thread Theodore Y. Ts'o
Hi, I'm having trouble building syzkaller (which is primarily written in Go) in a Debian schroot for amd64 using qemu emulation. That is, I'm using a chroot filled with arm64 binaries, running them on an x86_64 system using a setup such as described in [1]. The specific chroot I am using can be s

[go-nuts] Goroutines memory leak

2018-04-29 Thread Vadim
I'm have memory leak in this function but i don't know where. func CheckProxySOCKS(prox string, c chan QR) (err error) { //Sending request through proxy dialer, _ := proxy.SOCKS5("tcp", prox, nil, proxy.Direct) timeout := time.Duration(5 * time.Second) httpClient := &http.Client{

AW: [go-nuts] Question about int inside json

2018-04-29 Thread Lutz Horn
Use `int64` instad of `int`. https://play.golang.com/p/j10cDz7z-N0 Von: golang-nuts@googlegroups.com im Auftrag von pick...@kamelos.org Gesendet: Samstag, 28. April 2018 20:04 An: golang-nuts Betreff: [go-nuts] Question about int inside json Hallo all

Re: [go-nuts] Failure to build syzkaller in a build chroot

2018-04-29 Thread Ian Lance Taylor
On Sun, Apr 29, 2018 at 7:12 PM, Theodore Y. Ts'o wrote: > > Hi, I'm having trouble building syzkaller (which is primarily written > in Go) in a Debian schroot for amd64 using qemu emulation. That is, > I'm using a chroot filled with arm64 binaries, running them on an > x86_64 system using a setu

[go-nuts] Goroutines memory leak

2018-04-29 Thread Tamás Gulácsi
Where do you Close the dialer? Why aren't you reusing the httpClient? -- 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. Fo

[go-nuts] Re: Failure to build syzkaller in a build chroot

2018-04-29 Thread 'Dmitry Vyukov' via golang-nuts
Hi Ted, I don't know what's the problem with Go toolchain, maybe Ian's hypothesis is true. But we use cross-compilation for arm64 and arm from Debian Rodete distors and it's working. I cross-compiled executor for arm with arm-linux-gnueabihf-gcc just few days ago. People also recommend Linaro-prov

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Yuval Lifshitz
It seems like go and C++ are doing something different regarding floating point arithmetic, but I cannot say one is better than the other. It is just the that C++ consistently overshoots (hence truncation work), and go consistently undershoots (this is why rounding is needed). For example, in C