freenode/#lisp - IRC Chatlog
Search
13:23:08
_death
knobo: you could use REPLACE and decrementing the fill-pointer (or ADJUST-ARRAY) to remove an element
13:23:30
tonton
Hi! I've noticed slime is slow when calling an external command using sbcl with thread support (cf http://paste.lisp.org/display/349650)
13:23:53
_death
varjag: you can always write OCTET-VECTOR-P and (typecase ... ((satisfies octet-vector-p) ...) ...)
13:25:07
tonton
seems to be an issue linked to slime, wondered if you already noticed this (I plan to investigate further)
13:26:15
tonton
Bike: without thread support, no difference, a soon as sbcl is compiled with thread support, 1 second of difference
13:28:11
_death
(time (uiop:run-program "/bin/hostname")) Evaluation took: 0.026 seconds of real time
13:30:23
tonton
_death: thanks for your feedback. I'm using slime 2.19 + sbcl 1.3.18 under freebsd, can you tell me under which os you get those timings please?
13:31:54
tonton
_death: Good, I'll make some tests under linux too then. I'll let you know if I find something.
13:32:28
Bike
if you do find a persistent problem, you'll probably have to reduce the case. use whatever sbcl function uiop calls for run-program, at least
13:34:07
tonton
Bike: same performance issues with sb-ext:run-program by the way. Might be related to feeebsd/slime.
13:36:28
_death
knobo: there are some issues.. if the item is not in vector, or appears multiple times..
13:40:43
_death
knobo: perhaps DELETE is the one to consider.. even if it becomes a quality-of-implementation issue
13:40:56
tonton
Bike: looks like slime behaviour under threaded environments is really different, I'll dig later on. Thanks for your tests!
13:55:44
knobo
I ended up replacing (delete item vector) with (alexandria:copy-array (remove item vector) :fill-pointer t), and the bug was removed.
14:00:46
dim
doing (unless (member (type-of condition) '(cli-parsing-error source-definition-error)) ...) in an handler-bind form
14:01:07
dim
so, is there a way for the handler to avoid getting listed for those conditions without doing that?
14:02:06
Bike
and for the first thing, you can use full type specifiers, so you can do (and overall-condition (not (or cli-parsing-error))) and stuff
14:06:17
dim
I am using a monitor thread that among other roles is outputing log messages to the console and a log file, and of course it didn't have time to output precious messages when I close the program :/
14:12:11
dim
(looks like I might have used (unwind-protect ,@body ...) instead of (unwind-protect (progn ,@body) ...) in a macro. ahah.
14:20:58
dim
ok, sometimes I still don't get the output, but it happens rarely, threads don't really want to process it all it seems
14:23:37
jdz
dim: another thing that has bit me a couple times is the use of PROGN instead of MULTIPLE-VALUE-PROGN.
14:47:09
_death
this plist use is not extensible, unless you add &allow-other-keys ... you could just use a class or a structure
15:17:12
Bike
you mean some toy lisp? i'd just read examples. lisp500, memory pool system's scheme, maru
15:17:21
phoe
Murii: https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours and http://www.buildyourownlisp.com/
15:18:48
beach
Murii: I am asking about the purpose of the exercise, because there is no particular reason to write an interpreter, and there is no particular reason to use C to implement Common Lisp.
15:19:43
Murii
I want to prove myself I can. I tried to write it using only me head but I didn't end up too far so now I'm asking for help :\
15:21:28
phoe
use something that's tested and relatively debugged, or waste time reinventing the wheel.
15:23:36
phoe
but if I'm scripting for a game or other tool, the last thing I want is to debug the tool that I'm using for that
15:25:00
Bike
maru is the simplest i know of that isn't terrible. it even has a garbage collector. MPS does too, but MPS is kind of involved. alternately you could use boehm
15:25:57
Murii
The idea is to write it myself. I'll search for some books or papers on the internet and see what I can use
15:26:49
beach
Murii: Lisp in Small Pieces has been recommended. There is also an older book called "Anatomy of Lisp" which has some parts that are directly useful.
15:29:20
larsen
"If there is a bug with your code or the compiler, trust the compiler, unless you wrote the compiler, in which case there is a 50% chance that it's the compiler."
15:30:22
beach
Murii: I am asking because there is usually no particular reason to use a language other than Common Lisp.
15:31:02
beach
Murii: And most people who think that such a reason exists, are the ones that have no idea about what Common Lisp is or what it can do.
15:31:07
loke____
beach: There is one that I can think of: Client-side web development. I'd love to be wrong on that though.
15:37:08
beach
loke____: I must take your word for it. I did use qualifiers such as "usually" and "most" in order to avoid being too categorical.
15:37:36
loke____
beach: Damn, I was hoping there was some amazing toolkit that I didn't know about :-)
15:38:13
loke____
It's a bit sad that Clojure is a practical choice to use on the browser side, where CL is not.
15:38:59
loke____
dlowe: I wonder which of the current implementations are most likely to be ported to webassembly.
15:48:52
loke____
It's not clear to me how you'd deploy it in a browser. Also, it doesn't implement CLOS
15:56:13
_death
nowadays I have javascript turned off and use a different browser for the few sites I care about that need it, so if I needed to do web development it'd likely be good ol' server-side work with a dumb client.. of course, I'm not constrained by a job :)
15:57:44
tonton
Bike: swank use the :spawn communication style for threaded sbcl, switching to to :FD-HANDLER provide a temporary workaround
15:59:59
tonton
Bike: now I'll get my hand dirty and see why :spawn give those results under freebsd (and darwin) systems
16:00:48
pjb
You can write an interpreter or compiler of a SUBSET of Common Lisp. This would be the best choice. The only added difficulty compared to scheme is that CL is a lisp-2, so you need to have more slots in your environment.
16:13:15
jasom
loke____: fwiw, clisp and ecl are both non-starters for emscripten. They both assume a unix-style stack
16:23:04
jasom
hmm, if you had delimited continuations in CL, how would you expect unwind-protect to work with them
16:25:48
Bike
doesn't scheme have some super complicated thing instead of unwind protect for just that reason
16:26:21
jasom
http://okmij.org/ftp/papers/DDBinding.pdf has a sane way of doing dynamic binding, but I'm not convinced it can be extended to an unwind-protect with side-effects
16:27:04
jasom
Bike: IIRC they also have a "only run on non-local exits" form that isn't affected by call/cc
16:30:02
Bike
i guess dynamic wind is just unwind protect but there's also a nonlocal entry cleanup, that doesn't seem too bad
16:35:10
Bike
the first time i saw a detailed explanation of it it was combined with something like handler-bind, and it went in both directions
17:55:31
Bike
on sbcl the compiler does not run concurrently, so you have to do that kind of thing (not sure about ccl etc)
18:04:10
jasom
also note that a large fraction of quicklisp projects have :serial t set so poiu gets zero gain
18:04:20
flip214
Bike: for SBCL compilation itself there's SBCL_MAKE_PARALLEL, so why not do something similar in QL?
18:05:04
flip214
Eg. after compiling a new SBCL, recompiling all the QL systems might be done much faster.
18:05:24
jasom
forking rather than threads is more deterministic, as it will discard any changes to the global environment caused by compiling
18:08:05
jasom
It looks like poiu predates xcvb; it was clear that there was influence, and they both came from ITA
18:11:40
jasom
At a high level it's just a parallel{ fork() compile}; load, but getting it right is non-trivial, and there's a lot of inversion of control with ASDF
18:12:16
Bike
yeah what i mean is, i wanted to do compile instead of fork, but i tried to understandn action plans and something in me died
18:37:40
pjb
beach: Capability Hardware Enhanced RISC Instructions (CHERI) http://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
19:15:52
dim
(I would like to select it from handler-case here, but maybe I just don't understand what I'm doing at this point)
19:16:23
jasom
dim: the restart needs to be available; with handler-case the stack has already unwound so it's not going to work
19:17:58
dim
well in my case I need to redo all I've done in the function, so I don't need to stay at my position in the stack
19:46:59
dim
(handler-bind ((condition (lambda (c) (format t "bind: ~a~%" c)))) (handler-case (error 'cl-postgres-error::crash-shutdown :message "plop") (cl-postgres-error::crash-shutdown (condition) (format t "case: ~a~%" condition))))
19:47:56
Bike
you mean, you have a handler case, and there's an error, and its handler isn't firing?
19:48:22
pjb
It may be clumsy to handle CONDITION, since there may be implementation specific non-error conditions that are essential to the good working of the implementation that need to be handled (by the implementation).
19:49:51
dim
condition, I should refrain yes, but then unexpected behavior happens leaving users in the interactive debugger
19:51:41
Posterdati
pjb: basically I export the gpio, then poll the stat of gpioXX to see if (and mode #o664) = #o664
20:01:02
pjb
ie. it doesn't matter if you can access the item thru the other, the group or the owned access rights.
22:29:23
mrottenkolber
When it says Mbps in an Intel whitepaper it means Megabits per second, right?
23:59:54
dim
now working on having pgloader resilient to PostgreSQL operator interventions such as a restart... people have strange ideas about what is a bug sometimes, but at the same time, if we can handle it?
0:03:35
dim
the bug report reads: “When server restarts, or there is an issue with network connection, import fails with error:“
0:04:09
dim
(but then adds “but pgloader does not stop and is running infinitely” unfortunately, or it would have been great)