--- Log opened Tue Feb 27 00:00:24 2018 |
00:04 | | Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds] |
00:11 | | Kindamoody is now known as Kindamoody[zZz] |
00:19 | | VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code |
00:19 | | mode/#code [+ao VirusJTG VirusJTG] by ChanServ |
00:31 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
00:31 | | mode/#code [+o mac] by ChanServ |
00:34 | | macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
00:54 | | Derakon[AFK] is now known as Derakon |
00:57 | | celticminstrel [celticminst@Nightstar-gil1m1.dsl.bell.ca] has joined #code |
00:57 | | mode/#code [+o celticminstrel] by ChanServ |
01:05 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
01:05 | | mode/#code [+o macdjord|slep] by ChanServ |
01:09 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
01:11 | | RchrdB [RchrdB@Nightstar-qe9.aug.187.81.IP] has quit [[NS] Quit: Leaving] |
01:23 | | Jessikat [Jessikat@Nightstar-rpoh7s.dab.02.net] has joined #code |
01:24 | | Jessikat` [Jessikat@Nightstar-up8rgv.dab.02.net] has joined #code |
01:27 | | Jessikat [Jessikat@Nightstar-rpoh7s.dab.02.net] has quit [Ping timeout: 121 seconds] |
02:06 | | Jessikat` [Jessikat@Nightstar-up8rgv.dab.02.net] has quit [Ping timeout: 121 seconds] |
02:12 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
02:12 | | mode/#code [+o mac] by ChanServ |
02:15 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
02:43 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [[NS] Quit: Fixing terminal] |
02:43 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code |
02:43 | | mode/#code [+ao McMartin McMartin] by ChanServ |
03:54 | <&McMartin> | More Genesis/Mega Drive shenanigans: https://bumbershootsoft.wordpress.com/2018/02/27/genesis-graphical-basics/ |
03:57 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
03:57 | | mode/#code [+o macdjord|slep] by ChanServ |
04:01 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
04:35 | <&McMartin> | I enjoyed this thread: https://twitter.com/capnramses/status/967746184919044096 |
04:39 | <@celticminstrel> | Heh. |
04:40 | | * celticminstrel has been contemplating whether it'd be worth obtaining/playing certain old games of that era, like FF1-4, Phantasy Star 1-4, Ys 1-2. |
04:41 | <@celticminstrel> | Oh yeah, on another note, I found this article recently and found it quite interesting and ( <_< ) relevant to my interests. https://www.chiark.greenend.org.uk/~sgtatham/mp/ |
04:43 | <@celticminstrel> | (I hadn't even thought of abusing goto in my own forays into custom control structures. I did create a type that evaluates to true once, then false thereafter, for using when you want a for-loop that just introduces a variable without actually looping.) |
04:45 | <@celticminstrel> | (But it turns out you can get this effect even in pure C! Assuming it allows you to declare variables in a for-loop.) |
04:53 | <@celticminstrel> | (Which just means C99 or later.) |
04:56 | <&McMartin> | (You can do it without C99, even if you're willing to just stick in bare braces to define subscopes.) |
04:57 | <&McMartin> | A lot of "abuses of goto" or even abuses of *gosub* are just traditionally structured code run through a peephole optimizer. |
04:57 | <@celticminstrel> | (I don't think that'd work in the context of defining custom control structures though? Or maybe it would, I haven't really thought that hard about it." |
04:57 | <@celticminstrel> | ^) |
04:57 | <@celticminstrel> | What do you mean by "gosub"? |
04:58 | <&McMartin> | Well, there's fun trick where you need to do something twice, so you write a sub function to do it, taking some arg |
04:58 | <&McMartin> | Then you write code like set-arg-1; jsr do-stuff; set-arg-2; |
04:59 | <&McMartin> | And then don't return, letting the program counter spill down into the next function... which is do_stuff. |
04:59 | <@celticminstrel> | Sounds confusing... |
04:59 | <&McMartin> | But that's looking at what should be adter set-arg-2, which is "jsr do-stuff; rts" |
04:59 | <&McMartin> | And then saying "wait, jsr do-stuff; rts is just jmp do-stuff" |
05:00 | <&McMartin> | And then saying "wait, this is a jmp statement to *the next statement*, it's a no-op, begone" |
05:02 | <&McMartin> | Let me see if I can find a routine my archives where I do it for an actual reason |
05:05 | <&McMartin> | Here we go. The Printhex routine: https://github.com/michaelcmartin/bumbershoot/blob/master/dos/sound/blastwow.asm#L83 |
05:05 | <&McMartin> | I've got three functions, for printing 16, 8, and 4 bit numbers as hex. |
05:06 | <&McMartin> | Each is implemented by calling the next one twice; each optimizes the second call down to zero instructions. |
05:09 | <@celticminstrel> | That article mentions that the constructs are not transparent to "continue". I wonder if it's possible to make them so with some extra hackery similar to what it did for "break". |
05:09 | <@celticminstrel> | ...or at least the header file posted at the bottom of the page mentions that. I don't recall if the article itself mentioned it. |
05:11 | <@celticminstrel> | I also wonder if those constructs would confuse some compilers, because ISTR the "if(false) {error_label: return;}" kind of construct confusing some compilers because it sees "if(false)" and assumes it's impossible to get there. |
05:13 | <&McMartin> | Hrm. You should be able to get variables in for initializers in C89 through mechanical translation of definitions. |
05:13 | <&McMartin> | for (int i = ...; ...) { ... } |
05:13 | <&McMartin> | is |
05:13 | <&McMartin> | { int i; for (i = ...; ...) { ... } } |
05:15 | | Derakon is now known as Derakon[AFK] |
05:16 | <@celticminstrel> | But the key to those macros is producing a valid statement prefix. |
05:19 | <&McMartin> | Mmm. I suppose that's true. |
05:19 | <&McMartin> | If one were more aggressive and awful about it, I'm sure one could square that circle, but that defeats the first point~ |
05:20 | <&McMartin> | The original UQM code was built with a horrific set of macros that were clearly designed to let the code be ANSI C if necessary but still compile with the K&R function style |
05:20 | <&McMartin> | The one where instead of f(int a, float b) { ... } it is f(a, b) int a; float b; { ... } |
05:22 | <@celticminstrel> | Yeah, I've seen that. It's bizarre. |
05:56 | | gnolam [quassel@Nightstar-jighpc.dip0.t-ipconnect.de] has joined #code |
05:56 | | mode/#code [+o gnolam] by ChanServ |
06:18 | | Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code |
06:18 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
06:46 | | Vornlicious [Vorn@Nightstar-7tgjuc.sub-174-211-11.myvzw.com] has joined #code |
06:47 | | Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds] |
06:49 | | Vorntastic [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds] |
06:49 | <&McMartin> | I'd say "suddenly my hobby project is full of yak shaving," but I think the yaks have already been shaved, more or less |
06:49 | <&McMartin> | What I need to do is take all this yak hair that's all over my repository and weave it into throw rugs so that it's acceptable to bring in guests. |
06:52 | < Vornlicious> | Merry yaksmas |
06:53 | <&McMartin> | Also keep trying to come up with ways to write my algorithms so they're way slower but could execute in, like, 32KB of available RAM |
06:53 | <&McMartin> | Trading sensible RAM usage for a hojillion passes over the input |
06:59 | | celticminstrel [celticminst@Nightstar-gil1m1.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
07:09 | | celticminstrel [celticminst@Nightstar-gil1m1.dsl.bell.ca] has joined #code |
07:09 | | mode/#code [+o celticminstrel] by ChanServ |
07:10 | | Vornlicious [Vorn@Nightstar-7tgjuc.sub-174-211-11.myvzw.com] has quit [[NS] Quit: Bye] |
07:11 | | gnolam [quassel@Nightstar-jighpc.dip0.t-ipconnect.de] has quit [[NS] Quit: Gone] |
07:11 | | Vorntastic [Vorn@Nightstar-7tgjuc.sub-174-211-11.myvzw.com] has joined #code |
07:23 | | celticminstrel [celticminst@Nightstar-gil1m1.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
08:00 | | Kindamoody[zZz] is now known as Kindamoody |
11:06 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client] |
11:06 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code |
11:06 | | mode/#code [+o Reiv] by ChanServ |
11:12 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
11:12 | | mode/#code [+o mac] by ChanServ |
11:16 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
11:24 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client] |
11:29 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
11:29 | | mode/#code [+o macdjord|slep] by ChanServ |
11:32 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 122 seconds] |
11:52 | <&[R]> | http://blog.nobl.ca/ld.txt <-- woo! |
11:58 | < Vorntastic> | What |
12:00 | <&[R]> | http://blog.nobl.ca/ld.chat.txt <-- conversation about it |
12:00 | <&[R]> | Note as soon as I did the "rm /lib /lib64" you could no longer call non-static binaries directly on that system |
12:05 | <&[R]> | I probably have some details wrong, but that's what I've learned from experimentation |
12:05 | <&[R]> | Also that wasn't the first time I did that |
12:16 | <&[R]> | https://grahamwideman.wordpress.com/2009/02/09/the-linux-loader-and-how-it-finds-libraries/ |
12:21 | <&[R]> | I think for further research I'll have to understand ELF |
13:49 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
13:49 | | mode/#code [+o mac] by ChanServ |
13:52 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
14:45 | | Kindamoody is now known as Kindamoody|afk |
15:33 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
15:33 | | mode/#code [+o macdjord|slep] by ChanServ |
15:36 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
15:42 | | Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code |
15:42 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
16:38 | | Degi [Degi@Nightstar-orn9ji.dyn.telefonica.de] has joined #code |
17:14 | | Kindamoody|afk is now known as Kindamoody |
17:18 | <&McMartin> | [R]: If you have missed it in the past, http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html is a fun delve into the ELF format and its followup where he stops cheating by doing nonportable system calls is much more directly relevant |
17:19 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
17:19 | | mode/#code [+o mac] by ChanServ |
17:21 | | macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
17:21 | | mode/#code [+o macdjord] by ChanServ |
17:23 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
17:24 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
17:24 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
17:24 | | mode/#code [+o macdjord|slep] by ChanServ |
17:26 | | macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
17:35 | | Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Connection closed] |
17:51 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
17:51 | | mode/#code [+o mac] by ChanServ |
17:54 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
18:32 | <&McMartin> | Making the rounds: https://twitter.com/ap00rv/status/968195742509752320 |
18:58 | <&jerith> | I hate golang so much. |
18:59 | <&jerith> | (A lot more than C, slightly less than PHP.) |
19:00 | <&jerith> | My previous objections were mostly philosophical. |
19:02 | <&jerith> | I have added some very practical objections to those. |
19:03 | <&jerith> | I can accept that indexing a string gives me a byte and iterating it gives me runes (which are codepoints). |
19:04 | | Vornicus [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code |
19:04 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
19:04 | <&jerith> | But why is there apparently no way to get the first (or last or nth) rune except by iterating? |
19:05 | <&jerith> | Okay, there's Reader.ReadRune() which returns a pile of crap I don't want and is vastly awkward to use. |
19:06 | <&ToxicFrog> | jerith: because in variable-width character encodings you have to take-n to get the nth character, you can't index |
19:06 | <&ToxicFrog> | And IIRC go has an Everything Is UTF8 assumption baked in |
19:06 | <&jerith> | ToxicFrog: Sure, but then give me a function that can return the first rune from a string. |
19:06 | <&jerith> | Or an inefficient one that walks it. |
19:07 | <&ToxicFrog> | I'm very unfamiliar with go but I would assume it has some equivalent to take/drop for iterators |
19:08 | <&jerith> | Not that I can find. |
19:09 | <&jerith> | The strings package has a Map function that takes a rune->rune func. |
19:10 | <&jerith> | Also a bunch of functions to find runes in a string (ContainsRune, IndexRune, etc.) but nothing that returns a rune. |
19:11 | <&jerith> | Well, nothing apart from Reader.ReadRune(), but that returns (rune, size, err). |
19:12 | <&jerith> | Of course, it doesn't help that the language has the worst documentation I've seen in years. |
19:13 | <&[R]> | McMartin: <3 |
19:14 | <&jerith> | "Package strings implements simple functions to manipulate UTF-8 encoded strings. For information about UTF-8 strings in Go, see https://blog.golang.org/strings." -- that's the entirety of the prose documentation for the strings package. |
19:14 | <&jerith> | A pointer to a four year old blog post. |
19:17 | <&jerith> | StackOverflow tells me I can cast to a rune slice, which apparently allocates an array. |
19:19 | <&jerith> | Oh, I forgot to mention earlier. Go has no iterators. |
19:20 | | Degi_ [Degi@Nightstar-orn9ji.dyn.telefonica.de] has joined #code |
19:20 | <&jerith> | It has ranges, which seem to serve the same purpose. |
19:21 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
19:21 | | mode/#code [+o macdjord|slep] by ChanServ |
19:22 | <~Vornicus> | wjat |
19:22 | <~Vornicus> | s tjos tjomg |
19:22 | <~Vornicus> | er |
19:22 | <~Vornicus> | what's this thing |
19:22 | <&jerith> | Golang. |
19:22 | | Degi [Degi@Nightstar-orn9ji.dyn.telefonica.de] has quit [Ping timeout: 121 seconds] |
19:22 | <&jerith> | It is trying to eat my sanity. |
19:23 | <&McMartin> | I think the best way to approach Go is to pretend it was written by someone whose last exposure to language design was in the late 1970s, and who hates all this OOP fooferaw and is going to do it all right and proper |
19:24 | <&McMartin> | And promptly reinvents a lot of stuff from the last 40 years, poorly |
19:24 | <&McMartin> | The two things it has that are Genuinely Great Things are channels and slices. |
19:24 | <&jerith> | McMartin: If that was the extent of the problem, I'd be less harsh in my criticism. |
19:24 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
19:24 | <&McMartin> | All the rest of it feels like it comes from that first source, to me |
19:25 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
19:25 | | mode/#code [+o mac] by ChanServ |
19:26 | <&jerith> | But they claim to take documentation very seriously (cf https://blog.golang.org/godoc-documenting-go-code -- opening sentence) while having the worst documentation I have seen in probably a decade. |
19:26 | <&[R]> | https://github.com/duffn/dumb-password-rules |
19:27 | <&[R]> | BMO is especially attrocious |
19:28 | | macdjord|slep [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
19:28 | <&[R]> | Since there are less than 6^62 possible passwords. |
19:28 | <&jerith> | Every time I have tried to learn how to use a language feature or a standard library or a tool that ships with the language, I have ended up in SO or blog posts from random people on the internet. |
19:29 | <~Vornicus> | 62^6 |
19:29 | <~Vornicus> | Much smaller number |
19:29 | <&[R]> | Derp, right |
19:30 | <~Vornicus> | (being 49 and 11 digits long respectively) |
19:31 | | macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
19:31 | | mode/#code [+o macdjord] by ChanServ |
19:31 | <&[R]> | Yeah, how long would it take to crack 59 billion PWs? |
19:31 | <&[R]> | An hour? |
19:31 | <~Vornicus> | a reasonable guess |
19:33 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
19:35 | <&[R]> | Keys per second in 2015: 11344618.21kps |
19:35 | <&[R]> | Processor Used: Core i5-6600K |
19:35 | <&McMartin> | jerith: Interesting. I got quite far with just the language spec and description. |
19:35 | <&[R]> | I was wrong. |
19:35 | <&[R]> | A bout 2 minutes. |
19:35 | <&[R]> | Holy fuck |
19:36 | <&McMartin> | But I was also working mostly with binary structures, which are a hilarious clusterfuck but one that had enough official information to let me roll with it |
19:37 | <&jerith> | The project I'm doing this for is a container logging adapter thing for work. |
19:37 | <&McMartin> | (And when dealing with byte arrays, slices are So Good I took them with me back to C) |
19:38 | | * McMartin nods |
19:38 | <&jerith> | Someone else on the team (who has a little more golang experience than I do) hacked up a prototype. |
19:38 | <&[R]> | ... or not, my math is wrong again |
19:38 | <&McMartin> | I am entirely willing to believe that it's got 70s level problems with strings. |
19:38 | <&McMartin> | (That said, from the specific thing you mentioned before: take-n for n of 1 should be a fast and constant-time operation) |
19:39 | <&[R]> | 1.4h |
19:39 | <&jerith> | I jumped in by improving the tests, because that's a thing I tend to do. |
19:39 | <&jerith> | The stdlib test tooling is... well, probably not *maliciously* atrocious. |
19:40 | <&jerith> | Criminally negligent, maybe? |
19:40 | <&McMartin> | I literally didn't notice, so I defer to your expertise, though I'm again curious about what's Obviously Necessary that I apparently thoughtlessly implemented on my own |
19:40 | <&jerith> | They deliberately don't give you assertions. |
19:41 | <&McMartin> | ... can you, uh, define "assertion" for me? |
19:41 | <&jerith> | Instead, you get to manually log failures on the test object. |
19:43 | | * McMartin checks his own tests |
19:43 | <&McMartin> | ... I can see why I didn't keenly notice its lack |
19:43 | <&McMartin> | (My code was implementing an RPC protocol, so every failure is a manual log after a timeout or midway through processing responses) |
19:44 | <&jerith> | So instead of 'self.assertEqual("expected", actual)' (from the Python stdlib unittest module, which is itself subpar) you get to do 'if "expected" != actual { t.Fail() }' or whatever. |
19:44 | <&jerith> | (Sorry, had to go look up the syntax.) |
19:44 | <&McMartin> | I made very heavy use of t.Fatalf() |
19:44 | <&jerith> | Yeah. |
19:44 | <&McMartin> | But given the thing you're testing, I think t.Fatalf isn't the thing you want. |
19:45 | <&McMartin> | ... though you should also be able to implement assertEqual in three lines, if you don't mind not having formatstring custom failure messages? |
19:45 | <&McMartin> | though *that* will get you in trouble because equality isn't properly overloaded |
19:45 | <&McMartin> | Which gets us back to "hey, it's the 1970s" |
19:45 | <&jerith> | On its own, the difference between "assert condition" and "if not condition: error" isn't that big. |
19:46 | <&McMartin> | Also, my tests were better than I remembered them being |
19:46 | <&jerith> | But when it turns every one-line assertion into a three-line conditional with the condition flipped, tests very quickly become unreadablbe. |
19:47 | <&jerith> | -b |
19:47 | | mac [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has joined #code |
19:47 | | mode/#code [+o mac] by ChanServ |
19:47 | <&jerith> | Fortunately there's https://github.com/stretchr/testify which is basically what the stdlib testing package should have been. |
19:48 | <&jerith> | Then there's the docs thing. |
19:49 | <&jerith> | As far as I can tell, https://golang.org/pkg/testing/ does not contain a single example of "this is how you write a test assertion". |
19:50 | <&jerith> | You get the function signature your test must have, an example of skipping a test, and then pages upon pages of stuff about benchmarks. |
19:50 | <&McMartin> | https://golang.org/pkg/testing/quick/ |
19:50 | | macdjord [macdjord@Nightstar-a1fj2k.mc.videotron.ca] has quit [Ping timeout: 121 seconds] |
19:50 | <&McMartin> | Linked at bottom of that page |
19:51 | <&McMartin> | Which also looks like an internal document, but |
19:51 | <&McMartin> | Oh, that's different, though |
19:51 | <&jerith> | No, that's their half-arsed QuickCheck implementation. |
19:52 | <&McMartin> | I know I learned about the testing infrastructure from something that wasn't SO, but I don't remember what it was. |
19:53 | <~Vornicus> | I want to see what jerith's test suite would look like for some of my code. 'cause I suspect that it'd be *vastly* more powerful than anything I've come up with |
19:53 | <&jerith> | I learned from the existing tests and some random blog posts. |
19:53 | <&McMartin> | Yeah |
19:53 | <&McMartin> | I was, at the time of this project, literally the only Go developer at my company, so I was starting from effectively zero. |
19:53 | <&McMartin> | (And this was because I didn't want to learn high performance java servlet implementation and knew Python wouldn't scale.) |
19:54 | <&jerith> | Vornicus: If you point me at the code and the existing tests, I can have a go at improving them. :-) |
19:54 | <&McMartin> | It is quite possible I just went from https://golang.org/doc/code.html |
19:54 | | gnolam [quassel@Nightstar-99bsle.dip0.t-ipconnect.de] has joined #code |
19:54 | | mode/#code [+o gnolam] by ChanServ |
19:55 | <&McMartin> | And then just demoscened it from there. |
19:55 | | * Vornicus hunts around for a good pile. Got some lua math code! |
19:55 | <&McMartin> | At some point I should also pick your brains on unit or functional tests for Ophis and its components, because I remember we had a clash about that in the past |
19:56 | <&jerith> | McMartin: I think that is the most useful page I've seen so far in the golang docs. It is also new to me. |
19:56 | <&McMartin> | In that case, glad to be of service |
19:56 | <&McMartin> | Which may be summarized as "your lexer has no tests whatsoever" "My lexer is literally f.readlines().split()" |
19:56 | <&McMartin> | Well |
19:56 | <&McMartin> | [x.split() for x in f.readlines()] but |
19:57 | | * McMartin still hasn't found the correct descriptive name for the sorts of tests he tends towards, other than that they don't seem to count as unit and they usually aren't up to what *he'd* consider systemic. |
19:57 | <&jerith> | I should also note that I haven't gone through the "learn golang from scratch" stuff, because I've read enough of it that I'm familiar with the basic syntax and only really need reference documentation for specific things. |
19:58 | <&McMartin> | Ah |
19:58 | <&McMartin> | I meanwhile had to do that both because it's a habit of mine and also because I needed to learn enough about how GOPATH worked to cause checkouts and makes to work sanely |
19:58 | <&jerith> | I did actually try the "learn golang from scratch" thing a few years ago and gave up a few steps in because it was roken. |
19:58 | <&McMartin> | And knowing enough to ask that question correctly enough to find answers in a reference is... well, you know how to solve it on your own then |
19:58 | <&jerith> | *broken |
19:59 | <&McMartin> | But that's a problem endemic to reference-level docs all over. |
20:00 | <&jerith> | I would like to submit Elixir's documentation as an example of Doing It Right. |
20:01 | <&jerith> | Compare https://hexdocs.pm/elixir/String.html to https://golang.org/pkg/strings/ for instance. |
20:02 | | * Vornicus works on packing it up. Lots of random crap is unhelpful. Also, I still don't know how to organize a damn project directory |
20:03 | <&ToxicFrog> | Does anyone?~ |
20:03 | <~Vornicus> | touche |
20:04 | <&McMartin> | jerith: I'm going to assume you mean more here than just "entries are, in fact, documented" |
20:05 | <&McMartin> | On what metrics would you compare this to, say, the Java library docs? |
20:05 | | Degi_ is now known as Degi |
20:05 | <&McMartin> | (I am assuming you consider these superior to those, and I can guess with moderate confidence the end-result user-story version of why these are better than the Java library docs, but that doesn't actually answer what aspects *of the docs themselves* are different to get those results) |
20:05 | <&jerith> | I don't really know the Java library very well, but I'd put them somewhere in the middle. |
20:05 | | Jessikat [Jessikat@Nightstar-h5uggv.dab.02.net] has joined #code |
20:06 | <&McMartin> | The guess, then, was, "Once I knew the question to ask, and thus had managed 75% of the solution anyway, the actual details I needed were all exactly where I expected them to be" |
20:06 | <&jerith> | The fundamental difference is that I can start with "I want to do a thing with a string" and look at the Elixir string docs and know how to do the thing I want to do. |
20:07 | <&jerith> | Even if I don't really know what that thing is. |
20:07 | <&McMartin> | Right, and then with Java you think "I want to do a thing with a string" and you're actually stymied immediately because there are something like twelve string classes scattered throughout the library in ways that are defensible but that wasn't *your* question. |
20:07 | <&jerith> | I also come away with a reasonable understanding of how strings work and what other things I can do with them. |
20:08 | <&McMartin> | Even if it was very basic string things you may have gone to java.lang.String when you needed java.lang.StringBuffer or more likely java.lang.StringBuilder. |
20:08 | <&jerith> | Yeah. |
20:09 | <&jerith> | But at least with Java if I want to know how to use StringBuilder I can go to the StringBuilder docs and find out. |
20:09 | <&McMartin> | Right, the trick is knowing that you need to use StringBuilder and not String. |
20:09 | <&McMartin> | "Oh, Strings are immutable, so concatenation is quadratic *sets entire runtime on fire and flees screaming*" |
20:10 | <&McMartin> | And since that (well, Doxygen on C and C++, which has similar issues) is where I came from, my default assumptionis that the API level docs are for phrasing and module-level organization, and that there is no guarantee modules will match problem spaces. |
20:10 | <&McMartin> | And then there will be a separate place for discussing the system as a whole's, er, theory of operation. |
20:10 | <&McMartin> | (Which Doxygen *also* has but which nobody uses) |
20:11 | <&McMartin> | But that also might have been why I hit that "How to Write Go Code" page much earlier in my investigations because I started with the general topic documentation. |
20:11 | <&jerith> | With the golang docs, I get a minimal function reference (basically just a list of signatures) with a couple of obscure warnings in it. |
20:12 | <&McMartin> | (This also means that my gnashing of teeth shows up a lot at Apple, who very explicitly splits up API and topic docs and then has incomplete API docs and out-of-date or actively misleading topic docs full of dead links to other documents.) |
20:12 | <&jerith> | Most language/stdlib documentation I've had to use has had a lot of module-level prose. |
20:14 | <&McMartin> | Yeah. Java trips up there because, e.g., the generic utilities in java.io are not the same ones as the ones for nonblocking I/O or realtime I/O, so you need to know more about what problem you're really solving before you dive in. |
20:14 | <&jerith> | Python's the one I'm most familiar with, but Rust and Elixir and OCaml do that too. |
20:15 | <&McMartin> | Java has less module-level docs but it does have them and class-level documentation often has that material in it. |
20:15 | <&jerith> | So does Java, but that's insufficient for the reasons you mention. |
20:15 | <&McMartin> | Yeah |
20:16 | <&jerith> | When I say "module" here, I'm being more general than "what Python calls a module" or whatever. |
20:16 | <&McMartin> | Yeah |
20:16 | <&McMartin> | That said, when you say that, in Java that often *does* mean "class". |
20:16 | <&jerith> | So Java class-level stuff is included. |
20:16 | <&McMartin> | I really can't gainsay putting the regex syntax not in java.util.regex but java.util.regex.Pattern. |
20:16 | <&McMartin> | (https://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html vs https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html ) |
20:19 | <&jerith> | Anyway, golang docs are terrible. |
20:19 | <&McMartin> | I cannot gainsay that either. |
20:20 | <&jerith> | So don't expect me to believe anything they say when they proudly declare that documentation is very important to them. |
20:20 | <&McMartin> | I'm also less than impressed with its standard library support and its attempts to reimplement polymorphism, though when I switch over to my C brain I madea lot more headway. |
20:21 | <&jerith> | The Elixir people claim that documentation is very important to them, and they demonstrate it by having excellent documentation. |
20:23 | <&jerith> | José Valim has said that if you read the documentation and you don't understand something, that's a bug they need to fix. |
20:26 | <@Tamber> | "Documentation is very important to us, which is why it's all doxygen generated." |
20:27 | <&jerith> | I've never used doxygen, so I don't know what tooling it provides. |
20:28 | <&jerith> | Javadoc is clunky, but acceptable if you try hard enough. |
20:28 | <&jerith> | Sphinx is good for prose docs, very mediocre for API docs. |
20:29 | <&jerith> | (Sphinx is standing in Pythonland.) |
20:29 | <&jerith> | *standard |
20:30 | <&jerith> | I don't really know the Elixir tooling either, but it seems to be pretty good given the amount of decently documented Elixir code out there. |
20:31 | <@Tamber> | (Well, it's possible for doxygen docs to be decent, or even pretty good... but that requires good documentation writing abilities in the first place... Not "I just ran doxygen over the project, there you go, it's documented, stop bothering me"~) |
20:31 | <&jerith> | Well, yeah. Docs don't just happen on their own. |
20:32 | <&jerith> | But like most things, the tooling can make good practices easier or harder. |
20:32 | <@Tamber> | yeah. |
20:32 | <~Vornicus> | Documentation is very important to me so I document shit even if it's just for me. I haven't ...ever bothered with the tools, because the number of times I've published some source I expect anyone on the planet to read can be counted on one hand. |
20:33 | <&jerith> | The thing about good tools is that the reference docs generally live with the stuff it's documenting. |
20:34 | < Jessikat> | We have doxygen at work, it's a wild west of shit that's out of date and impossible to navigate |
20:34 | < Jessikat> | Not like we write many docs as a company |
20:34 | <&jerith> | I love Javadoc because I can just read the comment markup in the code and be reasonably confident that the last person who changed the code at least knows the documentation is there. |
20:34 | < Jessikat> | (I wish people would write more overview documentation though) |
20:35 | <&jerith> | Half the time I write docs, I don't bother to run the tools that turn them into publishable artifacts. |
20:38 | | Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code |
20:38 | | mode/#code [+o Reiv] by ChanServ |
20:42 | <~Vornicus> | Overview docs are something I need to learn to do |
20:42 | <~Vornicus> | But the whole "how do you organization" thing gets in the way of that a lot |
20:43 | <&jerith> | http://www.writethedocs.org/ is useful. |
20:50 | <~Vornicus> | now I have both readthedocs and writethedocs as bookmarks |
20:50 | <~Vornicus> | what's next, executethedocs |
20:51 | <&jerith> | https://docs.python.org/2/library/doctest.html <-- close enough. |
20:54 | <~Vornicus> | of course |
21:36 | | Vornlicious [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code |
21:38 | | Vorntastic [Vorn@Nightstar-7tgjuc.sub-174-211-11.myvzw.com] has quit [Ping timeout: 121 seconds] |
21:43 | | Vorntastic [Vorn@Nightstar-9fb41v.sub-174-210-12.myvzw.com] has joined #code |
21:46 | | Vornlicious [Vorn@Nightstar-1l3nul.res.rr.com] has quit [Ping timeout: 121 seconds] |
21:49 | | * TheWatcher readsup |
21:51 | < Vorntastic> | That byte-rune distinction is incredibly awful |
21:52 | <@TheWatcher> | Jessikat: I'd be happy to offer my services to fix fdev's comments, for a sufficient fee of course (because I'm insane when it comes to doxygen documentation, to the point where even my perl code is doxygen-documented~) |
21:56 | <&McMartin> | Vorntastic: Rust is similar, though it calls runes 'chars' like a normal language |
21:57 | <&McMartin> | It also includes iterators because traits allow this because traits are more expressive than single inheritance |
21:57 | <&McMartin> | And *also* also includes a constant time function for "is this index the start of a UTF-8 character" because that is in fact a simple bitmask test because as multibyte encodings go UTF-8 is Actually Good |
21:58 | | Vorntastic [Vorn@Nightstar-9fb41v.sub-174-210-12.myvzw.com] has quit [[NS] Quit: Bye] |
21:58 | | Vorntastic [Vorn@Nightstar-60o.3mj.149.47.IP] has joined #code |
21:58 | <&McMartin> | (Also you apparently can index as an operation that can fail, but you index at byte offsets) |
21:59 | <&McMartin> | Rust docs are not organized in a way I find intuitive |
21:59 | <&jerith> | Likewise. |
22:00 | <&jerith> | But there's less of them than Java has. |
22:00 | <&McMartin> | Also there's a global search function that usually gets me where I need to be, as opposed to Javadoc's simple global flat list |
22:01 | < Vorntastic> | Like in Python 3 you pick one and run with it (same in py2 but less so). Having the two obvious methods of handling a string do two different things is a terrible idea |
22:03 | <&McMartin> | One thing Python 2 and 3 have that force that decision is that the byte-string representation admits to multiple interpretations. |
22:03 | <&McMartin> | (And overall seems to use the notion that UTF-8 is for serialization and UCS-4 for internal processing, a position I can get behind) |
22:04 | <&jerith> | pypy recently switched to utf-8 internally. |
22:04 | <&McMartin> | That also said, if you're going to go that route, you can kind of claim it for go. |
22:04 | < Vorntastic> | (it's the right position, so, there's that) |
22:04 | <&McMartin> | In that "string" is the unicode string in UTF-8 and []byte is Py3 bytes or Py2 str. |
22:04 | <&jerith> | IIRC, they cache an index of character offsets or something. |
22:05 | <&McMartin> | (In which case I guess Rust does also have converters to and from Vec<u8>) |
22:11 | | Vornlicious [Vorn@Nightstar-9fb41v.sub-174-210-12.myvzw.com] has joined #code |
22:14 | | Vorntastic [Vorn@Nightstar-60o.3mj.149.47.IP] has quit [Ping timeout: 121 seconds] |
22:23 | | gnolam [quassel@Nightstar-99bsle.dip0.t-ipconnect.de] has quit [[NS] Quit: Z?] |
22:24 | | Vornlicious [Vorn@Nightstar-9fb41v.sub-174-210-12.myvzw.com] has quit [[NS] Quit: Bye] |
22:25 | | Vorntastic [Vorn@Nightstar-1l3nul.res.rr.com] has joined #code |
23:21 | | Degi [Degi@Nightstar-orn9ji.dyn.telefonica.de] has quit [Connection closed] |
23:56 | < Jessikat> | TheWatcher: if we're paying anyone to do it, we're paying me to do it :p |
23:58 | <@iospace> | requesting someone to ping me please :) |
--- Log closed Wed Feb 28 00:00:25 2018 |