freenode/#lisp - IRC Chatlog
Search
8:32:10
aeth
jackdaniel: apply could be used in serialization because you can apply a plist, which would make it very convenient for serialization
8:35:36
aeth
very useful.. (apply #'make-array 42 '(:element-type 'single-float :initial-element 42f0))
8:35:40
jackdaniel
it might be that after nuclear disaster, 2000 years from now, people will try to recreate machines capable of running program of our age
8:36:31
aeth
jackdaniel: Someone should make a revised CLHS and only bump up the minimums for things. Or, actually, define separate 32-bit and 64-bit minimums. Iirc, a fixnum is only 16 bit as a minimum, which is tiny.
8:40:09
Ober
what is the proper way to replace if seen progn with cond? (cond ((seen ... in this case sees it as a function
8:46:17
jackdaniel
each clause cond is (test forms*), where test is arbitrary expression returning value
8:47:42
Ober
ok so under cond a single or double open paren before it should not confuse it. ok. must be error. lisp-critic cleanup
9:07:01
jasom
You can have 31 bit fixnums on a 32 bit machine; if you require all allocations be 8-bit aligned, that still gives you two tag bits for non-fixnums
13:35:19
myrkraverk
Is my assumption correct, that :below (foo) is only eval'd once? In (:loop :for bar :from 0 :below (foo) ... )
13:38:07
myrkraverk
I tried "simplifying" my code, and got rid of a variable from (sb-posix:read ...)
13:38:40
myrkraverk
And while I'm doing SBCL specfic stuff, I try not to let my guesses and tests rule the world.
13:39:24
specbot
The for-as-arithmetic subclause: http://www.lispworks.com/reference/HyperSpec/Body/06_abaa.htm
13:46:47
myrkraverk
(loop :for i :below (sb-posix:read fd (sb-sys:vector-sap buffer) (length buffer)) ... )
13:50:21
myrkraverk
Later, I have :with v := 10 ... and then :finally (return v) ; do I need the (return v) or is there another way to specify the return value of LOOP?
13:51:40
mfiano
certain clauses imply a return value, such as the last `collect`. You can either do it as you are now, or wrap it in a let variable.
13:54:57
beach
myrkraverk: No need to force it if it doesn't fit your needs. I was just answering your question.
15:30:36
warweasle
Can someone point me to a simple cl-autowrap project? Where they create the json files and then use them in their package.
15:36:57
jmercouris
I'm trying to figure out the regex to get "a string of stops salmon", and I want to find given input "st", the position of "stops" and "string"
15:40:04
jmercouris
I also tried \st\b but the syntax is confusing me, I got so used to emacs regex, and it keeps changing for every language
15:41:26
Bicyclidine
it kind of goes badly with the string syntax. for ppcre to see a backslash b, the lisp string would be "\\b"
15:43:13
loke`
jmercouris: I'm not sure I understand what you want... Do you want to match any word beginning with "st"?
15:45:34
warweasle
In cl-autowrap, Am I supposed to export it's functions directly or are they just thin wrappers around the library?
15:47:05
rumbler31
^ talks about adding emacs settings that make some of the pain go away, and explain what's going on
15:50:27
jdz
jmercouris: you can also do (ppcre:parse-string "\\W(st\w+)") to see if it does what you expect.
15:52:13
jdz
Back in the day Edi had the regexp-coach (that used cl-ppcre) GUI application. Not sure it is still ovailable.
15:54:16
jdz
Back in the day I don't remember any websites doing it, probably because JavaScript was not cross-browser.
16:49:04
Xach
mfiano: http://report.quicklisp.org/2017-12-12/failure-report/gamebox-grids.html#gamebox-grids has a log
16:52:20
mfiano
Indeed, I should remember that I have old libraries in Quicklisp that even I don't use anymore, but I should still maintain them!
16:53:46
jackdaniel
Xach: is it easy for you to test if changes doesn't break something before merging them to main branch?
16:54:11
jackdaniel
which comes from develop branch and it enables bunch of extensions which I hopefully fixed (at least from the compilation perspective)
16:54:58
jackdaniel
I would appreciate it a lot, because I remember that last time I've touched these parts I've caused a regression
16:56:38
jackdaniel
sure, I've added Display tests (activated with asdf:test-system). but for "visual" stuff you want clx/demo system – note that many demos there didn't work before PR
16:57:26
jackdaniel
and it worked fine (even better for CCL, because previously it didn't work with CLX when loaded from outside software/)
18:34:00
emaczen
how do I enforce a form to be accessible by only one thread at a time in terms of bordeaux threads?
18:38:30
emaczen
shka: I think, I'm not that familiar with concurrency in general, but I understand the concept
18:40:43
emaczen
Why do I have to create a lock here? Can't bt determine that entry into the form is what needs to be controlled?
18:51:55
shka
emaczen: you don't want to control evaluation of forms, you want to control memory access
18:54:48
emaczen
where exactly do you place your locks? I have a form which calls a function #'add-row which mutates a table, which is what I need to lock.
18:59:30
lisp_guest
the fundamental problem you want to avoid is basically 2 or more threads partying on the same memory at the same time
19:00:42
emaczen
how do I control a loop variable? (loop for var in vars do (bt:make-thread (lambda () ...)))
19:00:47
shka
emaczen: also, it is sometimes possible to avoid placing locks by using other guarantees of exclusive memory write
19:04:46
lisp_guest
hm, how does multithreading in lisp even work? i would expect every thread to have its own lexical bindings
19:05:18
jasom
lisp_guest: this is a de-facto standard (I think all implementations that implement threads do it), not part of the spec
19:08:09
jasom
If you are going to use threads, I highly recommend something like lparallel; if you type the word "mutex" enough times, you are going to have bugs.
19:10:38
jasom
that's because "bound" is used to mean "has a value" which is slightly different from "establishes a binding" because english doesn't have enough words...
19:10:50
shka
well, using mutex is that difficult on it's own, but there is much more required to implement efficient parallel program so if you are not using lparallel, you are wasting time
19:12:34
jasom
manually managing acesses to mutable shared state is futile in any non-trivial program.
19:13:42
jasom
I love lparallel because I can write my program sequentially, profile, and sprinkle in some parallel fairy-dust with almost zero effort
19:13:54
lisp_guest
jasom: oh, i'm not sure why i was confused. so DEFVAR/DEFPARAMETER act as if calling setf when setting the value, right?
19:14:26
shka
at this point i think that not using lparallel for parallel programming is a waste of time :P
19:14:26
jackdaniel
lisp_guest: try typing one after another (defvar *foo* 3) (defvar *foo* 4) *foo*
19:15:14
jasom
lisp_guest: SETF on a special modifies the outtermost dynamic binding of it. If that binding was established in the current thread, it is invisible to all outer threads
19:17:03
jasom
contrast with: (let ((*foo* 1)) (bt:make-thread (lambda () (let ((*foo* 2)) (sleep 10))) (sleep 3) *foo*)
19:17:11
lisp_guest
right. so if you don't rebind them, then *var* means the same thing in #1 and #2?
19:17:22
lisp_guest
i thought there was some invisible namespacing because of the way you put it at first
19:18:04
jasom
and most threading libraries (including lparallel) let you setup variables that will get bound implicity on task creation, thus making them thread local. I use this e.g. for giving each thread a database connection.
19:23:14
jasom
so you can also use lexical bindings to communicate beween threads. But really, use a queue or a mailbox or something higher level than a shared variable for signalling.
19:24:05
jasom
shka: I'm well aware. I use queues of promises to ensure that I can collect the work of decompressing chunks of data in order to the output stream
19:24:36
lisp_guest
jasom: when you said "does what you would expect", you were thinking of that it creates a closure and that every thread will have x bound to the same object, right?
19:25:00
jasom
lisp_guest: correct. The only thing that matters for lexical bindings is where it is in the source code.
19:27:24
lisp_guest
does anyone know why i'm getting this error when trying to use SSL with Drakma (GET-ing an https url)
19:30:15
jasom
lisp_guest: you can also check if there have been any updates to drakma since the version you have installed
19:30:55
lisp_guest
hm i guess. i'm only getting into doing HTTP with CL and have seen that drakma is what most poeple use
19:32:59
jasom
My http on CL is all server-side, I don't know that I've ever made an HTTP request from CL.
19:35:23
lisp_guest
i've found this and the guy has the exact same problem https://ccl.clozure.com/irc-logs/lisp/2017-05/lisp-2017.05.06.txt :-)
19:38:35
jasom
lisp_guest: I usually just M-. and then see the name of the directory (ql puts the version string in the pathname of the source)
19:44:54
jasom
well I would just check which openssl packages are available and ensure they are installed...
19:49:48
lisp_guest
i have version OpenSSL 1.1.0 installed though. not sure why i would have to downgrade when the CL+SSL package i have seems to use OpenSSL 1.1.0
19:52:18
lisp_guest
hah wow, changing my libssl.so symlink to version 1.0 instead (which i also have installed) fixes it
20:05:01
jasom
If you edit the library search path to load a more version-qualified openssl, it should work and you can undo the link change. Submit a patch upstream as well, reporting which distro you are using.
20:11:17
lisp_guest
jasom: i'm very new to lisp (and especially system/package management). where exactly is this library search path?
20:11:58
jasom
https://common-lisp.net/project/cffi/manual/html_node/define_002dforeign_002dlibrary.html
20:12:23
lisp_guest
ok. i just opened up ffi-1.1.0.lisp from cl+ssl btw, they only define 2 new functions which were added
20:12:54
lisp_guest
which makes sense i guess, the real issue is in loading version 1.1.0 when 1.0 is expected by drakma
20:16:39
jasom
my guess is that early versions of 1.1 deprecated, but did not remove the function, so it "worked on the developers machine at the time"
20:17:55
lisp_guest
looks like my version is "1.0.2m", while the closest one in cl+ssl is "1.0.2", i.e. without the "m"
20:18:32
lisp_guest
jasom: does doing (ql:quickload '#:cl+ssl) reload the system if i changed the file?
20:19:57
jasom
lisp_guest: I don't know; (asdf:load-system "cl+ssl") definitely wil reload the system, but it may or may not force reloading of the library depending on how cl+ssl defined its dependencies