--- Log opened Tue Mar 10 00:00:59 2020 |
00:04 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
00:18 | | macdjord|wurk is now known as macdjord |
00:23 | | celticminstrel [celticminst@Nightstar-80avij.dsl.bell.ca] has joined #code |
00:23 | | mode/#code [+o celticminstrel] by ChanServ |
00:29 | | celticminstrel [celticminst@Nightstar-80avij.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
00:29 | | celticminstrel [celticminst@Nightstar-80avij.dsl.bell.ca] has joined #code |
00:29 | | mode/#code [+o celticminstrel] by ChanServ |
01:23 | <@Reiv> | so what /would/ be a decent solution to http://thecodelesscode.com/case/83 |
01:24 | <&McMartin> | Alter the spec~ |
01:24 | <@Reiv> | uh |
01:24 | <&McMartin> | As I had mentioned elsechan, the preferred solution the last time this came up was to use an entity-property system, which boils down to "any method may in theory be invoked on any object, and then there are errors if you try to invoke something it can't do" |
01:25 | <&McMartin> | Then you can do custom delegation as needed, and in many cases you really want to be able to say, like |
01:25 | <&McMartin> | "Everything with a location and whose location is within 20 units of X, if it has health, take 20 damage to health" |
01:25 | <&McMartin> | Given a framework like this, it is pretty easy to do every piece of the question, but it is also, by the analysis here, "erroneous compromise". |
01:26 | <&McMartin> | I would defend the thesis that it was not an error; what is being described is formally "multiple implementation inheritance", which Java expressly forbids. |
01:26 | <&McMartin> | I consider multiple-implementation inheritance to be fundamentally misbegotten, which a more extremely position than average but I stand by it. |
01:27 | <&McMartin> | The short evidence for this is that there is an obvious thing one might wish to do, and you have to make a decision about what it means, and both are "obviously wrong" |
01:27 | <&McMartin> | Which is why C++ gives you a special declaration to let you pick which one to do this time. Most languages just pick one and say "we do this, wear a helmet" |
01:27 | <&McMartin> | Java's decision to simplify itself by banning this entirely is one of the few places I will not criticise its penchant for simplification. |
01:28 | <&McMartin> | The nasty case is, in fact, this one, with an aside that it does not nail to make it intrinsically awful everywhere :) |
01:28 | <&McMartin> | To wit: you have four classes, A, B, C, and D. |
01:28 | <&McMartin> | B and C extend A. D extends both B and C. |
01:29 | <&McMartin> | Now. Suppose that A has a value in it. |
01:29 | < catalyst> | In hindsight inheritance is a very frustrating partial solution to the problems it looks good for, but I don't blame us for not realising that until having gone through the motions |
01:29 | <&McMartin> | In the myth's case, the value is the soldier's rank. |
01:29 | | VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection closed] |
01:29 | | VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code |
01:29 | | mode/#code [+ao VirusJTG VirusJTG] by ChanServ |
01:30 | <&McMartin> | So. How many ranks does a D have? Both "1" and "2" are obviously correct answers, but if it's two, that's nonsense for *this* case (surely our soldier only has one rank, even if an archer and a horseman would independently have them) |
01:30 | <&McMartin> | But a soldier who is an archer and a grenadier should not share an ammunition count between their arrows and grenades! |
01:31 | <&McMartin> | And if A is "depletable-weapon", something that is both a rifle and a grenade launcher damn well wants its Rifle and its Grenade-Launcher to keep its ammo independent |
01:31 | <&McMartin> | And the flaw we will place here is "your error is in the statement 'this weapon is a rifle in every way, but it is also a grenade launcher in every way'" |
01:31 | < catalyst> | It's as much a domain modelling problem as a programming language feature problem |
01:31 | <&McMartin> | My crack about how CS is applied philosophy is flippant but it is not a joke. |
01:31 | <&McMartin> | Yeah. |
01:33 | <&McMartin> | catalyst: For the record, my traits-in-C technique is to, instead of (or in addition to) having my object-like struct carry a reference to its own vtable, generic functions that accept objects conforming to some trait take the trait's vtable for that argument directly as an additional argument. |
01:33 | <&McMartin> | (The core vtable may have an asTrait() method equivalent to do this if I'm feeling real frisky, but I haven't needed to use this in anger yet) |
01:33 | < catalyst> | :) |
01:34 | < catalyst> | I'm pretty sure in Rust it just can't discern at runtime because there's no generic object |
01:34 | <&McMartin> | Yeah. |
01:34 | <&McMartin> | And I intuit but have not worked through it, but I suspect this backfill-of-traits looks a lot like what the OO designers call "Views". |
01:35 | < catalyst> | I've mostly abandoned OOP as a concept I guess |
01:35 | < catalyst> | Just like until Rust does something egregious in terms of capability or deployment I'm not going back to C++ |
01:36 | < catalyst> | Your approach is intriguing |
01:46 | | catalyst2 [yaaic@Nightstar-v6lb30.cable.virginm.net] has joined #code |
01:50 | | catalyst [yaaic@Nightstar-kfgo16.dab.02.net] has quit [Connection closed] |
01:54 | | catalyst2 [yaaic@Nightstar-v6lb30.cable.virginm.net] has quit [[NS] Quit: Bye] |
01:54 | | catalyst [yaaic@Nightstar-v6lb30.cable.virginm.net] has joined #code |
02:08 | <@Reiv> | I manage to consistently understand the problem yet never understand the proposed solution |
02:09 | <@Reiv> | This makes me woeful enough I should probably stop asking >_> |
02:16 | <&McMartin> | This... puts you ahead of a bunch of people >_> |
02:18 | <@Reiv> | And still no closer to a solution to a problem I have routinely grappled with, back when I was skilled enough to grapple it. |
02:19 | <@Reiv> | Nowadays it's just philosophy, of course. I don't think my brain is really able to relearn those skills fast enough any more. |
02:28 | <&ToxicFrog> | Ahahahahaha it's alive! Aliiiiiiiiiive! |
02:28 | <&ToxicFrog> | I can incrementally construct a multimethod dispatch map across multiple namespaces |
02:28 | <&ToxicFrog> | This is going to make defining event handlers for spellcast much simpler, since I can dispatch on [current game phase, event type] |
02:31 | <&McMartin> | How much of Clojure's native multimethod support are you still able to rely on? |
02:38 | | Degi [Degi@Nightstar-dgd0ad.dyn.telefonica.de] has quit [Ping timeout: 121 seconds] |
02:39 | | Degi [Degi@Nightstar-slmf4m.dyn.telefonica.de] has joined #code |
02:41 | | catalyst [yaaic@Nightstar-v6lb30.cable.virginm.net] has quit [Connection closed] |
02:46 | | catalyst [yaaic@Nightstar-v6lb30.cable.virginm.net] has joined #code |
02:50 | <&ToxicFrog> | All of it |
02:50 | <&ToxicFrog> | It turns out that this is pretty straightforward; as long as you can refer to the var that was `defmulti`d you can `defmethod` it regardless of ns |
02:52 | <&ToxicFrog> | The part I was uncertain about was all the plumbing to turn an HTTP request into a [gamestate event] pair, then get the [gamestate response] pair from the event handler and swap! the former in while returning the latter to the caller without violating atomicity requirements. |
02:52 | <&McMartin> | Very good, very good |
03:09 | <&ToxicFrog> | (this plumbing turns out to be fairly simple) |
03:18 | | SmithKurosaki [uid215460@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
03:34 | | celticminstrel [celticminst@Nightstar-80avij.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
04:46 | | himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Ping timeout: 121 seconds] |
07:28 | | Kindamoody[zZz] is now known as Kindamoody |
07:39 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code |
07:39 | | mode/#code [+o himi] by ChanServ |
08:31 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
08:31 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
11:51 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: WeeChat 2.7] |
11:52 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
11:52 | | mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ |
11:53 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: WeeChat 2.7.1] |
11:54 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
11:54 | | mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ |
11:55 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: WeeChat 2.7.1] |
11:56 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
11:56 | | mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ |
12:34 | | celticminstrel [celticminst@Nightstar-80avij.dsl.bell.ca] has joined #code |
12:34 | | mode/#code [+o celticminstrel] by ChanServ |
12:45 | | celticminstrel is now known as celmin|away |
13:17 | | catalyst [yaaic@Nightstar-v6lb30.cable.virginm.net] has quit [Ping timeout: 121 seconds] |
13:19 | | catalyst [yaaic@Nightstar-l1kho9.dab.02.net] has joined #code |
15:33 | | Kindamoody is now known as Kindamoody|afk |
15:41 | | catalyst [yaaic@Nightstar-l1kho9.dab.02.net] has quit [Ping timeout: 121 seconds] |
15:45 | | catalyst [yaaic@Nightstar-v6lb30.cable.virginm.net] has joined #code |
15:51 | | catalyst [yaaic@Nightstar-v6lb30.cable.virginm.net] has quit [Connection closed] |
15:56 | | catalyst [yaaic@Nightstar-v6lb30.cable.virginm.net] has joined #code |
17:00 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
17:43 | | Kindamoody|afk is now known as Kindamoody |
18:11 | | VirusJTG_ [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code |
18:13 | | VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Ping timeout: 121 seconds] |
18:46 | | * Vornicus befuddles at this bit of crossroads. |
18:52 | <~Vornicus> | There's a text block that for some reason has a part in petscii, a part in screen codes, and then another part in petscii. This I don't find *too* surprising, if you need color and stuff using petscii gives you the ability to do that reasonably, etc. But the weird part is, there doesn't seem to be anything that points at the last of those three |
19:38 | <&McMartin> | Could just be dead code. |
19:38 | <&McMartin> | Of course, if it is PETSCII, you can read it and maybe remember where in the game it appears if anywhere~ |
19:49 | <~Vornicus> | it's the titles for the stat line |
19:50 | <&McMartin> | One could set a watch in VICE's debug monitor for reads from that location and see who does it |
19:50 | <~Vornicus> | ah good plan |
19:50 | <&McMartin> | My guess is "overflowing the screencodes" though |
19:50 | <~Vornicus> | static analysis isn't everything~ |
20:48 | | Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [[NS] Quit: .] |
20:50 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
21:28 | <~Vornicus> | meanwhile, hooray vice/c64/chargen |
21:43 | <&jerith> | Oh, man. It's been forever since I read thecodelesscode. |
21:44 | <&jerith> | I think it was even still updating back then. |
21:44 | <@Reiv> | I am a bit sad it stopped quite so definitively |
21:45 | <&jerith> | Better to stop suddenly than to degrade over time and taint what came before. |
21:47 | <@Reiv> | I suppose |
21:55 | | Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code |
21:55 | | mode/#code [+o Syloq] by ChanServ |
22:00 | <&jerith> | Half a decade is a good run. |
22:49 | <@ErikMesoy> | And it had a fitting last one, too. |
23:17 | | himi [sjjf@Nightstar-1drtbs.anu.edu.au] has joined #code |
23:17 | | mode/#code [+o himi] by ChanServ |
23:21 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
--- Log closed Wed Mar 11 00:00:00 2020 |