code logs -> 2018 -> Tue, 27 Nov 2018< code.20181126.log - code.20181128.log >
--- Log opened Tue Nov 27 00:00:06 2018
00:41 Derakon[AFK] is now known as Derakon
00:49 gnolam [lenin@Nightstar-ego6cb.cust.bahnhof.se] has joined #code
00:49 mode/#code [+o gnolam] by ChanServ
00:50 celticminstrel [celticminst@Nightstar-l19e78.dsl.bell.ca] has joined #code
00:50 mode/#code [+o celticminstrel] by ChanServ
00:53 gnolam_ [lenin@Nightstar-ghphrt.cust.bahnhof.se] has quit [Ping timeout: 121 seconds]
01:47 * ToxicFrog gnaws on clojure
01:48 * McMartin considers taking up the blade of C again.
01:53
<&ToxicFrog>
I want some equivalent to lua's : method calls, and #clojure is not particularly helpful here
01:53
<&ToxicFrog>
As best I can tell what I want here is defprotocol+defrecord?
01:54
<&McMartin>
Oof. My Clojure is too rusty to be any use at all in this instance.
01:54
<&ToxicFrog>
Oh, except that doesn't actually define methods per se, it's more like an alternate way of declaring multimethods that disambiguate based on JVM type rather than based on arbitrary functions
01:57
<&ToxicFrog>
Gnar.
01:57
<&McMartin>
What's the precise semantics of the : method call?
01:58
<&McMartin>
Because if it's the classic scripting language method call mechanism, the only compiled language I know of that offers those semantics is Objective-C, and, uh, you don't want to use that
01:58
<&ToxicFrog>
foo:bar(...) is eqv to foo.bar(foo, ...) except that foo is evaluated only once
01:59
<&ToxicFrog>
In effect it lets you create "methods" by just stuffing a bunch of functions into a dict
01:59
<@celticminstrel>
Kinda doubt this'll be possible in C...
02:00
<&ToxicFrog>
This saves you from having to either explicitly do the lookup inside the dict on each call (the foo.bar(foo, ...) version) or taking the C approach of just prefixing all the method names with the type and passing the instance as the first argument (FOO_bar(foo, ...))
02:00
<&ToxicFrog>
celticminstrel: fortunately, I'm not using C
02:00
<&McMartin>
Yeah, ObjC's method call mechanism is the one that's largely equivalent to "stuffing a bunch of functions ito a dict" with prelookup when possible
02:00
<&McMartin>
Which in turn means that @protocol is just "we promise that we implement these methods somehow" because semantically all function calls are symbolically resolved
02:00
<@celticminstrel>
Oh that was McM not TF, whoops.
02:01
<&McMartin>
... which is what it is you want, I think, which means...
02:01
<&ToxicFrog>
What I really want here is to be able to, e.g., define a "get" method on Levels so I can (.get the-level ...) rather than (Level/get the-level ...) each time
02:01
<&ToxicFrog>
Which is basically the same as the C approach and just as ugly to my eyes
02:01
<&McMartin>
... yeah, the direct approach here would be to use reflection to absorb it
02:01
<&McMartin>
The indirect one might be playing games with the equivalent of Java interfaces combined with reify
02:02
<&ToxicFrog>
And I'm pretty sure some combination of defprotocol, definterface, deftype, defrecord, gen-class, and maybe but probably not reify are what I want here
02:02
<&ToxicFrog>
But that's a lot of options, most of which I've never used before and not all of which have clearly documented limitations.
02:03
<&McMartin>
Yeah, my half-assed answer is "using Lua/Python style method semantics in a language with Java/C++-like method semantics is a recipe for pain and one is best off redesigning one's system to get the broader semantics one wants"
02:04
<&ToxicFrog>
The immediate issue I see with that is that it's not even clear to me that it's accurate to say Clojure has "Java/C++-like method semantics", except insofar as interoperation with Java code is involved
02:05
<&McMartin>
That is a fair point and one I am unqualified to answer
02:05
<&ToxicFrog>
Like, the preferred way to handle polymorphic function invokation in Clojure seems to be to use defprotocol/extend or defmulti/defmethod and now you have a function that lives "outside" any type but intelligently selects implementations based on what you pass it.
02:06
<&McMartin>
Hm, OK
02:06
<&McMartin>
I'm less familiar with that but it sounds CLOS-y.
02:06
<&ToxicFrog>
The problem is that built-in functions like (get) and (set!) aren't defined in this way and thus can't be used with extend or defmethod, which brings me right back to "qualify the function name with the name of the type it's operating on every single time I call it", which is what I'm trying to get away from here.
02:06
<&ToxicFrog>
Well.
02:06
<&ToxicFrog>
A problem, there's a bunch of interrelated problems here.
02:08
<&McMartin>
This is kind of a dumb thing, but, um, can't you use keywords as if they were functions that fetched dictionary keys in Clojure?
02:08
<&McMartin>
Could you, in fact, just straight-up *use* a dict of functions?
02:09
<&ToxicFrog>
I can, but it looks kind of gross and does not reduce repetition, because unlike Lua it doesn't have sugar for it; I end up with stuff like ((:theMethod the-instance) the-instance ...)
02:09
<&ToxicFrog>
Hmm
02:10
<&ToxicFrog>
I could do something with defmacro, maybe.
02:10
<&McMartin>
And of course `let` gives you the ability to force "only evaluate once"
02:12
<&ToxicFrog>
(defmacro mc [this method & args] `(let [this# ~this] ((get this# ~method) ~@args))
02:12
<&ToxicFrog>
(mc the-instance theMethod ...)
02:12
<&ToxicFrog>
I would use : for this in a nod to the Lua syntax, but all tokens starting with : are reserved as keywords by the Clojure lexer.
02:13
<&ToxicFrog>
Oh, I'd probably have to use '~method or something like that, but that's the basic idea.
02:13
<&ToxicFrog>
Performance is probably going to suffer, though, because that's a map lookup on every method call with no possibility of resolving calls at compile time.
02:13 * McMartin nods
02:13
<&McMartin>
Yeah, this is the cost of smalltalk-style methods, but if you aren't doing it *much*...
02:14
<&McMartin>
But this is a place where an optimization like Rapid Type Analysis can make a real difference
02:14
<&ToxicFrog>
I will probably be doing it quite a lot all the time, sadly
02:14
<&McMartin>
Mmm
02:14
<&ToxicFrog>
Which is part of why I want to make it more pleasant to write!
02:14
<&McMartin>
In such cases I think even Java interfaces carry a significant performance cost :/
02:15
<&McMartin>
Do Clojure macros allow token-pasting to let you construct atoms like 'Level/get'?
02:16
<&ToxicFrog>
I mean, performance is relative here, this is a non-realtime user-interactive program, but it would be nice if it weren't noticeably laggy
02:16
<&ToxicFrog>
Hmm. Maybe.
02:16
<&McMartin>
Yeah, I mean, I've played text games on modern systems that noticably lagged and it's no fun at all
02:16
<&ToxicFrog>
I do wonder if I'm getting too far into the weeds here.
02:17
<&McMartin>
This doesn't yet seem to be *obviously* an X/Y problem, though it is as vaguely noted a premature optimization if so
02:18
<&McMartin>
Though I also admit that "I can invent a more inefficient way to do this" does not mean that the existing code was prematurely optimized~
02:22 Kindamoody is now known as Kindamoody[zZz]
02:32
<&ToxicFrog>
After some experimentation, it looks like the least bad way to do this, if I really want to, is:
02:33
<&ToxicFrog>
- definterface an interface that defines all the methods I want (or defprotocol, but that comes with extra baggage that is probably not useful here)
02:34
<&ToxicFrog>
- defrecord an extended map that implements those methods
02:43
<&[R]>
"Unlike realtime raytracing, our merch actually exists"
02:47 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [[NS] Quit: back later]
02:54 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
02:59 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
03:38
<@celticminstrel>
XD
03:39
<@celticminstrel>
But doesn't realtime raytracing exist now? Supposedly that's the gimmick of Nvidia's latest cards?
03:39
<@celticminstrel>
Or is the implication supposed to be that Nvidia is being misleading?
03:59 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
03:59 mode/#code [+ao McMartin McMartin] by ChanServ
03:59
<&[R]>
The implication is it isn't implimented in anything
04:02
<@celticminstrel>
Meaning the cards support it but nothing actually leverages that?
04:02
<&[R]>
Right
04:03
<&[R]>
Though now there's two games that support it... at the of losing like 70% of your FPS
04:03
<&[R]>
cost_*
04:03
<&[R]>
cost+**
04:07
<@celticminstrel>
Heh.
04:10
<&McMartin>
They also wildly overuse it
04:10 * McMartin digs out the quote from the last time this came up
04:11
<&McMartin>
"But in BF V, you have a warzone where everyone has inexplicably applied 10 layers of wax to every abandoned car, all the buildings have impeccably polished ballroom floors and freshly washed windows, and the mudpuddles in the street have been replaced with pristine spring water."
04:11
<&McMartin>
"'Alright, men, remember, don't fire until you see the reflection of the whites of your eyes in the whites of their eyes!'"
04:27
<@celticminstrel>
XD
04:29
<&Derakon>
McMartin: by the way, I think that disk image you sent me has one issue, namely that you can't run the program from the image itself.
04:29
<&Derakon>
ISTR seeing an error in Console saying that a process was trying to modify a read-only filesystem, or something like that.
04:48 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Ping timeout: 121 seconds]
05:19 Derakon is now known as Derakon[AFK]
05:27 celticminstrel is now known as celmin|sleep
05:46
<&McMartin>
Derakon[AFK]: That's interesting; we do not (intentionally) write to the bundle directory.
05:46
<&McMartin>
That said, the issues you were having before about not launching immediately are probably due to app-sideloading issues because we're filthy indies who haven't payed the annual four-figure sum for blessed signing keys
07:10 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has quit [Connection reset by peer]
07:11 VirusJTG [VirusJTG@Nightstar-42s.jso.104.208.IP] has joined #code
07:11 mode/#code [+ao VirusJTG VirusJTG] by ChanServ
07:35 himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code
07:35 mode/#code [+o himi] by ChanServ
08:11
<&McMartin>
Woot-ish
08:11 * McMartin has taken someone else's Classic Mac demo - which was being stored as a pile of independent resources - and assembled them into a working application.
08:12
<&McMartin>
Python script to put together a correctly-formatted resource fork followed by ResEditing in the file type.
08:16
<&McMartin>
Unfortunately, as there is no real interactivity in it, there's very little gain from this other than just linking the .gif of it: https://www.v68k.org/advanced-mac-substitute/NyanCat.gif
08:40
<@macdjord>
McMartin: o/~ Nyan, nyan, nyan-nyan-nyan-nyan-nyan-nyan-nyan, nyan, nyan, nyan-nyan-nyan-nyan-nyano/~
08:41
<@macdjord>
Also, I seem to have made the menu bar on HexChat go away some how. Can someone who's HexChat install is working tell me the magic key combo to fix it?
08:42
<~Vornicus>
f9
08:43
<~Vornicus>
What is a classic mac demo? A miserable pile of independent resources!
08:52
<@macdjord>
Vornicus: Thank you!
09:06
<&McMartin>
... the license file is too large to open in SimpleText
09:29
<@TheWatcher>
That's... impressive
09:31
<&McMartin>
I'm guessing there's a 32KB cap
09:31
<&McMartin>
half of old-school Notepad's =P
09:35
<&McMartin>
(The AGPL3 is 39KB)
09:35
<&McMartin>
*34KB
09:53
<@TheWatcher>
Eris save me from bloody students using react, node, and the rest of that godsforsaken ecosystem
10:04
<@TheWatcher>
Especially ones that have no fucking clue what they're doing
10:41 Kindamoody[zZz] is now known as Kindamoody
11:24 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
13:29 celmin|sleep is now known as celmin|away
13:31 * celmin|away wonders if what McM is working on would have any relation to something that would read a Mac resources file (either data-fork or compressed - probably sit/hqx) on Windows.
14:59 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
15:10 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
15:30 Kindamoody is now known as Kindamoody|afk
15:45 Vorntastic [uid293981@Nightstar-6br85t.irccloud.com] has joined #code
15:45 mode/#code [+qo Vorntastic Vorntastic] by ChanServ
16:10 Vash [Vash@Nightstar-sjaki9.res.rr.com] has joined #code
18:14 ErikMesoy [Bruker@Nightstar-hq72t5.customer.cdi.no] has quit [Connection closed]
18:15 ErikMesoy [Bruker@Nightstar-hq72t5.customer.cdi.no] has joined #code
18:15 mode/#code [+o ErikMesoy] by ChanServ
18:41 Vash [Vash@Nightstar-sjaki9.res.rr.com] has quit [[NS] Quit: Quit]
18:54
<&[R]>
https://clips.twitch.tv/GlutenFreeCoweringSowFunRun
18:59
<~Vorntastic>
Silly
19:32 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
19:32 mode/#code [+ao McMartin McMartin] by ChanServ
19:34
<&McMartin>
celmin|away: I use a program called "HFVExplorer" that manages that as part of its import/unimport operations.
19:34
<&McMartin>
For an application with no data fork, however, I can just provide a raw resource fork and say "import as raw resource fork"
19:35
<&McMartin>
While it *should* be an AppleSingle or whatnot, it doesn't seem to support that despite it being older than BinHex
19:35
<&McMartin>
BinHex is also utterly terrible
19:47 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
20:39 Degi [Degi@Nightstar-6iq8qf.dyn.telefonica.de] has joined #code
20:50 Degi [Degi@Nightstar-6iq8qf.dyn.telefonica.de] has quit [Connection closed]
20:51 Degi [Degi@Nightstar-6iq8qf.dyn.telefonica.de] has joined #code
20:52 Degi [Degi@Nightstar-6iq8qf.dyn.telefonica.de] has quit [The TLS connection was non-properly terminated.]
20:52 Degi [Degi@Nightstar-6iq8qf.dyn.telefonica.de] has joined #code
21:37 himi [sjjf@Nightstar-1drtbs.anu.edu.au] has joined #code
21:37 mode/#code [+o himi] by ChanServ
22:26 Degi [Degi@Nightstar-6iq8qf.dyn.telefonica.de] has quit [The TLS connection was non-properly terminated.]
23:14 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds]
23:22 * McMartin =( at this code
23:22
<&McMartin>
That feeling when it turns out switching code entirely over to manual memory management makes it simpler
23:58
<@Alek>
anyone familiar with brackets.io?
--- Log closed Wed Nov 28 00:00:05 2018
code logs -> 2018 -> Tue, 27 Nov 2018< code.20181126.log - code.20181128.log >

[ Latest log file ]