libera/#commonlisp - IRC Chatlog
Search
15:34:42
shka
is when he mentioned that nobody will be serious about the programming until software bug will cause a major aviation accident
15:36:28
shka
yeah, it sounded ludicrous at first, but i actually think that this may be not be worst idea ever
15:38:28
beach
I agree, but it would be a terrible idea presently. What will happen will depend a lot on the "experts" that are chosen to draft legislation. I won't be surprised if (say) free software is outlawed, and VSCode becomes mandatory, and stuff like that.
15:47:47
jcowan
Obviously Boeing has very good (and very expensive) e&o insurance, some of it paid for by taxpayers. I read once that aviation didn't become profitable (as opposed to pervasive) iuntil the 1960s or so
15:49:27
beach
I am not worried about Boeing. I am worried about the future of software development.
15:54:33
shka
regardless, despair https://www.bloomberg.com/news/articles/2019-06-28/boeing-s-737-max-software-outsourced-to-9-an-hour-engineers
17:47:47
pjb
well, airbus at least uses a Coq-validated C compiler: https://github.com/AbsInt/CompCert
17:48:44
pjb
Perhaps one day we'll have a formal specification of CL, and a Coq validated CL compiler?
20:22:50
coat
I am trying to make a small wrapper that can push a cons to alist. (defun add-key-value (key value alist) (push (cons key value) alist)) (defparameter *a* nil) (add-key-value "foo" "bar" *a*). But *a* remains as NIL after I execute this.
20:28:36
pjb
(define-modify-macro aconsf (key value) (lambda (alist key value) (acons key value alist))) (let ((alist '((a . 1) (b . 2)))) (aconsf alist 'c 3) alist) #| --> ((c . 3) (a . 1) (b . 2)) |#
20:29:13
pjb
coat: unfortunately, a lot of CL functions don't have their parameters in the right order for define-modify-macro… So you need to swap them, eg. with that lambda.
20:30:03
coat
pjb: Okay. Curious about another thing. Is creating a list and pushing cons to it not a popular way? Do people usually use acons instead?
20:30:27
pjb
(let ((alist '((a . 1) (b . 2)))) (let ((alist (acons 'c 3 alist))) alist)) #| --> ((c . 3) (a . 1) (b . 2)) |#
23:55:49
aeth
the way lists go, a push is a cons, so how can it not do that? there is no list, only cons pairs
23:56:36
aeth
pushes could only directly modify if the list data structure was actually one more pointer, a pointer to the first cons pair (or if it added to the end and was O(n))
23:57:47
moon-child
it could also add to the beginning destructively, moving down the elements of each successive cons cell. Still O(n) though
0:07:54
aeth
if I have a (with-open-file (stream #P"test42.txt" :direction :output :if-exists :append :if-does-not-exist :create) ...) for quite a few streams (42 would not be too many, since I'm talking about IRC logging), when do I hit limits?
0:09:17
moon-child
on modern unix, a file descriptor is a signed 32-bit integer between 0 and 2^31-1 or so
0:09:47
White_Flame
there are limits beyond running out of descriptors though. Don't recall where they are unfortunately
0:11:19
aeth
Very naive is just leave all of the streams open for all of the files and just keep appending, with periodic FORCE-OUTPUT. Less naive is to only leave it open for very active channels (e.g. here), while not leaving it open for very inactive channels (e.g. my own project channels) until necessary.
0:11:33
aeth
However, guessing "inactive" incorrectly is going to mean opening/closing a lot of files
0:12:03
aeth
I suppose it kind of has to guess it, though, once queries are taken into account, but those can just be special cased to time out, unlike channels, which are probably going to have some joins/parts/quits/nicks at the very least
0:12:59
aeth
I could also buffer it for an arbitrary amount of time, but the longer the buffer period is, the more likely that a system failure loses a lot of logs.
0:14:53
aeth
I guess with-open-file isn't the way to go since (1) there will be a lot of files and (2) files need to be able to "time out" if inactive until active again (at the very least, for queries)