freenode/#shirakumo - IRC Chatlog
Search
14:42:33
mfiano
With the l-t-v trick, do I still have to be careful about values escaping the function as with DX?
14:43:21
Shinmera
they may escape, but since they're on the heap it doesn't matter as long as you know you're not gonna use them in the same place. The make-hit thing for instance obviously escapes, and I have to take care that I don't retain the instance for longer than reasonable.
14:45:20
mfiano
I basically do something liek (let ((a (make-identity-mat3)) (b (make-identity-mat3)) .... (values a b)), in a function that is called each frame for each object, and the calling function is just a boolean predicate
14:47:20
Shinmera
since the object is allocated once and sticks in the heap, and you have to modify it to actually use it, two threads doing that at the same time is obviously bad.
14:48:29
Shinmera
because the object is allocated at load time. How are you going to use it for anything good without first filling it with useful values?
14:54:17
mfiano
until one of my users reported their dumped binary's game clock months in the future
14:55:27
Shinmera
I also have this: https://github.com/Shirakumo/trial/blob/master/toolkit.lisp#L459
14:55:28
Colleen
github.com/Shirakumo/trial/... Website (HTML), Title: trial/toolkit.lisp at master · Shirakumo/trial · GitHub
14:55:57
Shinmera
And for the g-i-r-t thingy you'd use a trick like this: https://github.com/Shirakumo/trial/blob/46b56ecbab3d04b264a8313a65014fa6d1c8b204/toolkit.lisp#L551-L560
14:55:58
Colleen
github.com/Shirakumo/trial/... Website (HTML), Title: trial/toolkit.lisp at 46b56ecbab3d04b264a8313a65014fa6d1c8b204 · Shirakumo/trial · GitHub
14:56:58
Shinmera
the former inlines constant argument calls, basically, and the latter does first-call jit optimisation.
14:57:20
mfiano
shouldn't mksym be making an uninterned symbol. i didn't look at the definition of that, but couldn't it clobber stuff?
14:59:35
mfiano
i see symbol-package though, and a defun name set from the result of that, whatever it is doing with symbol-package
15:24:35
mfiano
Isn't modifying the result of load-time-value undefined behavior? CLHS says load-time-value results in a literal.
15:25:29
Shinmera
sure. an implemantation could choose to protect the memory, but there's no real reason to do so.
15:27:42
mfiano
Fair enough. I just feel icky when I rely on UB because I'm throwing away one of the main reasons I use CL :)
15:28:18
Shinmera
:shrug: this one's a pretty safe bet as long as you're aware of the caveats I mentioned.
17:45:02
Shinmera
Bike: You also seem to make a ton of things, and I really appreciate the depth of insight you have into compiler tech.
17:50:11
Bike
i have some game ideas so i decided i'd lurk here since you have an engine... they're not really beyond the twinkle in my eye stage yet though
17:56:36
Shinmera
I don't post too much about Kandria here, though. We have a mailing list with dev updates for that: https://kandria.com/#subscribe
19:04:15
Shinmera
SAL9000: for some reason nicks don't seem to be coloured in lichat buffers. any ideas?
19:38:45
SAL9000
Shinmera | seems fine? https://filebox.tymoon.eu//file/TWpJMk5BPT0= [irc_privmsg,notify_message,prefix_nick_lightgreen,nick_Shinmera,host_~shinmera@supersolid.equilibrium.tymoon.eu,log1]
19:40:44
SAL9000
well there is a nick_color and nick_color_name "info" item, which points in favour of my hypothesis :/
19:55:38
SAL9000
Shinmera: I get a 21:53 =!= Lichat: You do not have sufficient permissions to perform this action. upon connection
20:14:43
SAL9000
Shinmera: looks like prefixes are NOT auto-colored for us. prefix_nick_ccc is not the cause; it is provided for filters etc. ("hide all messages from blue users") it seems.
20:16:15
SAL9000
Message(id=10, clock=3826728939, from=SAL9000-, text=derp, channel=lichatters, bridge=('lichat-protocol', 'nil'))
20:18:57
SAL9000
Shinmera: my reading of the spec seems to indicate that the bridge field should remain completely null since there are no bridges involved...?
20:20:14
Shinmera
you mean be missing? that would be nice. there's an issue in how exlichat does defaultings that makes this difficult to avoid.
20:20:52
SAL9000
right... so what value should be treated as-if-missing, for lichat.py's purposes at least?
20:25:17
Shinmera
either way, not like the bridge field does anything right now? Why are you fretting about it?
20:26:04
Shinmera
I must have added that at some point, forgotten about it, and not updated my weechat :u
20:45:31
SAL9000
Shinmera: btw, you want to be using "x is None" (or "x is not None") rather than "x == None"; None is a singleton, so "is None" is a pointer comparison, while == None may involve (attempts at) coercion.
20:50:27
SAL9000
I'm guessing it's because '==' is the more DWIMmy option that most programmers will reach for
20:50:48
SAL9000
then they learn about 'is' when they want a more specific comparison and/or more speed
20:52:27
SAL9000
...would you rather have perl, where '==' is coercing numeric compare and 'eq' is coercing string compare?
20:56:16
SAL9000
pushed fixes to pylichat for lichat-protocol:nil, and made the Update class act more like a {}
20:56:35
SAL9000
python stdlib has "collections.abc" module which gives abstract base classes for collections/collection-like things
20:56:47
SAL9000
so we just implement the minimum set of methods, and that class then does things like get() for us
20:57:09
SAL9000
in this case, MutableMapping, which needs __getitem__, __setitem__, __delitem__, __len__ and __iter__