[go-nuts] informal proposal: KeepOnError handling for flag package

2025-02-28 Thread Stephen Illingworth
The following is an informal proposal for a new error handling method in the standard flag package. I'm posting it here for a preliminary discussion. If there's any interest in it I'll prepare a more thorough proposal and submit it correctly I am calling this method KeepOnError. KeepOnError i

[go-nuts] Re: inconsistent min max signatures with variadics

2025-01-20 Thread Stephen Illingworth
e the min/max functions use the Generic with the > interface cmp.Ordered but from an "usage point of view", it doesn't seem > "understandable". > > Le lundi 20 janvier 2025 à 16:14:54 UTC+1, Stephen Illingworth a écrit : > >> What value do you think sh

[go-nuts] Re: inconsistent min max signatures with variadics

2025-01-20 Thread Stephen Illingworth
What value do you think should be returned for "max(5, slice)" ? On Monday, 20 January 2025 at 15:00:04 UTC Benoît Marguerie wrote: > Hi, > > Even if the spec precises : > > slice arguments are not permitted > > I wonder if there's any real technical reason to prohibit the use of the > slice var

Re: [go-nuts] Re: runtime/pprof - pausing CPU profiling

2024-11-13 Thread Stephen Illingworth
On Wednesday 13 November 2024 at 12:02:12 UTC Jason E. Aten wrote: > I've tried but this unfortunately, the Start and Stop processes are too expensive and really require writing to a different file for every stop. The nature of the program means I need to do the Start/Stop process 60+ times per

[go-nuts] Re: runtime/pprof - pausing CPU profiling

2024-11-13 Thread Stephen Illingworth
Thank's Jason. These are all good ideas: On Wednesday 13 November 2024 at 02:06:56 UTC Jason E. Aten wrote: Idea 0: Can you just click on the graphviz boxes in the pprof http page for your section and then just show the source for only those? Might give you a quick idea of which are the hottest

Re: [go-nuts] Re: runtime/pprof - pausing CPU profiling

2024-11-13 Thread Stephen Illingworth
On Wednesday 13 November 2024 at 06:05:36 UTC scott beeker wrote: 2. **Start Profiling**: Use `pprof.StartCPUProfile(file)` to start profiling, where `file` is an `os.File` object to write the profile data. 3. **Restrict Profiling**: Place `pprof.StartCPUProfile()` before the code section you w

[go-nuts] runtime/pprof - pausing CPU profiling

2024-11-12 Thread Stephen Illingworth
Hello, I want to create a runtime CPU profile but to restrict the profile to a specific part of the program. I currently have a way of taking a CPU profile for the entire program so have experience with the runtime/pprof package but this is a new requirement for me. The 'section' to be profile

Re: [go-nuts] go test cache: include umask as a test input for caching?

2024-09-17 Thread Stephen Illingworth
If the only problem is that the cache is getting in the way then you can run the tests such that test cache is not used. The idiomatic way is to use -count=1 on the test command line I would do this: go test -count=1 And then: go test On Tuesday 17 September 2024 at 11:25:40 UTC+1 twp...@g

Re: [go-nuts] Modules 'replace' directive

2024-06-18 Thread Stephen Illingworth
On Tuesday 18 June 2024 at 19:33:28 UTC+1 Marcin Romaszewicz wrote: One of your dependencies could, in turn, have a dependency on that third party project. Run "go mod graph" to see what imports what and you should be able to track it down. I thought about that but there's no reference to anyt

[go-nuts] Modules 'replace' directive

2024-06-18 Thread Stephen Illingworth
Hello, What's the correct way to do the following: I'm using a third-party Go module which is no longer under development. I've forked the project in order to apply some patches of my own. I want to use the new version of the module in my project. The following has been added to the go.mod fil

[go-nuts] Re: Congrats to the Go team

2024-04-24 Thread Stephen Illingworth
How does it perform with v1.22.0? I found a small but measurable drop in throughput in one of my projects when compiled with 1.22.0. Issue raised here: https://github.com/golang/go/issues/65647#issuecomment-1944830588 I have a feeling it's an issue with my older development hardware. But it's

[go-nuts] Critical Section - static analysis

2024-04-22 Thread Stephen Illingworth
Hello, I've created a proof-of-concept for a method of defining critical sections. Crucially, the scheme allows for static analysis, thereby helping prevent violations of the critical sections. It's a simple concept but I think it's something that can be built upon. https://github.com/JetSetIlly

[go-nuts] Re: v1.22.0 Performance Issues

2024-02-09 Thread Stephen Illingworth
that this is probably the > result of a compiler change, given that the flat time increases all seem to > come from "user" code (as opposed to, say, runtime code). > > Do you have a reproducer? It might be worth filing a GitHub issue at this > point. (https://github.com/golang/go

[go-nuts] v1.22.0 Performance Issues

2024-02-09 Thread Stephen Illingworth
Hello, I'm trying v1.22.0 and I'm measuring an approximate drop in performance of 10%. I'm comparing to v1.21.7 I'm looking at the release notes but I can't see anything that I would think would be having an impact. Is anyone else noticing a performance drop? I've created a cpu.profile for my

Re: [go-nuts] Go ARM

2023-11-15 Thread Stephen Illingworth
On Wednesday, 15 November 2023 at 21:25:37 UTC Def Ceb wrote: I downloaded and ran `go env` with both the 32-bit and 64-bit Go toolchains from go.dev, and the GOGCCFLAGS results were: Since you're on a newer Raspberry Pi with a 64-bit ARM environment, you should download the 64-bit Go toolchai

Re: [go-nuts] Go ARM

2023-11-15 Thread Stephen Illingworth
nesday, 15 November 2023 at 20:05:59 UTC Jan Mercl wrote: > On Wed, Nov 15, 2023 at 8:30 PM Stephen Illingworth < > stephen.i...@gmail.com> wrote: > > I'm trying to build a project on the Raspberry Pi, natively. > > > > Using "go env" I can see that Go ha

[go-nuts] Go ARM

2023-11-15 Thread Stephen Illingworth
Hello, I'm trying to build a project on the Raspberry Pi, natively. Using "go env" I can see that Go has the following value for GOGCCFLAGS GOGCCFLAGS='-fPIC -marm -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build745518569=/tmp/go-build -gno-record-gcc-switches' However,

Re: [go-nuts] ldflags -X

2023-11-08 Thread Stephen Illingworth
Yes. I agree that it's correct given the general rules. On Wednesday, 8 November 2023 at 15:42:25 UTC Jan Mercl wrote: > On Wed, Nov 8, 2023 at 4:01 PM Stephen Illingworth > wrote: > > > I would have expected the "main.A" string to require the same form. But &g

Re: [go-nuts] ldflags -X

2023-11-08 Thread Stephen Illingworth
I would have expected the "main.A" string to require the same form. But either way, that's the correct solution. Thanks. -- 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

[go-nuts] ldflags -X

2023-11-08 Thread Stephen Illingworth
Hello, I'm trying to use the -X ldflag to set a string at compile time. I can do this successfully if the string is in the main package but it does not work if the string is in a subpackage. For illustration purposes, I have prepared a simple test project https://github.com/JetSetIlly/ldfl

Re: [go-nuts] Re: Help with WASM performance

2023-09-23 Thread Stephen Illingworth
gt; On Saturday, September 23, 2023 at 7:37:13 AM UTC+2 Stephen Illingworth > wrote: > >> Comparison to native speeds is the key attraction of WASM. From the >> go.org blog published 10 days ago: https://go.dev/blog/wasi >> >> "WebAssembly (Wasm) <https://web

Re: [go-nuts] Re: Help with WASM performance

2023-09-22 Thread Stephen Illingworth
;  > > WASM goes through the browser - so it is very different. Are you using > OpenGL or similar? > > On Sep 22, 2023, at 3:44 PM, Stephen Illingworth > wrote: > >  > I'm comparing the results of a program compiled for AMD64 and WASM > architectures. The

Re: [go-nuts] Re: Help with WASM performance

2023-09-22 Thread Stephen Illingworth
gels wrote: > When you say negative performance are you talking about a native app > running directly on the hardware what are you referring to exactly > > On Sep 22, 2023, at 1:03 PM, Stephen Illingworth > wrote: > >  > > I've been thinking some more

[go-nuts] Re: Help with WASM performance

2023-09-22 Thread Stephen Illingworth
ms. I expected a drop in performance but not that much. If anyone can offer any insight or if these figures seem wrong then I'd love to take some advice. Regards Stephen On Saturday, 16 September 2023 at 09:02:34 UTC+1 Stephen Illingworth wrote: > I have tried running it in Firefox and

[go-nuts] Re: Help with WASM performance

2023-09-16 Thread Stephen Illingworth
I have tried running it in Firefox and Chromium. The webserve.sh script in the ebiten_test folder runs a small httpd server to serve up the binary to the browser. On Saturday, 16 September 2023 at 08:45:52 UTC+1 Brian Candler wrote: > What WASM runtime are you using to execute the code? --

[go-nuts] Help with WASM performance

2023-09-15 Thread Stephen Illingworth
Hello, I'm hoping for some help with a Go WASM project I am working on. The project is based on another project of mine, which runs very well and I have no concerns about its performance. The WASM project however performs poorly. The help I need is to determine whether the performance of the WA

Re: [go-nuts] Go Toolchain Management from 1.21.0 onwards

2023-08-16 Thread Stephen Illingworth
On Wednesday, 16 August 2023 at 10:15:50 UTC+1 Christoph Berger wrote: I would assume that GOTOOLCHAIN=local does what you want. The doc says, > When GOTOOLCHAIN is set to local, the go command always runs the bundled Go toolchain. That's the conclusion I came

[go-nuts] Re: Go Toolchain Management from 1.21.0 onwards

2023-08-16 Thread Stephen Illingworth
On Wednesday, 16 August 2023 at 08:47:36 UTC+1 Christoph Berger wrote: Thank you for replying. What prevents you from using the new toolchains mechanism? Nothing really. I suppose it's just that I don't really understand what it is or what it's for. The current method of dealing with the to

[go-nuts] Go Toolchain Management from 1.21.0 onwards

2023-08-14 Thread Stephen Illingworth
With regards to the new Toolchain Management feature introduced in 1.21.0 Currently, my toolchain management is: download the source; compile; set paths to point to the new version. I like this and it works for me. Am I correct in thinking that the environment variable, GOTOOLCHAIN=local, will

Re: [go-nuts] binary.ByteOrder

2023-08-10 Thread Stephen Illingworth
> > -rob > > > > > > > On Thu, Aug 10, 2023 at 8:46 PM Stephen Illingworth < > stephen.i...@gmail.com> wrote: > >> Hello, >> >> I want to detect the implementation of binary.ByteOrder. ie. whether it >> is Little Endian or Big Endian. >

[go-nuts] binary.ByteOrder

2023-08-10 Thread Stephen Illingworth
Hello, I want to detect the implementation of binary.ByteOrder. ie. whether it is Little Endian or Big Endian. Normally, you would do this with a type assertion or a type switch but in the case of the binary package the little/big endian implementations are not exported. The only way that I c

[go-nuts] Re: Error handling

2023-08-01 Thread Stephen Illingworth
On Tuesday, 1 August 2023 at 18:14:56 UTC+1 DrGo wrote: Fair enough. But many would prefer shorter functions if there is no loss to explicitness or clarity. I don't think putting the assignment and return statement on the same line is very clear. I would prefer the compiler to enforce somethi

[go-nuts] Re: Error handling

2023-08-01 Thread Stephen Illingworth
On Tuesday, 1 August 2023 at 18:06:25 UTC+1 DrGo wrote: Compare the following; which one would you prefer to read a lot of? You've asked a fair question so you deserve an honest answer. Looking at the two examples, I would prefer to read the code in the first example. -- You received this m

[go-nuts] Re: error handling thoughts

2023-07-27 Thread Stephen Illingworth
Hi Steve, What's the compiler error that you're seeing? Here's a go playground example of your scenario. It doesn't seem to cause any issues but maybe I'm misunderstanding. https://go.dev/play/p/vvtrQTl7FSr Regards, Stephen On Thursday, 27 July 2023 at 16:04:19 UTC+1 Steve Roth wrote: > The

[go-nuts] Re: testing whether two maps are the same object

2023-07-18 Thread Stephen Illingworth
I like that. I think it's is quite a smart way of doing it, I don't think you need to check both maps when choosing a key. Once you've found a candidate key in one map, you can test the other map and if it *does* exist then the two maps aren't equal. You've then saved the insertion and deletio

[go-nuts] Go Toolchains

2023-06-24 Thread Stephen Illingworth
Hello I'm a little confused by what's being documented for the new "Go toolchain" feature. https://tip.golang.org/doc/toolchain Will this be downloading binaries or will it be downloading the source for the new toolchain and compiling it with the available Go version? Stephen -- You receive

Re: [go-nuts] Detecting race conditions

2023-06-04 Thread Stephen Illingworth
But it does not introduce false positives. It exposes true positives. The race are still there, even if the race detector can not detect them. Note that the race detector is a heuristic. It will never find all race conditions, only the ones encountered in the actual run. This is a great poin

Re: [go-nuts] Re: Windows Binaries and stdout

2022-04-29 Thread Stephen Illingworth
Hello Alex. Thanks for your response. On Fri, Apr 29, 2022 at 9:34 AM brainman wrote: > Once windows executable is built, go has no control over how this program > executes. > > When command line program is executed by clicking in explorer window > Windows automatically starts a new console wind

Re: [go-nuts] atomic.Value : inconsistent types

2021-11-16 Thread Stephen Illingworth
> How about just a 'container' type for the interface. >> >> https://play.golang.org/p/WSXVjVHj1Ya >> > >> For what I need, that does the job nicely. The type being stored in the >> atomic.Value isn't changing so it satisfies the atomic.Value constraints >> but I have the flexibility of the con

Re: [go-nuts] atomic.Value : inconsistent types

2021-11-16 Thread Stephen Illingworth
> I've found that the way around this is to create a new instance of >> atomic.Value whenever I have reason to believe that the type to be stored >> has changed. >> > > That seems to be counter to the idea behind `atomic.Value`. Creating and > setting the new `atomic.Value` requires synchroniz

[go-nuts] atomic.Value : inconsistent types

2021-11-16 Thread Stephen Illingworth
When using atomic.Values it is important that the type being stored is consistent. Trying to store a different type in an atomic.Value will cause a panic panic: sync/atomic: store of inconsistently typed value into Value I've found that the way around this is to create a new instance of atomic

Re: [go-nuts] Re: WASM Performance

2021-09-09 Thread Stephen Illingworth
r the difference? how much? Did he do > the same in the Doom article to get it to OK? > > On 09/07/2021 8:34 AM Stephen Illingworth wrote: > > > Yes. I'm seeing a 10x difference in speed too. So at least I know I'm not > doing anything fundamentally wrong. It'

Re: [go-nuts] Re: WASM Performance

2021-09-07 Thread Stephen Illingworth
Yes. I'm seeing a 10x difference in speed too. So at least I know I'm not doing anything fundamentally wrong. It's a general problem at the moment. Thanks. On Tuesday, 7 September 2021 at 09:31:41 UTC+1 ma...@eliasnaur.com wrote: > In my experience (Gio projects), WASM is very slow compared to

Re: [go-nuts] Re: WASM Performance

2021-09-05 Thread Stephen Illingworth
(Links to screenshots) https://github.com/JetSetIlly/Gopher2600-Utils/blob/master/web2600/Doom_profile.png https://github.com/JetSetIlly/Gopher2600-Utils/blob/master/web2600/Web2600_profile.png On Sunday, 5 September 2021 at 15:13:32 UTC+1 Stephen Illingworth wrote: > Thanks for that, it

Re: [go-nuts] Re: WASM Performance

2021-09-05 Thread Stephen Illingworth
Thanks for that, it was interesting reading. The problem he was describing in the Doom case seems to be have been caused by the WASM program taking up all the CPU time, meaning the browser itself is unresponsive. I've solved that by using a Web Worker. From what I understand requestAnimationFram

Re: [go-nuts] Re: WASM Performance

2021-09-04 Thread Stephen Illingworth
geting the browser has been acceptable, > so you could write an implementation of television.PixelRenderer > backed by ebiten. You could then compile both to native and wasm and > see if there is still a big performance difference? > > HTH > > Arnaud > > On Sat, 4 Sept 2021

Fwd: [go-nuts] Re: WASM Performance

2021-09-04 Thread Stephen Illingworth
I was hoping it was the rendering code that was the problem but I'm almost 100% certain that it isn't. If I just allow the emulation to run without drawing anything to the HTML canvas (and just writing a frame count to the console) the performance is still the same. Good tip about Ebiten though. I

Re: [go-nuts] Re: WASM Performance

2021-09-04 Thread Stephen Illingworth
> > 3) I know nothing about WASM beyond the bare minimum. How can I profile > and understand the compiled WASM binary? Is it possible to use the pprof > tool in some way? > > > On Fri, Sep 3, 2021 at 10:40 AM Stephen Illingworth < > stephen.t@gmail.com> wrote: > &

Re: [go-nuts] Re: WASM Performance

2021-09-03 Thread Stephen Illingworth
, but: 3) I know nothing about WASM beyond the bare minimum. How can I profile and understand the compiled WASM binary? Is it possible to use the pprof tool in some way? On Fri, Sep 3, 2021 at 10:40 AM Stephen Illingworth < stephen.t.illingwo...@gmail.com> wrote: > > > > On Fri,

Re: [go-nuts] Re: WASM Performance

2021-09-03 Thread Stephen Illingworth
On Fri, Sep 3, 2021 at 10:15 AM Brian Candler wrote: > Could you explain a bit more about what you're comparing? > > - Is the wasm version running in a browser? If so, which one? Or have you > got a way to run wasm directly on the host (in which case, what is it)? > Running it in Firefox (78.13.

Re: [go-nuts] Makefiles for Go Programs

2021-08-25 Thread Stephen Illingworth
I use Makefiles with Go projects. For many of the reasons already given but it's especially useful for me for cross compilation to the target platforms at release time. So, when running "make release" I have "test" and "generate" targets as dependencies to make sure I've not missed anything. I

Re: [go-nuts] How to clear current line in terminal

2020-11-16 Thread Stephen Illingworth
This is how I would do it. Note that you must be careful not to insert newlines. If you do, terminal control becomes trickier. package main import "fmt" // ClearLine is the CSI sequence to clear the entire of the current line. const ClearLine = "\033[2K" func main() { // print a string

Re: [go-nuts] Re: Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-09-13 Thread Stephen Illingworth
I've been using the Go bindings for Dear Imgui with great success. https://github.com/inkyblackness/imgui-go On Saturday, 12 September 2020 at 01:05:11 UTC+1 pcha...@pcsw.us wrote: > There is a gtk binding, but I'm not sure if it's fully cross platform. > > https://github.com/gotk3/gotk3 > > On

[go-nuts] Re: Conversion to Complex numbers

2020-03-27 Thread stephen . illingworth
On Friday, 27 March 2020 16:16:18 UTC, Stephen Illingworth wrote: > > > > On Friday, 27 March 2020 15:58:19 UTC, Brian Candler wrote: >> >> On Friday, 27 March 2020 15:42:08 UTC, stephen.i...@gmail.com wrote: >>> >>> // float -> complex >>>

[go-nuts] Re: Conversion to Complex numbers

2020-03-27 Thread stephen . illingworth
On Friday, 27 March 2020 15:58:19 UTC, Brian Candler wrote: > > On Friday, 27 March 2020 15:42:08 UTC, stephen.i...@gmail.com wrote: >> >> // float -> complex >> >> const constFloat = 1 >> >> > Did you mean const constFloat = 1.0 ? > Yes. Results are the same. -- You received this message bec

[go-nuts] Conversion to Complex numbers

2020-03-27 Thread stephen . illingworth
type) n n I wouldn't want to argue too strongly on this point but for consistency, should casting be allowed at all? Regards Stephen Illingworth -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

Re: [go-nuts] Why Discord is switching from Go to Rust

2020-02-08 Thread stephen . illingworth
On Saturday, 8 February 2020 08:38:40 UTC, Eric S. Raymond wrote: > Go, on the other hand...I'm an old > hand from the same culture the Go devs exemplify. > I'm glad somebody else has said that. For me, Kernighan and Pike's involvement was the clinching argument in favour of Go. Coding p

[go-nuts] Re: Go 1.13.4 and Go 1.12.13 are released

2019-11-01 Thread Stephen Illingworth
Build fails here. Using v1.13 to build: go test proxy running at GOPROXY=http://127.0.0.1:41805/mod go proxy: no archive rsc.io v1.5.2: file does not exist go proxy: no archive rsc.io v1.0.0: file does not exist go proxy: no archive rsc.io v1.0.0: file does not exist go proxy: no archive rsc.io v1

[go-nuts] Watches / Data breakpoints

2019-09-26 Thread Stephen Illingworth
all this a "watch" but I believe it's sometimes referred to as a "data breakpoint". I've looked at delve and can't see anything like it. I've had a quick look at VSCode and Goland and I can't see anything there either. Is there anything I've missed