phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
<seok> Ya, I can't wait until I can afford another machine to setup linux
<lerax> The idea of extending using Common Lisp is just fascinating for me
<lerax> Now I have exwm, so next too...
<lerax> Lisp everywhere.
<lerax> A quite hackable OS.
<lerax> (at least on userland...)
<pjb> Of course, if it had its own name, I could be more inclined to try to use it. NeXT is Steve Jobs baby!
q3d has quit [Ping timeout: 256 seconds]
Josh_2 has joined #lisp
karlosz has quit [Remote host closed the connection]
q9929t has quit [Remote host closed the connection]
q9929t has joined #lisp
Fare has joined #lisp
orivej has joined #lisp
ltriant has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
lerax has quit [Ping timeout: 250 seconds]
asarch has joined #lisp
sjl has quit [Quit: WeeChat 2.2-dev]
Lord_of_Life_ has joined #lisp
<asarch> Is there any way to do "by hand" what (defun ...) does?
<asarch> I mean, (defun) is actually a macro
<asarch> So, there is a way to do it step by step what this "shortcut" does, right?
<Josh_2> Use a lambda?
<Josh_2> Set a symbols value to a lambda then funcall that symbol?
<no-defun-allowed> (setf (fdefinition 'name) (lambda args (block name . body)))
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life_ is now known as Lord_of_Life
* asarch takes notes...
<Bike> you can macroexpand a defun form to see what exactly it does
<Bike> though it might have implementation dependent junk.
<Bike> the effect is mostly the setf fdefinition.
<asarch> Thank you
<asarch> Thank you very much guys :-)
<asarch> Yeah!
<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
<asarch> Ok
igemnace has joined #lisp
q9929t has quit [Quit: q9929t]
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #lisp
<mfiano> Bike: hello
<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
<mfiano> empty.
tharugrim has quit [Quit: WeeChat 2.4]
<Bike> i vaguely remember something like that, but you might be putting too much stock in my words.
myrkraverk has joined #lisp
<mfiano> Fair enough. One of our team members was just curious about it wrt SBCL
<Bike> let me see if i can find actual documentation on what sbcl does
<mfiano> Ok, thanks.
<Bike> it is a little vaguer than th eproper manual
<mfiano> Hmm
<mfiano> So the right applicable method is or is not cached? I guess I'll have to read all of that
notzmv has joined #lisp
ltriant has quit [Ping timeout: 246 seconds]
Oladon has joined #lisp
X-Scale` has joined #lisp
mingus has quit [Ping timeout: 245 seconds]
X-Scale has quit [Ping timeout: 250 seconds]
X-Scale` is now known as X-Scale
myrkraverk has quit [Ping timeout: 245 seconds]
ltriant has joined #lisp
Aruseus has quit [Read error: Connection reset by peer]
ltriant has quit [Ping timeout: 245 seconds]
ltriant has joined #lisp
ltriant has quit [Ping timeout: 246 seconds]
<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!
sjl has joined #lisp
<mfiano> Of course
<pjb> mfiano: on ccl, there's less than 10% difference in time: https://pastebin.com/fj1HfCgG
<pjb> Using a structure is 3 times slower, only using a direct counter is faster: https://pastebin.com/Egma3LV1
<mfiano> I'm more interested in the caching strategy of applicable methods on SBCL
catchme has quit [Quit: Connection closed for inactivity]
lavaflow has quit [Read error: Connection reset by peer]
ym555 has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
myrkraverk has joined #lisp
lavaflow has joined #lisp
<asarch> Any tool to convert hours, minutes and even seconds to seconds (e.g. 02:00 -> 120 seg)?
<asarch> (And even 02:00:00 -> 7200 seg?)
<pjb> really? You need a tool for that?
<pjb> cf. com.informatimago.common-lisp.cesarum.date.utility:hms60-from-secondes and com.informatimago.common-lisp.cesarum.date.utility:hms60-to-secondes
<pjb>
<pjb> (hms60-to-secondes 0 0 2) #| --> 7200 |#
<pjb> (hms60-from-secondes 7200) #| --> 0 ; 0 ; 2 |#
psilord has joined #lisp
<asarch> Thank you!
<asarch> Thank you very much!
<Josh_2> How do I tell the compiler to not make annoying noises about variables that are "unused"
<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 |#
<pjb> Josh_2: (declare (ignore your-var))
<Josh_2> thanks pjb
<pjb> Josh_2: (declare (ignorable your-var)); in some cases…
<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
<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?
<Josh_2> hmm I used declare ignore but still getting undefined variable
Fare has quit [Ping timeout: 245 seconds]
<Josh_2> however when I use the function with its proper scope it works just fine
<pjb> psilord: no requirement, but an implementation could add a cache indeed.
<pjb> Josh_2: of course, scope matters.
<Josh_2> I'm trying to use scope to my advantage, but the compiler is giving me warnings I want to ignore :O
<Josh_2> let me show
<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.
<pjb> psilord: there's an algorithm to find the right method. You call a generic function, not a method. Methods are not funcallable.
<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. :)
<psilord> Oh yes, that's right, sorry.
<pjb> psilord: as you can see from by benchmark above, it's only 10% slower than a normal function call.
<Josh_2> pjb: this
<Josh_2> maybe I have ignore in the wrong place
<pjb> Josh_2: tcp-in-socket is not defined.
<psilord> benchmark? I just joined this channel, so I may have missed it.
<Josh_2> It is in the function that calls that function
<pjb> Josh_2: scope is lexical!
<Josh_2> So what ur saying is
<Josh_2> I'm doing it wrong?
<pjb> Yes.
<Josh_2> What should I do to achieve the same result?
<pjb> Pass it as argument, or define a local variable with LET.
<Josh_2> hmm
<psilord> pjb: reading.
<Josh_2> I thought if I passed as an arg it won't actually modify that argument
<pjb> Indeed.
<Josh_2> but a reference of it
<pjb> Alternatively, pass a closure.
<mfiano> psilord: That benchmark is on CCL btw
<pjb> or use a special variable, with dynamic binding.
<Josh_2> like defvar?
<Josh_2> or defparameter
<Josh_2> I can just use global var I suppose, I was trying to avoid that
aindilis has quit [Read error: Connection reset by peer]
<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 |#
<pjb> No, not a global! A local dynamic variable!
<Josh_2> So basically the same but local
<Josh_2> I don't really know the difference between lexical and dynamic bindings
<Josh_2> I just sorta do things and hope they work *shrug*
<pjb> It's explained in the above url.l
<Josh_2> I am readin
<pjb> Just follow the links.
<psilord> pjb: thanks for the benchmarks. I appreciate it!
<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.
aindilis has joined #lisp
<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.
<Josh_2> Is there special naming convention for local dynamic variables?
<Josh_2> do they need earmuffs?
<pjb> Josh_2: they don't need the earmuff. You could consider avoiding it, since there's always a clear declarations of their specialness.
<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.
DGASAU has quit [Read error: Connection reset by peer]
<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.
<Josh_2> pjb: well I'm not calling eval or compile
<pjb> So you should be ok.
<Josh_2> alrighty
igemnace has quit [Ping timeout: 246 seconds]
<psilord> thanks pjb, later!
psilord has left #lisp ["ERC (IRC client for Emacs 25.1.1)"]
myrkraverk has quit [Ping timeout: 272 seconds]
okeg has quit [Quit: WeeChat 1.6]
DGASAU has joined #lisp
impulse has quit [Read error: Connection reset by peer]
Fare has joined #lisp
dddddd has quit [Remote host closed the connection]
igemnace has joined #lisp
myrkraverk has joined #lisp
lavaflow has quit [Read error: Connection reset by peer]
myrkraverk has quit [Ping timeout: 268 seconds]
lavaflow has joined #lisp
verisimilitude has joined #lisp
dale has quit [Quit: dale]
Arcaelyx has joined #lisp
wigust has joined #lisp
wigust- has quit [Ping timeout: 255 seconds]
libertyprime has quit [Ping timeout: 245 seconds]
ltriant has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
nanoz has quit [Ping timeout: 268 seconds]
myrkraverk has joined #lisp
ltriant has quit [Ping timeout: 272 seconds]
jack_rabbit has joined #lisp
torbo has quit [Remote host closed the connection]
Bike has quit [Quit: Lost terminal]
Oladon has quit [Quit: Leaving.]
Fare has quit [Ping timeout: 250 seconds]
Fare has joined #lisp
caltelt_ has quit [Ping timeout: 245 seconds]
sauvin has joined #lisp
beach has joined #lisp
<beach> Good morning everyone!
Inline has quit [Quit: Leaving]
AdmiralBumbleBee has quit [Ping timeout: 245 seconds]
AdmiralBumbleBee has joined #lisp
beach has quit [Remote host closed the connection]
vlatkoB has joined #lisp
hiroaki has joined #lisp
CrazyEddy has quit [Ping timeout: 255 seconds]
hiroaki has quit [Ping timeout: 246 seconds]
CrazyEddy has joined #lisp
<seok> Parenscript and iterate causes name conflicts. Whats the best way to resolve?
<jackdaniel> seok: don't USE both in your package, just use package qualifiers
<jackdaniel> if you are lazy and not overly attached to ANSI CL standard use package local nicknames
<seok> Ya, thats what I ended up doing
<jackdaniel> to make package names shorter
<seok> I hoped for another workaround as I would use both packages a lot
<jackdaniel> given ideal world where everything is implemented the moment you think about it, how do you imagine this working?
<jackdaniel> i.e foo has symbol qux and bar has symbol qux
<jackdaniel> i.e foo has symbol qux and bar has symbol qux
<jackdaniel> you use both foo and bar and call (qux 42)
<jackdaniel> what do you expect to happen?
<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.
Ukari has quit [Remote host closed the connection]
<pjb> So instead of writing parenscript:foo, you'd write parenscript-foo
Ukari has joined #lisp
<seok> pjb: Yes, this would be great as there is only one collision. How do I do this?
<pjb> (iterate-while more-to-do-p (parenscript-while more-dom-objects-p …))
<pjb> seok: I'm being ironical! There's no gain!
<pjb> just use the colon: (iterate:while more-to-do-p (parenscript:while more-dom-objects-p …))
Ukari has quit [Remote host closed the connection]
<jackdaniel> or use two colons just to be sure! ;-)
<seok> HaHa you found out the collision ;)
<gilberth> :shadowing-import-from
<pjb> seok: so you can still use both, and ^
Ukari has joined #lisp
<pjb> (defpackage "YOUR-PACKAGE" (:use "CL" "PARENSCRIPT" "ITERATE") (:shadowing-import-from "ITERATE" "WHILE")) ; or the other, depending on which you use more.
<pjb> and use the qualified symbol for the other.
<gilberth> Exactly.
<pjb> You may also use defalias to bind the function or macro to new symbols.
angavrilov has joined #lisp
<pjb> something like: https://pastebin.com/vU0gJS6E
<gilberth> pjb: Will that work in case of parenscript?
<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).
<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.
varjag has joined #lisp
<gilberth> It does not. WHILE in parenscript is both a CL macro and a keyword to the Parenscript language.
<gilberth> You could copy the CL macro definition. But not the Parenscript definition.
<pjb> You can check with (macroexpand-1 '(jwhile test body1 body2))
<gilberth> Yes, but what does (ps (jwhile foo bar)) yield? In contrast to (ps (ps:while foo bar))?
gxt has quit [Ping timeout: 250 seconds]
<seok> how do I write _wss.onopen = function(event) {_wss.send('hello')} in PS?
<pjb> Ah, true, perhaps ps processes it. Then you would have to modify the sources.
asarch has quit [Quit: Leaving]
<pjb> IIRC iterate also uses a code walker, so it may also be a problem with it.
<seok> if i do (lamda (event) ((@ _wss send) "hello")) it forces return
<gilberth> pjb: Point is: Both span new name spaces and you cannot just copy _every_ meaning of a symbol in every namespace.
<gilberth> pjb: I have never touched iterate. No clue, really.
<pjb> Definitely; it that case, it's better to use the previous solution.
beach has joined #lisp
<gilberth> pjb: An FBOUNDP somewhere would be nice too.
Fare has quit [Ping timeout: 250 seconds]
<gilberth> pjb: And SYMBOL-FUNCTION does not need to return a function. Yet (SETF SYMBOL-FUNCTION) wants a function.
<pjb> One can hope that if SYMBOL-FUNCTION doesn't return a function, (SETF SYMBOL-FUNCTION) will accept it.
<pjb> How else would SYMBOL-FUNCTION have gotten it?
pankajgodbole has joined #lisp
<gilberth> By MACRO-FUNCTION perhaps? By being a special form?
<pjb> Granted, it could be an internal setter, and (setf symbol-function) could have conforming checks.
<gilberth> It is crazy, but the spec tells so.
<pjb> That's where the hope intervenes.
<pjb> ok it was a Q&D defalias. There are libraries that are better written.
<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.
<pjb> gilberth: 1- the use case is not CL symbols. 2- it's true that for CL symbols, it would be more complicated.
varjag has quit [Ping timeout: 245 seconds]
Arcaelyx has quit [Ping timeout: 250 seconds]
razzy has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
scymtym has quit [Ping timeout: 246 seconds]
_whitelogger has joined #lisp
JohnMS_WORK has joined #lisp
nopf has joined #lisp
scymtym has joined #lisp
Josh_2 has quit [Remote host closed the connection]
Josh_2 has joined #lisp
zigpaw has quit [Remote host closed the connection]
zigpaw has joined #lisp
<splittist> morn
varjag has joined #lisp
gravicappa has joined #lisp
<beach> Hello splittist.
<splittist> Wishing everyone at ELS the best for next week!
<beach> Thanks. Are you not coming?
akoana has left #lisp [#lisp]
mingus has joined #lisp
<splittist> No. I can't really justify the 3 days of leave I would have to take (vs taking it with my family).
schweers has joined #lisp
<beach> Oh, I see. Too bad.
<beach> Maybe you can come visit us in Bordeaux instead sometime.
<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
<splittist> Well, the kids have school. Eventually they'll be embarrassed to be seen with their parents, then I can go (:
<beach> Heh!
<beach> That happened to me when I was 7. How old are your kids?
<gilberth> jackdaniel: Heh, tell that my wife please, do you?
<splittist> 6 and 11
<beach> OK so next year.
<splittist> Heh
<splittist> Well - Zurich would be hard to miss, anyway.
* gilberth doesn't even have children.
<beach> splittist: True.
<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.
<beach> Oh, I am sorry to hear that.
<phoe> But, as someone said it yesterday, I could have gone with Scheme if I wanted hygiene.
<beach> And you were organizing the dinner?
<schweers> *sigh* the keynodes sound interesting.
<phoe> beach: nope, not me
<beach> phoe: ah, must have misunderstood.
<beach> phoe: I should thank you for not coming then. If I get pneumonia, with my asthma, it could be fatal.
<phoe> beach: this is another reason. My conscience wouldn't let me live if I accidentally shrunk the Lisper population even further. :(
<beach> I fully understand.
* gilberth is lucky that depression is not contagious.
<gilberth> Fatal in cicrumstances, sure, but not contagious.
<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)
<gilberth> *sigh*
<gilberth> That may well be true. But I think, this is _way_ more complicated than that.
<jackdaniel> agreed, just saying that having depressed people around may induce depression; so in some sense it is contagious
<gilberth> I am an optimistic person, even.
<gilberth> jackdaniel: Sure, that could well be true.
jprajzne has joined #lisp
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 255 seconds]
gxt has joined #lisp
Tordek has quit [Ping timeout: 246 seconds]
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
hhdave has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
gxt has quit [Ping timeout: 246 seconds]
dmiles has quit [Ping timeout: 246 seconds]
beach has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
heisig has joined #lisp
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
dmiles has joined #lisp
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
DGASAU has quit [Ping timeout: 246 seconds]
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
Achylles has joined #lisp
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
DGASAU has joined #lisp
<phoe> fe[nl]ix: ping
m00natic has joined #lisp
lavaflow has quit [Ping timeout: 255 seconds]
Tordek has joined #lisp
Essadon has joined #lisp
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
<schweers> Is anyone aware of documentation on how to interpret the :graph report of sbcl statistical profiler?
<phoe> #sbcl should know better
Achylles has quit [Remote host closed the connection]
<schweers> phoe: good idea, thanks
igemnace has quit [Quit: WeeChat 2.4]
<heisig> schweers: Do you know about clim.flamegraph? It is great for visualizing the output of sb-sprof.
<schweers> no, I do not know about it
<heisig> The url is https://github.com/scymtym/clim.flamegraph/tree/future (the good stuff is on the future branch)
<schweers> thanks, I’ll have a look!
gxt has joined #lisp
ym555 has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
amerlyq has joined #lisp
flazh has quit [Ping timeout: 246 seconds]
pjb has quit [Remote host closed the connection]
Bike has joined #lisp
pjb has joined #lisp
flazh has joined #lisp
Lord_of_Life has quit [Read error: Connection reset by peer]
<schweers> heisig: thanks a lot for that tip. It’s a bit buggy, but the tool is really awesome and gave me at least one valuable insight!
orivej has quit [Ping timeout: 246 seconds]
Lord_of_Life has joined #lisp
<heisig> schweers: Great to hear you like it, too! I think it is relatively stable for a not-yet-announced tool from a branch labeled 'future' :)
<schweers> that on the other hand is very true!
<schweers> also, the only buggyness I’ve encountered, is that it lands in the debugger on redisplay. skipping redisplay works fine
<schweers> so it’s usable and really awesome!
<heisig> As far as I know, scymtym also welcomes patches and feedback.
<schweers> Sadly I have no idea how [mc]clim works, so I’m afraid I won’t be able to contribute.
Ukari has quit [Remote host closed the connection]
<jackdaniel> snarky part of myself feels the urge to say: it doesn't (but that would be a lie :)
Ukari has joined #lisp
<schweers> lol
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
Achylles has joined #lisp
lucasb has joined #lisp
fiddlerwoaroof has quit [Quit: Gone.]
fiddlerwoaroof has joined #lisp
zooey has quit [Ping timeout: 256 seconds]
akater has quit [Ping timeout: 256 seconds]
zooey has joined #lisp
akater has joined #lisp
jmercouris has joined #lisp
random-nick has joined #lisp
wxie has joined #lisp
ebrasca has joined #lisp
rippa has joined #lisp
elderK has joined #lisp
LiamH has joined #lisp
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
vtomole has joined #lisp
Ukari has quit [Remote host closed the connection]
Ukari has joined #lisp
warweasle has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
Inline has joined #lisp
vtomole has quit [Quit: Page closed]
lavaflow has joined #lisp
pjb has quit [Remote host closed the connection]
jdz has quit [Quit: ZNC - http://znc.in]
pjb has joined #lisp
jdz has joined #lisp
pfdietz has joined #lisp
andrei-n has joined #lisp
heisig has quit [Remote host closed the connection]
heisig has joined #lisp
sjl_ has joined #lisp
wxie has quit [Quit: Bye.]
wxie has joined #lisp
wxie has quit [Ping timeout: 250 seconds]
hiroaki has joined #lisp
<phoe> Is there some sort of mechanism in ASDF that would prevent an arbitrary symbol from being used?
<phoe> I want to constrain a given system and/or systems from ever using a given symbol.
<phoe> I could achieve a similar behavior with a git grep pre-commit hook, but I wonder if it's possible on the Lisp side.
<Bike> what do you mean "using"
<phoe> being read, I guess
<phoe> and it seems that I'd need to codewalk to achieve that
<phoe> oh well, okay - too much hassle
<Bike> what would happen if it was read?
<phoe> nothing
<phoe> though I'd like to signal an ASDF-load-time error
<phoe> but yeah, I won't do that
Arcaelyx has joined #lisp
jmercouris has quit [Remote host closed the connection]
<pjb> phoe: you could write a reader macro that would read the symbols, and reject the forbidden symbol. However, there's no link between reading symbols and system. You would have to define such a link, probably dynamically.
<pjb> phoe: you could also do it post-hoc, using find-symbol; but again, this would check the symbol is interned in a package, but symbols can be interned in the same package by different systems!
chipolux has quit [Quit: chipolux]
chipolux has joined #lisp
slyrus_ has joined #lisp
Ukari has quit [Remote host closed the connection]
slyrus__ has quit [Ping timeout: 250 seconds]
<heisig> phoe: Would SBCL's package locks help here? Alternatively, you could preprocess all source files with a suitable Eclector client.
<pjb> New O(nlogn) multiplication algorithm: https://hal.archives-ouvertes.fr/hal-02070778/document
<phoe> heisig: hmm. Eclector sounds like an option. Can I make it run before ASDF loads a file of a particular system?
Ukari has joined #lisp
dale has joined #lisp
jack_rabbit has quit [Ping timeout: 245 seconds]
dddddd has joined #lisp
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
<heisig> phoe: Sure, ASDF is extensible. It is probably easiest to provide your own system subclass.
<phoe> hm
gigetoo has quit [Ping timeout: 255 seconds]
Fare has joined #lisp
orivej has joined #lisp
gigetoo has joined #lisp
keja has quit [Ping timeout: 255 seconds]
bgardner has quit [Ping timeout: 255 seconds]
Fare has quit [Ping timeout: 245 seconds]
Fare has joined #lisp
beach has joined #lisp
hiroaki has quit [Ping timeout: 250 seconds]
bgardner has joined #lisp
lnostdal has quit [Excess Flood]
lnostdal has joined #lisp
igemnace has joined #lisp
t58 has joined #lisp
Josh_2 has quit [Read error: Connection reset by peer]
warweasle has quit [Quit: later]
rdap has quit [Remote host closed the connection]
rdap has joined #lisp
karlosz has joined #lisp
ebrasca has quit [Remote host closed the connection]
selwyn has joined #lisp
Josh_2 has joined #lisp
heisig has quit [Remote host closed the connection]
keep_learning has quit [Ping timeout: 246 seconds]
m00natic has quit [Remote host closed the connection]
jprajzne has quit [Quit: Leaving.]
<selwyn> hello all
<beach> Hello selwyn.
<Josh_2> Hi
<selwyn> today i noticed that (make-array '(0 0)) and (make-array '(0 1)) are not eq, or even equalp. yet they have the same printed representation #2A()
<selwyn> now i understand why they are quite different from each other
vsync has joined #lisp
<vsync> doing some work with spooling... message queueing touching on event sourcing maybe
<vsync> anything I should read?
<selwyn> but i vaguely recall reading somewhere that having two objects that are not 'eq' to each other having the same printed representation in CL is asking for trouble
<vsync> and, are there Lisp technologies/techniques/libraries etc useful for this?
<vsync> I remember PostgreSQL has a way to subscribe to updates - anything in e.g. CLSQL to support? and maybe graph DBs (allegro) have something nice?
<beach> selwyn: It happens all the time.
<selwyn> my question is 1) do i in fact recall correctly and 2) if this is indeed received wisdom how seriously should i take it considering that the language itself does not appear to
<vsync> or, what MQ products work particularly nicely (esp with Lisp) if any
<vsync> used ActiveMQ via JMS before and it was fine, but different platform obviously
<selwyn> beach: thank you. is it considered bad practice?
<beach> selwyn: (eq (list 1) (list 1)) => nil
<beach> It is perfectly normal.
<selwyn> hm. of course...
<beach> selwyn: but arrays with one dimension containing no elements are strange.
<selwyn> in which ways?
<beach> It means they can contain no elements.
<phoe> selwyn: arrays of different dimensions cannot be equalp.
<phoe> even if their effective element count is =.
<phoe> so (make-array '(0 0)) and (make-array '(1 0)) are not going to be equalp because of that.
sjas has joined #lisp
<selwyn> i see. thanks for answers
<beach> Anytime.
karlosz_ has joined #lisp
lnostdal has quit [Ping timeout: 250 seconds]
<Bike> in my sbcl, arrays with dimensions (0 0) (0 1) and (1 0) actually all have different readable printed representations.
karlosz has quit [Ping timeout: 245 seconds]
karlosz_ is now known as karlosz
<Bike> #2a(), #a((0 1) t), and #2a(()) respectively
<phoe> (make-array '(0 1 0)) ;=> #3A()
<phoe> (make-array '(0 0 1)) ;=> #3A()
ckonstanski has joined #lisp
<selwyn> Bike: that's interesting, my sbcl does not
<phoe> you need to have a nonzero first dimension
<Bike> did you specify :readable t
<phoe> selwyn: Bike: what are your sbcl versions?
<Bike> or *print-readably* true
<phoe> Bike: oh, I haven't
<Bike> :readably, sorry
<phoe> one sec
<phoe> yes, but #A(...) is SBCL-specific syntax
<Bike> yes it is.
<phoe> not portable and so on
<phoe> but yes, you are correct
<Bike> this doesn't alter beach's point or anything, i just wanted to say that *print-readably* is important. without it the printer can pretty much do whatever, since it's intended for humans rather than toasters.
lnostdal has joined #lisp
<beach> Good point.
<selwyn> i am using 1.4.14. no i did not specify *print-readably* -> t , now I do i get the same results as bike.
<Bike> the rule you are probably thinking of, selwyn, is that if you read a readably-printed object, you get an object that is "similar" to the original object.
<Bike> similarity is a kind of equality, though it's not EQ.
<phoe> Bike: https://i.imgtc.com/8RuxtJZ.png well you are right
<Bike> not bad
beach has left #lisp ["ERC (IRC client for Emacs 25.2.2)"]
<phoe> hope toasters understand that
<Josh_2> what on earth is that phoe xD
<Bike> toast
<phoe> Josh_2: a toaster, can't you read?
<phoe> s/toaster/toast/
<Josh_2> its toast
comborico1611 has joined #lisp
karlosz has quit [Quit: karlosz]
<selwyn> Bike: that rule rings a bell. i did not know about similarity though
karlosz has joined #lisp
karlosz has quit [Client Quit]
Fare has quit [Ping timeout: 250 seconds]
selwyn has quit [Read error: Connection reset by peer]
Fare has joined #lisp
<pjb> There are serveral kinds of objects that have the same printed representation. For example, simple-vectors vs. vectors; pathnames, empty arrays, etc. round-trip print/read has been broken by those modern data types…
<pjb> hash-tables don't even have a standard printed representation!
<pjb> (values (make-array '(0 0)) (make-array '(0 1)) (make-array '(1 0))) #| --> #2A() ; #2A() ; #2A(()) |#
hhdave has quit [Ping timeout: 255 seconds]
comborico1611 has quit [Quit: Konnection terminated!]
X-Scale` has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
X-Scale has quit [Ping timeout: 245 seconds]
X-Scale` is now known as X-Scale
jsjolen has joined #lisp
orivej has joined #lisp
lumm has joined #lisp
ckonstanski has left #lisp ["ERC (IRC client for Emacs 26.2)"]
<jsjolen> stylewarning: Hey, is this stylewarning of cl-a-d-t? If so: I'm using cl-a-d-t to write a compiler (just toy stuff for university) and I got into the situation that I want tests on the output of my AST -> AM compiler. So I want tests like (compile (+ (num 1) (num 2))) == (list (push 2) (push 1) ADD). That means that I need to check for 'shape equality' (structural induction) and that means I need some sort of fold for that to happen
<jsjolen> (probably a catamorphism). This would be nice to generate through some macro (DEFINE-FOLD adt) and I know that Haskell can at least generate functors for their ADTs automagically. SO, HERE'S THE POINT TO IT ALL: If I write this, would you like a pull request to the algebraic-data-library?
atgreen has joined #lisp
rumbler31 has joined #lisp
orivej has quit [Ping timeout: 250 seconds]
nowhere_man has joined #lisp
pankajgodbole has quit [Remote host closed the connection]
Fare has quit [Ping timeout: 245 seconds]
<seok> Is there a way I can call an (update) function at regular intervals?
<seok> precisely
<pjb> (bt:make-thread (lambda () (loop (sleep 3) (update)))) ; more or less precisely regular…
<seok> Nice
<seok> How would I chech if (update) is taking longer than a single interval?
<grewal> (get-universal-time)
<phoe> execute (update) in a separate thread that sets some sorta variable when it's starting, and then sets it again when it's done
<grewal> And subtract from the previous value
<phoe> conditionalize your timer code based on that
<pjb> (defmacro on-overtime (time exception &body body) `(let ((start (get-universal-time))) (multiple-value-bind prog1 (progn ,@body) (if (< time (- (get-universal-time) start)) ,exception))))
<pjb> (on-overtime 2 (error "took too much time") (sleep 3))
<seok> Great ideas, thanks guys, I'll give it some thought
<seok> pjb: did you just write that from the top of your head?
<pjb> yes.
<seok> Do tell me that's from a code you've used before
<seok> haha
<pjb> A seriou macro would include a unwind-protect too.
<pjb> Nope.
<seok> Darn, how long will it take for me to be that fluent in CL
<pjb> When it's from code I've used before, I give an url.
<pjb> ten years, minimum.
<pjb> I started CL in 1996.
<seok> You've used CL for decades?
<seok> O
<seok> When I have a child I'll teach him Lisp once he is in school. Haha
<pjb> I saw people using MacLisp at the university on a Macintosh in 1985, and I couldn't understand then why. Later I could beat me for not having started using lisp in 1986 (ten years earlier!)
<pjb> seok: dont' wait, teach them to read, and to program as soon.
<seok> Yes, ASAP.
<seok> is bt Bordeaux Threads?
amerlyq has quit [Ping timeout: 272 seconds]
<seok> that one's the go-to library for threading is it?
<pjb> Teach them to read and write with a keyword: HA-NEUL ; then: (loop (print '(annyeonghaseyo ha-neul)))
<pjb> Yes, bordeaux-threads.
<seok> Heh. you caught that I am Korean
<pjb> ;-)
MichaelRaskin has joined #lisp
amerlyq has joined #lisp
ym555 has quit [Ping timeout: 268 seconds]
atgreen has quit [Read error: Connection reset by peer]
gxt has quit [Ping timeout: 250 seconds]
Fare has joined #lisp
nanoz has joined #lisp
<stylewarning> jsjolen: yes that’s me
<stylewarning> jsjolen: I would love PRs!
<stylewarning> jsjolen: also be sure to check out the Coalton project
Aruseus has joined #lisp
drewlander has quit [Ping timeout: 255 seconds]
norserob has quit [Read error: Connection reset by peer]
__jrjsmrtn__ has joined #lisp
_whitelogger has joined #lisp
Quasus has joined #lisp
Bike has quit []
Fare has quit [Ping timeout: 244 seconds]
nanoz has quit [Read error: Connection timed out]
Jesin has quit [Quit: Leaving]
orivej has joined #lisp
Jesin has joined #lisp
kyby64 has joined #lisp
vms14 has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
funnel has quit [Ping timeout: 246 seconds]
<vms14> which is your favourite html template generator for common lisp?
Fare has joined #lisp
bgardner has quit [Quit: leaving]
bgardner has joined #lisp
funnel has joined #lisp
<MichaelRaskin> Mine is CL-Emb. But I am biased, I am currently nominally maintaining it (if bugs are reported, I do investigate and push a fix if I can). But I am only nominally maintaining it because I liked it and it was unmaintained, so to add features I had to pick up maintainership.
random-nick has quit [Ping timeout: 250 seconds]
<vms14> thanks for maintaining it <3
gravicappa has quit [Ping timeout: 250 seconds]
<MichaelRaskin> Well, it doesn't actually mean I am doing anything. Most of the time it doesn't.
<MichaelRaskin> But please tell you if you know of some bugs
vlatkoB has quit [Remote host closed the connection]
<aeth> If I needed to generate HTML, I'd probably write it myself, like a true Lisper, always writing a new library.
<MichaelRaskin> There is CL-Emb and there is CL-WHO, do you really need something different?
<aeth> Generating strings (or, alternatively, character streams) is a fun problem
<aeth> There's probably room for a dozen different solutions
<MichaelRaskin> Also, there is a CL implementation of Mustache, I think
<MichaelRaskin> But… But… Parsing is also a fun problem with a lot of interesting things inside!
<MichaelRaskin> And unlike templating, actually far from solved.
<White_Flame> aeth: my sexpr->html renderer is like 7 lines across 2 functions
<MichaelRaskin> (do not listen to the lies that it is)
<aeth> Parsing is comparatively rare because it's not as trivial because there's no FORMAT for parsing
<aeth> Of course, a few lines means you used hard to read FORMAT strings instead of many FORMATs and/or lower-level writing functions
<MichaelRaskin> … yes, the standard of Common Lisp does not include an almost complete solution for parsing, that's true
<aeth> I totally believe it could be done in a few lines of FORMAT. Now, should it?
<verisimilitude> You can get somewhat far with readtables.
<White_Flame> aeth: are you talking about rendering or parsing with FORMAT?
<aeth> By rendering you mean (:html (:body)) to "<html><body></body></html>" or the character stream equivalent, right? (And a stream solution can build strings, too... the direct string solution would either use FORMAT NILs or one giant generated FORMAT string)
Fare has quit [Ping timeout: 272 seconds]
<aeth> verisimilitude: Can you describe how?
<aeth> White_Flame: Parsing with FORMAT-style strings is probably a bad idea... I think C has something like this?
<aeth> regexp is probably a more flexible solution
<White_Flame> btw, my renderer does something I gleaned from erlang: generate nested lists of strings ("iostring"), and output it serially as a separate step
<White_Flame> it makes more literal conses, but ends up being quite a bit faster, and WAY simpler
<dlowe> surprised it's faster.
<verisimilitude> Well, there's that example of writing a JSON parser using only reader macros.
<aeth> White_Flame: I'd just write directly to a character stream in tree-walking order
<White_Flame> dlowe: there's no string concatenation
<dlowe> White_Flame: yeah, I got that part.
<aeth> White_Flame: I suspect comparative benchmarks would depend on with-output-to-string's implementation
<vms14> aeth: you are right about a lisper should create it's own, and it's like one of the first exercises a lisper should make to practice with sdl
themsay has joined #lisp
<aeth> I suspect a generating a string from a stream is a character buffer that gets copied and doubled if it runs out of space that is then written with its length and type tag at the end, making the front part of it a valid string. Possibly more efficient than anything we can directly write in CL itself
<aeth> "character buffer" being probably UTF 32 characters, not C chars, even though I described a C-like algorithm
orivej has quit [Ping timeout: 246 seconds]
<aeth> What you can't directly do in CL itself is cut the length of the string once the final size is known. You'd subseq, although a sufficiently smart compiler could see that that is the last use of the original
lucasb has quit [Quit: Connection closed for inactivity]
<aeth> (You also can only have adjustable vectors by changing its type or doing the copying manually.)
random-nick has joined #lisp
Fare has joined #lisp
jsjolen has quit [Remote host closed the connection]
<pjb> aeth: you can directly cut the length of the string, if you allocated it with a fill pointer, or as an adjustable array.
Bike has joined #lisp
kyby64 has quit [Quit: Leaving]
Jesin has quit [Quit: Leaving]
scymtym has joined #lisp
nowhere_man has quit [Ping timeout: 244 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
LiamH has quit [Quit: Leaving.]
<verisimilitude> That's one use for displaced arrays, aeth.
Jesin has joined #lisp
Josh_2 has quit [Ping timeout: 268 seconds]
catchme has joined #lisp
catchme has quit [Client Quit]
andrei-n has quit [Remote host closed the connection]
vms14 has quit [Quit: WeeChat 2.3]
sjl_ has quit [Quit: WeeChat 2.3-dev]
<White_Flame> displaced arrays don't free the memory for the unused tail
amerlyq has quit [Quit: amerlyq]
<stylewarning> in general partially freeing memory is hard without indirection
<stylewarning> (or without the participation of the memory allocation system)
gxt has joined #lisp
Fare has quit [Ping timeout: 246 seconds]
tsizz has joined #lisp
<tsizz> hello
<phoe> heyy
<White_Flame> what's going on?
Josh_2 has joined #lisp
__jrjsmrtn__ has quit [Quit: ZZZzzz…]
<Josh_2> If I (bt:kill-thread <thread>) and that thread is running a function that has a handler-case does the handler-case get called?
<Josh_2> assuming the thread is evaluating something inside the handler-bind
<Josh_2> case8
<Bike> i don't think so. killing is pretty abrupt.
<Josh_2> hmm
<Bike> unwind-protects i thiiiiink will still run?
<Josh_2> oof
teej has quit [Quit: Connection closed for inactivity]
<Josh_2> sorry that's what I meant
<Bike> " Terminates the thread THREAD, which is an object as returned by MAKE-THREAD. This should be used with caution: it is implementation-defined whether the thread runs cleanup forms or releases its locks first. " oh, good
<Josh_2> I meant unwind-protect
<Bike> that's for destroy-thread, though
<Josh_2> This whole question has just been full of mistakes from start to finish xD
<Josh_2> Yep destroy-thread is what I used xD
keep_learning has joined #lisp
<Josh_2> I need a big boi thread to stop my other networking threads, currently I just use destroy-thread but the unwind-protect doesn't seem to be called
<Josh_2> perhaps there is a nicer way to stop the threads like with conditions
<Bike> i think you would want to set up some kind of condition-wait deal
<Josh_2> I think the best way to kill my threads would be to have a variable that the threads will atomic read to check if they should continue
<Josh_2> altho that will be a problem with usockets wait-for-input
dale has quit [Quit: dale]
<fe[nl]ix> phoe: pong
<tsizz> ive decied i wanted to learn lisp, but very very slowly lol
<tsizz> bc of school and work D:
<Josh_2> do et
<tsizz> common lisp best lisp?
<Josh_2> yes
<tsizz> can i somehow add it to my website code as a feature?
<tsizz> well im sure i can
<tsizz> i wonder if its hard though
<Josh_2> what do you mean?
<tsizz> idk. all i remeber is that graham website about lisp and he wrote websites with lisp. and since i work with web for now, i thought that'd be cool
<Josh_2> I right, yeh web design with CL is really good
<tsizz> awesome i'll see what i can do with it
<Josh_2> There is Hunchentoot which is a webserver and you can use a library like cl-who to generate html
<tsizz> hm
<tsizz> i wonder how it works with current js libraries
<Josh_2> I personally just write the JS normally and include the scripts in my cl-who functions
<Josh_2> I can show you some examples if you want
<tsizz> hm sure
<tsizz> perhaps something super basic first
<tsizz> also is there any holy grail learning resource for lisp
<Josh_2> If you are already a programmer then PCL
<Josh_2> Practical common lisp
<tsizz> opk thanks
<Josh_2> So whenever I want a navigation bar I just call the function (navigation) within a with-html and it will display that bar in that site
<tsizz> Josh_2: i assume u still have to use css or styling?
<Josh_2> I have css in a .css file
<tsizz> mhm
<Josh_2> Which is included in my function (header)
<tsizz> and the rest of the page is JS or what?
<Josh_2> The whole page in that image is generated per request
<Josh_2> So the client requests a page on my hunchentoot server, the server then generates the page dynamically and serves it to the client
<tsizz> all done in pure CL?
<Josh_2> Yes
<tsizz> is it possible to mix it for whatever reason with js
<Josh_2> Yes
<tsizz> like make the navbar CL and rest JS
<Josh_2> I use JS
<tsizz> server side language doesn't matter at all right when talking to front end
<Josh_2> But remember how you use <script src= ...> in html, well all my scripts are just included in my dynamically generated html
<aeth> pjb: But only a implementation internals can do this with the simple-string that with-output-to-string returns, i.e. (type-of (with-output-to-string (out) (format out "Hello, world!~%"))) => (SIMPLE-ARRAY CHARACTER (14)) ; technically, only string is specified, but I'm sure some code would break somewhere if it wasn't a simple-array
<aeth> If you implemented it yourself you'd have to copy it into a simple character array at the end, or manually adjust it with (simple-array character (*))s and subseq at the end to get the correct final length
<Josh_2> tsizz: https://plaster.tymoon.eu/view/1288#1288 that is my html header which is part of all the pages
<tsizz> thats nice
<Josh_2> generating a page then ends up just being a matter of piecing some blocks together
<Josh_2> so my index page ends up being (defun index-page () (with-html (:html (header) (index-body))))
<tsizz> import is big in JS/node, but isn't that not a thing in lisp or is that just my academia just talking about strictly functional programming
<aeth> pjb: Actually, slight correction, I should have used typep since reporting either simple-array character or simple-string is up to the implementation.
<Josh_2> tsizz: like package management?
<Josh_2> importing external libraries?
<tsizz> yeah or importing a function
<tsizz> but that might just be a part of node...
<tsizz> i think that is just part of node
<Josh_2> You can import external libraries using Quicklisp
Fare has joined #lisp
<Josh_2> so cl-who the library I'm using to generate that HTML is imported like (ql:quickload #:cl-who) once you have quicklisp installed :P
<Josh_2> PCL is a very good place to start with CL
joaj has joined #lisp
<tsizz> Josh_2: okay cool thanks im reading the first part right now the why learn CL part hha
<Josh_2> No problems!
<tsizz> i think this is the one of the most intriuging parts "You'll get more done, faster, using it than you would using pretty much any other language."
<tsizz> would you say doing computer science in the 80s writing assembly code was harder
<tsizz> or whenever they uesd to do that
<tsizz> more
<Josh_2> you will get things done faster if the program is sufficiently complicated, not sure if people will agree with me
<Josh_2> that's pretty vague
<tsizz> yeah
<Josh_2> doing simple things can seem a bit annoying but when it comes to doing harder things its a joy to use CL
<tsizz> i want to make a discord bot :)
<Josh_2> There are a couple libraries for that, I actually 75% finished my own hahaha
<Josh_2> I think lispcord is one
<tsizz> thats probably way too hard for a beginner
<tsizz> yeah i just looked it up
<tsizz> ill probably do it in js or python
<Josh_2> documentation can be a bit of an issue in CL, not gonna lie
<tsizz> oof i rely on that a lot
<Josh_2> well major libraries are all documented really well, but stuff you find on github might not be
<tsizz> i love discords design
<tsizz> i just looked up their stack. might just copy their css library
<tsizz> hm do css libraries work with CL or they have to build support for it.
<tsizz> or i mean css libaries for js like bootstrap
<Josh_2> Why wouldn't they
<tsizz> oh true css doesn't care about the js...i think
<tsizz> so i assume you can access everything in dom with CL
<tsizz> im just a bit confused bc natural language for browser is JS so when CL comes in the picture not too sure
<Josh_2> CL isn't a browser language
<Josh_2> Its the server language
<Josh_2> everything on the browser is the same
Quasus has quit [Ping timeout: 246 seconds]
<Josh_2> so all ur webdev stuff still works but you can use CL as your backend instead of PHP
<tsizz> but your navbar
<tsizz> is in CL. are you just returning html with CL
<tsizz> through CL*
<Josh_2> yes
<tsizz> but then dynamic stuff...? u use js or some CL library that compile to JS or something..?
<Josh_2> The client sends a request to my Hunchentoot server, which then evaluates some functions to get the HTML it then sends that HTML to the client
<Josh_2> Dynamic webstuff is done with JS
<Josh_2> although there are CL to JS libraries :P
<Josh_2> But I prefer just to write JS
<aeth> tsizz: A slight variation on what Josh_2 is saying... I personally find that writing things from scratch in Common Lisp is easier than in just about any other language, but that the necessity to write things from scratch is greater, so I'm not sure there's a real net time savings or not. It does suggest that CL is well-suited for very underexplored problems, though.
<aeth> Writing something in C++ or Java is much harder than CL but someone else almost certainly already wrote a library to do it.
<tsizz> mhm yeah tradeoffs
<tsizz> ML in lisp vs python?
<tsizz> or R
<aeth> Really, none of the above. ML is done on GPUs (or specialized hardware, like Google's TPUs).
random-nick has quit [Read error: Connection reset by peer]
t58 has quit [Quit: bodies under my floor are starting to smell again.]
teej has joined #lisp