libera/#commonlisp - IRC Chatlog
Search
19:01:43
moon-child
jcowan: 'just too hard' it's certainly not _hard_ to implement, but you need to somehow manage the lifetime of the closure
21:56:45
jcowan
I came up with an idea for a non-portable extension of CL. It may be doable with the MOP, but I never learned the MOP. It looks like this: (define-type-class name type-specifier). The instances of such a class are all the objects which belong to the specified type. Otherwise they work like built-in types (or perhaps I should say they are built-in types: no slots and no constructors. However, parent types are possible, in
22:00:07
hayley
(beach: For what it is worth, I would believe that the URL was an honest mistake on mfiano's behalf. Usually you don't see server URLs on Matrix, so it is hard to spot bad servers. And there are some of _that_ kind of person present in Lisp rooms; I know cause I had to get rid of some of them.)
22:01:10
Gnuxie
( there's some of those people lurking in this channel for sure for what it is worth )
22:03:23
hayley
What does rewriting the parent types achieve that inheritance doesn't achieve? Is it that classes defined with define-type-class don't inherit any slots or anything like that?
22:06:30
slyrus
any vellum and/or teddy users around? Other data-frame like libraries I should consider?
22:09:46
hayley
Right, I think it would be quite possible with the MOP. You could just rig COMPUTE-SLOTS to return the empty list.
22:11:34
hayley
If it was possible, I was going to use it for network proxying once, as I can handle everything else lazily.
22:13:18
jcowan
Anyway, I think the better approach is to say that where the type specifier of the class being defined is t_c and the type specifier of each superclass is t_s, then for each superclass, subtypep(t_s, t_c) returns T T.
22:14:49
hayley
That arrangement reminds me of stealth mixins, though you would reuse one mixin for multiple classes.
22:45:29
stylewarning
Are there any JSON libraries that let you customize the structure that gets built?
22:46:16
stylewarning
Everything I’m seeing let’s you do small customizations (like make an alist or plist, or use lisp booleans or symbols or …), but I’m not seeing anything that allows me to instruct the parser what exactly I want it to build
22:54:30
random-nick
stylewarning: going through the libraries on cliki, this looks like it lets you take parse events https://github.com/rotatef/json-streams
0:45:28
moon-child
on x86, why does cmucl generate code that pops the return address manually and jumps to it, instead of using the native RET instruction?
0:47:29
hayley
I've never used CMUCL, so I don't have the disassembly on it. But one thing which came up when discussing the calling convention of SICL was that you also have to pop more of the stack before returning.
0:52:20
moon-child
It's a shame; I understand there is a dedicated return predictor, which is being bypassed in favour of a (much harder to predict) indirect jump. I wonder how setting up the return stack manually at the call site would compare
0:52:27
hayley
The choice here was to put another location on the cold end of the stack, which we copy the return address to. While I guess jumping makes more sense, meddling with the stack to get RET to work makes some predictor work.
0:55:11
moon-child
https://twitter.com/ktemkin/status/1375835935061942274 I think this technique is faster than regular threading, which would indicate the return predictor can work without a corresponding call
0:56:54
moon-child
anyway 'A Last-In-First-Out buffer, called the return stack buffer, remembers the return address every time a call instruction is executed, and it uses this for predicting where the corresponding return will go.'
0:58:22
moon-child
hmm, if you do something like this: push L1; push arg; push arg; call func; L1: then you will have a redundant entry on the stack, but the return predictor will work correctly
3:04:11
beach
moon-child: What we do is leave a space right near the frame pointer, so we do push <arg1>, push <arg2>... call. Then we pop the return address and put it first in the frame. So then, to return, we first deallocate the arguments and then RET.
5:43:20
rain3
beach: is it a good idea to separate "add-mixin" out of define-stealth-mixin ? https://termbin.com/2o62 Sometimes I need to add to victim classes mixins which are already defined so I need this add-mixin
5:55:48
contrapunctus
I don't know anything about OOP in other languages, and all I know of OOP is basic CLOS. Is there anything I might read to understand what mixins are, and how they're created and used in CLOS?
5:56:33
beach
contrapunctus: Technically, they are just ordinary classes. What qualifies them as mixins is just conventional use.
5:57:39
beach
contrapunctus: They are not intended to be directly instantiated, and instead are used as superclasses to "normal" classes in order to capture common things between several "normal" classes.
5:58:26
beach
contrapunctus: Example: (defclass name-mixin () ((%name :initarg :name :reader name))) could be used as a superclass for both a PERSON class and an ORGANIZATION class.
5:58:43
mfiano
How does stealth-mixin differ from my solution? https://gist.github.com/mfiano/af1a31d1a4767834b96d39f425ee75e9
6:00:14
beach
mfiano: This is Monday and Monday mornings are chaotic around here. I'll have a look later, unless someone else gets there first.
6:00:46
beach
mfiano: But we had a paper published in the Australian Conference on Software Engineering on it some two decades ago.
6:02:05
moon-child
http://clhs.lisp.se/Body/m_pshnew.htm the first example here mutates literal data!