!ydIAqzRPCpqoMWmoMi:matrix.org

Golang

316 Members
The Go programming language58 Servers

Load older messages


SenderMessageTime
14 Apr 2021
@xaionaro-guest:matrix.dx.centerDmitrii Okunev (at work)Here's the gopanic function: https://github.com/golang/go/blob/master/src/runtime/panic.go#L95119:16:49
@diamondburned:matrix.orgdiamondburned276ns/op is pretty fast, actually19:17:04
@diamondburned:matrix.orgdiamondburnedI still would never do this, but that was a lot less than I expected19:17:16
@diamondburned:matrix.orgdiamondburnedI was expecting a number around 20000ns/op19:17:30
@discordian:matrix.thedisco.zoneDiscordian They made it way faster recently 19:22:29
@discordian:matrix.thedisco.zoneDiscordianMaybe the errors.New should be inside the loop19:23:35
@diamondburned:matrix.orgdiamondburnedmaking global the errors.New thing is pretty common19:23:57
@diamondburned:matrix.orgdiamondburnedpeople probably just don't do it because it's effort, like me19:24:04
@diamondburned:matrix.orgdiamondburnedyou should add errors.Wrap/fmt.Errorf %w though, that'd be interesting19:24:21
@xaionaro-guest:matrix.dx.centerDmitrii Okunev (at work)
In reply to @diamondburned:matrix.org
you should add errors.Wrap/fmt.Errorf %w though, that'd be interesting
I prefer to avoid fmt.Errorf in places where performance is really important.
19:46:42
@xaionaro-guest:matrix.dx.centerDmitrii Okunev (at work)
In reply to @xaionaro-guest:matrix.dx.center
Here's the gopanic function: https://github.com/golang/go/blob/master/src/runtime/panic.go#L951
Added one more experiment: what if there's a stack of 100 calls between panic and recover. In this case it takes 3300ns against 700ns.
20:11:20
15 Apr 2021
@moritz:moritz.shMoritz joined the room.06:41:17
@moritz:moritz.shMoritzquestion: has anyone had an actual use for full unicode support apart from deliberately cursed code like this: https://github.com/Ta180m/Idiot-Code-Golf/blob/main/gcd/gcd.go ?06:42:06
@moritz:moritz.shMoritz * question: has anyone had an actual use for full unicode support apart from deliberately cursed code like this: https://github.com/Ta180m/Idiot-Code-Golf/blob/main/gcd/gcd.go ?06:42:27
@diamondburned:matrix.orgdiamondburnedyeah, some math codes use mathematical symbols in Unicode06:45:56
@diamondburned:matrix.orgdiamondburnedGo also uses middot internally to delimit package name and function/type names in symbols afaik06:46:15
@moritz:moritz.shMoritzi can get behind the latter, but the first seems to make mathematician code even harder to read and understand06:47:07
@diamondburned:matrix.orgdiamondburnedmath is already full of symbols anyway06:48:04
@diamondburned:matrix.orgdiamondburnedyou should've seen the stuff that formal proof people write06:48:33
@moritz:moritz.shMoritz I have… that's why I am strongly in favour of union over 06:49:38
@xaionaro-guest:matrix.dx.centerDmitrii Okunev (at work)
In reply to @moritz:moritz.sh
question: has anyone had an actual use for full unicode support apart from deliberately cursed code like this: https://github.com/Ta180m/Idiot-Code-Golf/blob/main/gcd/gcd.go ?
Code could be obfuscated and without unicode. If a programmer wants to obfuscate then you won't stop them.
09:39:14
@moritz:moritz.shMoritzsure, but obfuscation in a compiled languages isn't that useful, right?09:41:55
@xaionaro-guest:matrix.dx.centerDmitrii Okunev (at work)
In reply to @moritz:moritz.sh
sure, but obfuscation in a compiled languages isn't that useful, right?
Somebody may find it fun. Moreover there are obfuscation contests with prizes, where people use C.
09:45:31
@pcrandall:matrix.orgPhillip Crandall joined the room.10:32:04
16 Apr 2021
@01010011e:matrix.org@01010011e:matrix.org joined the room.13:45:21
@01010011e:matrix.org@01010011e:matrix.org joined the room.13:47:09
@01010011e:matrix.org@01010011e:matrix.org joined the room.13:48:35
@01010011e:matrix.org@01010011e:matrix.org joined the room.13:48:37
@01010011e:matrix.org@01010011e:matrix.org left the room.13:48:37
@ryya79:matrix.orgnil joined the room.19:32:20

There are no newer messages yet.


Back to Room List