freenode/lisp - IRC Chatlog
Search
13:58:50
beach
I think I may have gotten Quicklisp confused with an incorrect ASDF file. Is there a way to clear the idea that Quicklisp has of local projects, so that I can do the register-local-projects from scratch?
13:59:45
jdz
beach: have you tried removing the system-index.txt from local-projects? Or is it something else you're after?
14:27:41
ecraven
RFC 1459: Because of IRC's scandanavian origin, the characters {}| are considered to be the lower case equivalents of the characters []\, respectively. This is a critical issue when determining the equivalence of two nicknames.
14:36:45
ecraven
luis: I've found comments that imply that freenode did implement this years back, but that might have changed
17:39:45
dhis
Hello. I'm using CFFI and I'm able to load some shared libraries, but I sometimes get an error that the library is dependent on another library. I'm not clear on how to use the library designator in define-foreign-library. Is there a CFFI example for this? I'm thinking if I give a complete list of libraries it will load the library.
17:45:56
TMA
dhis: I have been bitten by that already. the solution is to load the depended-on library first. there is some dependency autoloading, but it fails too often to be reliable
17:48:30
dhis
TMA: Yes I did try loading some libraries first (that didn't depend on anything else) and that is ok. I guess some of my libraries depend on each other, in a cyclical way.
18:23:39
pjb
it would be nicer if the block were cut vertically under the opening parenthesis, instead of being flushed to the left margin. (As long as no printing character in the list are present between those two columns of course).
18:26:37
kuwze_
pjb: well it's definitely possible to highlight only part of it... at least I know evil c-v seems to imply that
19:16:38
kristof
in my DIY understanding of implementing lisp I continually run into things that make me go "oof, how do I even make that fast?"
19:18:30
kristof
reader functions generated by a defstruct form are guaranteed to work correctly on any struct that includes its parent. in a statically typed language this is a simple matter because the offsets are the same
19:19:21
kristof
however... typechecking is now this ugly overhead on struct access when the type is unknown.
19:20:49
kristof
a simple eq check on the part of the data structure that holds the type is insufficient because I need to check ancestors now, too.
19:22:02
kristof
So I'm thinking I... first check if the type is what I expected. And if it isn't, I check the type object's ancestor. And I keep following that chain until I hit T. Right?
19:22:37
kristof
yeah, that's not the slow part, it's the typecheck when I don't have type information through inference or declare
19:22:48
kristof
but I guess the old advice remains the same. If you want it to be fast, declare declare declare.
19:28:14
bike
yeah, typep with a class basically means checking the class precedence list of the class of the object.
19:41:02
pfdietz
Ancestry queries in trees can be done with two comparisons (compare pre and post order traversal numbers).
20:10:24
anamorphic
API design question: I have a function (origin foo) => x, y (i.e two values) and I'm writing a corresponding (defun (setf origin) (new-value foo) ..) Would it be a better design if new-value was an array of two numbers, or would it be better if it were a list?
20:12:50
anamorphic
or a cons, or a (defstruct point (x y) ...) I guess a struct would make the get and set congruent
20:15:52
heisig
anamorphic: Unless your API is used from the innermost loop of an HPC application, you should use generic functions and (defclass origin () ...).
20:17:55
heisig
CLOS is surprisingly fast and makes your code much more maintainable in the long run.
20:34:41
sjl_
For the record: you can define a setf function that can set multiple things at once without an extra datastructure: (setf (origin foo) (values 1 2))
20:35:39
sjl_
But if you want to represent something with a data structure, then yeah a class is generally a good choice. Only use a struct if you've benchmarked and it's a bottleneck.
20:40:20
pjb
macros and special operators may do something else than mapping input to outputs. It's not "operator" in the mathematical sense.
20:41:08
anamorphic
sjl_, so something like (defun (setf origin) (new-values foo) (multiple-value-bind (x y) new-values ...)?
20:46:46
theseb
if anyone has any experience with large lisp dev teams......i'm curious how they maintain *readability* if the gurus start using lots of macros
20:47:45
sjl_
The docstrings for my hairier macros are often as long or longer than the macros themselves
20:48:33
White_Flame
and they don't even have to be separate .asd files, just collected and documented together
20:48:43
pjb
theseb: readability comes from the fact that all operators have nice names, such as WITH-OPEN-FILE or CHAR-CODE, and that the name of the opertor is the first element of each sexp = symbolic expression = list.
20:49:55
pjb
theseb: everything in C is hard, even obfuscation. This is why there is a C obfuscation contest. But there's no lisp obfuscation contest, because it's too easy to obfuscate lisp code.
20:50:48
theseb
pjb: seems to me ....a lisp dev team couldn't risk hiring average people....for what you said
20:51:07
White_Flame
using Lisp should be exercising your skills of abstraction, because anything can be done at the source code level. Thus, it's reasoanble to assume that Lispers will experience good & bad abstraction consequences and git gud at it
21:03:18
pjb
For example, in the expendables, everybody in the team is old and muscular. If there was a baby, you could make N old muscular men and a coffin, but not the expendables.
21:03:25
theseb
pjb: hmm..not sure how we could control the more clever impulses of the 3 comma programmer
21:05:09
theseb
pjb: The minute a team lead says..."OK we are going to limit what you are allowed to do for readability".....then they are moving towards Python
21:07:10
pjb
What can be said against 3-, is that it shows a lack of abstraction. The 3-, programmer has more capabilities, to be able to understand, write and read 3-, expressions. This allows him to use them, instead of introducing abstractions.
21:07:50
theseb
pjb: it is sort of like a reverse Greenspun's rule..."Every large enough lisp dev team contains a half baked spec of a Pythonic language"
21:08:48
pjb
I don't think. I feel that lisp allows you to write more complex software using fewer brain cells.
21:09:35
pjb
You don't need to remember a lot, since the syntax is simplier and clearer. And you don't need to understand a lot, because of the abstractions used in lisp programs. 3-, goes against that.
21:10:51
pjb
LdBeth: Your question is whether ecl is ported to avr. Again, I don't know, but if not, it should be easy to define avr as a target of ecl, AFAIK.
21:15:11
anamorphic
You might be interested in https://ferret-lang.org/ though. I was just reading about it. It supports AVR boards
21:25:39
jasom
theseb: "...then they are moving towards Python" this is absolutely not true. Readability is important and good abstractions are a net-gain in readability.
21:26:45
jasom
theseb: A common lisp style suggestion is "Don't use a macro when a function will do" which doesn't bring lisp even a tiny bit towards python, but is a net gain for maintainability.
21:27:37
theseb
jasom: i heard another suggestion which was...do as much of the macro in a normal function as possible..then just make a macro wrapper for it
21:28:19
jasom
theseb: I've heard that one; probably not as universal as the one I said. In any event, you can place limits on what programmers can do without hamstringing the language
21:29:26
jasom
theseb: in fact you could take your theoretical "pythonized lisp rules" and add "... except when necessary" to the end of each rule and already have something both restrictive, but more powerful than python.
21:29:38
jasom
(note this is a thought experiment, I think pythonizing lisp is not a good starting point).
21:44:22
jmercouris
how to loop through element in like (loop for element in list do ...) and have index of element within do part?
21:44:34
jmercouris
I seem to remember needing to have two clauses, but I can't remember how it should look
21:47:58
anamorphic
jkordani: you can do it this way too: (loop for i from 0 for elem in list do ...)
21:52:34
jmercouris
I wish I just knew it better, but it seems like there is so much to learn about it
22:13:05
PuercoPop
loke`: oi, just found stumpwm-dbus, can you share your setup config? Should I look at anything in particular beyond the formatter?
22:14:37
aeth
I thought it was just loop with s-expressions, but it's not, so it has an unnecessary learning curve and is unnecessarily complicated.
22:15:03
aeth
It also apparently only works with iterate:foo symbols, which doesn't really work well with the new style of not using :use for arbitrary packages. It should work on keywords.
22:16:48
aeth
i.e. (loop :for x :in y :collect (1+ x)) would just become (do-loop (:for x :in y) (:collect (1+ x))) and it would be a strict superset of loop so you could easily port loop clauses by adding parentheses.
22:21:05
aeth
The downside (other than having to, in effect, implement loop or port an implementation of loop) would be that it might not be sufficiently s-expressioned (s-expressed?). e.g. (:for-in x y) is Lispier than (:for x :in y)
22:22:24
aeth
(Of course, if it's a superset of loop, (:for x :in y) could be transformed to the preferred (:for-in x y))
22:24:20
aeth
White_Flame: If implemented with destructuring-bind that permits (:for x :then (* 3 x) := 1 :of-type fixnum)
22:24:29
White_Flame
maybe LOOP requires the ordering, but nothing semantically in that list of options does
22:24:55
aeth
White_Flame: I use keywords to implement a loop-like sum macro (for integer summation).
22:27:48
aeth
White_Flame: I would keep the order for LOOP's sections, and might even make them explicit with ()s like (do-loop ((:for x :in y) (:for a :in b)) ...)
22:28:17
aeth
The advantage is that that makes the sections explicit, the disadvantage is that that makes it harder to port existing LOOPs
22:56:28
jcowan
Today I read a claim that ACL2 is the most successful CL application ever; anybody have comments on that?
22:57:57
aeth
Maxima is used by SageMath, which is very popular. https://en.wikipedia.org/wiki/SageMath
22:58:40
aeth
I think Maxima is the only Common Lisp application in Fedora, and it might be a similar situation with other distros.
23:06:02
luis
How about Crash Bandicoot and its 50 million copies? (Not all versions used Lisp though.)
23:28:14
jiby
I've changed my exports (removed one, added other instead) in a trivial pkg and the removed exported symbol is "missing" all the time
23:28:51
jiby
I get that exported symbols would be very stable over time (who's silly enough to change their interface!? =p)
23:35:00
jiby
I'll be damned, neither worked to clear my exported symbol. Loading it again shows the same thing: caught WARNING: ; CL-YOUR-PKG also exports the following symbols: ; (CL-YOUR-PKG:MAIN)
23:35:03
jasom
jcowan: it's probably the only current day CL application for which it is the "one to beat"
23:37:12
jasom
jiby: (delete-package 'cl-your-pkg) (asdf:load-system :force t "my system that defines cl-your-pkg")
23:37:29
jasom
jiby: (delete-package 'cl-your-pkg) (asdf:load-system "my system that defines cl-your-pkg" :force t)
23:38:56
jiby
wow, hardcore. Seems to have cleared the exported symbol! thanks guys! Am I correct in assuming there is a big assumption of "thou shall not remove a symbol from your export" wrt. compatibility?
23:42:47
PuercoPop
loke`: For some reason overriding the stumpwm-dbus:popup-timeout doesn't appear to affect the durationg the timeout is displayed.
23:43:33
jasom
jiby: I don't think so (there is unexport, for example). However, static analysis tools are confused by exported symbols not in the defpackage, which is probably why SBCL warns.
23:44:30
jiby
fair, the warning is early on, and turns into a big fat compile error down the line. it's starting to make sense
23:44:38
jasom
ah "If the new definition is at variance with the current state of that package, the consequences are undefined"
23:45:32
jasom
so changing exports and imports are find, as long as you don't re-evaluate the defpackage form.
23:46:14
jasom
right, if you delete the package, then there is no existing package, and that line doesn't apply
23:52:16
PuercoPop
I'm guessing they don't due to the behaviour I'm observing in stumpwm-dbus but not sure
23:53:03
jasom
function lookups are non-thread-local, but sbcl makes assumptions about when they will be redefined. The same might be true for methods.
23:55:58
jasom
I don't think that PCL had any thread-specific code, but sbcl has divirged quite a bit from it now.
0:00:12
jasom
a simple test caused the method to propagate, but I wasn't running with optimization levels dialed up
0:01:11
jasom
and with optimizations high on the thread function (but not the defmethod) it also propagated.
0:02:09
jasom
My test used an eql specifier for the method "foo" and looked like this: (sb-thread:make-thread (lambda () (declare (optimize (speed 3))) (loop (foo 'foo) (sleep 1))))
0:04:23
jasom
Of course I didn't try e.g. (defmethod ((foo child-class)) ...) then spawn thread and (defmethod ((foo base-clase)) ...) which might be different