freenode/#lisp - IRC Chatlog
Search
8:27:22
phoe
I need to get in touch with the administrator of http://clozure.com ASAP. The site was attacked and is serving phishing pages.
8:28:20
White_Flame
were they running Drupal? that was fresh in the media on how it's being newly hacked
8:30:29
Shinmera
In happier news, here's this year's ELS group photo https://www.dropbox.com/sh/1ho9ud3ibfw0yxm/AAArAu8tes0tO-MdsDPII5pTa?dl=0&preview=20180417-160221-L1008873.jpg
9:18:04
shrdlu68
My colleagues get sponsored to cons by the company, maybe I'll do the same, but there's precisely 0 lisp code right now.
9:45:16
Xach
beach: aside from being tall, bald, slim white men who wore black clothes, that is true.
9:46:17
Xach
kevin layer and christian schafmeister, who are side-by-side in the group photo to my right
9:49:00
beach
Also, I would need a computer that makes that "diddly-diddly-did" sound when the resolution is increased.
10:25:45
puchacz
I may revert to previous version of the code that was not processing output and had :wait t
10:29:53
phoe
use UNWIND-PROTECT if your file access is only happening in dynamic and/or lexical scope to make sure you clean up after yourself
10:32:46
puchacz
phoe: http://www.sbcl.org/manual/ says run-program has one output stream, not 2. I guess stdout and stderr are somehow conflated then.
10:35:24
shka
still, you can use in-memory stream, and just copy content of it into file in one place
10:40:52
puchacz
it won't work if run-program fails before returning process object with stream in it, I think I don't need to worry
10:41:05
shka
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwjL6-rZmtDaAhUFQMAKHSrjBBkQFggvMAE&url=http%3A%2F%2Fclhs.lisp.se%2FBody%2Fm_w_open.htm&usg=AOvVaw003Nq0T6e2LtiA4Ni2z9pe for reference
10:41:59
phoe
I think the same thing - he is not opening a file, he's running a program and getting a stream
10:42:23
hajovonta
puchacz: I had this problem recently, and I ended up with (close stream) and (setf stream nil) and this would let the GC collect them
10:43:24
puchacz
hajovonta: what's more, I want similar mechanism to work on lispworks..... IF there is something fishy about reading program output as it grows, I might just drop this functionality
10:47:59
phoe
the only SB-internal functions it uses are run-process (UIOP), streams from the process (UIOP), threads (BT)
10:48:15
Colleen
About simple-inferiors https://shinmera.github.io/simple-inferiors#about_simple-inferiors
10:48:44
hajovonta
but as I stated in the readme, it runs everything through "unbuffer". I tried other approaches but this was the only one that would actually work in practice
10:48:53
Shinmera
if I remember correctly uiop's capabilities with regards to attaching arbitrary streams to i/o is limited
10:48:54
puchacz
hajavonta: without setting process slot containing stream to nil, did you have memory leak?
11:40:22
phoe
UIOP/RUN-PROGRAM:RUN-PROGRAM: :STREAM is not allowed as synchronous I/O redirection argument
11:46:24
schweers
phoe: how (when) do you expect to read from or write to a stream, when your program is synchronously waiting for the forked process to finish?
11:56:55
phoe
hajovonta: https://github.com/phoe-trash/cl-expect I have no means to test this now, could you take a look?
12:10:11
Xach
phoe: i would expect any expect-like library to use ptys, but i don't see it when glancing at the code.
12:12:10
phoe
Xach: neither do I, but all I did was try to translate from SBCL-specific calls to portability libraries.
12:14:54
puchacz
hi again, when running slime in *inferior-lisp* buffer, ie not remotely, can I have 2 or 3 REPLs in different threads pls?
13:20:51
phoe
puchacz: I don't know a way to do this from inside emacs with slime being run the default way.
13:34:49
phoe
puchacz: on the other hand, I do multi-repl so rarely that I never thought of doing anything about it.
13:48:21
billstclair
clozure.com’s DNS server has been restored. May take a while to propagate, but not long.
13:57:29
Xach
Hmmmm! I am experimenting with read-only source directories for quicklisp builds. One of the first obvious failures is cl-unicode, which wants to write generated files into its source directory to proceed with building.
13:58:51
Xach
I wonder what could be done to be compatible with a read-only source directory. Putting it in the fasl directory doesn't feel quite right - it's not machine- or implementation-dependent.
13:59:59
Xach
The general idea is that some .lisp files are created by interpreting unicode data files. the lisp files are used as part of the rest of the build.
14:01:15
Xach
The data files ship with the repo. I wonder if the generated lisp files could be made part of a release.
14:01:41
Xach
I wonder if there will be too many other problems to bother with read-only source directories.
14:02:09
phoe
Would probably be much cleaner to generate them freshly on each compilation, and that's what is going on now.
14:03:38
Xach
How is it "clean" to dirty up a directory with generated files? It is completely impure and unhygienic too.
14:04:56
jackdaniel
Xach: McCLIM repository address has changed to https://github.com/mcclim/mcclim (the old one has a redirection thanks transfer ownership github system, so nothing should break)
14:06:43
phoe
Xach: I kind of wish it actually generated the Lisp files in some temporary locations, then compiled these temporary files, then included the resulting FASLs in the compilation output.
14:12:22
phoe
Since ASDF has access to UIOP, it can use its WITH-TEMPORARY-FILE macro as a part of the system's build.
14:41:16
beach
There are combinations of values of OPTIMIZE qualities for which SBCL does not do tail-call merging, yes, but I don't know the exact combinations.
14:42:48
sjl
http://www.sbcl.org/manual/#Debugger-Policy-Control doesn't say anything about speed 0 specifically, just at debug > 2
14:45:03
sjl
I get the feeling the manual doesn't tell the full story about the various optimize combinations though
14:45:27
sjl
e.g. http://www.sbcl.org/manual/#Declarations-as-Assertions says that you get full type checks at (or (>= safety 2) (>= safety speed 1))
14:45:53
sjl
so if safety and speed are both 1, you get full checking, but if you reduce speed to 0, you wouldn't get full checking any more
15:38:13
ecraven
how does swank intercept a condition in one thread and handle it in the other thread, that communicates with SLIME? doesn't sldb run in the context of the thread where the condition was raised?
15:49:48
phoe
and I think the original thread blocks until SLDB returns control to the offended thread, at which point the selected restart takes effect in that thread
16:12:32
phoe
light2yellow: setq is a special operator so implementations do not have to write macroexpansions for it but can rather implement it as a primitive
16:20:52
beach
light2yellow: The distinction between macros and special operators is a bit blurred, so don't think too hard about it.
16:22:07
phoe
so (SETQ FOO BAR) could theoretically expand into (INTERNAL::%SOME-SORTA-PRIVATE-SETQ 'FOO BAR :ANSWER 42) or some other crazy internal stuff
16:25:38
Bike
it makes some sense to have "%setq" be a special operator that only mutates one, lexical binding, and then have setq expand into a few of those, or setfs, or sets
17:54:14
Xach
phoe: for what it's worth, I am going to tinker with aufs to get read-only sources but with local read-write.
17:55:06
jeosol
how do you guys package CL code for easy deployment on a remote machine (AWS). I'll like to pack resources (e.g., .sbclrc, code directories, data directories) to remote machine.
17:56:22
jeosol
by package above, I didn't mean CL packages, but more like how to gather dependencies up
17:56:46
Xach
phoe: my bigger goal is to be able to run multiple parallel test builds from a single shared set of project sources.
17:57:30
jackdaniel
jeosol: ql:bundle-systems for source code, clon for the binary build, proper systemd definitions for start. if you want to recreate your home directory on aws, why not tar it?
17:57:38
jeosol
So other project requirements like data directory (large files) are copied separately
17:58:36
jeosol
i recently copied my setup to another linux box close to me, it was a pain. I need to copy the package simlinks, data directories, repo, etc.
18:03:19
fourier
I just copy lisp implementation config files and my lisp sources directory. Then download quicklisp.lisp, load it and install; then just do ql:quickload for my local packages and everything is downloaded and installed
18:04:32
fourier
did it couple of times recently, no problems at all (the only problem is that I always forget to do ql:quickload "prove-asdf" before ql'ing my packages which use prove
18:08:16
jeosol
For my case, all my code is in one giant repo. Moving is not much of an issue. I have other dependencies, e.g., data directories (contain data for the application and could be large), some others e.g., wine to run a windows exe on linux, ...
18:11:25
fourier
jeosol: my code is from multiple github and not only repos and in something like "Sources/lisp" directory, so I just archive the whole directory together and move to the next PC. same I do with the ".emacs.d" folder
18:14:54
jeosol
fourier: Thanks. I do use external libraries, it's just that the project I am working on, I trying to keep everything else (apart from application data) in the same repo.
18:16:38
jeosol
I need to look into this asp, to package code to remote machine -- had another power issue a while ago and had to restart my runs.
18:19:32
jeosol
anyone running math/computational problems with random numbers where they save state and restart?
18:21:55
jeosol
apologies for my use of "save state" and "restart". These are not in the usual CL context. By "save state" I mean save information about the random number generator and by "restart" I mean restart the run again but now using the info from the random number generator
18:22:46
phoe
if you are using the Lisp RNG, then simply save *RANDOM-STATE* somehow, perhaps to a file
18:24:28
rme
You can always print *random-state* to a file and read it back in. The format of *random-state* is implementation-dependent, but you can always print and read it.
18:24:39
_death
in sbcl's case, even if it didn't provide a way, you'd still be able to reconstruct the state ("clone" it) since it's not a cryptographic rng
18:26:06
rme
I am pretty sure that the spec requires that you be able to print and read *random-state*.
18:26:38
jeosol
rme: I am able to initialize it and read back in. Let me quickly check that part of the code again
18:30:41
_death
on my flight home I actually ported my old Go code to clone the state.. https://gist.github.com/death/ba34a87cd43fc041215f36c735e0fe13
18:30:49
jeosol
when I start, I call make-random-state, save that info somewhere. If I need to continue to run, I read back that info
18:31:10
rme
For instance, in ccl, the default random-state object is #.(INITIALIZE-MRG31K3P-STATE 314159 42 1776 271828 6021023 1066)
18:32:54
rme
jeosol: the random state object gets modified every time you call random. the point of saving and restoring it is so that you can run your computation multiple times using the same sequence of (pseudo-) random values.
18:34:43
jeosol
they way my application works is this (simplified). I get a random number, do some calculations. Let's call this one iteration. I repeat this again for more iterations
18:35:19
jeosol
somewhere along the line (I may have power failure like today), I want to be able to pick up from where I stop, or sometimes just continue if I don't have convergence.
18:35:51
jeosol
So the reason is to continue the search trend I had before the disruption or just continue in the case of extension
18:36:57
jeosol
extending the run works fine, but with power failure, some required files for rerun where not written. I am currently working on this part ...
18:44:04
rme
Beware that *random-state* might be thread-local (it is on ccl). I have no idea if that applies to your situation.
18:46:44
phoe
welp, multiple threads might be modifying the random state at the same time, too. that might be dangerous.
18:48:09
jeosol
I run multiple threads for evaluation but I the generation of solutions is non-threaded
18:51:51
jeosol
I am sure this has been said enough. This place is like a hive of connected brains. Problems getting resolved quickly and also, you are getting multiple ideas and gotchas. What's there not to love
18:52:22
jeosol
I am singing to the choir, but with suggestions here over last few weeks, my code is more stable
18:54:26
fourier
jeosol: why dont you just precompute a series of number and run on it until you get some stable results?
18:57:04
jeosol
I am running an optimization problem with > 1000 variables per solution and like 30 solutions per iteration.
19:00:55
jeosol
So I just live with that approach for now. As per stability, for small problems (not expensive computationally), I perform multiple runs and average the results.
19:01:21
jeosol
with SBCL, the code is pretty fast the bottleneck is elsewhere. My current pain is instrumenting code for re-runs
19:11:20
ecraven
is there a way to print a custom "banner" in SLIME from the swank? it just says '; SLIME 2.20', but nothing about the actually connected lisp (only in the buffer name, but I'd love to see the actual lisp somewhere up there on connecting)
19:16:58
sea
Is there a way to tell lisp that a particular function always returns the same value, and can be compiled away?
19:17:15
ecraven
phoe: yea, but I'd love to see it somewhere up top too. I guess I'll have to add some :write-string somewhere to just show it that way
19:18:02
sea
(defun bar (x) (+ x (foo))). How can I make it evaluate that foo once, and store 42 in bar instead?
19:22:08
sea
I have a macro that compiles code to lisp, and I have a function I'm defining with one of those macros in it. I realized that every time I run the function, it re-compiles the code in it for no reason, and I wanted to avoid that
19:28:56
ealfonso
how can I avoid an undefined variable warning when using (cffi:defcvar ("my_var" my-var) :int) and then referring to my-var?
19:32:57
ealfonso
Bike https://pastebin.com/H8SEkxL4 I'm simply referring to the defcvar variable with setf
19:33:48
Bike
ealfonso: i believe defcvar is intended to be used at top level. the compiler won't be aware of the definition while compiling init-lib.
19:35:24
Bike
since defcvar just establishes a symbol macro it's largely pointless to do it at runtime, anyway
19:39:27
pierpa
sea: maybe you can do the computation at read time? (defun foo (x) #.(compute-something x))
19:40:16
sea
That's just the example code. I wanted something slow to take up time, so I could figure out if the macro was being run at compile-time or run-time
19:41:00
Bike
if you just evaluate it it could go either way, but in most implementations now it'll still be expanded just the once.
19:46:17
sea
Hrm, it's still slightly slower than it should be. I took the macro bit out altogether and put it as a global variable it can reference