freenode/#lisp - IRC Chatlog
Search
11:18:26
pillton
beach: Nice work with the Early parser. Writing lambda list parsers is such a pain.
11:19:44
pillton
beach: https://github.com/markcox80/specialization-store/blob/master/tests/lambda-lists.lisp#L45
12:06:44
beach
pillton: Thanks. I made my life harder, because this is Cleavir, so what is a valid lambda list could be extended by the implementation.
16:05:39
kefin_
I have (define-alien-routine "read" size-t (fd int) (sb-alien:void-alien buf) (size-t offset)) currently
16:13:26
nosefouratyou
I am trying to parse some json but I am getting results that don't make sense. It seems that (jonathan:parse ...) isn't modifying the result at all https://gist.github.com/nosefouratyou/bd4907f3de763c36abed39f502e0d6e0
17:12:03
phoe
to be more precise, in Lisp, stuff like (compile nil (lambda (x) (+ 'foo x)) will compile (and most likely produce a warning) and then, when you run it, produce a runtime error. but that's what you get for having a language with strong but dynamic typing.
17:15:14
phoe
nonetheless, type detection in some Lisp implementations (including the most popular ones) works decently, which is why you get that type warning during compilation.
17:18:43
pjb
adlaistevenson: the point is that the lisp systems validate the correctness at run-time, because it can change at run-time!
17:19:18
pjb
adlaistevenson: when you write an AI that learns, and compiles new knowledge into itself at run-time, you cannot prove it ages before.
17:21:02
pjb
adlaistevenson: furthermore, there is indeed the important question of what you call correctness: all lisp data is valid and correct lisp program (well almost, you can declare safety 0 and get a bunch of undefined behavior). But otherwise, you should always have controlled ie. "correct" execution, at the most basic level.
17:21:47
pjb
adlaistevenson: there can be an incorrect program, ie. a bug, only if you have a specification to check the behavior of the program against. To let do that by the computer, you will need a FORMAL specification.
17:23:14
pjb
It correctly signals a program-error (or an error, depending whether you pass it to the compiler or the interpreter).
17:23:41
Bike
checking that an algorithm implements a function isn't NP-hard. why would it be NP-hard? it's impossible. but for specific cases it's reasonable.
17:24:21
phoe
Bike: "when you write an AI that learns, and compiles new knowledge into itself at run-time, you cannot prove it ages before."
17:26:00
pjb
Often even multiple times the expected lifespan of all the universes in the multiverse.
17:28:16
Bike
whatever. lisp question. what happens if you use a forward-referenced-class as your metaclass.
17:29:37
pjb
If the metaclass cannot be finalized, there's no way to use it to even create a non-finalized class, so nothing can help.
17:30:52
Bike
actually, wait, to be a metaclass it has to be finalized, so the defclass with the :metaclass should finalize it at compile time (or if that's impossible, signal an error)
17:48:59
drmeister
If I break up a job across 8 threads and set them all in motion - does it make sense to have a loop that does JOIN-THREAD on all of them to synchronize with them all?
17:50:33
drmeister
(let ((threads (loop for x in jobs collect (make-thread #'(lambda (job) (do-job job))))) (loop for x in threads do (join-thread x)))
17:55:02
pjb
Granted, it may be needed more often in threads to collect the result, but honestly if you use threads, it's probably because the problem is more parallel than sequential, so you don't have a single result at the end in general, but you will have computed vectors of results during the processing.
17:55:43
pjb
drmeister: we fork more often than we wait for children, because synchronization with the termination of children is rarely needed.
17:56:46
pjb
In case of threads, often they will mutate a common data structure, so the final result is already synchronized around those mutation, and we don't care when it's complete.
17:57:07
pjb
My point is that it make sense to use join-thread, but also not to use it, when you don't need to.
17:57:55
drmeister
In this case I need to aggregate all of the results together. But I think now I'll use a thread pool and farm off smaller jobs to them. I have about 300 C++ source files that need to be analyzed to identify pointers in classes within the code. They can be analyzed in parallel - but the results need to be aggregated to generate code for a garbage collector.
17:59:01
pjb
drmeister: yes, if you keep worker pools, and initiate tasks by messaging them, you will get the results thru some messaging, and not at the end of the thread (they will be infinite loops). In this pattern, you don't need join-thread (it'd block forever).
18:01:44
drmeister
Hmm, I just incorporated a non-locking multi-producer, multi-consumer queue - I could use those here.
18:03:11
scymtym
drmeister: it make this kind architecture quite easy. e.g. https://lparallel.org/pmap-family/
19:25:41
Bike
I thought sb-alien took care of that, but I guess not. If you use CFFI instead, it should do en/decoding transparently, as far as I remember.
19:28:20
kefin
inotify_event has some uint32 and at the end a char*, but it doesn't write to what that ptr points to, it writes essentially "past" the struct object, and the char ptr represents that