[go-nuts] Re: Can a lambda passed to other functions be inlined by a Go compiler?

2023-10-25 Thread 'drc...@google.com' via golang-nuts
The short answer is yes, but not in this example. In your example the inline doesn't happen because `foo` is (barely) too complex so it is not inlined and the closure remains a parameter: ``` go build -gcflags=-m=2 main.go # command-line-arguments ./main.go:3:6: cannot inline foo: function too

Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-26 Thread 'drc...@google.com' via golang-nuts
"Vote with YOUR feet, not MY feet". On Monday, June 26, 2023 at 12:56:12 PM UTC-4 Thomas Bushnell BSG wrote: > I mean, this is mostly true, except that the protesters do have the right > to administer the subreddit in the way they choose, as long as they are the > admins. > > As you said, if

Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-26 Thread 'drc...@google.com' via golang-nuts
Have you considered moving to another platform, either Lemmy or Kbin? (He says, not having completed his own move of the benchmarking bot to botsin.space). On Saturday, June 24, 2023 at 1:51:10 PM UTC-4 Robert Engels wrote: > I’m fairly certain Reddit will license those tools for moderators use.

Re: [go-nuts] Redfining loop variable semantics - what's the plan?

2023-04-05 Thread 'drc...@google.com' via golang-nuts
Based on studying large bodies of existing code, you should be about 25x more scared right now that there's an undetected bug in your code from the existing semantics -- especially if you haven't written many tests. If this change does cause a failure in existing code, we have a tool to help

Re: [go-nuts] Redfining loop variable semantics - what's the plan?

2023-04-03 Thread 'drc...@google.com' via golang-nuts
And if there is a problem, let us know. Probably around the time 1.21 is released we should write up "how to debug this problem if you see it" but we've been working on the tools to automate the search if/when such a bug appears. On Saturday, March 25, 2023 at 10:12:43 AM UTC-4 Eli Bendersky

[go-nuts] Re: Building Go 1.21 for openbsd/386

2023-02-28 Thread 'drc...@google.com' via golang-nuts
Try also GOMAXPROCS=1 ? At some point not too long ago we made that dial down the concurrency in the compiler (before, it would do concurrent builds/compiles anyway) and that should reduce the maximum footprint. On Wednesday, February 22, 2023 at 1:42:56 PM UTC-5 Jan Mercl wrote: > The subject

Re: [go-nuts] Re: Upgradable RLock

2023-02-13 Thread 'drc...@google.com' via golang-nuts
Could you use an applicative data structure? (e.g., a balanced binary tree where you allocate a new spine for each insertion/deletion) That has log N overhead to read, log N storage allocated per write, but I think if you CAS the writes, the reads can proceed with a lightweight barrier. On

[go-nuts] Re: App Engine hasn't upgraded beyond Go 1.16, which is now out of security window

2022-12-19 Thread 'drc...@google.com' via golang-nuts
I just checked with my personal app engine project ("gcloud app deploy", that's app engine, I think), and with 1.19 specified in go.mod and "runtime: 119" in app.yaml, the app reported runtime.Version() of 1.19.3. My understanding is this is a recent change. On Thursday, December 15, 2022 at

Re: [go-nuts] Golang 1.19+ preemption model on a preemptive linux kernel?

2022-12-07 Thread 'drc...@google.com' via golang-nuts
>From the POV of not-runtime-code, preemption can happen anywhere. Certainly with GOMAXPROCS > 1, there is OS preemption, and Go's default goroutine preemption is now potentially preemptive in most parts of non-runtime functions. On Monday, December 5, 2022 at 7:12:54 PM UTC-5

Re: [go-nuts] Is there any way to force Go to call asm function using register-based arguments?

2022-03-08 Thread 'drc...@google.com' via golang-nuts
You could use build tags to write a portable implementation and a (very) version-specific implementation. E.g. //go:build go1.18 && !go1.19 // go1.18-specific and //go:build (go1.8 && !go1.18) || go1.19 // not go1.18 We have ideas about changing the ABI in the future -- possible changes include

Re: [go-nuts] Does GC pause affect non-go threads spawned by CGo?

2021-10-27 Thread 'drc...@google.com' via golang-nuts
The pause also tends to not be large. Except for bugs (which do exist and some of them are hard to fix) the goal on a modern fast processor is under 100 microseconds of a thread "pausing". There is a period of time where goroutines will make reduced progress as the garbage collector steals

Re: [go-nuts] use delve to debug golang with 'next' will skip some step

2021-07-28 Thread 'drc...@google.com' via golang-nuts
That debugging is (now) in the runtime package, which is (always) compiled with optimizations on. That will tend to interfere with debugging. The 1.17 change to use registers for passing parameters has also caused some regressions in debugging quality (and it would be nice to fix those, but it

Re: [go-nuts] Warning for look alike Unicode characters

2021-06-14 Thread 'drc...@google.com' via golang-nuts
I was going to ask, "how do they define/measure that?", decided to look at the Rust code, and found http://www.unicode.org/Public/security/10.0.0/confusables.txt So there's a defined source and everything. On Friday, June 11, 2021 at 5:48:05 PM UTC-4 Ian Lance Taylor wrote: > On Fri, Jun 11,

[go-nuts] Re: Table-driven benchmarks defeat inlining

2021-06-08 Thread 'drc...@google.com' via golang-nuts
On Sunday, June 6, 2021 at 8:35:02 AM UTC-4 Paul S. R. Chisholm wrote: > For example, could this code: > > func BenchmarkPopCountAlive(b *testing.B) { > sum = 0 > for i := 0; i < b.N; i++ { > sum += PopCount(0x1234567890abcdef) > } > } > > hypothetically be optimized to: > >

[go-nuts] Re: meaning of SSA operation

2021-03-24 Thread 'drc...@google.com' via golang-nuts
Also, be aware that work that we really hope lands in 1.17 will tinker with all the call operations. The goal is to switch to an ABI that passes parameters to/from calls in registers, and the way that ends up expressed in SSA is that first (and we do this part in 1.16) the parameters to the

Re: [go-nuts] insane idea to eliminate CGO latency

2021-03-15 Thread 'drc...@google.com' via golang-nuts
Go "cares" because in Go it's common for a single OS thread to correspond to 25-100% of runnable goroutines. So the accounting for "how many OS threads are available to run goroutines" tends to be fine-grained, otherwise weird failure-to-schedule bugs can occur. It's likely it could be

Re: [go-nuts] Why not use F in generic?

2020-06-22 Thread 'drc...@google.com' via golang-nuts
We could regard the function as a method on the type(s), maybe? Not sure if this is a good idea or not, especially since we don't have multimethods (methods applied to multiple values) for ordinary values. On Monday, June 22, 2020 at 1:53:56 PM UTC-4 Ian Lance Taylor wrote: > On Mon, Jun 22,

Re: [go-nuts] Bound checks elimination hint.

2020-02-27 Thread 'drc...@google.com' via golang-nuts
FYI, strided iteration is something we're trying to do better but this is very tricky code, and it is also possible for it to get very expensive at compile time. On Saturday, February 22, 2020 at 4:42:03 PM UTC-5 Nigel Tao wrote: > On 2/23/20, Bruno Albuquerque wrote: > > Would adding an

[go-nuts] Re: Is it possible to get code coverage information in a way that does not assume you can see color?

2020-01-22 Thread 'drc...@google.com' via golang-nuts
Different, new bug instead: https://github.com/golang/go/issues/36685 On Tuesday, January 21, 2020 at 4:33:00 PM UTC-5 drc...@google.com wrote: > I reopened an old bug for this, and perhaps it will get some attention. > https://github.com/golang/go/issues/6623 > > On Sunday, January 12, 2020 at

[go-nuts] Re: Is it possible to get code coverage information in a way that does not assume you can see color?

2020-01-21 Thread 'drc...@google.com' via golang-nuts
I reopened an old bug for this, and perhaps it will get some attention. https://github.com/golang/go/issues/6623 On Sunday, January 12, 2020 at 1:19:59 AM UTC-5 Fazlul Shahriar wrote: > I also wrote a tool like that: https://github.com/fhs/golinecov > It displays coverage report from 'go test'