freenode/lisp - IRC Chatlog
Search
23:30:14
seok
Well, after a day of fiddling with various server and web libraries, I think I am ready to build a simple webgame app
23:49:32
pjb
:components ((:file "source1" :depends-on ("package")) (:file "source2" :depends-on ("package")) …)
23:50:56
pjb
:components ((:file "source1" :depends-on ("package")) (:file "source2" :depends-on ("package" "source1")) …) <- add it!
23:54:58
seok
It would save me days of coding trying to figures out puppeteer + chrome api for scraping
23:56:24
pjb
*f is not used often, you could use it, but for special variable the convention is *foo*.
23:56:57
lerax
seok: seems that the main developer uses macOS too, initially didn't even work on Linux
23:56:59
seok
lerax: Its one of the dependencies on NeXT that is hard to install, if not impossible on windows
23:58:55
lerax
I don't use Windows currently... actually it past some years since the last time I used
23:59:29
seok
Well, the options for scraping JS based content atm is Selenium (outdated library on CL), PhantomJS (discontinued) or puppeteer
23:59:53
lerax
Good to see your feedback, seok. Sorry to hear that you cannot tried in Windows. NeXT it's really a nice browser.
0:01:26
pjb
Of course, if it had its own name, I could be more inclined to try to use it. NeXT is Steve Jobs baby!
0:46:04
Bike
if you look at the definition for sb-impl::%defun, you can see it does a bunch of things, and one of them is the setf fdefinition
0:59:53
mfiano
I remember one of the reasons why my team doesn't use defmethods for inner loop stuff is because you said it was slow. We had a discussion about it where I thought SBCL cached the right applicable method after it computed it the first time. But you said it doesn't do that and that's why it is slow. Do you remember anything about this conversation, or have any relevant references? My log searching is coming up
1:01:18
Bike
i vaguely remember something like that, but you might be putting too much stock in my words.
1:04:14
Bike
http://www.sbcl.org/sbcl-internals/Discriminating-Functions.html#Discriminating-Functions
1:06:16
mfiano
So the right applicable method is or is not cached? I guess I'll have to read all of that
1:43:43
pjb
mfiano: anyways, if you use CLOS objects, accessing the slots will use generic functions, and this will be at the core of the most inner loops!
1:50:29
pjb
Using a structure is 3 times slower, only using a direct counter is faster: https://pastebin.com/Egma3LV1
2:00:15
asarch
Any tool to convert hours, minutes and even seconds to seconds (e.g. 02:00 -> 120 seg)?
2:04:47
pjb
cf. com.informatimago.common-lisp.cesarum.date.utility:hms60-from-secondes and com.informatimago.common-lisp.cesarum.date.utility:hms60-to-secondes
2:07:05
Josh_2
How do I tell the compiler to not make annoying noises about variables that are "unused"
2:07:16
pjb
asarch: notice that (decode-universal-time 7200 0) #| --> 0 ; 0 ; 2 ; 1 ; 1 ; 1900 ; 0 ; nil ; 0 |# and (encode-universal-time 0 0 2 1 1 1900 0) #| --> 7200 |#
2:07:49
asarch
Yeah, I need it because I've downloaded a big video with the full OST soundtrack from YouTube and I need the seconds in order to set the bookmarks for the track
2:08:06
psilord
Hello, I have a question about generic functions. When I defgeneric something, and then defmethod a pile of methods, when I invoke them later, are there are requirements about caching the applicable method so the next time I call it in that same code location, the call is faster? Does this concept even exist?
2:09:48
Josh_2
I'm trying to use scope to my advantage, but the compiler is giving me warnings I want to ignore :O
2:09:55
psilord
pjb: [hello!] I'm mostly wondering if when I call a method it MUST perform a lot of work to compute the applicable method.
2:10:33
pjb
psilord: there's an algorithm to find the right method. You call a generic function, not a method. Methods are not funcallable.
2:10:34
psilord
I have a 'memory' of method invocations being slow, and unsuitable for things like math libraries. And, finding that I don't remember the evidence why, or if I just hallucinated it, I'm asking around. :)
2:11:08
pjb
psilord: as you can see from by benchmark above, it's only 10% slower than a normal function call.
2:15:57
pjb
(defun f () (declare (special *tcp-in-socket*)) *tcp-in-socket*) (defun g () (let ((*tcp-in-socket* 42)) (declare (special *tcp-in-socket*)) (f))) (g) #| --> 42 |#
2:20:15
psilord
pjb: But, it is implementation dependent for how much work is done when the generic function is invoked, correct? It COULD compute the applicable method each time, or possibly cache it, or anything in between.
2:21:11
pjb
Yes. But I don't know how to call the method outside of the scope of the generic function. There are constraints on call-method and call-next-method. They're not available in general.
2:23:05
pjb
Josh_2: they don't need the earmuff. You could consider avoiding it, since there's always a clear declarations of their specialness.
2:23:37
pjb
Josh_2: without earmuff, they could pose a problem if you call eval or compile in a function called by a function declaring them special.
2:23:48
psilord
pjb: thanks. It seems then, for my purposes (inner loops running billion or trillions of times) I should prolly use functions and inlining when appropriate as opposed to generic functions.
6:54:09
jackdaniel
if you are lazy and not overly attached to ANSI CL standard use package local nicknames
6:55:12
jackdaniel
given ideal world where everything is implemented the moment you think about it, how do you imagine this working?
6:57:23
pjb
seok: then modify one package to rename the symbol in collision. FOr eaxmple, you could prefix them with the name of the package and a dash.
6:58:47
pjb
just use the colon: (iterate:while more-to-do-p (parenscript:while more-dom-objects-p …))
7:01:41
pjb
(defpackage "YOUR-PACKAGE" (:use "CL" "PARENSCRIPT" "ITERATE") (:shadowing-import-from "ITERATE" "WHILE")) ; or the other, depending on which you use more.
7:08:00
pjb
If you correct the typo, and if the macro aliased don't use the form name to compute their expansion. (That's usually the case).
7:08:56
pjb
You could write a bunch of macros as (defmacro foo (&whole form …) (expand form)) where the function expand use (first form) to generate different expansions. In that case, the aliasing would break it.
7:12:05
gilberth
It does not. WHILE in parenscript is both a CL macro and a keyword to the Parenscript language.
7:13:55
gilberth
Yes, but what does (ps (jwhile foo bar)) yield? In contrast to (ps (ps:while foo bar))?
7:16:40
gilberth
pjb: Point is: Both span new name spaces and you cannot just copy _every_ meaning of a symbol in every namespace.
7:22:35
gilberth
pjb: And SYMBOL-FUNCTION does not need to return a function. Yet (SETF SYMBOL-FUNCTION) wants a function.
7:23:19
pjb
One can hope that if SYMBOL-FUNCTION doesn't return a function, (SETF SYMBOL-FUNCTION) will accept it.
7:24:30
pjb
Granted, it could be an internal setter, and (setf symbol-function) could have conforming checks.
7:26:37
gilberth
So you'd need to figure out if it is fbound and if it is a function at all. Then what about compiler macros? And all the other name spaces? That'll never work.
7:27:16
pjb
gilberth: 1- the use case is not CL symbols. 2- it's true that for CL symbols, it would be more complicated.
8:56:13
splittist
No. I can't really justify the 3 days of leave I would have to take (vs taking it with my family).
8:58:10
jackdaniel
splittist: the trick is to take your family to Genua! we aren't comming this year because the little one is too little, but next year we're definetely going
8:58:58
splittist
Well, the kids have school. Eventually they'll be embarrassed to be seen with their parents, then I can go (:
9:01:25
phoe
beach: I'm also skipping ELS this year. I unexpectedly developed an instance of pneumonia, and I'm staying home to make sure it's collected.
9:03:10
beach
phoe: I should thank you for not coming then. If I get pneumonia, with my asthma, it could be fatal.
9:03:49
phoe
beach: this is another reason. My conscience wouldn't let me live if I accidentally shrunk the Lisper population even further. :(
9:07:11
jackdaniel
I don't think this is true (not to mention offtopic with which I play along apparently): depressing environment may induce depression (and vice versa, optimistic one may mitigate it)
9:09:42
jackdaniel
agreed, just saying that having depressed people around may induce depression; so in some sense it is contagious