freenode/lisp - IRC Chatlog
Search
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
20:49:34
alandipert
is it possible to specify which "version" of quicklisp to use when resolving packages? i understand that the set of packages available on quicklisp are versioned together, and that this set changes over time. i am interested in specifying former versions in code so i can know that the code will continue to work the same way even if packages it pull
21:06:52
pjb
They may be subclasses of standard-object. But since they are not in all implementations, you cannot depend on that.
21:07:04
jmercouris
Is there a way to make M-q indent with spaces only? Is there an advantage to doing so? (please note, I am not trying to start a tabs vs spaces flame war)
21:08:36
pjb
jmercouris: sure. Just configure emacs to use spaces instead of tabs. There are ton of howto pages on the subject.
21:09:03
jasom
KZiemian: the standard says that they are not guaranteed to be sublcass of standard-object
21:09:19
jmercouris
So, is there a disadvantage to indenting with spaces in emacs? or should I be okay with it?
21:09:34
jmercouris
I'm thinking about changing this from the defaults, and that makes me a little nervous
21:09:50
jasom
jmercouris: it's not the default, which means it's not the majority, but other than that it's fine. I prefer it...
21:11:18
pjb
For you as a CL programmer, ther eis no better way, you must consider that conditions are not standard-object.
21:11:46
pjb
If you're a CL implementer, I would say it is easier to just define conditions with defclass.
21:12:36
pjb
KZiemian: But as a CL implementer you may want to provide more speed, or consider other constraints when creating and processing conditions, which may motivate you to implement them differently.
21:14:45
Bicyclidine
i can't think of any constraints on conditions that would really be helpful to an implementer
21:16:59
Bicyclidine
in sbcl conditions are "slot-objects", which standard objects also are. that class provides most of the guts, like the initialize methods and shit
21:23:27
jasom
KZiemian: note that it is technically illegal to work from the CLHS, you should work from the TeX sources of the draft specification...
21:35:05
KZiemian
jmercouris: but after that my knowledge will be not suffiecent to make progres alone
21:36:28
jmercouris
KZiemian: Are you the project leader? Do you need someone to edit stuff? any ways I can tangibly contribute?
21:42:27
KZiemian
jmercouris: project leader is phoe, but in some strange twist of fate, I think that probing ccldoc was left to me as subproject
21:43:11
KZiemian
jmercouris: we and phoe will neet at monday 18 and after that I should now more about that
21:43:59
jmercouris
Ah, you are saying Monday the 18th, not at 18:00, got it! Sorry for the confusion
21:45:52
KZiemian
jmercouris: is to write ccldoc that generate one page that looks like that of CLHS
21:49:14
KZiemian
jmercouris: this is my part and don't know why we decided on ccldoc, not why we do next
21:51:40
KZiemian
jmercouris: this is one of my problems, I can see only part of project, but I try to make my part as good as I can
21:52:48
jmercouris
It's unfortunate that I don't speak polish, otherwise I would read what you've done :D
21:53:25
jmercouris
Looking at the HTML, it looks okay, there is indent a lot of work that could be done on it though
21:54:18
jmercouris
Mostly indentation and some spaces throughout, but the CSS will make it look fine, so it should be okay
21:55:03
KZiemian
jmercouris: I know that laguage is big problem, but until I understand ccldoc I will write in polish, because that is much faster to me and now I must note a lot
21:55:48
KZiemian
jmercouris: many of this things will became probably irrevelant when we understand what is going on
21:59:17
KZiemian
jmercouris: one problem of CLUS is that, that I take a break after ending last stage
22:05:37
KZiemian
jmercouris: thank you for questions, I will try not forget to tell phoe about them
22:06:08
KZiemian
jmercouris: I must go in next 5-10 minuts, so if you want ask about somthing now is the time
22:09:21
jmercouris
I think I'll wait to see what you guys talk about on Monday, for now I think we've covered all the bases, thanks!
22:14:17
jasom
any suggestions for improving numeric performance on ccl? I'm seeing it currently ~10x slower than sbcl right now
22:21:52
foom
jasom: I think if you tell it the exact types of inputs and outputs to every math call it will compile it efficiently. E.g. (the fixnum (+ (the fixnum a) (the fixnum b)))
22:38:27
alandipert
i see #'(lambda () ...) in CLHS example code, is there a reason for the #' with the inline lambda?
22:39:57
Shinmera
If I recall it used to be necessary. Now that it isn't, some people just prefer it that way.
22:45:44
pjb
alandipert: so either you're in code position and the macro will do the right thing, or you're in data position, and writing #'(lambda will introduce the (function (lambda …)) sexp which is not evaluated, so probably not what you want anyways.
22:46:33
pjb
alandipert: furthermore, lambda may be not cl:lambda (if it's shadowed). So writing #'(lambda … may expand to (CL:FUNCTION (NOT-CL:LAMBDA ...)) which is not conforming!
22:46:51
pjb
alandipert: while NOT-CL:LAMBDA may be a macro that do what it needs to do. Adding #' in front prevents it.
22:47:41
pjb
(now of course, if you take the pain to shadow lambda you should also shadow function, and override #' too for consistency…)