freenode/#lisp - IRC Chatlog
Search
18:46:39
_death
huh, neat.. I was thinking about pokemons and that I should update a program that scrapes UN "concerned" statements and generates a ban-ki-moon image with them as think bubbles.. at some point I disabled it.. now that I generated an image, however, I see that I don't need to update anything, as it reflects reality: https://adeht.org/img/ban.png
19:45:32
whartung
just curious if any of the current lisps support the idea of “volatile” variables.
19:46:52
phoe
as in, volatile from C language, meaning, "don't optimize this stuff, don't touch it, don't do anything with it"?
19:48:04
whartung
well, I’m thinking of the Java language where volatile variables will see changes done across cores in multi-threaded applications.
19:48:29
White_Flame
usually it means "always perform a real read & write when the source code says to" instead of caching it
19:49:37
White_Flame
in all the multithreading lisp stuff I've done, using your basic mutexes & such, I've never had a problem with multi-threaded access to shared variable
19:50:25
whartung
I’m thinking about atomiic “read and set” type of things, and “lockless” algorithms
19:51:38
pjb
whartung: threading is not considered by the CL language. An implementation that has threads could provide a declaration. You could (declaim (declaration volatile)) and (defun foo (x) (declare (volatile x)) …)
19:53:41
whartung
I think mutexes solve the problem, but they’re pretty heavy weight I dont know what their impact is on the caches when they happen.
20:09:03
AeroNotix
I'm getting errors just quickloading it: "Lock on package SB-VM violated when interning EMIT-SKIP while in package: SB-X86-64-ASM."
20:14:09
AeroNotix
Wonder why it's still in quicklisp, thought the CI process caught stuff like this.
20:15:25
phoe
it'll likely need to be dealt with in #sbcl since stmx is using internal symbols of sb-vm package
20:17:16
Demosthenex
oni-on-ion: yeah, windows swaps search and save vs emacs in firefox. control-s is save not search, adn control-f is find with a F key to cause repeates
20:17:19
phoe
AeroNotix: ha, look! http://report.quicklisp.org/2018-07-27/failure-report/stmx.html#stmx
20:19:07
AeroNotix
Weird, I thought they were removed if they didn't pass tests. Perhaps this is an omission/Xach thought it wise not to break dependencies?
20:20:13
AeroNotix
haha, it's actually weird. I had an idea on hacking on sbcl's internals with stmx as well actually. Whole reason why I loaded it up
20:23:51
oni-on-ion
Demosthenex: ahh right. and ctrl+g is search again etc . putting FF tabs as individual emacs buffers with EXWM does help a bit.
20:39:07
jasom
whartung: C's volatile is very lightly specified. It essentially says that accessing a volatile is a side-efect, and C does define when previous side effects must complete by (i.e. sequence points). This means it cannot remove accesses (since only side-effect free expressions can be removed) and it cannot reorder accesses across sequence points.
20:40:46
whartung
I don’t know how that differs from the java definition, or how they differ in practice.
20:40:48
jasom
whartung: most implementations give some additional guarantees, often specified in relation to the ISA, and in some cases the microarchitecture
20:42:18
jasom
one common additional guarantee is that the size of the access will match (e.g. a read write a pointer to a volatile 8-bit value won't cause a 32-bit read-modify-write on the bus, but it might for non-volatile accesses)
20:44:32
jasom
whartung: the spec as-written would guarantee that cores see volatile accesses on other cores only if a memory-write from one core is visible on other cores. For proper ordering, more synchronization may be needed (especially on non-x86oids)
20:45:03
jasom
as some microarchitectures do not enforce that issuing write instructions in order will be seen in the same ordering on another core
20:45:40
jasom
I think C11 now provides enough levers to do it in pure C, prior to C11, compilers would offer intrinsics that would essentially place synchronization instructions in the emitted code.
20:46:16
whartung
right, that’s what I thought something like that happens — some kind of hard sync between the cores.
20:47:27
jasom
pfdietz: compiler customers are notorious for overestimating what volatile is required to do as well :)
20:48:23
whartung
and I may be wrong, but it seems to be that volatile’s are important to lockless algorithms, but maybe CAS alone is adequate.
20:49:55
jasom
CAS removes the need for volatile in many cases because it explicitly performs the read and writes.
20:50:31
jasom
The typical CAS intrinsic has (nearly?) a superset of the guarantees that volatile provides
20:52:02
jasom
lockless Atomic modify can be implemented with a CAS, and atomic modify gets you many useful lockless algorithms, though there may be either forward-progess issues or slow performance for some algorithms if you build on top of that tower of abstraction.
20:53:05
jasom
and on multicore systems volatile will almost certainly not be enough, since cross-core synchronization is also going to be needed.
20:55:09
jasom
whartung: anyways when you get to gritty details, feel free to pick my brain since I've implemented a few simple lockfree algorithms on x86, arm and power.
21:14:17
asarch
I've done a few (ql:quickload...) and some (in-package...). Is there any SBCL command to wipe your session and start over again (anything else besides exit and restart again)?
21:19:12
whartung
but it’s an interesting question. For example, if I do (make-package “FOO”), then (in-package “FOO”), then (defun xxx ()), when I do a DELETE-PACKAGE, assuming no other binding, will FOO:XXX “go away” and be GCd?
21:19:59
phoe
so, if that symbol is not referenced anywhere in the image, it is free to be collected.
21:20:26
whartung
right, so, in theory, to “reset” he could delete all of the packages that he’s quick-loaded.
21:20:53
jasom
whartung: there are still things like DLLs that have been loaded, files that have been opened, &c.
21:22:14
whartung
outside of out-of-spec finalizers, there’s not much of a formal lifecycle for things.
21:22:51
|3b|
don't forget to delete all the print object methods, whoch keep refs to classes which ref names which ref ...
21:24:50
whartung
from a LispOS perspective (not wanting to open that, at all, really), I was always keen to understand how things were “forgotten”.
21:28:15
whartung
but that’s an interesting point regarding generic functions, and what holds on to them.
21:32:18
Bike
I guess the list of methods of a gf could be "weak" so that methods specialized on otherwise unused classes could be gced
21:33:44
jasom
beach recalculates the dispatch function whenever a method is added or removed though, right?
21:35:38
Bike
but if a method is collectable in this way, the discriminator doesn't actually need to be recomputed, since there's no way to call the gf with arguments of the gc'd classes
21:37:08
phoe
you'd need to explicitly make the method references in the discriminator weak, somehow
21:38:34
Bike
but conceptually there's no reason for a generic function to keep a method alive, i think.
21:38:44
phoe
yep, and you need to take them all into account when designing the CLOS implementation to make sure that methods are actually garbage-collectible.
21:39:24
phoe
Bike: basically, when a class becomes collected, then all methods specializing on that class are free to be collected, too, correct?
21:41:10
phoe
frodef: (defclass bar () ()) (defmethod foo ((bar bar)) 42) (setf (find-class 'bar) nil)
21:41:39
phoe
literally the only way for you to be able to call that method now is CLOS introspection
21:42:31
phoe
Bike: the issue is when you have (defmethod foo ((bar bar) (baz baz) (quux quux))) and when one of the classes becomes unreachable
21:43:54
phoe
frodef: if you have uncollected instances, then they refer to their class, so the class is reachable even if it's deleted
21:44:29
Bike
just putting a finalizer on classes would probably be okay. it's not like they're destroyed very often.
21:44:43
whartung
well, it’s not like you have a class and a list of generic functions. You have a list of generic functions and the dispatch arguments.
21:45:48
whartung
by that point, yes, in theory, if a class goes away then any generic function that is dispatched based on that class is “unreachable” via the dispath mechanism and could “go away".
21:46:19
phoe
when in a (defmethod foo ((bar bar) (baz baz) (quux quux)) 42) any of classes BAR, BAZ, QUUX are collected, then the method itself could freely be collected
21:47:20
whartung
in theory you would have a hard reference from teh symbol to the method, and a weak link from the “list of methods” to the method.
21:49:11
Bike
symbols just name generic functions. there are other ways to keep a generic function live.
21:50:15
phoe
you could (defvar *something* #'my-generic-function) and then (fmakunbound 'my-generic-function)
21:50:37
phoe
and 2) is lost but 1) is still live, since now a global variable refers to that function.
21:51:05
phoe
which brings me to another interesting question, storing methods for anonymous generic functions in the environment.
21:51:27
whartung
it just seems that “normally”, the “hard” references to the function would be tied to the naming symbol. Anything else (within the CLOS infrastructure) should probably be a weak reference.
21:52:28
phoe
I just wonder, if your generic function gets collected, you also need to collect its methods
21:52:56
whartung
that’s fine, but that doesn’t mean that the CLOS infrastruture should maintain hard references to them.
21:54:32
whartung
doesn’t this sort of work now since I assume the systems don’t leak memory when a generic function/method is redefined?
21:56:45
jasom
whartung: when a method is redefined, it still keeps the reference to the class around, so it's not really a parallel case
21:57:12
phoe
(defgeneric foo (bar)) (defmethod foo ((bar number)) 42) (defgeneric foo (baz)) (foo 1.0) ;=> 42
21:58:15
phoe
"if the new class given to setf is nil, the class association is removed (but the class object itself is not affected)"
21:58:19
Bike
actually destroying the object doesn't have a standard protocol any more than destroying any object does
21:59:31
pfdietz
method qualifiers should be weak references to their classes (or to objects, if EQL method qualifiers).
22:03:47
phoe
that's what (remove-duplicates (mapcar #'mop:method-qualifiers (mop:generic-function-methods #'print-object)) :test #'equal) tells me
22:07:32
phoe
and as long as they're unnamed, then we're already doing it in our garbage collection algorithms
22:08:33
phoe
we're talking about the cross-section of a CLOS implementation and a garbage collection algorithm
22:10:02
Bike
there's no need to manually destroy a class any more than there is to manually destroy any object.
22:11:06
|3b|
yeah, if you can find all the refs, removing a class, symbol, package works same as anything else
22:12:03
|3b|
just that for those, there are a lot, many of which are cyclic (but linked to other things so the whole cycle can't be collected), and some are hidden (like internal caches in GF dispatch or whatever)
22:12:24
phoe
and if you dare to have a reference to that class on a method on an anonymous generic function lingering in a closure inside some random instance somewhere inside a separate thread, then good luck finding that
22:13:01
|3b|
and that's before conservative GC, or some random half-dead loop variable somewhere up the stack happens to hit one
22:17:25
makomo
also, Jamie Zawinski who worked on early Netscape Navigator releases and thought of the name Mozilla, used to work for Lucid, Inc.
1:40:31
no-defun-allowed
we're doing a presentation on pidgins and creoles in eng lang so we have different places green screened
1:44:36
AeroNotix
I found an internal advertisement I was made to do ten years ago while I worked at HP on an old hard drive the other day. Other dimensions could feel the cringe.
3:00:40
Pixel_Outlaw
Is there a way to print a literal escape sequence? Thinking about toying with some ReGIS in xterm.
3:00:40
Colleen
Pixel_Outlaw: jackdaniel said at 2018.09.12 05:06:21: it seems that for some reason trivial-garbage's make-weak-hash-table doesn't remf this keyword argument before passing to make-hash-table in sbcl
3:00:40
Colleen
Pixel_Outlaw: jackdaniel said at 2018.09.12 05:06:53: what is weird, because I have newest trivial-garbage and all works just fine for me. do you have some hacked version in your local-projects?
5:37:28
gendl
I'm just going to bed (told my wife I would be there 2 hours ago but got stuck finishing a few things on our new web-based object browser)
5:40:49
gendl
can't rightly complain much, although I still do... been through some challenges lately,
5:41:46
gendl
you know about one of them. That looks like (knock wood) coming to a conclusion here real soon.
5:44:01
gendl
ALU has been in limbo, as far as I'm personally concerned, it's a bit far down on my list.
5:44:35
gendl
RS is technically still president and things are kind of in a holding pattern until he gets a new one
5:45:38
gendl
we have $5000 in matching funds and they're finally in the proper bank account and Stripe is hooked up to it
5:45:57
gendl
... so i just have to get the website spun up and re-skinned (the one from Quicklisp from almost two years ago)
5:47:50
beach
By the way, McCLIM development is very active these days, in case you are looking for a fundraising target in the future.
5:49:28
gendl
well, I think if we can demonstrate some modicum of organization, there are deep-pocketed donors out there who can help us out
5:50:21
gendl
i think it'll be great to have a balance between a good number of grass-roots donors of smaller amounts, and a few deep-pocketed well-wishers who can see that their larger donations are going to good use
5:52:12
beach
Seeing no-defun-allowed, I was reminded about the importance of coming to ELS so that one can recognize the people here.
5:53:01
gendl
I still have to make the XML file to index the ELS proceedings with ACM... I didn't see a hard deadline for that so I'm hoping they'll still accept.
5:53:52
beach
no-defun-allowed: I have told you this before, but I'll say it again. I think you should do what I recommended to froggey, namely put up a crowd funding site to pay your way to ELS 2019.
5:57:03
no-defun-allowed
anyways i do need to do school work for a while, i've got to hack up a video for tomorrow
5:57:55
no-defun-allowed
- make the parallel-mapvideo buffer guess the frame count that can fit in memory instead of a fixed frame count
6:00:27
no-defun-allowed
you're expected to have a medical certificate for days off, and anything below 90% attendance or some shit is failing too
6:01:23
Shinmera
talk to your department lead if you can get the week off to attend an important (!) conference that will further your studies (!)
6:07:36
beach
OK then, first check whether it is possible, hinting that you can get a letter from me.
6:11:54
beach
Go to the head of the school. Say something like "I have become involved in the Common Lisp community, and I have received an invitation to come to ELS 2019... Would there be a possibility for me to get that week off from school?"
6:12:28
beach
no-defun-allowed: It is a common mistake to believe that the talks are the important part of a conference like this.
6:12:49
beach
The important part is to chat with the participants between talk, at lunch, at diner, etc.
6:13:42
no-defun-allowed
is it going to cost anything if i manage to get a flight there? i've never been to europe or planned much myself
6:15:52
no-defun-allowed
the school does a lot of extracurricular stuff so maybe they'll let me go for the week
6:20:22
Shinmera
The story goes that it was initially supposed to be much more lisp-like before it got rushed out the door at netscape
6:28:11
jackdaniel
"In 1995, Netscape Communications recruited Brendan Eich with the goal of embedding the Scheme programming language into its Netscape Navigator."