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)
0:43:24
pjb
aeth: note: the programs use already a good number of the available file descriptors for the shared libraries etc.
0:48:13
aeth
you can "easily" be in a few hundred channels (I'm constantly in anywhere from 16 to 35), which is already pushing into the limits assuming that the machine isn't being used solely for IRC
0:49:18
aeth
And yet, every single channel might be active if it logs joins/parts/quits. Most trivially, if you ping out and reconnect before your connection gets the ping timeout, since that ping out will show up in every channel you (re)join.
0:51:54
phadthai
shared lib fd are usually closed after reading+mapping, for irc there's the standard 3 (stdin/stdout/stderr) plus one socket per network/server, possibly a few for the display via curses etc... but yes if every channel is logged depending on client it may also mean one fd per channel. As for the 1024, it's probably the process limit more than the total system one
0:52:59
moon-child
you can split up your thing into a bunch of different processes, where each one only has a file or two open
0:54:18
aeth
White_Flame: for one thing, idk the no-power failure state of sqlite, while I know the no-power failure state of appending to a bunch of log files
0:55:22
aeth
also, IRC is pretty much designed for appending to plain text files since it's a text-and-line oriented protocol with no editing/deletion
0:55:53
White_Flame
quassel logs everything to sqlite, and I've not had a problem with recovering from system crashes and such
0:56:03
aeth
Afaik, some people lost their logs when they moved from freenode to libera because it wasn't just plain text files.
0:57:17
aeth
you'd only need a database to cache unsent messages in a bouncer (not client)... more for the reliability guarantees than anything else
0:57:43
White_Flame
also, since irc logs are often-written, seldom-read, you could just do a singular linear log, and grep for individual channels later
0:58:59
aeth
White_Flame: I mean, yes, that's what I do to display my bot's messages in SLIME (it's running in a background thread).
0:59:58
aeth
White_Flame: However, the stateless all-in-one-place log has a few issues. In particular, QUIT and NICK (and perhaps a few others) are global in IRC, which makes it unclear in which channels those are actually taking place.
1:01:56
aeth
Also it becomes unreadable without grep if I was in a bunch of channels, with one way noisier than the others. For instance, my SLIME is basically just a log of #lispcafe because cond is present there, but it is also present in other, quieter channels
1:11:16
waleee
what would be the likely reason for someones (not me) M-x slime-connect to fail with "Can't locate module: SWANK-IO-PACKAGE::SWANK-INDENTATION"?