code logs -> 2019 -> Fri, 13 Sep 2019< code.20190912.log - code.20190914.log >
--- Log opened Fri Sep 13 00:00:27 2019
00:17 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
00:33 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Connection closed]
00:55 Degi [Degi@Nightstar-r5vtp9.dyn.telefonica.de] has quit [Connection closed]
00:56 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
01:10
<&[R]>
https://termbin.com/4awa <-- I updated the man function someone here kindly wrote up, I had to adjust the `read` to work in bash, and I fixed the issue where it didn't work if no results were returned
01:30 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has joined #code
01:30 mode/#code [+o himi] by ChanServ
02:25 catalyst [catalyst@Nightstar-5dv16h.cable.virginm.net] has quit [Connection closed]
03:12
<&ToxicFrog>
[R]: what went wrong if no results were returned?
04:29 celticminstrel [celticminst@Nightstar-6an2qt.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
04:38
<&[R]>
https://termbin.com/hs3l <-- that
04:39
<&[R]>
There are two situations where I'd want it to just run man with the args given even though whatis returned no results
04:39
<&[R]>
1) New manpage and mandb simply wasn't run 2) I gave it an absolute or relative path to a manpage outside of /usr/share/man/
04:40
<&[R]>
I could detect and handle #2 but the solution to handling #1 handles #2 as well
05:12 * McMartin spreads The Corruption
05:14 * McMartin is gradually making this code less portable by removing the layers of unnecessary-for-purpose compatibility glue, or workarounds to do 'portably' what the target OS has libraries or even primitives for
05:25 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Connection closed]
05:39 Derakon is now known as Derakon[AFK]
05:49
<&McMartin>
Hrm. A gap in my Linux knowledge.
05:50
<&McMartin>
What's the pre-C11 way to implement atomic increment/compare-and-swap/etc on Linux?
05:50
<&McMartin>
BSD and Windows have OS-level primitives in their C libraries
06:03
<@sshine>
that just happens to be a gap in my Linux knowledge as well.
06:09
<&[R]>
McMartin: pthreads mutexes?
06:20
<&[R]>
Wait atomic
06:36
<&McMartin>
Yeah. gcc has some builtins (two conflicting sets, even!) but I'm looking for the equivalent of std::atomic in C++11 or its equivalents in C11.
06:40
<&[R]>
Oh gods, `grep -RFi atomic /usr/include` was a bad idea with both qt4 and qt5 installed
06:41
<&McMartin>
FINAL ATOMIC BUSTER
06:42
<&McMartin>
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html is what I've found so far
06:44
<&[R]>
Yeah, I don't know
06:44
<&[R]>
glib and llvm both provide some atomic stuff
06:44
<&McMartin>
But that's not something *Linux* provides, not the way BSD has libkern/OSAtomic.h and Windows has InterlockedCompareExchange.
06:44
<&[R]>
(note: that's glib without the c)
06:44 * McMartin nods
06:45
<&McMartin>
Maybe it *does* just rely on compiler intrinsics to emit the necessary asm code.
06:47
<&[R]>
oldfstat(2) 1.0
06:47
<&[R]>
oldlstat(2) 1.0
06:47
<&[R]>
oldolduname(2) 1.0
06:47
<&[R]>
oldstat(2) 1.0
06:47
<&[R]>
... from `man syscalls`
06:48
<&McMartin>
Gotta keep that ABI compat
06:48
<&[R]>
Uhh
06:48
<&[R]>
You know this is Linux right?
06:48
<&[R]>
Or is that just kernel modules?
06:49 * McMartin shrugs
06:49
<&[R]>
I parsed `renameat` as `rename meat`
06:49
<&[R]>
Took a bit
06:49
<&McMartin>
I do recall that Arch ran into chicken and egg problems with kernels and glibc (did it ever transcend that?) but this is also one of the few places where people will actually care
06:49
<&McMartin>
Because it will break their asm sources that call int 0x80 directly =P
06:52
<&[R]>
I don't see any syscall that'd suggest atomic operations
06:52
<&McMartin>
Oh yeah, it would definitely need to not be a syscall per se
06:52
<&McMartin>
The whole point of these atomic routines is that they don't incur the cost of a context switch.
06:54
<&[R]>
Right, the only library you can count on being available on Linux is libc if you're not using syscalls. glibc is *likely* to be your libc, but musl's getting pretty popular.
06:54
<&[R]>
So I'd probably troll the glibc documentation
06:59
<&McMartin>
musl is still targeted by gcc, right?
06:59
<&McMartin>
The thing about compiler intrinsics is that they usually don't even turn into function calls.
07:00
<&McMartin>
So if it can assume gcc (or llvm cloning the gcc intrinsics or having its own) then it can use the intrinsics in lieu of inline assembler for lockfree atomic increment and the like.
07:03
<&[R]>
That's fair, does mean that you're locked to using one compiler on that one platform though
07:03
<&[R]>
And there's at least four compilers that work on Linux
07:10 * McMartin nods
07:10
<&McMartin>
And as I noted in passing when I kicked this off
07:10
<&McMartin>
If you've actually got C11 support in your weird side compiler that means you *have* atomics because they're part of C11's additions to the standard.
07:43 Vorntastic [uid293981@Nightstar-2dc.p8m.184.192.IP] has joined #code
07:43 mode/#code [+qo Vorntastic Vorntastic] by ChanServ
08:30 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
08:30 mode/#code [+o himi] by ChanServ
10:52 Kindamoody[zZz] is now known as Kindamoody
10:55
< Yossarian>
Things suck.
11:14
<&ToxicFrog>
[R]: Aah. At least part of that is down to differences between zsh and bash read; I wouldn't have expected the zsh version I posted to work at all, really.
11:54 catalyst [catalyst@Nightstar-5dv16h.cable.virginm.net] has joined #code
12:04 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
12:05 Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
12:52 celticminstrel [celticminst@Nightstar-6an2qt.dsl.bell.ca] has joined #code
12:52 mode/#code [+o celticminstrel] by ChanServ
13:43 celticminstrel is now known as celmin|aqway
13:43 celmin|aqway is now known as celmin|away
14:28
<&jerith>
Ugh. While trying to fix brokenness in hugo (because I'm procrastinating on my blogging) I rediscovered Go's "feature" that you can create structs without filling in all the fields.
15:00 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
15:00 mode/#code [+qo Vornicus Vornicus] by ChanServ
15:14
<@sshine>
You can do that with Haskell records, too, when using the RecordWildCards pragma.
15:14
<@sshine>
it's kinda dangerous, because if you leave out ones, they're undefined and will crash at runtime if addressed.
15:14
<&jerith>
Yeah.
15:15
<@sshine>
I don't know if Go's structs will initialize them to some default value?
15:15
<&jerith>
I discovered this because I wanted to add a field to a struct and have the compiler tell me which things needed to be updated.
15:16
<&jerith>
Go uses the field type's "zero" value.
16:06 Pinkhair [user1@Nightstar-g7hdo5.dyn.optonline.net] has joined #code
16:07 Pink [user1@Nightstar-g7hdo5.dyn.optonline.net] has quit [Ping timeout: 121 seconds]
16:32 Vorntastic [uid293981@Nightstar-2dc.p8m.184.192.IP] has quit [[NS] Quit: Connection closed for inactivity]
17:13 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
17:47 catalyst [catalyst@Nightstar-5dv16h.cable.virginm.net] has quit [Connection closed]
17:53
<&jeroud>
I have to say, I'm not a huge fan of the Go community's general response to comments about how their language could be improved.
17:54
<~Vornicus>
which is to say "no it's perfect fuck you"?
17:54
<&jeroud>
Not quite that far.
17:56
<&jeroud>
But instead of any discussion about why struct creation works the way it does or what could be done to improve things, there's "use a factory function *close issue*".
17:58
<&jeroud>
There are workarounds using annotations and reflection for things like json and protobuf serializers, so presumably the problem is known to be a problem.
18:05
<&jeroud>
In general, they suggest working around language deficiencies with hacks and patterns that require programmer discipline and cognitive overhead.
18:36
<&[R]>
Heh
18:37
<&[R]>
When I emailed xs' creator about my strugles with some of the syntax (kind of wanting some features added to the language, like hash-tables) his reponse was basically "learn lisp"
18:37
<&[R]>
Also I learned that not all hook functions were meant to be replaced/used
18:43 Derakon[AFK] is now known as Derakon
18:59
<&jeroud>
xs the perl FFI thing?
18:59
<~Vornicus>
xs the shell thing
19:00
<~Vornicus>
https://github.com/TieDyedDevil/XS this guy I presume
19:13
<&[R]>
Yes
19:32
<&jeroud>
Ah. It's rather a difficult thing to search for.
19:33
<&[R]>
It's a little obscure
19:33
<&[R]>
I've mentioned it a few times here though
19:41
<&jeroud>
Nah, the results are all full of iPhones and XSD.
19:58 gnolam [lenin@Nightstar-e3tf4i.priv.bahnhof.se] has quit [[NS] Quit: Reboot]
20:00 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection closed]
20:01 gnolam [lenin@Nightstar-e3tf4i.priv.bahnhof.se] has joined #code
20:01 mode/#code [+o gnolam] by ChanServ
20:32 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
22:13 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
22:13 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
22:47 Kindamoody is now known as Kindamoody[zZz]
22:57 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
--- Log closed Sat Sep 14 00:00:28 2019
code logs -> 2019 -> Fri, 13 Sep 2019< code.20190912.log - code.20190914.log >

[ Latest log file ]