freenode/lisp - IRC Chatlog
Search
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…)
4:10:01
Ober
pillton: ok. that's what ive been doing. saw a shinmera video where he appeared to hit a swank server directly.
4:16:18
turkja
yeah i'd make swank to listen localhost only, then use SSH -L to redirect to that port
4:25:33
aeth
Rewrite it in Common Lisp. Most of the content won't be there, but that's a feature, not a bug.
5:33:37
asarch
I made this script to render the book from HTML pages into PDF with HTMLDOC: https://github.com/asarch/pcl/blob/master/doit.sh
6:01:20
beach
asarch: gigamonkey worked pretty hard to write that. I think he deserves his royalties. Perhaps you should send him some money.
6:01:24
asarch
Besides, I'm saving for "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp", "The Elements of Artificial Intelligence" and "Introduction to Artificial Intelligence"
6:07:02
beach
I am the first to admit that publishing companies are unethical in the way they treat their authors, and in the way they make money. That is why I use self publishing when I write books.
6:08:30
asarch
I thought I could get the hard copy of the book the same way you can get books from the Free Software Foundation
6:15:46
beach
Well, I haven't checked whether what you did is legal; perhaps it is. I just think that the author deserves to be compensated for his work. The FSF does not have as a goal to make money from their publications (though they would be happy for you to order a hard copy, or course). But I pretty sure that gigamonkey did not write that book just to be a nice guy and in order to spread the word about Common Lisp.
6:15:56
asarch
If you need to change some parameters of the book, like the paper size, download the source code and compiles it
6:18:57
beach
But thanks for the information. I am now convinced that I absolutely should not make HTML versions of my books available online.
6:29:09
asarch
Even Wikipedia had a great conversion tool to get the PDF version of each article those days
6:41:29
jackdaniel
asarch: there is a huge gap between "fair share" and "free books", I think that you mistake these two terms
6:43:03
jackdaniel
I'm pretty sure RMS doesn't promote idea of free labor in contrast to fair share and the consumer rights to have control over what he bought / use
6:46:28
jackdaniel
and generally, fsf encourages to buy the manuals from them, but doesn't close the door for people, who are not interested in spending money for other people effort (wikipedia, on the other hand, encourages donations, which for some reason outrage some people)
7:01:26
beach
My solution to expensive books is to self publish and to set a reasonable price on the book. That way, more people can afford it, and I get paid significantly more per copy sold than if I had used a publishing company.