code logs -> 2016 -> Fri, 16 Dec 2016< code.20161215.log - code.20161217.log >
--- Log opened Fri Dec 16 00:00:37 2016
00:34 catadroid [catalyst@Nightstar-54p.06s.132.82.IP] has joined #code
00:37 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
01:03 Vorntastic [Vorn@Nightstar-quk3ol.sub-174-199-3.myvzw.com] has quit [[NS] Quit: Bye]
01:39 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has joined #code
01:51 Derakon_ is now known as Derakon
01:51 mode/#code [+ao Derakon Derakon] by ChanServ
02:28 catadroid` [catalyst@Nightstar-uu6cgc.dab.02.net] has joined #code
02:30 CoolDude [NSwebIRC@Nightstar-l8t4dn.mi.comcast.net] has joined #code
02:32 catadroid [catalyst@Nightstar-54p.06s.132.82.IP] has quit [Ping timeout: 121 seconds]
02:35
< CoolDude>
hii
02:36 CoolDude [NSwebIRC@Nightstar-l8t4dn.mi.comcast.net] has left #code ["IRC.Brett-TechRepair.com 6667 - CoolDudeChat.ZohoSites.com"]
03:00
<@Alek>
.....
04:40 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
04:50
<~Vornicus>
I am finally learning to use home and end to navigate lines.
04:51
<~Vornicus>
It's weird how that tool never came up, so I need to consciously train myself to use it
04:58 * McMartin is full of cake, opens up advent of code for the countdown
05:00 * Vornicus got around to doing 9B. Hooray recursion! Could probably go back and replace 9A with a very similar implementation with one fewer recurse call.
05:04 Derakon is now known as Derakon[AFK]
05:25 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has quit [Connection closed]
05:30
<~Vornicus>
ok 10 looks fun.
05:52 himi [sjjf@Nightstar-dm0.2ni.203.150.IP] has quit [Ping timeout: 121 seconds]
07:19 Kindamoody[zZz] is now known as Kindamoody
07:22 Kindamoody is now known as Kindamoody|afk
07:25 catadroid` is now known as catadroid
07:26
< catadroid>
I'm very happy at how my ideas are coming together
07:28
<&McMartin>
:D
07:28
< catadroid>
I've never been this sustained with something not work related
07:28
<&McMartin>
woot
07:29 * McMartin meanwhile has properly buried an abandoned project, brought another to release candidate status, and found the ancillary materials needed to finalize the release on two more.
07:29
<&McMartin>
It's the end-of-year cleanup/mercykill, I guess
07:30
<&McMartin>
I've got two projects I'd like to work on in earnest, but I will not let myself start until these old ones are cleaned up and sent out.
07:30
<&McMartin>
(They a work of art is never finished, only abandoned. The one I just got to release candidate status is less "abandoned" and more "uploaded to an archive in the dead of night, followed by fleeing cackling into the wilderness")
07:32
< catadroid>
Nice
07:37
< catadroid>
I'm still debating the best way to evaluate my language
07:37
< catadroid>
It feels like something stack based would be reasonable
07:38
< catadroid>
At least as a first attempt
07:41
< catadroid>
I've been really enjoying the general mode of thought that Reduct promotes
07:45
<~Vornicus>
oh man strong typing just stung me.
07:45 * Vornicus is way too used to js apparently
07:46
<&McMartin>
Watcha workin' on?
07:46
<&McMartin>
in
07:46
<&McMartin>
but also on
07:47
<~Vornicus>
python, AoC 10
07:48
<~Vornicus>
'7' > '23'
07:48
<&McMartin>
Ah yes
07:50
< catadroid>
:)
07:51
< catadroid>
It annoys me that I'm reasonably competent with python
07:51
< catadroid>
It feels like such a nothing language
07:51
<&McMartin>
It's my shell script
07:51
<&McMartin>
Or given my sordid and twisted past, it's really my QBASIC
07:52
< catadroid>
But Ruby and Perl are so much better for that, at least IME
07:52
< catadroid>
my QBASIC is C++, which probably explains a lot
07:52 * Vornicus typically thinks in Excel and then either JS or Python
07:52
<&McMartin>
I hold an unreasoning hatred for Ruby and while I've dealt with Perl in some capacity I prefer not to.
07:52
<~Vornicus>
I have a *perfectly reawsonable* hatred for Ruby
07:53
<~Vornicus>
BUt that's a story I'm pretty sure you've all heard
07:53
<&McMartin>
???!!??:!!!??
07:53
<~Vornicus>
That is not it.
07:53
< catadroid>
Huh? Nope! Do tell
07:53
<~Vornicus>
oh, you'll like this! It's a type problem
07:54
<~Vornicus>
So, I was planning on building vectors (of the mathematical type)
07:54
<&jerith>
My best debugging story involves Ruby. But I'll wait for Vornicus to finish. :-)
07:54
<~Vornicus>
One thing you can do with vectors is you can multiply or divide them by regular numbers; x*v, v*x, and v/x all work. ...but x/v makes no sense.
07:58 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
07:58 mode/#code [+o himi] by ChanServ
07:58
<~Vornicus>
Various languages that handle operator overloads handle this different ways: in C++ you make two of the operator methods on Vector and the third one as a bare function that's a friend; in Python you give Vector __mul__, __rmul__, and __div__; in Lua Vector's __mul and __div will get their two arguments in order so you just reject the reversed version on the latter.
07:58
<~Vornicus>
Ruby ... does none of these things.
08:00
<~Vornicus>
In Ruby, operators are a two step process: 1. a coercion that possibly converts the two operands, and 2. a single call to the first operand's operator overload function
08:04
<~Vornicus>
So here's the puzzle: how do you manage to make it so x*v, v*x, and v/x work, but x/v, x+v, x-v, v+x, v-x, v*v, and v/v don't? Coercion is a problem: you can't really pretend to expand the scalar into the vecotr and then use componentwise product etc, because all those other things *shouldn't* work and now *do*
08:05
< catadroid>
Yeah... that sounds unhelpful
08:05
<~Vornicus>
But if you *don't* coerce, you have *another* problem: you have to duplicate your effort for every single numeric type. While there is a numeric abstract base class, its operator functions never get called, having been (obviously) overloaded by its implementors like int and real
08:07
<~Vornicus>
So -- and this is in keeping with Ruby's philosophy! -- you go in and you move aside the official implementations, implement your own that knows about this new vector class, and for things that aren't the vecotr class you call the original. ...except of course that you have to do this half a dozen times, once for each already-existing numeric type.
08:08
<~Vornicus>
I explained this problem to a friend who was a huge ruby evangelist and he sat there for three hours trying to puzzle out a way where I didn't have to repeat myself so much and was just "...shit, you're stuck"
08:10
< catadroid>
That sounds like when u attempted to write performant statistical code in java
08:10
< catadroid>
When I*
08:10 * Vornicus also eyes AoC 11. Madness!
08:10 * Vornicus gives jerith the rubber chicken
08:11
<&jerith>
Vornicus: That's the only one where I'm not reasonably sure my solution is general.
08:11
<&jerith>
So, my debugging story.
08:11
<&jerith>
We had some code that had been working perfectly in production for months.
08:12
<&jerith>
While adding a new feature, we discovered a tyop in a well-used code path: "false" had been spelled "flase".
08:12
<&jerith>
This should be, at minimum, a "missing identifier" error.
08:12
<~Vornicus>
Um
08:13
<~Vornicus>
Holy Shit, Fuck Ruby
08:14
<&jerith>
We searched the entire codebase and all its dependencies for "flase", found one other example... a similar tyop in an explanatory comment.
08:14
<&jerith>
Our first clue was when we logged the value of "flase" at that point in the code: nil
08:15
<~Vornicus>
I forget if ruby does some crazybullshit where nil and undefined are the same thing
08:16
<&jerith>
Eventually, after half a day of digging around and trying various things, we discovered that some class somewhere had method_missing defined.
08:16
<&McMartin>
Oh wait
08:16
<&McMartin>
This is that thing that's listed under Let's Talk About Ruby
08:16
<&jerith>
This was somehow being indirectly included in the class we were looking at.
08:17
<~Vornicus>
"the wat is that someone would ever do this"
08:17
<&jerith>
Now, the *correct* way to use method_missing is to check if the name and args are sensible and throw an exception if they aren't.
08:18
<&jerith>
In this case, in the limited context in which this was *supposed* to be used, returning nil wasn't the worst behaviour ever.
08:19
<&McMartin>
"This is actually a result of how awesome Ruby is, but if you actually *do* this, then wat"
08:19
<&jerith>
Except that because of various things happening over time, that method_missing ended up escaping from its original confines.
08:19 * Vornicus got the quote wrong
08:20
<&jerith>
There's nothing wrong with method_missing conceptually.
08:20
<&jerith>
Python's __getattr__ is basically the same idea with much cleaner semantics.
08:21
<&McMartin>
True, though even there, it is well-attributed that calling __hasattr__ three times will cause the King in Yellow to arrive and devour your sanity
08:21
<&jerith>
(Python's semantics can be much cleaner because method calls *must* be applied to a specific object.)
08:22
<&jerith>
McMartin: Again, there are a few places where This Is The Correct Solution.
08:22
<&McMartin>
Yep
08:22
<&McMartin>
My only major published work in Python is one of those places
08:22
<&McMartin>
Python's idiomatic equivalent to Visitor
08:23
<&jerith>
The thing I found really annoying about Ruby's metaprogramming is that it's really hard to limit scope.
08:24
<&jerith>
You can trivially add a method to someone else's class, but it's really hard to add a method to a single object.
08:25
<~Vornicus>
where "someone else" includes core objects such as string.
08:25
<&jerith>
Yes.
08:26
<&McMartin>
Adding a method to a single object implies things about your object ontology that I do not consider default
08:27
<&jerith>
It's a thing I use in tests much more than real code.
08:27
<&jerith>
Patch a method on an object to behave differently for this particular test case, etc.
08:28
<&jerith>
I can't remember the specific reason I wanted it in Ruby.
08:29
<&jerith>
It probably had something to do with getting an object I could mutate but not replace and needing to add behaviour to it.
08:30
<&jerith>
And not wanting that to infect all the other things that were using this object, because they might also need to modify it in similar ways.
08:33
<&jerith>
Err, all the other things using objects of this type.
08:47 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
08:58 catadroid` [catalyst@Nightstar-gtbck2.dab.02.net] has joined #code
09:00 catadroid [catalyst@Nightstar-uu6cgc.dab.02.net] has quit [Ping timeout: 121 seconds]
10:23 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
11:31 catadroid` is now known as catadroid
11:31
< catadroid>
Fun things - people telling me my code is awesome and easy to maintain
11:31 * catadroid sits and looks content with life
11:36
<@TheWatcher>
\o/
11:50
<&jerith>
catadroid: :-D :-D :-D
12:22
<&jerith>
Yay, AoC 16 done.
12:23
<&jerith>
I knew my naive solution for part 1 wasn't going to be performant enough for part 2, but I ran it anyway while I built a real solution.
12:23
<&jerith>
Four and a half hours later it hadn't finished.
13:26
<@TheWatcher>
Good gods
13:26
<@TheWatcher>
It's far harder to get a fucking input box to accept voice input than it should be
13:34 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has joined #code
13:34 mode/#code [+o celticminstrel] by ChanServ
14:15
<&jerith>
Voice input?
14:16
<&jerith>
Oh, I see.
14:16
<&jerith>
Why is this not a thing that all inputs get by default?
14:17
<@TheWatcher>
This is an excellent question!
14:17
<@TheWatcher>
One I have no answer for other than "browser developers are fucking trolls"
14:19
<@TheWatcher>
For a while there, chrome supported a x-webkit-speech attribute that marked input boxes as supporting speech input, added a little mic icon to the side, click on it, speak, and voila.
14:23
<@TheWatcher>
But now, that's defunct; everyone's supposed to use the speech API
14:24
<@TheWatcher>
So you need to write fuckign client-side javascript code to do something that should be part of the standard browser-provided widgets
14:30
<@TheWatcher>
(but then, I shouldn't really be surprised; this sort of bullshit is par for the course with web dev)
15:18 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
15:18 mode/#code [+qo Vornicus Vornicus] by ChanServ
15:25 * Vornicus examines 11 with fresh eyes, determines that it's not that bad at all
15:28 catadroid` [catalyst@Nightstar-2c36nq.dab.02.net] has joined #code
15:30
<~Vornicus>
the validity and pathing rules are a little weird, but that's all.
15:30 catadroid [catalyst@Nightstar-gtbck2.dab.02.net] has quit [Ping timeout: 121 seconds]
16:00
<&ToxicFrog>
I should do 8 today
16:02
< catadroid`>
I'd start with one and see how that goes
16:02
< catadroid`>
Eight in a day sounds like a lot of work
16:07 catadroid` is now known as catadroid
16:15
<&ToxicFrog>
Har har :P
17:29 * Vornicus writes the state transition system. Ewk.
17:31
<~Vornicus>
One of the big difficulties with pathfinding complicated stuff like this is that often you've got a thing where the natural method of defining new states is a mutation, but you need immutable objects for state to work.
17:32 * Vornicus makes mutify and immutify
17:32 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
17:32 mode/#code [+o Syloq] by ChanServ
17:41
<@celticminstrel>
...what...
17:44
<~Vornicus>
?
17:44
<@celticminstrel>
Mutify and immutify
17:46
<~Vornicus>
They're highly specific to my actual task here; they take the immutable object that I've made state things out of and return a thing that's mutable -- or vice versa
17:48
<~Vornicus>
they don't actually turn an immutable object actually mutable
17:49
<@celticminstrel>
I see.
17:52
< catadroid>
Freeze and thaw
17:53
<&jerith>
I like Vorn's names better. :-)
17:54 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
17:55
< catadroid>
Break and fix
17:55
< catadroid>
Unborrow and borrow
17:56
<&jerith>
turn_into_horrible_dangerous_thing and create_nice_clean_safe_thing :troll:
18:41
<~Vornicus>
oy there are a few possible states
18:42
<~Vornicus>
(duh. ten objects, four floors, a first pass suggests 2^22 possible states, though many are not allowed)
18:48 * Vornicus accidentally blows up the universe.
18:52
<&McMartin>
I need to have a go at doing the representation change someone suggested to me after the fact
18:52
<&McMartin>
That one would have, I think, made it feasible to not need mutify/immutify either.
18:53
<~Vornicus>
I can envision a method to encode as integers...
18:55
<&McMartin>
This was a representation change that altered big chunks of the algorithm. It wasn't a mere encoding shift from what I was doing.
18:55
<&jerith>
All my state was immutable, but I'm using a language that makes that very natural.
18:55
<&jerith>
I'm also up to day 7 of last year's.
18:56
<~Vornicus>
ah. I wrote a* as generic
18:56
<&McMartin>
I was using straight BFS
18:56
<&McMartin>
That part doesn't change
18:56
<&McMartin>
The rest of it does
18:57 * Vornicus destroys the universe again without having promiscuous diagnostics
18:57
<~Vornicus>
*definitely* need a smaller representation.
18:58
<&jeroud>
I used a greedy DFS.
18:59
<&jeroud>
It works very nicely on all the input I've thrown at it, which isn't very much.
19:00
<&jeroud>
Hrm. Maybe I should borrow some input from you guys for it.
19:00
<~Vornicus>
wait how do you get shortest path from dfs
19:07
<&jeroud>
By greedy.
19:15
<&jeroud>
I always move the lowest things first.
19:16
<&jeroud>
I always move two things up unless there's only one thing on that floor
19:16 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection reset by peer]
19:17
<&jeroud>
Oh, Vorn disappeared.
19:24 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
19:24 mode/#code [+qo Vornicus Vornicus] by ChanServ
19:26 * Vornicus fiddles, figures out how to manipulate state with just arithmetic, works on state legality.
20:21 ion [Owner@Nightstar-6grqph.vs.shawcable.net] has quit [Ping timeout: 121 seconds]
20:44 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has joined #code
21:20 ion [Owner@Nightstar-6grqph.vs.shawcable.net] has joined #code
21:20 mode/#code [+o ion] by ChanServ
21:32
<~Vornicus>
there we are. takes 2m29s, but it does not explode my memory.
21:35
<~Vornicus>
oy. another four things would probably be bad.
21:41 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has quit [[NS] Quit: Leaving]
21:45
<~Vornicus>
...would help if my a* heuristic actually worked.
21:46 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
21:58 catadroid` [catalyst@Nightstar-3voi6p.dab.02.net] has joined #code
22:01 catadroid [catalyst@Nightstar-2c36nq.dab.02.net] has quit [Ping timeout: 121 seconds]
22:16
<&McMartin>
Oh dear. An Underhanded Rust contest has been announced. https://underhanded.rs/
22:55 Kindamoody|afk is now known as Kindamoody
23:09
<&ToxicFrog>
Awesome.
23:12 * Vornicus has several a* fails, wonders what the heck he's doing wrong.
23:12
<@abudhabi>
Aaaaaaaaaaaa*! AAaaaaaaaa*!
23:21 Kindamoody is now known as Kindamoody[zZz]
--- Log closed Sat Dec 17 00:00:38 2016
code logs -> 2016 -> Fri, 16 Dec 2016< code.20161215.log - code.20161217.log >

[ Latest log file ]