[go-nuts] GC hint for collection timing

2025-02-26 Thread will....@gmail.com
I recently recalled that someone in the Go Team—I forget who—said that the Go compiler slowed down a lot after converting from C to Go because the Go GC was freeing a lot of memory that the C code wasn't. I wonder if an approach like that of memory regions (https://github.com/golang/go/discussi

[go-nuts] serializations that support generics?

2025-02-26 Thread Jason E. Aten
Are there serialization formats that support Go generics? I'd like to take a look at how they do it, if they exist. I'm wondering: Do they use reflection at runtime? and/or: Do they parse the source looking for template instantiations at go:generate time to codegen for all possible instantiatio

[go-nuts] Re: Is there a pure Go implementation for the Hypergeometric function?

2025-02-26 Thread awaw...@gmail.com
I have submitted a pull request to gonum providing an implementation based on Cephes. This implementation passes tests from both R's hypergeo and Python's scipy. On Tuesday, 25 February 2025 at 20:41:04 UTC+8 Jason E. Aten wrote: > I'm not aware of one;

Re: [go-nuts] Re: Exposing newcoro/coroswitch

2025-02-26 Thread Ian Lance Taylor
On Wed, Feb 26, 2025 at 2:18 AM Nuno Cruces wrote: > > On Tuesday 25 February 2025 at 18:15:40 UTC Ian Lance Taylor wrote: > > I think what you're presenting is an argument for > > package iter > > // Push returns an iterator, a yield function, and a stop function. > // The iterator will return al

Re: [go-nuts] Re: Exposing newcoro/coroswitch

2025-02-26 Thread Nuno Cruces
Assuming I'm not wrong, this is my updated proposal: package iter // Push takes a consumer function, and returns a yield and a stop function. // It arranges for the consumer to be called with a Seq iterator. // The iterator will return all the values passed to the yield function. // The iterator

Re: [go-nuts] Re: Exposing newcoro/coroswitch

2025-02-26 Thread Nuno Cruces
Hi Ian, On Tuesday 25 February 2025 at 18:15:40 UTC Ian Lance Taylor wrote: I think what you're presenting is an argument for package iter // Push returns an iterator, a yield function, and a stop function. // The iterator will return all the values passed to the yield function. // The iter

Re: [go-nuts] Re: Exposing newcoro/coroswitch

2025-02-26 Thread Nuno Cruces
Hi Andrew. My personal goal here is exclusively to support aggregate functions, which in SQLite terms actually have `Step(V)` and `Final() R` callbacks (rather than `Step(V)` and `Value() R`), because those semantics more closely match iterators and `iter.Seq`. I have a different interface for