freenode/#lisp - IRC Chatlog
Search
14:38:24
flip214
swank:undefine-function in sbcl seems to keep the same function type declaration in place -- redefining the function with a different arglist gives style-warnings
14:43:09
Bike
i don't know what the design of that particular function is, but type declarations are independent of the actual definition. you can declare an ftype for a function before you define it, after all.
14:44:30
flip214
so the declaration shouldn't be removed along with the definition by swank? okay, thanks.
14:53:19
BW^-
are you aware of any distributed connected components algorithms for *dynamic* (aka online) graphs?
14:56:45
ludston
I had a function in a tight loop that was wrapping around a (defmethod) by accident
14:57:35
ludston
Things learned: If I see a certain kind of lock in the profiler it means it's a function being defined over and over
15:05:40
ludston
Factor of 2, maybe is impressive but in a production environment usually there is *somewhere* that is redundantly O(n)
15:08:25
rpg
The only such algorithms I know are for dynamic transitive closure (longest paths), but I'm also interested.
15:12:23
ludston
schweers: It was impressively bad code. It takes real skill to write something that performs so badly and still has the right answer.
15:13:21
schweers
you mean without having to resort to such obvious things as (dotimes (i 100000000000000)) ;)
15:15:53
rpg
BW^-: https://stackoverflow.com/questions/7241151/how-to-find-connected-component-dynamically
15:16:47
beach
marvin2: There is no attempt whatsoever to update the Common Lisp standard, if that is what you mean.
15:19:02
marvin2
phoe you can do type hints for optimization purposes, but they aren't used to check for errors statically
15:20:05
phoe
and the moment you use highly typed code (with a lot of DECLARE TYPE and THE forms), you will see these warnings
15:21:05
phoe
and if you (declare (optimize speed)), SBCL complains also about what it could not optimize because of types that it could not recognize
15:24:54
dlowe
flip214: oh, no problem. I mean, I understand the whys from the inside, but from an outside perspective it still isn't great
15:25:02
Bike
you can declare the type of an array to be some type that doesn't correspond to an array storage class, and the compiler can use that information to infer the type of values extracted from the array with aref, find, etc.
15:25:30
rpg
My impression is that gradual typing turns out to be a lot harder than it seems on the face of things....
15:26:53
dlowe
well, when a "type" can be "a thing that satisfies an arbitrary predicate" that seems to be rather hard to optimize or analyze
15:27:51
dlowe
sure, I ignore the type system entirely except when sbcl (sometimes, not always) emits a helpful warning
15:28:08
rpg
Bike doesn't it require use of those arbitrary predicates to reason about homogenous lists of a single type?
15:28:41
Bike
rpg: yes. what i mean is, the type system could be changed so that you don't need to use predicates for that.
15:30:54
Bike
rpg: as in the problem isn't gradual typing in general, it's the particular system of types lisp has.
15:33:47
random-nick
beach: well, you can make a union type in common lisp's type system too using or
15:34:09
rpg
Bike: I looked at some papers (but programming languages isn't my field) that seemed to imply that the gradual typing was hard in general. Hm.... some paper from lambda the ultimate...
15:38:12
rpg
Doing maintenance on ASDF, I'm really finding myself annoyed by trivial type errors that I find only late.
15:52:24
Bike
sound gradual typing is hard because for soundness you need to put a lot of type checks at typed/unchecked boundaries. right.
16:19:43
Bike
is what "the same, identical object" means in the description of eq defined further anywhere? is the fact that characters and numbers can be "copied" stated outside of the notes on eq?
16:23:03
beach
Bike: Short story: "same" is relative to some predicate that has to be mentioned explicitly.
16:29:34
beach
oleo: Yes, but in addition, as I said, the very definition of "identical" involves EQ.
16:31:02
Bike
i'm not asking what eq-ness is, i know that, i'm just wondering about the definition a little. "pointer equality" is the usual explanation but it doesn't exactly reflect how a lisp runtime actually works.
16:32:01
beach
oleo: EQ is always identical usually means "if it is EQ then it is identical" which is the same as EQ => identical. But maybe you meant something more.
16:32:20
oleo
where stuff may seem to be eq on the surface but what happened in between changed stuff already.....
16:33:58
Bike
the glossary has the term "fresh", and i would take "fresh" to mean "not EQ to any existing object", but it doesn't say that
16:36:13
beach
Bike: Often in language specifications, it is an attempt to explain something that is obvious when implementation techniques are taken into account, but that become obscure when implementation techniques can not be referred to.
16:36:28
beach
The C language specification is way worse than the Common Lisp specification in that respect.
16:38:23
beach
oleo: When an object is no longer referenced, the memory location it occupies is typically reclaimed. And then, a new object may very well get the same address of the one being reclaimed.
16:39:53
beach
oleo: But if you hold on to all the objects you create, you might run out of possible pointers. But that will happen much later than running out of (virtual) memory, and it is safe to assume that it won't happen before your computer crashes.
16:40:54
oleo
i'm just not sure on all the implications now that you mentioned reuse of pointers.....
16:49:47
beach
If you have a 64-bit architecture, then the address space can hold 2^60 CONS cells. Now 2^60 ≅ 10^18. If we assume that it takes say 10ns (= 10^-8 s), it will take 10^10 seconds to fill your address space. There are around 3*10^7 second in a year, so that will come out to 3*10^2 (300 or so) years, unless I made some stupid mistake.
17:21:41
Bike
weird question. defclass has a compile time side effect of making the class name bound in the compile time environment. then subtypep might be used to query its class precedence list - but the class might not be finalized (or finalizable). what happens?
17:24:16
random-nick
if I have a declamation in a package, and use that package in another package, does the declamation exist in the second package?
17:25:52
Bike
proclamations are independent of packages. you cannot proclaim something "in a package".
17:27:20
Bike
proclamations usually last forever, though some implementations limit optimize declarations to a file or a compilation unit
17:31:02
Bike
no. declaim is a helper macro to ensure that the proclamations are made at compile time.
17:34:42
sjl
random-nick: assuming you meant "file" when you said "package", the answer is that it's implementation dependent
17:34:54
sjl
see https://trac.clozure.com/ccl/wiki/ReleaseNotes/1.9#Limitingtheextentofload-timeOPTIMIZEproclamations for more info
17:58:51
thetabit
(format t "~A ~A" item1 item2) where Item two might not have a value and thus I dont want format to just print nil
18:02:56
sjl
which means "if the argument is nil, consume it and print nothing, but if it's non-nil don't consume it and process the middle"
18:06:58
beach
oleo: With a 32-bit architecture, you would run out of address space in a matter of seconds.
19:17:13
pjb
O(1)=k₁ O(n)=n*k₂ There are k₁ and k₂ such as for any n that you can store on an actual number, O(1)>>O(n). But usually it's O(1)<<O(n), even assuming that n cannot be bigger than the size of the memory.
0:04:06
learning_
what's a good resource for learning to do threading with CCL? the docs just confuse me
0:12:20
pjb
The only specific things are ccl:process-interrupt and ccl:process-suspend, but you're better not using them in general.
0:13:07
pjb
Don't do that with slime, since swank has open sockets, and it'll fail when reloading the image.
0:14:27
pjb
But it should not be needed, since slime loads it automatically. Unless you want to be able to launch lisp image independently, and connect with slime after the fact.
0:19:00
learning_
I'm reading CCL's page about images, I realize now what you were talking about the executable. That's pretty cool, just modify your lisp system to be the application you want and then save it, and then bam instead of a lisp dev environment, you just have your app
0:20:07
pjb
While developping, you can keep saving the executable lisp image with the default startup function (the lisp toplevel REPL). And when you want to deliver, you can save it with the main function of your application instead.
0:21:16
pjb
On the other hand, since having reproductible builds from sources is convenient and desirable too, you may instead have a script used to build the application from the sources, calling quickload etc.