freenode/lisp - IRC Chatlog
Search
4:55:10
Decs
I had read Carl Hewitt didnt consider actors having their own message queues as fundamental so I decided on a whim that I would take that approach. even though all the implementations Ive seen tack them onto the actors class. Not sure of the pros and cons of either approach.
4:56:39
no-defun-allowed
If you had an implementation where actors had their own threads, and receiving a message blocked the thread, I think it would be a requirement to use separate queues.
4:58:59
no-defun-allowed
You use message handlers to represent actors and a scheduler running on one thread, which does not require that. I have not tested this, but I would also expect that using a message queue per actor (and an appropriate means of scheduling) would improve throughput with many worker threads.
5:06:10
Decs
ahh, yes I tried to make the queue operations as fast as i could to limit blocking between worker threads, but I can see how it may be a problem with more worker threads operating on the queue potentially simultaneously
5:07:49
no-defun-allowed
(Oh, and if you're on SBCL, safe-queue will use SB-CONCURRENCY, which is likely faster as it uses compare-and-swap instead of a lock.)
5:08:31
Decs
with the multi queue approach threads will only block if trying to write to the same actors queue
5:39:05
seok
can you pass multiple values (values a b c ...) to a function which takes same number of arguments?
7:12:25
beach
(loop with min-entry = (first alist) with min-value = (cdr min-entry) for entry in (rest alist) when (< (cdr entry) min-value) do (setf min-entry entry) (setf min-value (cdr entry)) finally (return min-entry))
7:13:30
phoe
(reduce (lambda (x y) (if (< (cdr x) (cdr y)) x y)) '((a . 335) (b . 29385) (c . 839875) (d . -32) (e . 447)))
7:56:00
beach
As in: when (funcall predicate (funcall key item) (funcall key best)) (setf best item)
13:49:30
Xach
https://github.com/quicklisp/quicklisp-client/issues/198 is a real head-scratcher for moe
13:55:33
MichaelRaskin
https://support.sectigo.com/articles/Knowledge/Sectigo-AddTrust-External-CA-Root-Expiring-May-30-2020 is the link to the upstream post
13:57:33
MichaelRaskin
Or paranoidally check everything provided in the chain even if it is not actually necessary to establish trust
13:57:36
Xach
ah, ok. hmm. i don't think my operating systems have updates for certs pending, though.
14:24:09
phoe
and for conses, you want stronger checks than just typechecking - you usually want destructuring of some sort
14:24:23
Bike
a form can be anything, so there's nothing to check. the rest of the syntax is usually covered by the lambda list
14:26:24
theseb
e.g. I made a for loop macro that works like this...(for i (list 1 2 3) ....) ......Seems like it may avoid issues to check if 1st for macro arg is a symbol and 2nd macro arg evals to a list
14:32:47
theseb
Oh one last thing.....is it easy to switch between CL and Clojure....I'm hoping that Clojure becoming fashionable is a good thing for the CL and Lisp community in general
14:32:57
aeth
theseb: you can check that the first is a symbol, but you can't check the second at macro time, at best you can insert a CHECK-TYPE in your expansion
14:45:09
pjb
theseb: it really depends on the complexity of your function (macros are functions), and whether you use the values immediately, or later or deeper in the code. If you use the value immediately, then a type error will be soon detected and reported, in a way that should be understandable to the programmer.
14:45:54
pjb
theseb: on the other hand, if the values are used later or deeper in the code, the relationship between the bad value and the call (or macrocall) can be less obvious. Then it may be helpful to the programmer to check the types and report the error earlier.
14:46:48
pjb
theseb: but it's rarely done. One objection is that the programmer checking the types often is too restrictive. Lisp is a generic programming language: you don't write function processing specific types, but functions processing ANY type that it can.
14:47:43
pjb
theseb: as for the ease of switching, 1- there's a clojure implementation written in CL, 2- just try to convert 10kLOC of Clojure to CL, and tell us! (better write directly in CL).
14:48:37
pjb
theseb: also for the types if you don't check it, then the type restrictions may depend on the implementation of the function. Which can be considered good or bad…
14:55:29
aeth
theseb: this is off-topic, but Clojure looks past fashionable, not "becoming fashionable", to me. That's the risk of relying on "fashion" in the first place.
14:57:20
aeth
pjb: You want to check the type early so you can fail early. Sure, a for loop macro would probably fail fairly early (but the message won't be as clear to the user) without a list (but it should be a sequence) as the input, but most things could fail very deep
14:58:01
aeth
IME it's fairly common in a large program to get a random NIL pop up when it could've been generated somewhere very far from where it shows.
15:02:21
theseb
aeth, pjb: i see both sides....dynamic typing is a wonderful thing that leads to cleaner code but may also lead to hard to find bugs.
15:03:17
aeth
pjb: duplicated code is efficiency, at the cost of space, at least. That's sort of the point of C++ templates or https://github.com/markcox80/specialization-store/
15:03:52
aeth
theseb: it appears to have peaked 5-6 years ago in multiple (obviously all unreliable in their own way) measures, e.g. Google Trends.
15:04:41
pjb
aeth: it's wrong. the generated binaries are often identical, since most type have the same size.
15:04:49
theseb
aeth: i would think ClojureScript will rocket to the moon since apparently anything in the browser becomes super popular
15:05:21
aeth
theseb: 5-10 years ago, everyone was trying to compile things to JS (including dozens of Lisps, mostly Schemes, but two CLs)
15:05:34
aeth
theseb: These days, it seems to have consolidated on TypeScript. Maybe WASM will be another chance for Lisp in the browser.
15:09:53
aeth
pjb: Quite a few CL APIs are for a specific type or for the union of a specific type and NIL (i.e. (or null foo) which I use a DEFTYPE to write as (maybe foo)).
15:10:49
p_l
currently V8, and thus Chrome, can't handle WASM that isn't representable as straight JS
15:29:49
phoe
I once came into #lisp and saw Chrome, being the new IE6, apparently translating WASM to JS
15:30:50
decs
Thanks for your advice earlier guys, I've spruced up my little hobby framework in accordance with your comments. I kept the closures for the moment though as I'd like to experiment with some of the material in Let Over Lambda. Pastebin https://pastebin.com/ZCjSjA37 if you feel like having a squiz
15:56:17
aeth
phoe: the context (with a bunch of offtopic thrown in, yes) being why we still don't have Lisp in the browser.
15:56:40
flip214
does someone know of a REPL over HTTP, ie. with a HTML <textarea> and a history and syntax highlighting and <tab>completion (via JS) and any other features?
15:57:36
thmprover
OK, I am about to start a toy AI project, and I'm deliberating between using Common Lisp vs Scheme...
15:58:46
aeth
You're probably best just asking in #lisp for CL and #scheme for Scheme and getting the strongest argument for each, though. ##lisp (for Lisps in general) is kind of inactive
15:59:32
thmprover
OK, well, what is the strongest arguments in favor of CL? (I don't know CL, I work with Clojure daily though)
16:00:03
phoe
multiparadigm, it doesn't really enforce any paradigm od programming style on you and adapts to new ways of programming
16:00:42
flip214
thmprover: thanks! but feels very slow, I'd have hoped for something very interactive
16:01:13
phoe
flip214: this likely executes a new CLISP process for each hit of the button, hence slowness
16:02:12
thmprover
I have read a good chunk of "Let over Lambda", so I appreciate the strength of CL's macro system, and realize Scheme lacks this power
16:04:31
beach
thmprover: As far as I know, Scheme doesn't have anything like CLOS yet. And that is one of the absolute strongest point in favor of Common Lisp.
16:05:37
aeth
beach: That's not quite true. Plenty of Schemes have CLOS-like systems, although portable Scheme does not and probably cannot
16:06:00
thmprover
So I'm going to be doing some symbolic mathematics, and I'd like arithmetic operators to extend to new types (e.g., quaternions should have addition). Can CL handle this?
16:06:33
beach
aeth: "Schemes" in plural form, and -like at the end. Very likely mutually incompatible.
16:07:08
beach
aeth: Of course portable Scheme could have it. It is just a matter of including it in the next version of the standard.
16:07:57
aeth
beach: It would probably have the same issue as R6RS's condition system, in that it would define a hierarchy that might conflict with an implementation, thus meaning that otherwise-conformant implementations might ignore that part of the standard.
16:08:08
aeth
It's kind of too late to do that sort of thing with Scheme, at least portably and standardized.
16:08:22
beach
p_l: I seriously doubt that something like CLOS for Scheme could be in a library. My experience with CLOS is that it permeates every aspect of the base system as well.
16:08:55
p_l
beach: at the same time, CLOS' major claim to fame is that it could be introduced through library
16:09:00
aeth
beach: It can, it just has to be a built-in library rather than one that can be added as a portability library.
16:10:26
flip214
hmmm, I'm testing cl-jupyter but I always get fatal error encountered in SBCL pid 273284(tid 0x7f0c8f9fb2c0):
16:10:59
p_l
beach: I hope I don't come through as argumentative on this - I just find Lisp implementations to be so malleable :)
16:29:47
aeth
On the one hand, CLOS is literally going to be in "a library" in Airship Scheme, but on the other hand, of course that's just exposing the underlying CLOS functionality from the base CL implementation it's running on...