[go-nuts] Re: Local variable escapes to heap

2020-11-21 Thread jfcg...@gmail.com
Hi, I have the following: package myf func F1(x *int, ch chan bool) { *x += 1 ch <- false } func F2() { var x int ch := make(chan bool) // or with buffer go F1(&x, ch) <-ch } I get this when I build with go 1.15.5 via go build -gcflags '-m -m' : 3:6: can inline F1 with

Re: [go-nuts] Re: Local variable escapes to heap

2020-11-21 Thread jfcg...@gmail.com
es to heap and I want to get rid of it with something like *go:local* :) On Saturday, November 21, 2020 at 5:10:46 PM UTC+3 Ian Lance Taylor wrote: > On Sat, Nov 21, 2020 at 12:11 AM jfcg...@gmail.com > wrote: > > > > I have the following: > > > > package myf > &

Re: [go-nuts] Re: Local variable escapes to heap

2020-11-23 Thread jfcg...@gmail.com
"go style" is > that it should be easy to read and understand. > > I'm not saying that there is no benefit to adding something like go:local, > just that the bar would be very, very high in my opinion. > > On Saturday, November 21, 2020 at 10:26:16 AM UTC-5

[go-nuts] Re: Go 1.17 is released

2021-08-18 Thread jfcg...@gmail.com
Hi, I benchmarked sorty v1.0.18 on an old laptop with Core i5-4210M CPU & Manjaro Linux, between Go 1.16.7 and 1.17 (o for optimization flags, in seconds): *16**16o* *17**17o* Sorting uint32 sort.Slice|17.25|16.03|14.95|14.00 sorty-1| 6.6

[go-nuts] Re: Creating a MQTT library

2021-09-22 Thread jfcg...@gmail.com
Did you take a look at: https://github.com/eclipse/paho.mqtt.golang https://github.com/eclipse/paho.golang On Friday, September 17, 2021 at 12:17:14 AM UTC+3 yba...@gmail.com wrote: > Hello everyone, > > I am trying to design a new library to encode/decode MQTT messages. I > began the work, and

[go-nuts] Re: [ANN] sorty

2021-10-04 Thread jfcg...@gmail.com
rday, May 9, 2020 at 1:53:40 PM UTC+3 jfcg...@gmail.com wrote: > Hello, > > sorty <https://github.com/jfcg/sorty> v1.0 was released with: > > - Concurrent dual partitioning (for initial long ranges) > - Median-of-5 / 9 pivotting with scheduling > - Sub-range assistive pivot

[go-nuts] Re: [ANN] sorty

2021-10-24 Thread jfcg...@gmail.com
Hi, sorty v2.0 <https://pkg.go.dev/github.com/jfcg/sorty/v2> has been released with greatly simplified API. It is now possible to sort same underlying native slices (like []int, []MyInt or IntSlice) without a cast. Best.. On Tuesday, October 5, 2021 at 12:52:04 AM UTC+3 jfcg...@gma

[go-nuts] Average of two strings

2021-11-01 Thread jfcg...@gmail.com
Hi, I wrote MeanStr(s1,s2) to calculate lexicographic average of two strings. It works fine with ascii strings but I want to get feedback on general (utf-8) inputs. It should satisfy: - a good average of two inputs (in some context): For mos

[go-nuts] Re: List embedded dependencies in a Go binary

2021-11-03 Thread jfcg...@gmail.com
try "go version -m" On Tuesday, November 2, 2021 at 8:18:15 PM UTC+3 Michel Casabianca wrote: > Hi gophers, > > I would like to know which dependencies are embedded in generated Go > binary, along with their version. I though at first that they were listed > in *go.sum* file, but it seems that

[go-nuts] Average of two integers

2021-11-03 Thread jfcg...@gmail.com
lso added Mean*() for 32/64 bit signed/unsigned integers with comprehensive tests to sixb <https://github.com/jfcg/sixb> v1.3.0. Let me know if you identify an input that breaks any of these functions. Cheers.. On Monday, November 1, 2021 at 8:47:03 PM UTC+3 jfcg...@gmail.com wrote: > Hi, &

[go-nuts] Generics: Self Referencing Constraint Types

2022-04-07 Thread jfcg...@gmail.com
Hi, please take a look . The aim is to write a HaveLess constraint that will work with any type like Large, without any reflection / traditional interfaces / dictionaries etc., just plain method calls. How would you write this? Keep in mind that type Large is

Re: [go-nuts] Generics: Self Referencing Constraint Types

2022-04-07 Thread jfcg...@gmail.com
> > If you are willing to require a pointer receiver, you can do constraint > type inference: > https://go.dev/play/p/L2NiAAM8qE4 > A single cast worked nicely , thank you. -- You received this message because you are subscribed to the Google Groups "golang

[go-nuts] jfcg/rng: compact, fast, sponge-based random number generator

2022-05-13 Thread jfcg...@gmail.com
Hi, jfcg/rng v0.7.0 is just released. It has the following advantages (std=math/rand, alt=golang.org/x/exp/rand): Effective Entropy (hidden information, in bits): rng: 128 std: 31 alt: 64 Used memory (in bytes): rng: 24 std: 4920 alt: 48 Benchmarks: goos: linux g

[go-nuts] Re: jfcg/rng: compact, fast, sponge-based random number generator

2022-06-21 Thread jfcg...@gmail.com
Hi, jfcg/rng <https://github.com/jfcg/rng> v1.0 has just been released. Let me know what you think. Cheers.. On Saturday, May 14, 2022 at 2:55:41 AM UTC+3 jfcg...@gmail.com wrote: > Hi, > > jfcg/rng <https://github.com/jfcg/rng/> v0.7.0 is just released. It has >

[go-nuts] Re: [ANN] sorty

2023-02-10 Thread jfcg...@gmail.com
cast. > > Best.. > > On Tuesday, October 5, 2021 at 12:52:04 AM UTC+3 jfcg...@gmail.com wrote: > >> Hi all, >> >> I've released sorty <https://github.com/jfcg/sorty> v1.2. Now it >> natively sorts [][]byte, []float32, []float64, []int, []int32, []int