Re: [go-nuts] Re: 'go run hello.go' taking ~30 seconds on windows

2024-03-20 Thread Larry Clapp
I found this webpage from MS which talks about configuring Windows Defender. https://support.microsoft.com/en-us/windows/turn-off-defender-antivirus-protection-in-windows-security-99e6004f-c54c-8509-773c-a4d776b77960 I'm running a Windows 10 VM via VirtualBox on a MacBookPro. I have my $HOME

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread 'Axel Wagner' via golang-nuts
FWIW I believe (as Brian sort of points out) this proposal is fully subsumed under #57644 . Under that proposal, the proposed type `int | nil` would be spelled `interface{ int }`. The other syntactical constructs are, as far as I can tell, identical -

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
On Wednesday, March 20, 2024 at 5:47:00 AM UTC-4 Brian Candler wrote: If you change fundamental things like this in the language, then you'll suggesting turning Go into something that looks like Rust. In which case, you may as well just use Rust. Agreed. Which is why I was asking if using

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
On Wednesday, March 20, 2024 at 5:31:08 AM UTC-4 Brian Candler wrote: It's in the very first post that opened this thread, under the heading "## Summary". I did in-fact miss it. Thank you for pointing to it. -Mike -- You received this message because you are subscribed to the Google

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread 'Brian Candler' via golang-nuts
I got the impression the proposal was motivated by scalars that did not currently allow `nil` values Under the heading "Alternatives and why they're bad" he describes some ways this is currently dealt with - such as the common idiom of returning or passing a pointer to a value, instead of a

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread 'Brian Candler' via golang-nuts
On Wednesday 20 March 2024 at 09:01:43 UTC Mike Schinkel wrote: Your comments made me go back and read the whole thing, but I was unable to find a list of enumerated objectives, and I did not find the text you quoted. Did I miss it somehow? It's in the very first post that opened this

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
On Wednesday, March 20, 2024 at 4:14:27 AM UTC-4 Brian Candler wrote: When you say "var x NillableUint8" then you've just declared a variable of an interface type, and interface types are already nilable, so there's no need for "| nil" in the type! Well, I was thinking of 1.) explicitness

Re: [go-nuts] Using new variable or updating existing variable in a loop

2024-03-20 Thread Mohamad Rostami
Thanks @kurtis, I actually have both functions without fmt print function, so no allocation is happening. I also did compare assembly codes with your command, and can confirm both are equal. go 1.21.0 darwin/arm64 On Tuesday, March 19, 2024 at 11:20:03 PM UTC+1 Kurtis Rader wrote: >

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread 'Brian Candler' via golang-nuts
When you say "var x NillableUint8" then you've just declared a variable of an interface type, and interface types are already nilable, so there's no need for "| nil" in the type! https://go.dev/play/p/f54akG65qJ3 https://go.dev/play/p/Jmtlta0h9m9 // generic version It's a perfectly valid way

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
> On Mar 19, 2024, at 2:43 PM, Daniel Lepage wrote: > > I'm not proposing that *any* value be made nillable, I'm proposing the > explicit syntax > > var x uint8 | nil > > that would create a nillable uint8. A variable of type `byte` would still > only take up one byte; a variable of type