z3t0 has quit [Remote host closed the connection]
<White_Flame> because of APPLY, keyword values need to be able to be runtime scanned from a generic argument list
<Bike> indeed you can have the keys be returned from calls or whatever. it's just very unusual to do so, so sbcl complains a little.
z3t0 has joined #lisp
<stacksmith> That's what I thought.
<White_Flame> ( s/values/parameters/ )
hiroaki has quit [Ping timeout: 256 seconds]
<stacksmith> I am not sure why the warnings went away...
damke_ has quit [Ping timeout: 264 seconds]
z3t0 has quit [Ping timeout: 252 seconds]
oleo has joined #lisp
damke_ has joined #lisp
shifty has joined #lisp
<stacksmith> White_Flame: would you give me the full link?
<White_Flame> oh, I wasn't referring to a specific part of the spec, just what it would take to APPLY a function that took keyword args
<stacksmith> Ha.
<White_Flame> if you use DISASSEMBLE in SBCL, you'll often see something like "non-keyword parsing entry"
<White_Flame> so there's another path that walks through the arguments one by one at runtime, seeing where in the keyword list things match up
trocado has quit [Ping timeout: 268 seconds]
smurfrobot has joined #lisp
<White_Flame> so that needs to be resilient to dynamically passed argument lists (like APPLY) as well as computed keywords, by necessity
<stacksmith> That is entirely sensible. If I could only figure out how I got this warning before, I'd feel a whole lot better.
<Bike> compile-filing "(defun foo (&key a) a) (defun bar (b) b) (defun baz (x) (foo (bar :a) x)) does it fo rme.
nirved has quit [Quit: Leaving]
<_death> I actually used runtime keyword args once.. even made a comment about it :)
fikka has joined #lisp
<stacksmith> Bike: Not for me! Shite.
<stacksmith> What warning do you get?
<stacksmith> And what implementation are you using?
<Bike> sbcl.
<Bike> "The first argument (in keyword position) is not a constant, weakening keyword argument checking."
<Bike> note that it has to be compile-file
Kaisyu has joined #lisp
<Bike> also, it's actually a note rather than a warning.
markong has quit [Ping timeout: 268 seconds]
<stacksmith> Right. that does work.
LiamH has quit [Quit: Leaving.]
<stacksmith> I think I was doing it from REPL, which behaves differently.
<Bike> yeah, it doesn't warn in the same way.
<jmercouris> Shinmera: In case you are interested, changing it to define-command fixed the indentation somehow magically :D
<jmercouris> Shinmera: Seems like indentation on something that doesn't meet those prefixes that you listed results in improper indentation
kupad has quit [Ping timeout: 256 seconds]
<stacksmith> Great... Thanks a bunch.
jmercouris has quit [Ping timeout: 264 seconds]
wxie has joined #lisp
<stacksmith> _death: curious about why you used runtime keywords...
wxie has quit [Client Quit]
<_death> stacksmith: just an aesthetic choice.. could be easily written differently
pierpa has joined #lisp
randomstrangerb has quit [Ping timeout: 256 seconds]
randomstrangerb has joined #lisp
moei has quit [Read error: Connection reset by peer]
<stacksmith> _death: by comment, do you mean a blog entry somewhere? I am morbidly curious about things that seem to be useful, but usually are a bad idea, like doubly-linked lists...
moei has joined #lisp
<yggdrasil_core> linked lists get a bad rap
<iqubic> Oh, I see.
loli has quit [Quit: WeeChat 2.0.1]
<stacksmith> I've had at least three situations where I thought I needed a doubly-linked list, but after writing gobs of code I always trashed it and went back to conses...
shifty has quit [Ping timeout: 248 seconds]
<stacksmith> Now I am really cautious about that... Fool me thrice...
ebrasca has joined #lisp
smurfrobot has quit [Remote host closed the connection]
<jasom> unbounded dequeues are a good use for doubly-linked lists
<yggdrasil_core> doom3 used intrusive linked lists for it's entity container
<pjb> wasn't it written in C?
<jasom> doom3 was probably C++
<jasom> just judging by the release date
<yggdrasil_core> C or C++, not sure which
loli has joined #lisp
<pjb> In those languages, it's customary to use intrusive linked lists, because of typing. (to avoid casting).
ckonstanski has quit [Remote host closed the connection]
<pjb> To undestand the horror that C is, have a look at /usr/include/sys/queue.h
<stacksmith> Yeah, intrusive lists are another problematic thing. It often seems like a good idea - the objects then have direct access to the remaining list, but it inevitably leads to reinventing the wheel as a good chunk of CL becomes unusable...
z3t0 has joined #lisp
Rawriful has quit [Quit: WeeChat 1.4]
EvW has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 240 seconds]
turkja has joined #lisp
pagnol has quit [Ping timeout: 268 seconds]
Cymew has joined #lisp
<jasom> pjb: there are other advantages of intrusive lists besides avoiding casting; C++ can do non-intrusive lists via templating but people still sometimes choose to use intrusive lists
<pjb> jasom: yes, like code duplication, i-cache overflowing, etc.
brendyn has joined #lisp
<_death> in Lisp, size considerations..
Cymew has quit [Ping timeout: 240 seconds]
<rme> I have never heard the term intrusive list.
<yggdrasil_core> probably because there is a big stigma around linked lists
fikka has joined #lisp
<stacksmith> In my case, I wound up with a shitton of code in every case. Linkage maintenance is problematic. Many tricks that work with lists don't work in both directions. And mostly, all the list operations no longer work.
<yggdrasil_core> circular linked lists are pretty interesting
<yggdrasil_core> ... I forgot where I was going with that :p
<jasom> rme: the generic term is "intrusive data structure" or "intrusive container" it's where your container and data are implemented in the same structure. So for e.g. a list of two dimensional coordinats, instead of having a list containing structures with X and Y fields, you'd have a structure with X, Y, and Next fields.
smurfrobot has joined #lisp
<jasom> The primary advantage comes from the fact that a new element needs only a single allocation, and that the container data and payload data have spatial locality.
<pfdietz> This reminds of utility fields that get used in algorithms. For example, a mark bit used by graph traversal algorithms.
<pfdietz> You could implement that as a separate map, but that's much less efficient.
attila_lendvai has quit [Quit: Leaving.]
<jasom> pfdietz: right it's intrusive in the sense that it breaks abstractions, so you lose the benefit of the abstraction but also lose the cost.
<_death> an item then belongs to a single container
<pfdietz> I've wanted cl-containers to support a WITH-MAPPING macro, that allows an algorithm to use a utility field in the container's objects. If someone else wants to use that field the WITH-MAPPING macro would just hand them the slower non-intrusive map instead, transparently.
<jasom> _death: well if you wanted points that could belong to two containers, you can have two next pointers! (Yes I've seen this in kernel code).
<_death> jasom: yep.. this reminds me of skip lists
smurfrobot has quit [Ping timeout: 268 seconds]
<jasom> modern architectures can encourage this a lot both because indirection can be expensive *and* the only thing that matters for memory performance is the number of cache lines you access, not the number of bytes.
nowhere_man has quit [Ping timeout: 248 seconds]
nowhereman has joined #lisp
Cymew has joined #lisp
<_death> it also has aesthetic properties, since an object is identified with its "node"
<_death> so it's possibly useful in repl-style programs
<jasom> conversely I've seen a structure that was the size of a cache line and held a single word value only (plus padding). This was so that an array of them could be efficiently accessed by multiple CPUs with unshared L1 caches.
ckonstanski has joined #lisp
Pixel_Outlaw has joined #lisp
Cymew has quit [Ping timeout: 240 seconds]
emacsomancer has joined #lisp
Cymew has joined #lisp
<rumbler3_> jasonm: can you explain that last part some more
Cymew has quit [Ping timeout: 248 seconds]
Cymew has joined #lisp
<rme> I've done that trick before.
randomstrangerb has quit [Ping timeout: 268 seconds]
Cymew has quit [Ping timeout: 240 seconds]
randomstrangerb has joined #lisp
<rme> I think it was in the context of a (concurrent) ring buffer, where I wanted the read and write pointers to be in different cache lines.
Cymew has joined #lisp
<rumbler3_> rme: how does that work or why would you do that
Devon has quit [Ping timeout: 248 seconds]
nowhereman has quit [Disconnected by services]
nowhere_man has joined #lisp
Cymew has quit [Ping timeout: 256 seconds]
Fare has quit [Ping timeout: 248 seconds]
<rme> I was trying to see if it was possible to keep up with reading packets from a 10 gig ethernet interface, and I didn't want consumer processes to have to contend for the cache line containing the write pointer, which was being continually bumped by the producer.
<rme> Kinda off-topic for here, though.
dieggsy has quit [Remote host closed the connection]
<rme> I failed at the attempt, by the way. That made (and still makes) me very unhappy.
<rme> But I had like something like a 20ns budget to classify and process a packet.
<rumbler3_> how were you able to specify that different processor's cache lines would have specific data
z3t0 has quit [Remote host closed the connection]
z3t0 has joined #lisp
<_death> you make sure each item is properly aligned and of a cache line's size, and have each processor access a different one?
z3t0 has quit [Ping timeout: 252 seconds]
<rme> yes, that's basically it.
jstypo has quit [Read error: Connection reset by peer]
Devon has joined #lisp
emaczen has joined #lisp
LoggerZZZ has joined #lisp
<emaczen> what would be faster writing to a vector and then writing to a file, or writing to a string-output-stream and then writing the string-output-stream to a file?
<emaczen> Or would the difference be trivial?
<emaczen> I was trying (write-sequence (get-output-stream-string sstream) file)
<Bike> can you not just write to the file?
<_death> like insignificant, both will be swamped by the file output
<emaczen> Bike: wouldn't I want to minimize the number of IO operations?
<rme> I would think that the cost of doing i/o would dominate in such a case.
Devon has quit [Ping timeout: 252 seconds]
ckonstanski has quit [Remote host closed the connection]
<_death> it's likely that the streams are buffered anyway
wigust has joined #lisp
LoggerZZZ has quit [Read error: Connection reset by peer]
<emaczen> _death: ahhh can we be sure though?
<_death> emaczen: no.. that's why you need to profile your code
<_death> emaczen: you also need to know which assumptions you can make
fikka has quit [Ping timeout: 268 seconds]
LoggerZZZ has joined #lisp
LoggerZZZ has quit [Read error: Connection reset by peer]
fikka has joined #lisp
arescorpio has joined #lisp
LoggerZZZ has joined #lisp
yggdrasil_core has quit [Read error: Connection reset by peer]
oleo has quit [Ping timeout: 252 seconds]
jstypo has joined #lisp
whoman has quit [Remote host closed the connection]
whoman has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
LoggerZZZ has joined #lisp
Devon has joined #lisp
k-hos has joined #lisp
smurfrobot has joined #lisp
Arcaelyx has joined #lisp
eschatologist has quit [Ping timeout: 264 seconds]
LoggerZZZ has quit [Read error: Connection reset by peer]
pbgc has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
eschatologist has joined #lisp
LoggerZZZ has joined #lisp
openthesky has joined #lisp
drewc has quit [Ping timeout: 264 seconds]
<pjb> rme: I/O is when you access secondary storage, not when you write in core memory whatever the API you use to write this core memory.
<pjb> rme: what is slow in the I/O process, is the physical latencies.
Devon has quit [Ping timeout: 248 seconds]
d4ryus2 has joined #lisp
d4ryus1 has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
Pixel_Outlaw has quit [Quit: Leaving]
papachan has quit [Quit: WeeChat 2.0.1]
jdz has quit [Ping timeout: 256 seconds]
wmannis has joined #lisp
impulse has quit [Ping timeout: 248 seconds]
jdz has joined #lisp
<stacksmith> Bike: White_Flame: re: non-symbol keyword arguments... What do you think of 3.5.1.5 Invalid Keyword Arguments: "It is not permitted to supply a keyword argument to a function using a name that is not a symbol."?
fisxoj has joined #lisp
<Bike> what's that matter? you are passing it a symbol
<stacksmith> Oh, you mean at runtime after arguments are evaluated it is a symbol...
<Bike> yah.
<Bike> the function is a function. it doesn't know or care about how what it's been passed was evaluated
Oladon has joined #lisp
<stacksmith> Right. thanks again.
krwq has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
<pjb> stacksmith: (flet ((foo (&rest r &key) r)) (let ((arguments '(1 2 3 4))) (apply (function foo) arguments))) #| ERROR: Incorrect keyword arguments in (1 2 3 4) . |#
<pjb> Sorry, bad test. Here it is:
<pjb> stacksmith: (flet ((foo (&rest r &key &allow-other-keys) r)) (let ((arguments '(:a 2 foo 4 #:bar 3))) (apply (function foo) arguments))) #| --> (:a 2 foo 4 #:bar 3) |# this is conforming.
<pjb> stacksmith: (flet ((foo (&rest r &key &allow-other-keys) r)) (let ((arguments '(1 2 3 4))) (apply (function foo) arguments))) #| --> (1 2 3 4) |# this is NOT conforming! it happens to work in ccl, but it could fail.
<pjb> only clisp signals the error: FOO: &KEY marker 1 is not a symbol
<pjb> (clisp, the best CL implementation!)
<stacksmith> pjb: interesting. SBCL allows it too.
<pjb> I still think it would be fun and worth the work to implement a strictly conforming CL implementation that implements things in the most unexpected way…
LoggerZZZ has quit [Ping timeout: 260 seconds]
<stacksmith> That is interesting. Technically, &allow-other-keys makes 1 and 3 keys...
<stacksmith> And changing arguments to '(1 2 3) reports "Odd number of &KEY arguments"!
<pjb> only 1 and 3 not being symbols should not be accepted as keys.
<pjb> and &key indeed imposes that the rest arguments be in even number.
<pjb> But remember, you can always just write &rest r, and then parse r in your function as you want.
LoggerZZZ has joined #lisp
borei has joined #lisp
<borei> high all
<pjb> for example, you could write: (flet ((foo (&rest r) (destructuring-bind (&rest rr &key a b &allow-other-keys) (loop while (and (cdr r) (symbolp (car r))) collect (pop r) into ks collect (pop r) into ks finally (return ks)) (list rr r)))) (let ((arguments '(:a 0 foo 33 1 2 3))) (apply (function foo) arguments))) #| --> ((:a 0 foo 33) (1 2 3)) |# and it's perfectly conforming.
<stacksmith> pjb: Are you sure it's not conforming? I seem to remember somewhere in the spec saying that &rest gets all arguments, and &key picks from that... So a null &key list may not really violate the spec.
<pjb> stacksmith: 3.5.1.5
<borei> continue to work on matrix multiplication optimization, trying to use build-in options - like type declaration and optimiztion
smurfrobot has quit [Remote host closed the connection]
dieggsy has joined #lisp
<borei> function is here
<stacksmith> pjb: Duh, I was asking specifically about that...
ebzzry has joined #lisp
<borei> compiling it lisp is generating the following output - https://pastebin.com/bYpSRBP4
<pjb> borei: you can instead write: (unless (= …) (error …)) (rest-of-the-body) so you don't accumulate the sexp levels.
<stacksmith> pjb: but, are these keyword arguments? I could make an argument that they are &rest arguments, and &key and &allow-other-keys does nothing here.
<stacksmith> except insist on pairing just in case.
<pjb> borei: why don't you use 2D arrays for matrix elements?
<borei> in https://pastebin.com/bYpSRBP4 i need some help with understanding starting from line 6
<borei> pjb: not sure yeat about 2D arrays
<pjb> stacksmith: that's the point, when you have both &rest and &key then the structure of the rest must be that of key value key value…
<aeth> I've looked into using 2D arrays for matrices.
<jack_rabbit> 2D arrays sort of suck.
<iqubic> 2D arrays are just the worst.
<aeth> It looks like in the disassembly of the allocation of a 2D array in SBCL, there are four allocations, instead of 2 for the equivalent 1D array. I think that might be because initial-contents is only optimized if flat.
<pjb> borei: it would be better to ask in #sbcl, but basically it says that it doesn't know what type the slots in elements are.
<borei> my biggest concerns about 2D arrays - slow addressing
<iqubic> Does CL provide a transpose function for 2D lists?
<jack_rabbit> aeth, That's surprising. From what I thought, the 2D arrays were backed by a 1D physycal array.
<iqubic> Where it swaps the rows and columns?
<pjb> borei: I would assume that the compiler is able to compile (aref 2darray i j) with way faster code than (aref 1darray (+ j (* i row))).
<jack_rabbit> iqubic, no.
<Bike> on sbcl, a multidimensional array is a "header" sort of structure with a boxed single dimensional array
<iqubic> jack_rabbit: Oh, that sucks.
<Bike> so it has to allocate both the underlying data array, and the header thing
<aeth> There should be no problems with 2D arrays in SBCL after the arrays are allocated. They're just 1D, and the compiler should be able to handle aref in an optimized way if the type is known (not knowing the full type, especially the dimensions, is probably going to be very expensive)
<iqubic> Haskell has that bulit in.
<jack_rabbit> iqubic, I know, That's how I knew the answer so quickly. I needed it once and it doesn't exist.
<aeth> Okay, looks like it takes up more memory, too, if it has a header.
<aeth> But if you're concerned about memory, you should not only use 1D arrays, but use ranges within that 1D array, and allocate a bunch of matrices at once.
<aeth> effectively a 3D structure expressed in 1D
<Bike> (apply #'mapcar #'list '((1 2) (3 4))) => ((1 3) (2 4))
<pjb> iqubic: yes: (lambda (lol) (apply (function mapcar) (function list) lol))
<stacksmith> pjb: It actually says that &rest must be followed by a lambda-list-keyword, which leaves &key, &env and &aux...
<pjb> iqubic: all the computable function already exist in CL. You only have to find their name. (lambda (lol) (apply (function mapcar) (function list) lol)) is the name of the function you want.
<borei> pjb: i didn't get that - "but basically it says that it doesn't know what type the slots in elements are"
<pjb> borei: it's really a sbcl problem.
damke_ has joined #lisp
<borei> ok, i'll try to chat with them
<pjb> borei: it says that i and n-cols are not fixnums.
<borei> (type fixnum n-rows n-cols n)
<borei> and i has specifier in loop
<pjb> yep, sbcl…
<pjb> well, it complains about the result of the multiplication.
<pjb> Of course, fixnum * fixnum -> bignum in general.
<borei> is there way to restrict it ?
<pjb> Also, you see, this is a problem of using vectors instead of 2d arrays: now you have to tell the compiler that your index computation returns an index…
<pierpa> borei: btw, IF + PROGN makes my eyes bleed.
<pjb> borei: with THE
<pjb> clhs the
<aeth> borei: or use a smaller integer size
<aeth> you can also implement your own way to handle overflow if you don't want bignums ever
<pjb> But you must ensure that it's really a fixnum.
<aeth> pjb: SBCL doesn't trust the (except maybe at safety 0), it has an internal truly-the that you should never use.
<pjb> (since you use it to index an array, it should be a fixnum, so it probably is one, so it should be safe enough to use THE: if the indices or matrix sizes were too big, you'd have problems allocating them).
<pjb> aeth: Well, I don't trust sbcl, so we're equal.
<borei> pierpa: "btw, IF + PROGN makes my eyes bleed." - why ?
<pierpa> something defective in my eyes, probably :)
<pierpa> almost always COND is a better choice than IF
<borei> pjb: "with THE" - can you clarify, never used it ?
<pjb> borei: have you read the clhs page?
<pjb> there are examples there!
<stacksmith> (the (unsigned-byte 8) index)
<borei> wow, it's a lot of notices :-)
<borei> i really appriciate it !
<pierpa> borei: a more basic question is why you believe that your handrolled matrix will be faster than system supplied 2D arrays.
<borei> don't know yet
<pierpa> it makes no sense
<pjb> be sure to benchmark them on various implementations!
<aeth> pierpa: It's possible that some 2D arrays in some implementations aren't very efficient because they're not very common.
<borei> it's all learning curve for me
<aeth> Of course, avoiding using them will just encourage 2D arrays to not be efficient.
red-dot has joined #lisp
<pierpa> aeth: in theory there can be implementations that puposefully slow down acces to 2D arrays, yes. :)
<pjb> (* i n-cols) and (* i n) are constant! Why do you compute them n-row and n times?
<aeth> pierpa: Well, that for some reason or another don't have an efficient implementation.
sjl has joined #lisp
<pierpa> I doubt that in such an implementtion a naive user implementation will be faster, anyway
<aeth> You don't have to purposefully write slow code, usually it's the other way around and slow code happens when you're not paying enough attention.
<borei> im solving one problem after another, i know that constant parts of the indexes can be moved out of the loop
<aeth> If you're doing linear algebra in pure CL, you probably want to use SBCL, though. (At least, that's the case in 2018.)
<borei> i use sbcl
<stacksmith> borel: keep in mind that specifying types in SBCL generates much smaller code with optimization on, but generally bigger code with it off as it treats type declarations as requests for extra checks. And of course, thinking about optimization before you need to is a sin.
<aeth> stacksmith: But it's still generally a win for arrays and numbers because with that type check, it at least knows to use efficient, inline code instead of not-inline, type-generic code.
<aeth> And with arrays there's the added benefit that if you have the full type information (including the dimensions) it can get rid of bounds checks
<aeth> Sometimes it's one type check vs 30+ bounds checks. I'd take the type check.
sjl has quit [Ping timeout: 248 seconds]
terpri has quit [Ping timeout: 265 seconds]
wmannis has quit [Quit: wmannis]
<aeth> I think the only time you need to worry about types is with arrays, sequences, and numbers.
Cymew has joined #lisp
<stacksmith> aeth: can't argue with that. If it matters, of course. I find more often than not that it doesn't matter because I wind up rewriting things that I care about a few times to get the algos right.
<pierpa> for a matrix multiplication it matters, and there's not much room for algorithmic wiggles, unless he wants to go real fancy
<aeth> It probably really depends on what you're doing. If you're working with arrays of floats, probably the most you'd have to change later (other than dimensions) is s/single-float/double-float/ or s/double-float/single-float/
<aeth> (Although if you're really writing efficient double-float code you do sometimes have to write some hacky workarounds to avoid consing.)
<borei> can't find about THE
<borei> need example :-(
turkja has quit [Ping timeout: 260 seconds]
<pjb> clhs the
<pjb> borei: go to this fucking link! ^
<aeth> (let ((foo (the fixnum (foobar 42)))) (+ foo 42)) is very similar (if not identical) to (let ((foo (foobar 42))) (declare (fixnum foo)) (+ foo 42)) and in either case, tells the compiler that it can assume foo is a fixnum (it can also completely ignore it, or type-check it)
Cymew has quit [Ping timeout: 248 seconds]
<aeth> The advantage of the is that you don't need the variable, so you can just say (+ (the fixnum (foobar 42)) 42)
<aeth> The disadvantage is you probably want check-type instead of the or declare. It will more portably do what you probably want.
<stacksmith> borel: Are you talking about constraining the result? Just return (the fixnum whatever). And for indices, use (the (integer 0 99) ...) or whatever the array size is...
didi has left #lisp ["there are always reasons to /part"]
fikka has quit [Ping timeout: 248 seconds]
<stacksmith> When adding or multiplying, use (unsigned-byte ...) or (integer ..) of a bitsize that fits into a fixnum after the operation.
damke_ has quit [Ping timeout: 264 seconds]
<aeth> Of course, "undefined" (with the or type declarations) doesn't mean "ignore it, type check it, or assume it without checking". That just happens to be what you will probably encounter. It could also sell all of your Bitcoin or tweet it to the world if the type doesn't match. Or literally anything else that a computer can do.
<stacksmith> Also declaring the array itself as a vector or simple-array generates much tighter code with sbcl.
<stacksmith> but you are doing that already.
<borei> from what i read make-array will create simple-array unless you specifed :fill-pointer and/or one more parameter
<stacksmith> borel: true enough, but I think you still need to declare it in functions that use the array.
<borei> yep
fikka has joined #lisp
smurfrobot has joined #lisp
<aeth> You should probably use specialization-store for this. https://github.com/markcox80/specialization-store/
<aeth> The alternative is making n versions of the exact same thing, just with different types.
quazimodo has quit [Read error: Connection reset by peer]
<stacksmith> Also, if you are really optimizing, you may be able to arrange the loop better using tagbody - sbcl loops sometimes jump around weirdly...
<aeth> Or you could just inline something and hope the type information is available where it is being used. But some things produce really massive functions when disassembled, e.g. many matrix operations. So those might not be a good choice for inlining.
<aeth> stacksmith: I'm not sure that there are many cases to use tagbody directly instead of do (do even has an implicit tagbody for when you really need it, but good luck getting that to auto-indent correctly because few people use that feature)
dieggsy has quit [Remote host closed the connection]
LoggerZZZ has quit [Read error: Connection reset by peer]
ahungry has joined #lisp
<stacksmith> Recursive functions often pack tighter than loop.
dieggsy has joined #lisp
<borei> using THE :-) dropped couple seconds
smurfrobot has quit [Ping timeout: 240 seconds]
<aeth> An alternative to using loops for arithmetics is to use macros to essentially loop unroll. I'm not sure how many iterations it would take before this is a bad idea. It definitely is ideal for small numbers of iterations like 2, 3, 4.
<borei> pjb: thanks
quazimodo has joined #lisp
dddddd has quit [Read error: Connection reset by peer]
<aeth> Oh, btw, on matrix multiplication in general: https://en.wikipedia.org/wiki/Matrix_multiplication_algorithm
<aeth> "Unsolved problem in computer science: What is the fastest algorithm for matrix multiplication?"
<stacksmith> borel: there are many matrix libraries floating around...
<aeth> So the good news is that there's going to be room for improvement!
shka has joined #lisp
<aeth> stacksmith: The majority of matrix libraries in CL are graphics libraries, so 4x4 matrices (and possibly smaller ones)
<stacksmith> aeth: agreed.
<borei> exactly, best algorithm now is O(n^2.7xxx) as i remember
<stacksmith> May be worth looking at how others handle optimization etc.
<aeth> Are there many native math libraries that aren't CL graphics math libraries? Most, I think, are wrappers.
<borei> in quantum mech - there is only matricies and vectors, and they are with complex elements
<aeth> The Maxima CAS is interesting. It has Fortran, and it has f2cl. So I think it might compile all of its Fortran into CL!
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fisxoj has quit [Quit: fisxoj]
damke_ has joined #lisp
<aeth> borei: oh complex is going to be... complex
<aeth> Does any CL even have specialized arrays for complex single-floats and double-floats?
<borei> i don't know
<aeth> In SBCL: (upgraded-array-element-type '(complex single-float)) => (complex single-float)
<aeth> (upgraded-array-element-type '(complex double-float)) => (complex double-float)
<aeth> :o
<aeth> Now I think the next question is if they can be worked with in a non-consing way, just like arrays of double-floats.
<pjb> that's the theory.
<beach> Good morning everyone!
<beach> rme: Bordeaux is a great place to live, but I don't think you should come here counting on the students.
<stacksmith> Good morning to you.
<aeth> And it looks like it's not non-consing in SBCL: (defun foo (v) (check-type v (simple-array (complex double-float) (3))) (incf (aref v 0)) v) (disassemble #'foo)
<aeth> (and (complex single-float) is the same)
smasta has quit [Ping timeout: 252 seconds]
Kevslinger has quit [Quit: Connection closed for inactivity]
<aeth> By comparison: non-consing in SBCL: (defun foobar (v) (check-type v (simple-array double-float (3))) (incf (aref v 0)) v) (disassemble #'foobar)
<stacksmith> borel: I find that when using type declarations and the... turning optimization off, sometimes generates helpful messages about dubious type declarations.
<pjb> borei: look how slower your solution is (even with the constant subexpressions out of the loops) than indexing 2D arrays, in ccl: https://codeshare.io/2KwP3z
<iqubic> What does flet do?
<pjb> clhs flet
<pjb> what is explained here ^^^^
arescorpio has quit [Excess Flood]
<iqubic> Is there a way to take a dynamically bound string, and set it to the value of my chosing?
<pjb> iqubic: you're asking the wrong question. Think about what you want to do.
<pjb> iqubic: strings may be mutable or immutable. When mutable, they may be adjustable or non adjustable. If they're not adjustabnle, then you can mutate them but not their length; if they're adjustable, you can mutate them and mutate their length. Whether the string is bound, and whether it's bound lexically od dynamically are irrelevant.
<ebzzry> How do I send text to the X clipboard?
<pjb> iqubic: notice that in general, one avoids to mutate strings, since all the difficulty is knowing whether it's an immutable or a mutable string!
<borei> pjb: should i see any numbers at https://codeshare.io/2KwP3z ?
<pjb> ebzzry: perhaps asking in #x11?
<stacksmith> pjb: are strings ever immutable?
iqubic has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
<pjb> borei: sorry, try again: https://codeshare.io/2KwP3z
<pjb> stacksmith: of course, just like any other array!
<pjb> (let ((foo (make-string 3 :initial-element #\a))) (print foo) (replace foo "bar") foo) #| "aaa" --> "bar" |#
<borei> i see now
<pjb> borei: try it in sbcl with your optimization levels!
<ebzzry> pjb: I meant, how does CL do it?
<pjb> borei: try it with small n and big n (eg. n=2, n=3, n=4 and n=20 n=30 n=40 and n=200, n=300, n=400).
<aeth> borei: your matrix isn't going to be anywhere near as efficient as built-in 2D arrays because you're using CLOS
<krwq> ebzzry: have you checked if clx has it?
<pjb> ebzzry: it doesn't.
<pjb> ebzzry: there's no notion of clipboard in clhs.
<aeth> borei: I don't see how a hand-made matrix in CLOS is going to be more efficient than built-in matrices unless you're using a JITed CL
<aeth> or perhaps inlined generic functions or something
<pjb> borei: you can still wrap your 2D arrays in CLOS objects if you need to.
<ebzzry> How do othesr do it, with CL
<pjb> ebzzry: using a library that gives you access to x11 functions to manipulate the x11 clipboard. Hence #x11
paul0 has joined #lisp
<pjb> ebzzry: (clx has already been mentionned).
<borei> ok, seems like there matrices 100x100
<stacksmith> pjb: forgive me for being dense, but how does one create an immutable array?
<borei> and you are getting 0.09 - 0.11 second
<borei> so for matrices 1000x1000 it will be x1000
<ebzzry> pjb: ok thanks
<borei> we are talkine about 90 seconds
<pjb> borei: your algo is O(n^3)!!!
<borei> yep
<borei> 20.430679 seconds of total run time (20.124209 user, 0.306470 system)
<borei> that is for 1D array
<pjb> Nice.
<pjb> And for 2D?
<pierpa> stacksmith: one way is to read "abc"
<borei> i did try to extract rows and columns from matrices was getting ~22 seconds
<pjb> stacksmith: by reading a literal indeed: '("abc" #.(vector 1 2 3) #.(make-array '(2 2) :initial-contents '((1 2) (3 4))))
<borei> i have 2.9Ghz icore7
ckonstanski has joined #lisp
<borei> and actually there is the same situation 1D against 2D in C
<pjb> There are no 2D arrays in C.
<borei> i don't know why, but to get an access to item a[i][j] is very expensive
<aeth> CL isn't going to have the same performance characteristics as C.
<pjb> Don't talk about languages you don't know the first thing about!
<borei> no no, im not trying to compare C vs Lisp
<borei> im comparing 1D vs 2D array
<pjb> So how fast for 2D arrays?
<aeth> iirc, a[i][j] is just syntactic sugar in C.
<borei> pjb: i don't have numbers in hands now
iqubic has joined #lisp
<borei> but i had reason to switch to 1D
<stacksmith> pjb: re immutable arrays: What you describe seem to be just literals. SBCL will actually allow modification with a warning - not that it's a good idea. Is there something in the standard?
<pjb> stacksmith: indeed. And the compiler may allocate the literals to ROM.
<aeth> borei: (This is just my opinion.) With CL, no need to have any numbers at all. Write two equivalent ways of doing something. Then use disassemble. If the disassemblies are identical (as they often are) there is no difference. If the disassemblies are very similar, you might be able to notice the differences. Only if they're very different do you need to benchmark.
<borei> agreed
<aeth> I would not be surprised at all if someone has already written a disassemble diff tool for this.
<rme> beach: Students with some CL would just have been a potential bonus.
z3t0 has joined #lisp
<rme> Certainly that's not a make-or-break factor.
<beach> Sure.
<rme> I'll be in town starting on the 23rd. It'd be nice to see you if you're available sometime.
asarch has quit [Quit: Leaving]
<beach> You need to act quickly. Prices of real estate are rising fast because of the increased popularity of the city in recent years.
<k-hos> I really do like sbcls disassmble feature, aeth, I used it the other day to confirm that macros don't have any overhead (at least simple ones)
<iqubic> testing a thing
<k-hos> because I couldn't find any information about this online :|
<iqubic> Good. no blank lines sent.
z3t0 has quit [Remote host closed the connection]
<beach> rme: Yes, I'll be here. How long are you staying and where?
z3t0 has joined #lisp
<aeth> k-hos: My favorite part about SBCL's disassembly is that it comments the potentially interesting things, such as constants and allocations and function calls.
<aeth> I wish other implementations with functional disassemblies would be as helpful.
<k-hos> yeah
<aeth> someone who knows 0 assembly can at least read the comments and notice some things
Devon has joined #lisp
<rme> beach: From Feb. 23 through March 6th. Not sure where I'll stay; some airbnb place (or places). I'll be looking around for a place to rent for a year to start with.
<aeth> (And I use disassembly not to write low-level code but to see how high level the code can get away with being.)
<rme> beach: I was thinking maybe Talence or Pessac, but I need to come and look around.
<beach> rme: I *might* be busy until end of February. A visitor might be here. After that, I'll be available.
<beach> rme: Talence is very expensive. It depends on how close to the center you want to be.
<beach> rme: The trick these days is to be away from the center, but close to the tram.
<beach> rme: It also depends on whether you want walking distance to commerce or not.
<rme> Nothing beats coming to look around in person, I am thinking. Hopefully, I won't be totally priced out.
<beach> We can discuss it when you get here.
<rme> Yes, that would be good.
dmiles has quit [Ping timeout: 252 seconds]
schoppenhauer has quit [Ping timeout: 240 seconds]
smasta has joined #lisp
schoppenhauer has joined #lisp
krwq has quit [Remote host closed the connection]
<aeth> Bike: Should I move my length 16 array to a (4 4) array for my 4x4 matrices? You seem to know more about this than anyone else in the previous conversation.
<Bike> i don't know that much. you should time ti yourself, of course.
<aeth> It does look like SBCL can declare them dynamic extent, so they do seem to be useful enough for my uses.
<Bike> empiricism rules the day
smurfrobot has joined #lisp
<aeth> It looks like dynamic extent still works with (list (list ...) (list ...) (list ...) (list ...)) for the initial contents (which I assume an inline make-matrix-4x4 would produce)
rumbler3_ has quit [Remote host closed the connection]
damke_ has quit [Ping timeout: 264 seconds]
dieggsy has quit [Remote host closed the connection]
<borei> again with types :-(, im blind
dieggsy has joined #lisp
<borei> https://pastebin.com/iL3c2JT2 <-- function
<borei> https://pastebin.com/11AzyWeU <-- compilation warning(s)
<beach> (not (= can be replaced by (/=
<borei> don't see
damke_ has joined #lisp
<beach> Just notes, no warnings.
<borei> yeah, but it can't do inline
<borei> and i don't see where and why
quazimodo has quit [Ping timeout: 264 seconds]
<beach> It can be very tricky to give the compiler enough information for that to work.
z3t0 has quit [Remote host closed the connection]
<aeth> Bike: 1829 byte disassembly for 4x4 vs. 1253 byte disassembly for length 16 :-(
<aeth> (in my matrix multiplication)
<aeth> I guess there's an optimization only 1D single float arrays get
z3t0 has joined #lisp
<Bike> that's not indicative of much
<borei> in https://pastebin.com/11AzyWeU how to read line 19 ?
<aeth> In the length 16 version it's all MOVSS, MULSS, and ADDSS. In the dimension (4 4) version, it has a lot of MOV instructions added
<borei> what is the first argument ?
<Bike> just time it
<Bike> nobody can figure out how fast a processor is going to go just by looking at code
<borei> and first argument of what
<beach> borei: I suggest you introduce a variable using LET that you sum into. That way, you can declare the type of it.
nox2 has joined #lisp
<beach> borei: It is complaining that when you use the SUM LOOP keyword, the type of the implicit variable it sums into is not known to be DOUBLE-FLOAT.
<borei> damn, i had feeling about it, but wasn't sure
ozzloy_ is now known as ozzloy
ozzloy has quit [Changing host]
ozzloy has joined #lisp
<borei> is there way to specify type for SUM >
<beach> borei: You need to work on your code layout.
<borei> ?
<borei> it copy-paste from emacs
<beach> I don't think so.
<borei> xemacs
z3t0 has quit [Ping timeout: 265 seconds]
<aeth> Bike: It's probably slightly slower, but it's really hard to tell because my computer is too fast and any loop will optimize it away
<beach> borei: Well, you have the LOOP keyword DO at the end of the line instead of at the beginning.
z3t0 has joined #lisp
<beach> borei: And you could use a newline before the innermost (LOOP.
<Bike> well, who gives a shit either way then
<beach> borei: You probably also need to untabify the code.
<beach> borei: I am guessing that pastebin doesn't deal with tabs very well.
<borei> yeah
<borei> ok
<borei> let me play with additional variable first
<beach> There is no need for a (PROGN (LET*
<beach> borei: The LET* will be enough.
<beach> Saves indentation.
kupad has joined #lisp
<beach> borei: You can "play with" the variables first, but you should work on the code layout before resubmitting.
<borei> yep yep
Bike has quit [Quit: Lost terminal]
<borei> no damn way
<borei> 2.174359 seconds of total run time (2.174359 user, 0.000000 system)
<borei> 1000x1000 multiplication
<beach> How much was it before?
<borei> it's 1Gflop
<borei> ~20sec
<borei> double-floar
<borei> double-float
kupad has quit [Ping timeout: 240 seconds]
<beach> Yeah, nice improvement.
<borei> i don't belive it
<borei> i think it will pushing C++ for sure
paul0 has quit [Remote host closed the connection]
<rme> that is exactly the kind of stuff that cmucl/sbcl excels at
<beach> Indeed.
Devon has quit [Ping timeout: 256 seconds]
<borei> too fast
<borei> no overhead at all
pierpa has quit [Quit: Page closed]
fikka has quit [Ping timeout: 248 seconds]
<borei> tested small identity matrices - result is correct
<borei> if i didn't screwed anything it's damn SUPER !
fikka has joined #lisp
terpri has joined #lisp
groovy2shoes has quit [Ping timeout: 260 seconds]
<borei> single-threaded application on the consumer-grade CPU with performance a bit less then 1Gflop on double precision numbers
<borei> whoevere will be saying that lisp slow - WRONG !
<aeth> Lisp isn't slow, but it doesn't have as many optimizations as a more popular AOT compiled language. Mainly becaue it doesn't have as many humans optimizing it as a more popular AOT compiled language.
<aeth> But I suspect a lot of those optimizations are pointless when you're just doing linear algebra.
<aeth> (Note: for some Lisps, the compilation might not be AOT)
<aeth> (Or, more accurately, it could AOT compile to a JITed bytecode)
<borei> i got additional and huge motivation for big dive into LISP ecosystem, huge thanks for support !
<k-hos> after my brief use of common lisp I wouldn't mind seeing some geared towards game dev
groovy2shoes has joined #lisp
<k-hos> would probably have to sacrifice things to make people happy though
<aeth> #lispgames is slowly infecting the world, it's wonderful
<fiddlerwoaroof_> borei: if you're doing matrixy-stuff and have an Nvidia GPU, you might look into Gabor Melis's libraries, like mgl-mat
drewc has joined #lisp
<borei> GPU will be running pretty hot doing graphics
<fiddlerwoaroof_> I've never got them to work because I don't have the hardware, but they look really nice for machine-learning applications
<aeth> k-hos: Well, I think Lisp games would benefit the most from a concurrent, parallel, real-time garbage collector.
oleo has joined #lisp
<aeth> And, yeah, a real-time garbage collector isn't the best for every use case.
<fiddlerwoaroof_> In theory, abcl should have that, right?
<aeth> I don't think the JVM's garbage collector is real time?
<fiddlerwoaroof_> The JVM has a concurrent collector, I think
<aeth> I think the GC literature just tends to write custom JVM GCs because Java is popular
<aeth> Some of them might be developed further, but a lot are probably commercial
<borei> fiddlerwoaroof_: actually i have question about ML, can you recommend any materials about ML+Lisp to read (entry level)
<aeth> fiddlerwoaroof_: The most important part in the GC buzzwords for games is real time, afaik.
<fiddlerwoaroof_> aeth: The built-in java GCs are really advanced, because of the JVM's position in the industry
<aeth> Games are usually on some strict schedule (or two, if the rendering framerate is separate from the logic one). e.g. 0.01 second ticks or something.
<borei> everything is spinnig about python , that is not the way i want to go
<borei> s/about/around/g
<fiddlerwoaroof_> borei: CL isn't the best yet for modern ML, just because we don't have the libraries that python/scala have. However, Gabor Melis managed to do pretty well using his own libraries
<fiddlerwoaroof_> e.g. https://github.com/melisgl/higgsml
shifty has joined #lisp
<fiddlerwoaroof_> However, I don't know much about these topics
<borei> damn, i wish i'd be 20 or 25 - so many things
nox2 has quit [Ping timeout: 240 seconds]
<borei> to learn and to work with
damke has joined #lisp
nox2 has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
<k-hos> aeth I think a gc would need to be optional
rumbler31 has joined #lisp
<aeth> k-hos: Most games wind up using a garbage collected scripting language in addition to a non-garbage collected engine language.
<aeth> So it can't be a simple optional GC.
<fiddlerwoaroof_> Hmm, it looks like redhat has recently opensourced a low-latency GC: https://wiki.openjdk.java.net/display/shenandoah/Main
<k-hos> personally I would prefer no gc and have some kind of ref counting mechanism built into the language
<beach> k-hos: That would be WAY slower than a tracing garbage collector.
<beach> k-hos: And it wouldn't be real-time anyway.
<beach> So only worse.
rumbler31 has quit [Ping timeout: 240 seconds]
<k-hos> it's pauses and inconsistency that make gcs generally bad for games, but there is little point to arguing about a theoretical language anyway
damke has quit [Ping timeout: 264 seconds]
damke_ has joined #lisp
<beach> k-hos: There are very good real-time, parallel, concurrent garbage collectors these days.
<aeth> k-hos: all you need is a real-time GC
<beach> k-hos: You are thinking of garbage collectors from a few decades ago.
<aeth> I agree 100% with beach
<k-hos> I am aware
<aeth> What would it take to replace SBCL's GC with a real time GC?
<jackdaniel> sweat, tears and blood
<aeth> seems like it still might be the easiest route, though
<jackdaniel> you say that blood is a reasonable price for realGC? ,)
<jackdaniel> real time*
<beach> k-hos: So if you are aware of that, why do you want reference counting?
smurfrobot has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 252 seconds]
<k-hos> they make a lot of constructs easier without relying on a full gc
<beach> Name two.
Oladon has quit [Quit: Leaving.]
<aeth> jackdaniel: Yes, because I think there are literally dozens of people on IRC who want one.
<aeth> So it would be one of the most noticable improvements.
_mjl has joined #lisp
drcode has quit [Ping timeout: 260 seconds]
<aeth> (Okay, probably at least a dozen.)
fikka has joined #lisp
LocaMocha has joined #lisp
LocaMocha has quit [Max SendQ exceeded]
oleo has quit [Ping timeout: 265 seconds]
damke has joined #lisp
<makomo> morning :-)
damke_ has quit [Ping timeout: 264 seconds]
<beach> Hello makomo.
<makomo> hi o/
LocaMocha has joined #lisp
<aeth> This matrix multiplication is... ugh.
<jackdaniel> (ugh m1 m2)
<aeth> It does look like the (16) array is consistently around 2.8 kilocycles compared to the (4 4) being consistently around 3.8 kilocycles. So that is quite a drop in performance, even though I have to use SBCL's cycles to even notice it at all (0.000 seconds)
<aeth> I've played with different ways of expressing it, e.g. pulling out all of the array accesses into variables first
<aeth> Wikipedia pretty much tells me to do it the naive way because it's a small matrix.
<aeth> Maybe the next thing I could try is using a loop instead of doing all of the adds/multiplies,
itruslove has joined #lisp
<aeth> It looks like the 4x4 matrix is always slower than the fake 4x4 matrix because SBCL can't access items from it as well. It generates an extra MOV for every one or two MOVSS, which adds up a lot in matrix multiplication. Both on retrieving the values and on setting the destination matrix.
giraffe has joined #lisp
z3t0 has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 240 seconds]
Arcaelyx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mishoo has joined #lisp
Karl_Dscc has joined #lisp
loli has quit [Quit: WeeChat 2.0.1]
ahungry has quit [Remote host closed the connection]
loli has joined #lisp
smurfrobot has joined #lisp
nox2 has quit [Ping timeout: 276 seconds]
sjl has joined #lisp
nox2 has joined #lisp
Karl_Dscc has quit [Remote host closed the connection]
dieggsy has quit [Ping timeout: 276 seconds]
borei has quit [Ping timeout: 276 seconds]
sjl has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Remote host closed the connection]
damke_ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
smurfrobot has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
vlatkoB has joined #lisp
fikka has joined #lisp
nullman has quit [Ping timeout: 248 seconds]
nullman has joined #lisp
smurfrobot has quit [Remote host closed the connection]
shrdlu68 has quit [Ping timeout: 248 seconds]
nox2 has quit [Ping timeout: 268 seconds]
rumbler31 has joined #lisp
Cymew has joined #lisp
nox2 has joined #lisp
rumbler31 has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
shka has quit [Ping timeout: 268 seconds]
zaquest has quit [Quit: Leaving]
smurfrobot has joined #lisp
damke has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
mlf has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
raynold has quit [Quit: Connection closed for inactivity]
Xal has quit [Ping timeout: 240 seconds]
zaquest has joined #lisp
Xal has joined #lisp
randomstrangerb has quit [Ping timeout: 256 seconds]
randomstrangerb has joined #lisp
schweers has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
drcode has joined #lisp
damke_ has joined #lisp
LoggerZZZ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
pagnol has joined #lisp
hhdave has joined #lisp
wigust has quit [Ping timeout: 240 seconds]
smurfrobot has quit [Remote host closed the connection]
vaporatorius has joined #lisp
vap1 has joined #lisp
fikka has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
vaporatorius has quit [Client Quit]
tessier has quit [Ping timeout: 276 seconds]
LoggerZZZ has quit [Remote host closed the connection]
damke_ has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
varjag has joined #lisp
mathi_aihtam has joined #lisp
orivej has joined #lisp
fikka has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
fikka has quit [Ping timeout: 256 seconds]
Murii has joined #lisp
wigust has joined #lisp
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
hhdave_ has joined #lisp
hhdave has quit [Ping timeout: 255 seconds]
hhdave_ is now known as hhdave
openthesky has quit [Remote host closed the connection]
LoggerZZZ has joined #lisp
randomstrangerb has quit [Ping timeout: 248 seconds]
random-nick has joined #lisp
fikka has joined #lisp
randomstrangerb has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
damke_ has quit [Ping timeout: 246 seconds]
Zhivago has quit [Changing host]
Zhivago has joined #lisp
nirved has joined #lisp
damke_ has joined #lisp
EvW has joined #lisp
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 268 seconds]
Kaisyu has quit [Quit: Connection closed for inactivity]
LoggerZZZ has joined #lisp
tessier has joined #lisp
ghard has quit [Remote host closed the connection]
ghard has joined #lisp
whoman has quit [Remote host closed the connection]
dddddd has joined #lisp
SamSkulls has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
drcode has quit [Ping timeout: 252 seconds]
ebzzry has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 246 seconds]
drcode has joined #lisp
ebzzry has joined #lisp
fikka has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
sjl has joined #lisp
sjl has quit [Ping timeout: 248 seconds]
wigust has quit [Quit: ZNC 1.6.5 - http://znc.in]
ebzzry has quit [Ping timeout: 256 seconds]
fikka has quit [Ping timeout: 268 seconds]
damke has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
random-nick has quit [Remote host closed the connection]
fikka has joined #lisp
random-nick has joined #lisp
ebzzry has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
smurfrobot has joined #lisp
nowhere_man has quit [Ping timeout: 276 seconds]
LoggerZZZ has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
smurfrobot has quit [Ping timeout: 240 seconds]
klixto has joined #lisp
LoggerZZZ has joined #lisp
nowhere_man has joined #lisp
Trystam has joined #lisp
smurfrobot has joined #lisp
Tristam has quit [Ping timeout: 240 seconds]
Trystam is now known as Tristam
fikka has joined #lisp
random-nick has quit [Ping timeout: 265 seconds]
drcode has quit [Ping timeout: 248 seconds]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
shifty has quit [Ping timeout: 276 seconds]
random-nick has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Remote host closed the connection]
fikka has joined #lisp
mathi_aihtam has quit [Quit: mathi_aihtam]
random-nickname has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
iqubic` has joined #lisp
drcode has joined #lisp
EvW has quit [Remote host closed the connection]
EvW has joined #lisp
markong has joined #lisp
iqubic has quit [Ping timeout: 276 seconds]
random-nickname is now known as random-nick
drcode has quit [Ping timeout: 252 seconds]
klixto has quit [Quit: Leaving]
EvW has quit [Ping timeout: 252 seconds]
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
EvW has joined #lisp
marvin3 has joined #lisp
ebzzry has quit [Ping timeout: 240 seconds]
scymtym has quit [Ping timeout: 252 seconds]
ebzzry has joined #lisp
drcode has joined #lisp
ebzzry has quit [Ping timeout: 240 seconds]
ebzzry has joined #lisp
scymtym has joined #lisp
damke has quit [Ping timeout: 263 seconds]
damke has joined #lisp
Denommus has joined #lisp
damke has quit [Ping timeout: 264 seconds]
damke has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
m00natic has joined #lisp
lagagain has joined #lisp
<drmeister> Is there a way to shut down pretty printing for trace output? Or is this an implementation dependent detail?
<Shinmera> Well, setting *print-pretty* is an option unless the implementation changes that itself during tracing.
<Shinmera> Otherwise pretty much the entire behaviour of trace is implementation dependent.
attila_lendvai has quit [Quit: Leaving.]
damke has quit [Ping timeout: 246 seconds]
<scymtym> maybe implementations could add something along the lines of SB-EXT:*DEBUG-PRINT-VARIABLE-ALIST* for TRACE
<drmeister> Sometimes in clasp trace generates pretty printed output and other times it doesn't.
rumbler31 has joined #lisp
red-dot has joined #lisp
damke has joined #lisp
<drmeister> It's pretty much "(setq *print-pretty* <which one doesn't drmeister want right now>)"
* drmeister is developing an adversarial with his code
<drmeister> adversarial relationship - (sigh)
<drmeister> Actually - this might be within slime - checking for *print-pretty* in swank.
trittweiler has joined #lisp
rumbler31 has quit [Remote host closed the connection]
fikka has joined #lisp
jmercouris has joined #lisp
trittweiler has quit [Remote host closed the connection]
<drmeister> (blush) Simply (setf *print-pretty* nil) in the slime repl turns pretty printing off for trace
SamSkulls has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
makomo has quit [Ping timeout: 240 seconds]
trittweiler has joined #lisp
zaquest has quit [Quit: Leaving]
Murii has quit [Quit: ¯\_(ツ)_/¯]
damke has quit [Read error: Connection reset by peer]
zaquest has joined #lisp
jmercouris has quit [Ping timeout: 248 seconds]
drcode has quit [Ping timeout: 248 seconds]
smurfrobot has joined #lisp
damke has joined #lisp
Tobbi has joined #lisp
rippa has joined #lisp
smurfrobot has quit [Remote host closed the connection]
orivej has joined #lisp
oleo has joined #lisp
damke has quit [Ping timeout: 264 seconds]
damke has joined #lisp
EvW has quit [Ping timeout: 240 seconds]
python476 has joined #lisp
papachan has joined #lisp
random-nick has quit [Remote host closed the connection]
random-nick has joined #lisp
<Xach> Hmm.
<Xach> I would expect --non-interactive to error on (y-or-n-p)
rumbler31 has joined #lisp
fikka has joined #lisp
brendyn has quit [Ping timeout: 240 seconds]
smurfrobot has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
jmercouris has joined #lisp
<jmercouris> Shinmera: Strange behavior huh?
fisxoj has joined #lisp
fikka has joined #lisp
Achylles has joined #lisp
nsrahmad has joined #lisp
jmercouris has quit [Ping timeout: 256 seconds]
Achylles has quit [Client Quit]
drewc has quit [Ping timeout: 268 seconds]
nullman has quit [Ping timeout: 252 seconds]
nullman has joined #lisp
nowhere_man has quit [Ping timeout: 264 seconds]
nowhereman_ has joined #lisp
quazimodo has joined #lisp
__rumbler31 has joined #lisp
fisxoj has quit [Quit: fisxoj]
damke_ has joined #lisp
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
damke has quit [Ping timeout: 264 seconds]
LoggerZZZ has quit [Remote host closed the connection]
ebrasca has left #lisp ["ERC (IRC client for Emacs 25.2.1)"]
LoggerZZZ has joined #lisp
Bike has joined #lisp
smurfrobot has quit [Remote host closed the connection]
LoggerZZZ has quit [Remote host closed the connection]
parjanya has joined #lisp
LoggerZZZ has joined #lisp
cuso4 has joined #lisp
LiamH has joined #lisp
smurfrobot has joined #lisp
dieggsy has joined #lisp
asarch has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
LoggerZZZ has joined #lisp
toncek55 has joined #lisp
Kyo91 has joined #lisp
toncek55_ has joined #lisp
toncek55_ has quit [Client Quit]
turkja has joined #lisp
lnostdal has quit [Remote host closed the connection]
lnostdal has joined #lisp
Kyo91 has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
Kyo91 has joined #lisp
toncek55 has quit [Ping timeout: 256 seconds]
tomlukeywood has joined #lisp
EvW has joined #lisp
sjl has joined #lisp
fikka has quit [Ping timeout: 276 seconds]
damke has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
lagagain has quit [Quit: Connection closed for inactivity]
sjl has quit [Ping timeout: 276 seconds]
sjl has joined #lisp
shka has joined #lisp
lnostdal has quit [Remote host closed the connection]
lnostdal has joined #lisp
jstypo has quit [Ping timeout: 268 seconds]
nsrahmad has quit [Quit: Leaving]
jstypo has joined #lisp
dyelar1 has joined #lisp
dyelar has quit [Read error: Connection reset by peer]
Kevslinger has joined #lisp
FreeBirdLjj has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
EvW has quit [Ping timeout: 276 seconds]
damke_ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
drcode has joined #lisp
cuso4 has quit [Ping timeout: 256 seconds]
LoggerZZZ has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
Cymew has quit [Remote host closed the connection]
LoggerZZZ has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
warweasle has joined #lisp
Cymew has joined #lisp
FreeBirdLjj has joined #lisp
damke_ has quit [Read error: Connection reset by peer]
Murii has joined #lisp
Cymew has quit [Ping timeout: 248 seconds]
BitPuffin has joined #lisp
damke_ has joined #lisp
Cymew has joined #lisp
drewc has joined #lisp
FreeBirdLjj has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 264 seconds]
orivej has quit [Ping timeout: 252 seconds]
Cymew has quit [Ping timeout: 260 seconds]
jibanes has quit [Ping timeout: 240 seconds]
pagnol has quit [Ping timeout: 255 seconds]
orivej has joined #lisp
jibanes has joined #lisp
eivarv has joined #lisp
fikka has joined #lisp
scottj has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
cuso4 has joined #lisp
fikka has joined #lisp
eivarv has quit [Quit: Quit]
eivarv has joined #lisp
Karl_Dscc has joined #lisp
smurfrobot has quit [Remote host closed the connection]
damke_ has quit [Ping timeout: 264 seconds]
damke_ has joined #lisp
JI6 has joined #lisp
smasta has quit [Ping timeout: 248 seconds]
<JI6> akkad: check keybase plz
LoggerZZZ has quit [Remote host closed the connection]
JI6 has quit [Remote host closed the connection]
LoggerZZZ has joined #lisp
nowhere_man has joined #lisp
nowhereman_ has quit [Ping timeout: 240 seconds]
kami has joined #lisp
<kami> Good evening.
<dlowe> Good morning.
fikka has quit [Ping timeout: 248 seconds]
smasta has joined #lisp
ebzzry has quit [Ping timeout: 240 seconds]
<oleo> evening
nox2 has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
kami has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
smasta has quit [Read error: Connection reset by peer]
Jesin has joined #lisp
smasta has joined #lisp
orivej has quit [Ping timeout: 276 seconds]
fikka has joined #lisp
nox2 has joined #lisp
raynold has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
LoggerZZZ has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
__rumbler31 has quit [Ping timeout: 264 seconds]
LoggerZZZ has quit [Remote host closed the connection]
smurfrobot has joined #lisp
LoggerZZZ has joined #lisp
varjag has joined #lisp
Devon has joined #lisp
smurfrobot has quit [Remote host closed the connection]
hiroaki has joined #lisp
makomo has joined #lisp
Xal has quit [Ping timeout: 248 seconds]
lnostdal has quit [Ping timeout: 255 seconds]
Xal has joined #lisp
<Devon> No portable defadvice?
smasta has quit [Ping timeout: 260 seconds]
Jesin has quit [Quit: Leaving]
dieggsy has quit [Remote host closed the connection]
randomstrangerb has quit [Ping timeout: 240 seconds]
<jackdaniel> Devon: advices are supported only by CCL I think (I don't count commercial implementations because I don't use them so don't know)
dieggsy has joined #lisp
hhdave has quit [Ping timeout: 240 seconds]
<jackdaniel> s/commercial/locked down/ - corrected myself because foss implementation may be commercial, why not
randomstrangerb has joined #lisp
smurfrobot has joined #lisp
<beach> "proprietary"?
<jackdaniel> right
Denommus has quit [Remote host closed the connection]
smurfrobot has quit [Ping timeout: 276 seconds]
fikka has quit [Ping timeout: 240 seconds]
LoggerZZZ has quit [Remote host closed the connection]
fikka has joined #lisp
<Devon> Any CL lacking DEFADVICE is an outlier, it may not be in the spec but it's in the culture.
<Shinmera> Nah
<phoe> Nah
LoggerZZZ has joined #lisp
<jackdaniel> Devon: never used defadvice (though I know what it is)
<jackdaniel> and I rarely see it in libraries
<jackdaniel> (probably because sbcl doesn't have it though, most libraries are developed with sbcl ;)
<phoe> uh, what was it? "languages teach you not to want what they don't provide"? (:
<pjb> Adding an advice would require recompiling all the files that use the adviced function.
<jackdaniel> actually more like: practice makes culture -thinking otherwise is called social engineering ;-)
<pjb> Since the compiler can inline ANY function in the same compilation unit!
<jasom> pjb: adding an advice would have exactly the same limits as redefining a function; and people do that with C-c C-c all the time
fikka has quit [Ping timeout: 276 seconds]
dyelar1 has quit [Quit: Leaving.]
<phoe> "There are three kinds of advice that may be defined: before, after and around advice."
<phoe> did someone reinvent the standard method combination
<pjb> jasom: C-c C-c cannot work if you use C-c C-k This is why I always use C-c C-l!
<jackdaniel> its much simpler (thanks to not relying on clos and its dispatch)
<Shinmera> phoe: The point of advice is that you can do it for functions that aren't generic
<Shinmera> On SBCL you can emulate advice by using (trace foo :report NIL :condition/-after/-all stuff)
<Shinmera> I don't recommend doing that though
<makomo> could you use something like ensure-generic-function combined with standard method combination?
<makomo> oh hmm, nvm
<makomo> thought it turns a normal function into a generic one
smasta has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
<pjb> OR, you can not use cl:defun, instead define your own defun macro, implement the conforming tricks so that any library compiled will use your:defun and then you can conformingly have a defadvice that would work even with inlined function calls.
random-nick has quit [Remote host closed the connection]
smurfrobot has joined #lisp
dyelar has joined #lisp
<Devon> As with DEFADVICE, when you change a macro, the implementation may recompile or not.
random-nick has joined #lisp
smurfrobot has quit [Ping timeout: 240 seconds]
jmercouris has joined #lisp
mejja has joined #lisp
<makomo> what's the best way to have something like an enumeration, i.e. a mapping from symbols to values?
<makomo> that's known at compile-time completely
<makomo> values as in integers
<phoe> makomo: a series of symbol-macros bound via symbol-macrolet
<phoe> if you want a compile-time mapping
<phoe> otherwise you can just use a hashtable of sorts, huh
<makomo> i want it to hold globally, i don't want to have to wrap everything into a symbol-macrolet
<makomo> yeah, that's what i was thinking about
<phoe> makomo: then define-symbol-macro a bunch of symbols
<makomo> not familiar with that one yet
<phoe> it's symbol-macrolet, just global and not lexical.
<sjl> (defconstant +account-state.active+ 1) (defconstant +account-state.inactive+ 2) ...
<makomo> lol yeah, constants, what am i even thinking...
Devon has quit [Ping timeout: 248 seconds]
<sjl> possibly with a macro to automate the naming boilerplate if you want
<sjl> (define-enumeration account-state active inactive ...)
<makomo> yeah, sure, but there are only a couple of them here
<sjl> I'd probably just defconstant then
<Shinmera> Or just define a function that does an ecase to return the value, and have the function exist at compile-time with eval-when
m00natic has quit [Ping timeout: 240 seconds]
<makomo> i guess that's also an option. i suppose i could write a macro that would automatically give me the other direction as well right?
<Shinmera> In that case I'd store the map as an alist in a variable, and define two functions to do the lookup in either direction.
<scymtym> emacs' object system has an interesting combination of CLOS and an advice facility: method qualifiers can always be augmented with :extra STRING, basically allowing the "same" method to be defined multiple times, like named pieces of advice
<makomo> Shinmera: hm i see, that's more to the point, yeah
fikka has joined #lisp
turkja has quit [Ping timeout: 260 seconds]
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 276 seconds]
nyef has quit [Ping timeout: 240 seconds]
python476 has quit [Ping timeout: 256 seconds]
__rumbler31 has joined #lisp
orivej has joined #lisp
JuanDaugherty has joined #lisp
SlashLife has quit [Quit: ZNC - http://znc.in]
pythosnek has joined #lisp
SlashLife has joined #lisp
epony has joined #lisp
pythosnek has quit [Remote host closed the connection]
LoggerZZZ has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 260 seconds]
SlashLife has quit [Client Quit]
SlashLife has joined #lisp
LoggerZZZ has joined #lisp
python476 has joined #lisp
fikka has joined #lisp
SlashLife has quit [Changing host]
SlashLife has joined #lisp
knicklux has joined #lisp
pagnol has joined #lisp
jfb4 has quit [Ping timeout: 268 seconds]
jfb4 has joined #lisp
jmercouris has quit [Remote host closed the connection]
jmercouris has joined #lisp
<pjb> sjl: I would be careful with mixing conventions. perhaps choosing between (defconstant account-state.active 1) (defconstant account-state.inactive 2) or (defconstant +account-state-active+ 1) (defconstant +account-state-inactive+ 2) would be preferable.
<sjl> I prefer my original bikeshed's color
<pjb> foo.bar has a conotation of functional abstraction (accessing a slot in a class or structure). So there's very little probability of anybody trying to bind such a symbol.
<pjb> (let ((foo.bar #|oh oh!|# 42)) '???)
<Bike> fluorescent orange was a great choice for my shed.
<Colleen> Bike: drmeister said 13 hours, 54 minutes ago: I disabled cl:row-major-aref and cl:row-major-ast temporarily
Jesin has joined #lisp
Jesin has quit [Remote host closed the connection]
<jmercouris> I'm trying to add hooks into my program, I was thinking about making them exist for every defined-command (user invokable defun)
<jmercouris> another thought I had was creating some macro like (define-hook :hook-name) that you can place inline, and any things registered to :hook-name will be invoked after that line of cod
<jmercouris> s/fish/code
<jmercouris> any suggestions?
<jmercouris> the only issue with (define-hook) is that as it may be within a defun body, it won't be a top level form so (defun register-to-hook (function hook) ...) may not necessarily be able to register against a non-existent hook
nox2 has quit [Read error: Connection reset by peer]
nox2 has joined #lisp
<jmercouris> though I guess that register-to-hook may make a binding for the hook if it does not exist, and then (define-hook) will just use that hook
<jmercouris> does any of this make sense, or not really?
nox2 has quit [Remote host closed the connection]
lnostdal has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
dieggsy has quit [Remote host closed the connection]
LoggerZZZ has joined #lisp
<phoe> jmercouris: just make (defvar *something-hooks* '())
<phoe> and then (mapc #'funcall *something-hooks*) in your code
<phoe> client code can either push to the toplevel value of *something-hooks* for a global effect or rebind that for a dynamically scoped effect
smurfrobot has joined #lisp
<phoe> people can push things like (lambda () (do-a-little-dance)) there
<jmercouris> phoe: Right yeah, it will ultimately just be a list in a global var
dieggsy has joined #lisp
<jmercouris> the question was about how will users declare new hooks and register where the hook gets invoked
<phoe> jmercouris: I see no point in custom macros then
<jmercouris> what if I want to add more logic down the road in what happens during a hook declaration
<jmercouris> what if I want a list of all hooks or something
<jmercouris> idk, maybe I'm over thinking it
<phoe> how many hookable places will your code have?
<jmercouris> I'm not sure, how many hooks does emacs have?
<phoe> hooooo boy
<jmercouris> I also would like to consider packages where people can put hooks
<jmercouris> so that number could grow out of control and I may need to do some magic down the road
<jmercouris> which is why I was leaning towards a macro
<phoe> (defvar *hooks* (make-hash-table))
tylerdmace has joined #lisp
<jmercouris> ok so far we are in agreement
<phoe> (push (lambda () (do-a-little-dance)) (gethash :on-new-tab *hooks*))
<phoe> somewhere in code that opens a new tab, (mapc #'funcall (gethash :on-new-tab *hooks*))
<jmercouris> I could wrap that in a little function to make it cleaner
<phoe> still no macros required
<dlowe> so, I have a hook mechanism in tcl I did myself. The things you'll want to do: have two identifiers for the hook - the hook trigger and a descriptive id
<jmercouris> like (push-to-hook lambda hook-name)
LocaMocha has quit [Ping timeout: 240 seconds]
<dlowe> that allows you to redefine things gracefully
<phoe> sure, that's doable
<jmercouris> dlowe: what's the descriptive id?
<dlowe> just a name.
<jmercouris> what is the hook trigger?
<jmercouris> I'm sorry, I'm not getting it :(
<dlowe> so that (define-hook connected foo ...) will replace the foo proc in the connected hook
<jmercouris> ah, okay
<phoe> dlowe: my mechanism has a flaw.
<jmercouris> phoe: what's that?
<jmercouris> I don't really see a flaw
<dlowe> second, you'll probably want a priority number attached to each for ordering
<phoe> if you reevaluate that push 10 times, you'll get with 10 hooks pushed to the list.
<jmercouris> dlowe: why would hooks not simply be executed in the order they are recieved?
<phoe> so if your hook is (lambda () (print "haha")) then the print will happen 10 times in a row.
<dlowe> because sometimes you want to calculate something before it's displayed
<jmercouris> shouldn't that have been chained somehow in the hook or something
<jmercouris> like in a lambda or something
<jmercouris> then that might result in duplicitous calculations during a hook call though
<phoe> that's why dlowe introduces a second identifier, so you can identify hooks by *their* identifier and replace them instead of pushing new ones.
random-nick has quit [Ping timeout: 264 seconds]
<_death> for hooks I prefer to push symbols
dtornabene has joined #lisp
<jmercouris> _death: so you intern a symbol for every action callable by a hook?
<dlowe> you can mess about with order inside the hook list, but if you want an abstraction layer that supports redefinition, the numeric priority is the way to go
<_death> jmercouris: I just use named functions for actions
<dlowe> this is from the point of view of declaring hooks in code with a macro or something
<jmercouris> right, that could work, its not incompatible so far with the phoe approach
<phoe> this will work with my approach - symbols are funcallable, too.
<jmercouris> right, that's what I'm saying
<jmercouris> I don't think i'll worry about priority just yet, that seems to be a more sophisticated problem
<jmercouris> though I could do some dependency tree stuff like
<jmercouris> :hook-function-depends-on
<jmercouris> and then it could automatically calculate the order in which hooks should be invoked
<dlowe> bleh
<jmercouris> it would only calculate it once, when adding or removing hooks
<phoe> hold your horses
<jmercouris> and it would make sure you don't remove a hook that is needed
<phoe> you're reinventing ASDF
<phoe> except for thunks this time
<jmercouris> shit, my name is Fare
<jmercouris> I mean, damnit, sorry :D
<_death> in my opinion, the function running the hooks should first copy the list and use that copy.. so that actions can change the list without issue
tylerdmace has quit [Quit: leaving]
<jackdaniel> library "cells" may be worth investigating here
<jmercouris> if it makes a copy of that list, why would it matter if actions change the list?
<dlowe> in my hook implementation, hook functions can modify the argument list for successive functions or break out of the hook completely
<dlowe> sorting a list by a bunch of integers is not a more sophisticated problem
<dlowe> but sure, you can introduce dependency trees if you really want
<jmercouris> _death: In that snippet you posted, hook is what? some sort of clos object?
<_death> hook is a symbol that names a special variable.. (defvar *my-hook* '()) (add-hook '*my-hook* 'some-function)
<jmercouris> dlowe: no way, I mean the trees are far and more complex, I'm just thinking, that either solution right now is not important for a first round implementation
<jackdaniel> https://github.com/kennytilton/cells ← jmercouris
<jackdaniel> not sure if it fits your problem, but is a very interesting approach to propagating events
<jmercouris> jackdaniel: I'll take a look, thanks!
<_death> there are more elaborate libraries for hooks, but this implementation suffices for what I need
<jmercouris> _death: seems clean, I'll do something similar, but introducing the list that phoe and I spoke about
<jmercouris> I would like to have a list of all hooks
<jmercouris> and I can just embed (run-hook *symbol-name*) wherever it is needed
knicklux has quit [Quit: Leaving]
tylerdmace has joined #lisp
<jmercouris> thank you all for your feedback, I'll have to spend sometime thinking about while not exhausted, and hopefully I'll have an implementation soon, and then my first version of hydra :) (https://github.com/abo-abo/hydra) for next
<_death> you can have a define-hook macro for that
d4ryus2 is now known as d4ryus
<jmercouris> _death: right, which is why I was saying I wanted a macro originally, so that I can make decisions like that in the future without breaking everyones code like an angry child with legos
trittweiler has quit [Ping timeout: 248 seconds]
smurfrobot has quit [Remote host closed the connection]
smasta has quit [Read error: Connection reset by peer]
smasta has joined #lisp
mejja has quit [Quit: mejja]
zooey has quit [Remote host closed the connection]
_iviv_ has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
randomstrangerb has quit [Ping timeout: 276 seconds]
zooey has joined #lisp
tomlukeywood has quit [Quit: Leaving.]
randomstrangerb has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
damke_ has joined #lisp
random-nick has joined #lisp
fikka has joined #lisp
kini has quit [Quit: No Ping reply in 180 seconds.]
fikka has quit [Ping timeout: 248 seconds]
Murii has quit [Quit: WeeChat 1.4]
LoggerZZZ has quit [Read error: Connection reset by peer]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
LoggerZZZ has joined #lisp
kini has joined #lisp
randomstrangerb has quit [Ping timeout: 248 seconds]
shifty has quit [Ping timeout: 240 seconds]
acolarh has quit [Quit: WeeChat 1.6]
randomstrangerb has joined #lisp
fikka has joined #lisp
Cymew has joined #lisp
BitPuffin has quit [Remote host closed the connection]
smurfrobot has joined #lisp
Cymew has quit [Ping timeout: 268 seconds]
Cymew has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
BitPuffin has joined #lisp
heurist` is now known as heurist
EvW has joined #lisp
Cymew has quit [Ping timeout: 264 seconds]
smasta has quit [Ping timeout: 276 seconds]
Cymew has joined #lisp
smasta has joined #lisp
python476 has quit [Remote host closed the connection]
<Xach> Shinmera: https://gist.github.com/xach/5e623744fa4777159719619c9eabb4d5 shows some behavior that is confusing to me.
<Xach> Shinmera: this is with ubiquitous.
<Xach> Shinmera: i expected the value to persist between sessions, but it does not seem to.
Cymew has quit [Ping timeout: 248 seconds]
Cymew has joined #lisp
earl-ducaine has quit [Read error: Connection reset by peer]
_mjl has quit [Ping timeout: 248 seconds]
earl-ducaine has joined #lisp
twouhm has quit [Quit: Page closed]
Cymew has quit [Ping timeout: 256 seconds]
Cymew has joined #lisp
fikka has joined #lisp
Cymew has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
<jmercouris> msg rme hey, how serious are you about wanting to work on a startup?
<jmercouris> sorry for off-topic :P
scymtym has quit [Ping timeout: 246 seconds]
nowhere_man has quit [Ping timeout: 256 seconds]
Cymew has quit [Ping timeout: 276 seconds]
Cymew has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
Cymew has quit [Ping timeout: 240 seconds]
LoggerZZZ has joined #lisp
Cymew has joined #lisp
shka has quit [Ping timeout: 240 seconds]
asarch has quit [Ping timeout: 256 seconds]
Cymew has quit [Ping timeout: 268 seconds]
moei has quit [Read error: Connection reset by peer]
moei has joined #lisp
jstypo has quit [Ping timeout: 248 seconds]
jstypo has joined #lisp
jstypo has quit [Max SendQ exceeded]
smurfrobot has quit [Remote host closed the connection]
papachan has quit [Quit: WeeChat 2.0.1]
Cymew has joined #lisp
vlatkoB has quit [Remote host closed the connection]
scymtym has joined #lisp
zaquest has quit [Read error: Connection reset by peer]
Cymew has quit [Ping timeout: 256 seconds]
damke has joined #lisp
eivarv has quit [Quit: Sleep]
Cymew has joined #lisp
dyelar has quit [Quit: Leaving.]
<rme> jmercouris: I am actually not totally joking about it.
damke_ has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 276 seconds]
Cymew has quit [Ping timeout: 256 seconds]
pmetzger has joined #lisp
Cymew has joined #lisp
jstypo has joined #lisp
Cymew has quit [Ping timeout: 256 seconds]
Cymew has joined #lisp
eivarv has joined #lisp
fikka has joined #lisp
Cymew has quit [Ping timeout: 260 seconds]
Cymew has joined #lisp
BitPuffin has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 240 seconds]
Cymew has quit [Ping timeout: 264 seconds]
Cymew has joined #lisp
Cymew has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
smurfrobot has joined #lisp
milanj has joined #lisp
Cymew has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
LoggerZZZ has quit [Remote host closed the connection]
Cymew has quit [Ping timeout: 268 seconds]
Cymew has joined #lisp
__rumbler31 has quit [Ping timeout: 248 seconds]
Cymew has quit [Ping timeout: 256 seconds]
random-nick has quit [Remote host closed the connection]
JuanDaugherty has quit [Ping timeout: 256 seconds]
Cymew has joined #lisp
random-nick has joined #lisp
Cymew has quit [Ping timeout: 248 seconds]
paule32 has quit [Ping timeout: 256 seconds]
Cymew has joined #lisp
paule32 has joined #lisp
gabriel_laddel has joined #lisp
Cymew has quit [Ping timeout: 256 seconds]
terpri has quit [Ping timeout: 256 seconds]
<Shinmera> Xach: If you don't restore a configuration it doesn't save it anywhere
paule32 has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
<Shinmera> Or rather, ubiquitous does not load anything unless you explicitly tell it to
<oleo> read does intern right ?
mishoo has quit [Ping timeout: 240 seconds]
<Shinmera> If it reads symbols, of course
<oleo> so when it was called in a package it interns them there right ?
LiamH has quit [Quit: Leaving.]
<Shinmera> If the symbols are not explicit in their package, they are interned to *PACKAGE*
<oleo> oh
<oleo> i'm confuzzled now
<oleo> bleh
<oleo> cause i'm trying to get some repl defined in a package to work
<oleo> errything works other than that package stuff
Cymew has quit [Ping timeout: 248 seconds]
<jmercouris> oleo: A repl defined in a package? what do you mean?
<jmercouris> A package defined in the repl?
paule32 has joined #lisp
Bike has quit [Ping timeout: 260 seconds]
<oleo> a repl defined in a package
<jmercouris> I'm not following you, sorry
<Shinmera> If you want to preserve the package that is used during compilation you need to, well, capture it.
<Shinmera> (let ((*package* #.*package*)) (read))
Cymew has joined #lisp
nopolitica has joined #lisp
<oleo> i have an m-repl repl there
<oleo> for having a math repl so to say in infix
sjl has quit [Quit: WeeChat 1.9]
<oleo> when i try that m-repl via loading the file it does not work
<oleo> when i try it toplevel in my clim listener it works
sjl has joined #lisp
smurfrobot has quit [Remote host closed the connection]
<oleo> so the thing is i'm comparing the input to 'quit
<oleo> when i just put quit in the toplevel repl it quits returning me back to the listener
<pjb> Shinmera: this doesn't work: the current package is not necessarily available at load or run-time.
<oleo> when i try to load the file the 'quit gets interned somewhere else
<pjb> Shinmera: better use something like (load-time-value (or (find-package "FOO") (error "No package FOO")))
<oleo> cause i tried also 'm-test::quit, but that does not work either
<pjb> Shinmera: or if you insist, (load-time-value (or (find-package #.(package-name *package*")) (error "No package FOO")))
<Shinmera> pjb: I assume this is placed in a file with (in-package ..) at the top. In that case it's just fine.
<pjb> Shinmera: again, not if you compile.
<pjb> You can have surprises..
Cymew has quit [Ping timeout: 260 seconds]
<Shinmera> Can't imagine any surprises right now that wouldn't be insane.
<jmercouris> I never cease to be surprised in this world
<jmercouris> maybe I don't have enough experience :P
Cymew has joined #lisp
<oleo> when i just input quit it does not work
<oleo> but when i try to input just m-test::quit it works
paule32 has quit [Ping timeout: 240 seconds]
<oleo> it quits me to the repl and restores the foreground and the text-style
paule32 has joined #lisp
<oleo> i.e. (m-test:m-repl) m-test::quit
<oleo> is fine
<oleo> but only quit not
brendyn has joined #lisp
random-nick has quit [Remote host closed the connection]
<oleo> so what should the package be at read time ?
<oleo> such that i don't have to refer to it as explicitly as m-test::quit
Cymew has quit [Ping timeout: 256 seconds]
<oleo> hmm, i have to think about that a little more
<oleo> maybe tomorrow
<pjb> Well, what bothers me most, is that you have there a literal package that needs to be serialized in the fasl file, while in another fasl file, there's a defpackage for that will be creating a new package with the same name (assumedly before loading the fasl with the serialized package).
<pjb> What is the semantics of serializing a literal package?
<oleo> oO
<oleo> now you sound arabic pjb
<oleo> i don't get half of it even
<oleo> lol
Cymew has joined #lisp
<Shinmera> pjb: http://www.lispworks.com/documentation/HyperSpec/Body/03_bdbb.htm "Two packages S and C are similar if their names are similar.
<Shinmera> Note that although a package object is an externalizable object, the programmer is responsible for ensuring that the corresponding package is already in existence when code referencing it as a literal object is loaded. The loader finds the corresponding package object as if by calling find-package with that name as an argument. An error is signaled by the loader if no package exists at load time.
<Shinmera> "
<Shinmera> So: it's fine.
<pjb> Shinmera: ok. Also, it seems that implementations implement that by using find-package at load time.
<pjb> So I guess it's ok.
iqubic` is now known as iqubic
smurfrobot has joined #lisp
<pjb> Notice that those are special rules. In general be warry of using #. with complex objects. It doesn't always work.
<pjb> (thru compile and load).
Cymew has quit [Ping timeout: 256 seconds]
<oleo> aha
<oleo> when i try infi-> *package* i get :clim-user as package
<oleo> cause (m-test:m-repl) gets called in the clim listener
<oleo> and tho i use in-package in the file.......
<oleo> wth
<oleo> why is that ?
<Shinmera> oleo: This is what I explained to you already. The run-time package is not the same as the compilation package. You need to capture the package that is used during compilation and bind it at run-time around READ.
smurfrobot has quit [Ping timeout: 256 seconds]
<Shinmera> 23:42:58 Shinmera | (let ((*package* #.*package*)) (read))
<oleo> yes, but what's the common idiom for it ?
<oleo> ah
<oleo> ok thank you, i'll try it tomorrow
<oleo> i'm so tired bleh
<pjb> Well the common idiom is to bind *package* at run-time. Not necessarily the same as the source package. Usually you prepare a run-time package…
<pjb> like COMMON-LISP vs. COMMON-LISP-USER.
<pjb> MY-PROGRAM MY-PROGRAM-USER
earl-ducaine has quit [Remote host closed the connection]
epony has quit [Read error: Connection reset by peer]
epony has joined #lisp
Cymew has joined #lisp
<oleo> ok now it changed to package m-test but it does not still understand quit
<oleo> it still only works with m-test::quit
borei has joined #lisp
<oleo> ah ok it worked now
<oleo> i was trying it in the same let without using let* or so
Cymew has quit [Ping timeout: 240 seconds]
<oleo> jep, it works, thank you all
Cymew has joined #lisp
z3t0 has joined #lisp
nowhere_man has joined #lisp
_iviv_ has quit [Ping timeout: 240 seconds]
smasta has quit [Quit: WeeChat 2.0.1]
Cymew has quit [Ping timeout: 276 seconds]
shifty has joined #lisp
Cymew has joined #lisp
<borei> hi all !
epony has quit [Read error: Connection reset by peer]
<jmercouris> borei: hello
<borei> aeth: are you getting 2.8 kcycles on (4x4) multiplication ?
<borei> hi jmercouris
milanj has quit [Read error: Connection reset by peer]
milanj has joined #lisp
moei has quit [Quit: Leaving...]
Cymew has quit [Ping timeout: 276 seconds]
epony has joined #lisp
varjag has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
smurfrobot has joined #lisp
milanj has quit [Read error: No route to host]
milanj has joined #lisp
<aeth> borei: single-float 4x4 naive (from the definition, but without a loop) matrix multiplication, with the matrix as a flat 16-length specialized array
Cymew has quit [Ping timeout: 240 seconds]
<aeth> Afaik, smarter algorithms only are effective when you go to sizes in the hundreds or thousands.
<aeth> borei: The actual implementation is not pretty, but I can cover it up with a macro when I settle on the final implementation. https://gitlab.com/zombie-raptor/zombie-raptor/blob/324c45a11a1ead12c368e1fb8aee1216f2720555/math/matrix.lisp#L160-185
Cymew has joined #lisp
<aeth> I had to make matref a macro rather than an inline function because there simply is so much of it. Loading the matrices into variables and then working on the variables seems to be slower for the 16-length version, though.
<aeth> Loading *some* into variables and accessing the array for some seems to be faster, but that... that would get complicated quickly.
Pixel_Outlaw has joined #lisp
dtornabene_ has joined #lisp
dtornabene has quit [Ping timeout: 248 seconds]
<aeth> Even with a 2D array (I played around with various implementations, just not uploaded) a matref (in that case, just (1- i) (1- j)) is essentially necessary because it's just too easy to make off-by-one mistakes unless I use a 1-based matref
rumbler31 has joined #lisp
rumbler31 has quit [Read error: Connection reset by peer]
nirved has quit [Quit: Leaving]
emaczen has quit [Read error: Connection reset by peer]
emaczen has joined #lisp
Cymew has quit [Ping timeout: 260 seconds]
Cymew has joined #lisp
<aeth> Oh, and in case it's unclear, all of my matrix operations modify a destination matrix, either a native-CL one or a C one that can be fed into CFFI for graphics.
smurfrobot has quit [Remote host closed the connection]
damke_ has joined #lisp
hiroaki has quit [Ping timeout: 240 seconds]
z3t0 has quit [Remote host closed the connection]
<aeth> If I want to use it in the REPL, I can just feed the result into a matrix created by (zero-matrix)
dtornabene_ has quit [Read error: Connection reset by peer]
damke has quit [Ping timeout: 264 seconds]
Cymew has quit [Ping timeout: 256 seconds]
Cymew has joined #lisp
emacsomancer has quit [Ping timeout: 264 seconds]
rumbler31 has joined #lisp
Cymew has quit [Ping timeout: 248 seconds]
z3t0 has joined #lisp
<borei> i just did timing for nested loops for 4x4 - best i was getting ~2700 cycles, in most cases it's in 4-5k range
<borei> seems like it depends on what CPU is doing at every particular moment
aindilis` has quit [Remote host closed the connection]
thallia has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
<borei> honestly saying in any cases, for me - it's good performance.
<borei> i just need to build 4x4 transforms and upload it to uniform
<borei> the rest is up to GPU, where i don't have a lot of control
aindilis` has joined #lisp
thallia has joined #lisp
rumbler31 has quit [Remote host closed the connection]
hiroaki has joined #lisp
Cymew has quit [Ping timeout: 276 seconds]
Cymew has joined #lisp
aindilis` has quit [Remote host closed the connection]
z3t0_ has joined #lisp
z3t0_ has quit [Remote host closed the connection]
Cymew has quit [Ping timeout: 240 seconds]