freenode/#lisp - IRC Chatlog
Search
2:41:21
lyf[kde]
Using CSP, I can wrap the continuations, to implement event loops and to optimize tail calls, but CSP is handly only when it comes to tail calls.
3:26:42
lyf[kde]
Here is one creative implementation: https://github.com/mystor/breaktarget/blob/master/src/lib.rs This library (in Rust) uses panic unwinding to its advantage.
3:32:17
no-defun-allowed
panic! is pretty much "all shit went south" so it seems like a bad idea to reuse that for normal program flow
3:39:28
lyf[kde]
Stack as in BFS, DFS... In DFS you have a todo queue. In BFS you have a todo stack. You can also implement DFS as a recursive function without the todo collection.
3:40:27
Bike
you can use an explicit stack in a limited context to do something like continuations, s ure
3:41:34
ealfonso
is there a built-in "which" in CL/sbcl to find the absolute path to an executable given its name? I tried looking at SB-EXT:RUN-PROGRAM's implementation which accepts a :search flag: https://github.com/sbcl/sbcl/blob/e98378ca004ef6d101b384f6c3130f24b7a1bc1f/src/code/run-program.lisp but can't figure it out
3:56:46
mange
lyf[kde]: If you're trying to implement call/cc in another language you could try something like http://www.schemeworkshop.org/2007/procPaper4.pdf, but it's pretty hard to do manually.
5:55:31
aeth
stylewarning: It depends. If it's something like shortening names to make them easier to type, that usually makes things worse, just get some form of autocomplete. But if it's removing a variable, that often makes the code clearer imo.
6:01:53
aeth
stylewarning: mapcar itself is sort of an example of this. It's basically just maplist where you're calling car on every variable.
6:02:05
aeth
a one variable version could be implemented as trivially as: (defun mapcar* (function list &rest more-lists) (declare (ignore more-lists)) (maplist (lambda (x) (funcall function (car x))) list))
6:59:30
slyrus1
Shinmera: it's probably not relevant given iclendar, but did have you seen my https://github.com/slyrus/soiree/blob/master/icalendar.lisp
8:08:36
Shinmera
iclendar can't parse things as it is, only produce them, but I would certainly welcome a parser addition to it.
8:14:09
slyrus1
It would be great if all of these were combined into one library/suite that could read and write icalendar/vcard and talk to caldav/carddav servers.
8:17:43
slyrus1
soiree does parsing but not serializing, iclendar looks like it does serialzing but not parsing...
9:24:45
hjudt
i have a design question: i am developing a web application which reads data from a hash-table. The hash-table gets updated (on demand), this process is usually very fast. nothing else writes to that hash table except the update method. do i still need to protect the hash-table with locking in every place it gets accessed? is there a better solution? i need a data structe like a hashtable because lookup would
9:26:05
phoe
some implementations have synchronized hash tables that are good for concurrent acccess.
9:28:41
phoe
you can simply #'(SETF GETHASH) and all the synchronization is going to happen in the background
11:07:27
phoe
so one thread blocks until the second thread handles the condition originating in the first thread?
11:07:45
phoe
or is it "fire and forget" where the thread does whatever after "sending" the condition object to a different thread?
11:08:12
shka_
phoe: thread1 waits for thread2 to finish, thread2 signals error, thread1 has logic to handle error
11:09:37
phoe
thread2 has a handler that sends the condition object to thread1 and blocks waiting for response, thread1 sends the "result" of how to handle error back to thread2, thread2 reacts accordingly
11:19:06
jackdaniel
shka_: I don't understand the use case here -- why would you handle error in parent thread instead of a child thread?
11:20:39
shka_
jackdaniel: because otherwise i will need user to know details about internal implementation
11:21:10
zigpaw
maybe you could want to handle errors in an aggregate manner probably? (in some algorithms, where only a significant percent of errors require automatic reaction), but even then you can do it on the same thread and just pass the counter to error-handling thread (supervisor).
11:21:47
jackdaniel
I mean why do you want something like (handle-thread (fork (error "hi"))) instead of (fork (handle-thread (error "hi"))) ?
11:21:51
zigpaw
so having something like producer-consumer, between failing threads and error-handling thread?
11:25:43
jackdaniel
ah, so you are fixed on your left-grabbing-right-pocket mindset. in that case I won't interfere
11:26:02
zigpaw
shka_ : more like just an idea I got for such a use case, it is not exhaustive. In most cases I can think of I don't see such architecture needed.
11:27:37
shka_
zigpaw: essentially i have library that introduces RANGES (like iterators, just with few extra elements)
11:29:48
shka_
if i could introduce way to allow part of pipe to run on separate thread, i could speed up few use cases
11:32:19
shka_
because range can be constructed by internal function and user can't do anything with that
11:36:45
zigpaw
yeah, that seems a reasonable use-case. but probably you'll have to catch the condition on the failing thread and pass that somehow to the parent thread. That is the one thing I don't like in most impl of threads in various oses, the child doesn't know their parent. Some languages do have easier to use constructs for parent-child communication, lik
11:36:45
zigpaw
e erlang or go with their channels, I'm quite sure CL have those too but I'm not that good in CL to have any experience in this regard (and I don't know about overhead which it surely have).
11:40:01
zigpaw
I mean for inter-thread communication that you would probably need to establish for each and every thread.
11:46:45
zigpaw
great, then you are probably all set up :-) at the end you may even wrap it into a function/macro and have it ready as a multi-purpose thing?
13:02:41
AeroNotix
First time thinking I might need eval-when. I have some constant values that are a pain to write out in full. I can write a small piece of code to create them instead. Do I want to use eval-when :compile to compute the constants at compile time or shall I choose a different method?
14:14:31
russellw
What's the naming convention for variants? Like if I have a function named foo, and I want to create another function similar to it but slightly different, so a slight variant of the name, that would be foo' in ML?