freenode/#lisp - IRC Chatlog
Search
9:00:19
jdz
This particular problem might be because of my changes to cl-log: https://github.com/jdz/cl-log
9:01:40
no-defun-allowed
jdz: i used (safety 0) to do a very fast weighted "blend" between two arrays i've already checked the bounds of
9:14:22
Demosthenex
dim: remove duplicates would have to operate on the complete pair, not just the car. but thats ok, i was blind to the change i made to teh function name
9:17:53
jdz
dim: I now think it's nothing to do with lparallel, but it was tricky to find the place where it is triggered because lparallel transfers errors across threads.
9:18:46
dim
yeah debugging is sometimes not as easy as it should, when running from the REPL pgloader should show you the base error though, I think
9:21:07
no-defun-allowed
this macro i wrote made me think about useless parallelisation, how do i stop it from doing that?
9:25:31
jdz
dim: OK, the problem was that in my version of cl-log the timestamp fraction is already in nsecs, and your print-object method assumes it is in internal-time-units-per-second.
10:00:50
_death
jackdaniel: heh... I've an idea to write a bbs-on-the-web thingy.. though that may take a while
10:02:46
jackdaniel
that would be cool to be able to share (say) lisp function via internet protocol and simply run it directly from clim gopher browser :)
10:09:25
jackdaniel
I think knusbaum will be able to answer such question, as asserted above I didn't dive there yet :)
10:40:32
_death
I mostly use it as a private server to do all kinds of scraping and such so there's not much content ;) .. once I'll get my bbs thing going it'll be more interesting
10:48:05
_death
looking at it though the "ansi art" is pretty terrible.. result of spending around 20m in aciddraw (I also have a project for an aciddraw clone..) after years of nonpractice.. I should replace it with older art :)
10:57:37
dim
shrdlu68: ok, so the bug isn't fixed in current HEAD/master versions of ironclad/nibbles, and depends on latest SBCL on linux?
11:00:05
russellw
is there a way to make case work with strings? Or is it just accepted that with strings, you have to fall back on cond... equal?
11:38:22
Demosthenex
i saw jackdaniel's post on cl-charms, and he used some rudimentary async keyboard io there which he said was poor. what's a better alternative?
11:40:42
jackdaniel
I have an intent (temporarily suspended due to other tasks) to make a terminal backend for McCLIM
11:41:26
jackdaniel
in such case io will be handled by McCLIM itself. that's what I meant by saying, that functions in this tutorial are ad-hoc (as a pun loosely based on greenspun 10th rule)
11:42:28
Demosthenex
i have no idea how CL would do async inputs, that's got to be a good example code
11:42:28
jackdaniel
sadly important improvements are usually mundane and unimpressive (but they enable impressive demos after they are done)
11:42:50
Demosthenex
i'm sure we've discussed before i'm just looking to make terminal CRUD interfaces for small databases
11:43:04
jackdaniel
well, event loop in McCLIM has some limitations (which we have plans to mitigate)
11:44:46
jackdaniel
(and the mentioned demo, as some people pointed out, is based on ffi and some people have ffi-o-phobia)
11:49:28
Demosthenex
though i'd expect using the upper level api to cl-charms, only a handful of basic terminal handling operations are needed if mcclim is going to manage all the other logic
11:50:29
jackdaniel
if such backend is written some day (I certainly hope so, because that will reveal many weird bugs, I'm sure about that), you wouldn't have to care about terminal at all
11:51:28
jackdaniel
you'll be able to run mcclim application in a terminal (of course terminal limitations will be still in place)
11:51:50
Demosthenex
i'm a complete noob, but if there were a way i could contribute, i'd be happy to
11:51:54
jackdaniel
I even have a screenshot somewhere, where I managed to start "Hello world" application side-by-side in a window and in a terminal
11:52:33
jackdaniel
there are many ways to contribute. first step is learning clim basics ;) there is #clim channel if you are intersted in socializing
11:52:34
Demosthenex
i'm a jaded old fart. i despise webapps, i strongly dislike gui apps, i live on the command line and in emacs. if i'm going to make a small db for personal use, it'll be there.
11:54:10
Demosthenex
i just despair regarding reinventing the wheel. i feel like a whole generation of code has been lost regarding TUIs
11:58:59
jdz
dim: BTW, this is how I set up cl-log without "monkey patching" PRINT-OBJECT for cl-log:timestamp.
12:28:11
no-defun-allowed
I'm alright with guis but there should be a good keyboard alternative after I've memorised enough of my workflow.
12:28:37
no-defun-allowed
GTK/Emacs is the first example that comes to mind since you can navigate by menus but you'll pick up keyboard chords relatively quickly.
12:38:56
Xach
PuercoPop: I am much more likely to drop asdf from quicklisp. Implementations should provide the asdf that best suits their users.
13:58:25
oni-on-ion
no-defun-allowed: i've been using no mouse for about a month. my secret is 'keynav' for the gui apps
14:03:03
jackdaniel
otoh SBCL is boostrappable from any conforming implementation, so one could build clisp with gcc, and then sbcl with clisp
14:04:02
jackdaniel
well, it is said, that everything must be possible to build from source, but they look at building ccl with ccl that way afaik
14:04:17
pfdietz
At some point in the distant past some proto-CCL must have been built from something else, but that's probably long dead.
14:15:03
oni-on-ion
makomo: got quite good with it. took me a couple days of having fun because i never learned hjkl movement. it does directionals too, and shift+(key)
14:15:33
oni-on-ion
makomo: i am happy to find that most UI elements are in that pattern of "subdivision", which is also quite interesting philosophically =)
14:16:47
makomo
oni-on-ion: hmm very nice. i wonder how efficient one could get it. at first it seems "horrible", but i suppose i would think differently after a few days of using it/practicing
14:18:33
oni-on-ion
the fingers learn which directions for which button quite quickly. ie. dark mode toggle on firefox is 3 keys to hit, or the youtube search bar is 2 key.
15:26:10
Demosthenex
no-defun-allowed: so i prefer my tiling wm with terminals pre-allocated. guis and i don't get along. yes, good hotkeys and keyboard support in a gui make it better, but if i'm writing something it'll be text only. and firefox sucks now that they've forced end user windoze hotkeys on everyone forever.
15:28:37
Demosthenex
btw, i am very impressed reading this introduction to concurrency. https://z0ltan.wordpress.com/2016/09/02/basic-concurrency-and-parallelism-in-common-lisp-part-3-concurrency-using-bordeaux-and-sbcl-threads/
15:32:20
Demosthenex
bet i could use that for async input for keyboards and a shared locked queue of input events
15:52:19
phoe
I'm designing a server for a text-based game, and I noticed that I base literally everything around queues and message-passing in there.
15:53:25
phoe
And threads that block until a message is received, at which point they parse the message, do their job, and block again, waiting for a queue to get a message again.
15:58:07
oni-on-ion
been using exwm+emacs+keynav for some time, no mouse, firefox only when necessary
16:38:38
Demosthenex
oni-on-ion: firefox used to have firemacs, which let me have real emacs bindings... now its all windoze crap. i'm so mad
16:38:57
Demosthenex
phoe: do you have an example? that's an architecture i'd love to learn more about
16:44:36
oni-on-ion
Demosthenex: it and chrome has extensions for using emacs to edit text in text fields, used one for a bit it was quite nice. brings up an emacsclient but thats isnt much. i am looking forward to the "next" browser.
16:46:35
jackdaniel
phoe: assuming erlang was public around 1986 it can't be true, because commonloops (direct predecessor of clos) was proposed the same year
17:02:23
phoe
in there, connection is a data structure that doesn't act on its own. Acceptor has a thread that's waiting on connections to its listening socket, listener has a thread that's waiting on input on the connection sockets, writer has a thread that's waiting on jobs inside its internal lparallel queue.
17:14:53
phoe
There is a function VECTOR-PUSH that adds an element to its end. Is there a function like VECTOR-REMOVE that accepts a vector and an index, removes the element from that position, copies the last element to that position, and decreases the fill pointer?
17:19:57
jackdaniel
vector-push adds at the vector end, so its counterpart is vector-pop (which removes from the end)
17:33:07
Colleen
phoe: Unknown command. Possible matches: 8, set, say, mop, get, about self, logout, grant, block, award,
17:33:19
Colleen
phoe: Function array-utils:vector-pop-position https://shinmera.github.io/array-utils#FUNCTION%20ARRAY-UTILS%3AVECTOR-POP-POSITION
17:36:34
phoe
Shinmera: your function preserves order of elements and is therefore O(n). I don't need to preserve order and therefore it can be O(1).
17:37:53
pjb
(defun vecto-remove (v zombie) (rotatef (aref v zombie) (aref v (1- (length v)))) (vector-pop v))
17:38:13
phoe
rotatef will put the element I seek into the vector's tail, and vector-pop will fetch it for me and decrease the fill pointer.
17:39:10
pjb
(Let ((v (make-array 6 :initial-contents '(a b c d e f) :fill-pointer t))) (values (vecto-remove v 2) v)) #| --> c ; #(a b f d e) |#
17:40:12
pjb
Perhaps it'd be better to use (defun vecto-remove (v zombie) (decf (fill-pointer v)) (shiftf (aref v zombie) (aref v (length v))))
17:42:34
pjb
Bah! In a library, you'll want to add check-type for the arguments, and check that the fill-pointer is >0, etc.
17:44:04
pjb
or an error: &key (no-fill-pointer :error) (check-type no-fill-pointer (member :error :copy nil))
17:53:52
pjb
(defun vector-remove (v i) (prog1 (aref v i) (vector-delete nil v :start i :end (1+ i) :test (constantly t))))
17:55:46
pjb
The thing here, is that in a given program, you can have a lot of nuances and conditions that makes it simplier to write the exact function you need, rather than use a library function, even (or exactly because!) if it's very versatile with lot of different &key options..
17:58:37
flip214
does anyone have the link to csrhodes' PDF from June where he reports about the final results of 'Using Lisp-based pseudocode to probe student understanding' for his class?
18:04:31
phoe
Shinmera: https://github.com/phoe-trash/array-utils/commit/6309033661a7f9fc9f3b540bb08187b52ddde68d
18:09:44
flip214
minion: memo for Xof: please send me the link with the full results (whole year) of your 'Using Lisp-based pseudocode to probe student understanding' Moodle experiments; ISTR that you posted that in June or so. I'd like to forward that. Thanks a lot!
18:34:58
phoe
dlowe: https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/International_Pok%C3%A9mon_logo.svg/2000px-International_Pok%C3%A9mon_logo.svg.png
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.