freenode/#lisp - IRC Chatlog
Search
18:17:36
Josh_2
I added :readers to :initargs but my instance that uses these new slots doesn't have any associated readers
18:38:00
Bike
not sure i understand. you have a keyword argument called "initargs"? what's special-slot look like?
18:38:39
Bike
also, the direct slots need to actually be in the direct slots of the class. they're not, here
18:39:05
Bike
you can't just add effective slots that don't correspond to any direct slots, as far as i know
18:39:18
Bike
effective slots don't have readers or writers, so the information would be discarded, anyway
18:40:12
Bike
if you want instances of your metaclass to have extra slots the easiest thing to do is just to define a superclass for all the instances, and put those slots in the superclass
18:40:49
Bike
i don't know if that's allowed, and if it is, the rest of the system is going to ignore it unless you put in special processing
18:43:04
Bike
slot definitions are properties of classes. classes have slot definitions. instances do not have slot definitions, they have slots.
18:43:25
Bike
In this scenario, do you have different instances of the same class that have different accessible slots?
18:43:50
Bike
compute-slots is called when you define a class. it's not called for every instance, or anything like that.
18:44:29
Bike
You need to decide what exactly you want. A class that can have slots added and removed is a lot different from flexible instances.
18:48:33
Josh_2
so basically redefine a class with a new slot each time I find a new header, and then create an instance of that
18:52:52
Josh_2
I basically did. In the plaster code there is a list called *slots-needed* now imagine that every once in a while a new symbol is added automatically and the class 'request' would need to update itself with the new slot
18:53:28
Bike
Why would you want instances of the same class to have different slots? That's confusing.
18:54:54
Bike
okay. so just do (eval `(defclass classname (supers...) ,@*slots-needed*)) when you change *slots-needed*.
18:55:12
Bike
and if that's what you want you can do that a little better with ensure-class instead, but it's still like a line of code.
18:57:22
Bike
I really don't understand your architecture here. How many instances of this class are relevant at any given time?
20:09:58
_death
I guess what Josh_2 is trying to do is usually a basic feature of frame based systems..
20:12:57
_death
for example, Parmenides (which can be made to run on today's CL implementations with a few easy tweaks) has add-slot <classname> <slot-name> <slot-contents> &key cache
20:28:12
_death
there was a good survey of frame representation systems.. http://www.ai.sri.com/pub_list/236
20:29:35
Lycurgus
i knew of it (parmenides) but now it occurs in the context of relief from encumbered frame systems
20:30:40
_death
what do you mean? (I played with it some years ago, but otherwise don't have much experience with those)
21:58:03
jcowan
What's the general view in the CL community about error conditions? Is it usual to just use condition type ERROR or to create your own subtype?
22:00:31
Xach
jcowan: it is pretty common to create your own conditions of the approprite type, which is often (but not always) a subtype of error.
22:01:26
Xach
and the custom condition helps distinguish your condition from others that aren't of interest
22:03:28
Xach
I usually think of (error "foo ~A" bar) as the quick and dirty first version and refine as time allows and need dictates
22:05:42
jcowan
The debate I'm having with a colleague is this. Given a document that is MIME-labeled with an unknown encoding name, what to do? We agree that returning NIL is a bad idea; I think the situation is rare enough that returning a generic condition type is enough, whereas my cow orker is strongly in favor of a unique type. Disregard for the moment the question of relevant information; the datum argument is enough.
22:07:30
Xach
I would make a unique type, and if the data isn't important, it would be as simple as (define-condition unknown-encoding-error (error) ())
22:08:06
Xach
There are so many other errors that might happen and being able to distinguish is very helpful later, as phoe suggests.
22:08:11
phoe
which means that the programmer cannot customize program behavior in case an unknown MIME label is encountered
22:11:43
jcowan
Well. The answer to that would have been to use predicates rather than types in handler-bind. But nooooo.
22:12:57
phoe
still, using a a SATISFIES type plus a named function that searches for substrings in condition reports is more ugly than using a proper condition type.
22:14:30
jcowan
My colleague is often very very very annoying. He makes up for this by sometimes (often?) being very very right.
22:15:00
fwoaroof[m]
Xach: that's my preference, for simple conditions: do the ugly string thing, but do it in a wrapper that signals a unique condition type
22:15:53
fwoaroof[m]
Also (and base-condition-1 base-condition-2) for the common subclasses of two conditions might occasionally be useful
22:15:54
jcowan
I mean, write a macro that can do OR-types and AND-types for you and use it instead of handler-bind
22:16:37
fwoaroof[m]
Sure, you can do predicates or whatever, but I actually like the type system in CL :)
22:16:41
jcowan
It's certainly a reasonable choice, but if you have predicates you can easily get types; vice versa, not so much.
22:51:28
jcowan
At one time I tried to convince eval-when on SBLC that I wanted a function needed only to expand a macro to be present at compile time but not runtime, but I was never able to get it to work with both compile-file and load.
23:39:01
sveit
hello; this is similar to a question i have asked before, but is it known/specified if inlining of function calls happens before or after compiler macros are run?
23:50:40
sveit
phoe: thanks. to confirm, i mean if G would have been inlined and F has a compiler macro definition, the F compiler has a chance to see G in (F (G x))?
0:07:54
_death
Josh_2: here's my patch from back then https://gist.github.com/death/3a9d34fcb092ad7d78ac65e62135be0f
0:17:02
Josh_2
I've already made all of the changes you have in that gist but it still struggles to compile, I also had a problem where some function that expected a symbol was getting a list containing a keyword
0:33:34
Josh_2
_death: https://github.com/K1D77A/Parmenides I added the problems I have with compiling as issues
0:34:58
_death
hmm, maybe better to fork the lispm repo which has the original code and then add your patch
0:43:23
Josh_2
_death: https://github.com/K1D77A/Parmenides this is a fork, I don't know how to add issues though
2:35:10
kilimanjaro
Are there any obvious ways to speed this up (e.g. on SBCL), without using multiple cores? https://gist.github.com/kilimanjaro/72eef27b8bd435b82461bfa2124e12ec
2:37:14
kilimanjaro
I am just curious -- the C version seems to be ~4x faster, but I don't really have any sense of why
2:50:54
aeth
kilimanjaro: Is the C version identical to what you just wrote? Because that currently returns nothing, and so can be optimized to do nothihng, but won't in SBCL.
2:56:08
aeth
Well, you can do this: (deftype matrix () `(simple-array double-float (,+size+ ,+size+))) ; except in CCL, if you do this portably and want it to run in CCL you'll have to wrap the defconstant in an eval-when
2:57:14
aeth
Then you can spin off the relevant part (and return c in the outer DOTIMES), e.g. (defun matmul-optimized (a b c) (declare (type matrix a b c) (optimize (speed 3) (debug 0))) (dotimes (i +size+ c) (dotimes (k +size+) (dotimes (j +size+) (incf (aref C i j) (* (aref A i k) (aref B k j)))))))
2:57:36
aeth
And then you can look at the asm in the now smaller function. (disassemble #'matmul-optimized)
3:00:40
aeth_
If you insist on having (safety 0) then you'll probably want to see the full asm in SBCL, i.e. (sb-disassem:disassemble-code-component #'matmul-optimized)
3:02:11
aeth
kilimanjaro: as for the C side, there's a website that does compiler asm output for such things because it's not built into C. You can then see how it differs. I forget the name of the site.
3:03:27
aeth
heh, I think DuckDuckGo was filtering out "C" because it was too short so I searched for C++ instead. It's this. https://godbolt.org/
3:06:06
aeth
So if the shortened version that I wrote has subsantially different generated assembly to what godbolt says for C/C++, that's the performance difference and #sbcl might be interested.
3:06:54
aeth
And if you (setf *print-case* :downcase) before you diassemble, you get the asm in lower case, which might help with the readability.
3:12:35
aeth
and this keyboard apparently needs cleaning because some keys are no longer pressing all of the way and I dropped some random letters in there
3:17:55
kilimanjaro
in this gist (updated), the SBCL disassembly is shown and all of the moves into XMM registers are 64 bit https://gist.github.com/kilimanjaro/72eef27b8bd435b82461bfa2124e12ec
3:23:40
kilimanjaro
so at the very least, if I want to write SBCL-specific code I can use https://pvk.ca/Blog/2013/06/05/fresh-in-sbcl-1-dot-1-8-sse-intrinsics/ etc
4:36:07
beach
The topic of this channel is Common Lisp. The language itself, implementations of it, libraries and applications written in it, etc.
4:37:17
lisbeths
there is more to what is expressed by the english word lisp than what is expressed in CLHS
4:37:51
lisbeths
even if you would like to relegate it to just commmon lisp, there is more that is expressed within the context of the phrase "common lisp" than what is expressed in clhs
4:38:20
lisbeths
newcomers hate this channel because this channel should be named #clhs based on the rules here
4:38:38
lisbeths
you have probably turned countless people away by rudely expecting them to be able to read a document only accessable by software engineers
4:39:31
lisbeths
You should create a channel named #CLHS or something like that, and transfer the rules of this channel to that one
4:39:47
lisbeths
you sohuld not censor people woh want to talk about extending commmon lisp beyond the hyperspec
4:40:34
lisbeths
Can you express to me in your own words what my point is do demonstrate that you understand what I've said
4:42:19
lisbeths
you have done wrong to lisp programmers, but you have done it "perfectly", without error
4:42:50
lisbeths
I half believe you are just an artificial intelligence behind that screen. A perfect machine made by the military or something.
4:48:24
lisbeths
I will protest htat you should leave to #clhs and do not come back or I will petition in #freenode to have you removed.
4:49:06
aeth
It's Friday in most of the world. Has anyone started/continued any interesting projects this week?
4:49:09
jasom_
4 hours ago people were discussing how to get sbcl to generate more optimal machine code, all things clearly mentioned in the clhs
4:50:07
ldb
aeth:not necessarily lisp related, but I heard someone made progress define formal semantics for python
4:51:50
lisbeths
If I shall not be banned then I declare a mutiny and the discussion topic is no longer #clhs but #common-lisp
4:51:58
lisbeths
and I shall discuss #common-lisp as I pleaes and if you do not like it then ban me.
4:53:11
lisbeths
It is clear to me that #common-lisp is the most superior programming language on the earth, because it is a supercategory of ada because it has syntactic macros.
4:53:38
lisbeths
In the 1980s the department of defence made note of ada and common lisp as very nice programming languages which were suitable for its needs.
4:53:52
lisbeths
Common lisp is the current best and fastest programming language for a quantum computer, which is the fastest computer on the public record.
4:54:03
aeth
ldb: Do you think that would work with CL? I think there's a Well-Specified Common Lisp project. It could be a good starting point.
4:56:42
lisbeths
There are many libraries for common lisp which aim to take an implementation of common lisp and apply it to make gtk applications.
4:56:54
lisbeths
it is a false statmenet to say that there is *only* one common lisp project, or that there could only be one
4:57:02
ldb
aeth: be precisely it is small step operational semantics, so I'd say maybe a particular implementation should be picked
4:58:09
aeth
ldb: CL-the-actual-language is just the intersection of how all of the major implementations behave, unless this behavior contradicts the spec
4:59:44
ldb
https://cs.brown.edu/~sk/Publications/Papers/Published/kle-next-700-semantics//paper.pdf
5:09:26
lisbeths
It seems to me that common lisp is the most superior programming language on the planet.
5:11:14
lisbeths
It seems to me that if my previous claim is true that it makes sence for the common lisp community to better advocate for lisp.
5:11:30
lisbeths
If it were in fact the most superior or best current available language then advocating for it would help humanity.
5:11:42
lisbeths
If it were not the best or most superior then advocating for it would reveal that it is not the best or most superior.
5:13:23
lisbeths
It seems to me that if my belief that common-lisp is the most superior langauge is true, then if the industry used common-lisp as a whole then they would not be able to then kick the habit of it, because each time they did so they would benefit negatively.
5:14:10
lisbeths
Thus, I predict that if the industry at large were comitted to lisp it would be so comitted indefinitely.
5:14:30
lisbeths
Therefore, I consider a good way to advocate for common-lisp should be to convince the industry to use it at large.
5:15:47
lisbeths
It seems to me that a good way to convince the industry to try using common lisp at large is a giant marketing campaign.
5:18:09
lisbeths
We can have a bot written in portable common lisp which accepts data as input, expects that data to be an image macro, and which produces memes.
5:18:35
lisbeths
this bot can be rewarded or punished based on how good the user thinks it's memes are
5:18:48
lisbeths
This bot can also be reward or punshed based on the number of google searches for lisp and common lisp
5:21:27
lisbeths
common-lisp programmers can additionally make an effort to promote lisp verbally and on thier online blogging platforms
5:21:48
lisbeths
Since common-lisp is a prefix language, I declare january to be lisp history month.
5:22:50
lisbeths
The first day of january is lisp week and the first day of that week, whenever january first is, is lisp day.
5:23:01
lisbeths
And the first hour is lisp hour and the first minute is lisp minute and the first second is lisp second and so on and so forth.
5:24:22
lisbeths
Lisp history will be for: enjoying common-lisp and lisp history, shaing lisp songs, sharing lisp image macros, lisp poems, and of course, writing and sharing and peer reviewing lisp code.
5:24:36
lisbeths
During lisp month it is traditional to read other peoples lisp code and rate it on github and comment on it.
5:26:45
lisbeths
Another ritual during lisp month is to completely re-read Practical Common Lisp or Gentle introduction to Symbolic computation (which is a beginner's lisp book)