freenode/#lisp - IRC Chatlog
Search
6:25:11
flip214
jdz: thanks, sent an email yesterday, too.... in the meantime I opened https://github.com/quicklisp/quicklisp-projects/issues/1825 to use your repo instead ;)
7:02:53
jdz
flip214: Cool. I have not run into the OOM issue, so I'm glad I've fixed it unknowingly.
7:04:13
jdz
The main issue I was fixing was out-of-bounds array access, which was not very nice since there were (safety 0) declarations.
7:12:27
flip214
didn't spend any time looking for the reason.... allocating 2GB for a NIL sounds interesting
7:16:16
flip214
hmmm, replicating the (declare (string input) (optimize ... (safety 0))) isn't enough, I get a type error
7:21:08
flip214
aeth: that's why https://github.com/jdz/cl-base64/commit/f495809807a9311747c84fcb9520105ed663a971
7:31:32
aeth
to be fair, (safety 0) wouldn't be less safe than C if SBCL didn't also stop doing most static checking when (safety 0) not just runtime checking
7:33:01
aeth
Compare (safety 0) to (safety 1) here: (with-compilation-unit () (defun hi () "hi") (defun foo () (declare (optimize (safety 0))) (+ 0 (hi))))
7:35:05
aeth
beach: The C compiler will tell you it's bad, as will SBCL with (safety 1). Compiler, not runtime. Of course, this is not quite a good example because GENERIC-+ will still typecheck so it won't mess up at runtime. This is UB because it's a non-generic +: (with-compilation-unit () (defun hi () "hi") (defun foo () (declare (optimize (safety 0))) (+ 0 (the fixnum (hi)))))
7:35:39
aeth
THE, of course, is portably speaking dangerous, but only because it permits behavior like what's happening here with SBCL, but only when SBCL has (safety 0)
7:36:18
adlai
beach: thanks; so it's probably for a specific project? since specbot is in #sbcl too, there's even a usual suspect :)
7:37:11
aeth
My example is also bad in one other way... (+ 0 ...) won't mess things up, but any other number probably will
7:38:12
aeth
to be fair, (safety 0) does have its use in removing bounds checks in arrays in a LOCALLY if you really know what you're doing...
7:38:42
aeth
Just never do it at the function level because then it won't check the inputs, e.g. you could pass in too many or too few arguments
7:38:56
jdz
aeth: One does not need (safety 0) if the compiler can figure out the bounds checks don't have to be checked on every iteration.
7:39:24
aeth
There definitely are cases where you know it can't go out of bounds but SBCL does not (yet) know this
7:41:41
aeth
I generally use fixed-size arrays when I want performance, though. Then there's no need to play any games around bounds checking.
7:44:40
aeth
Anyway for anyone following along later, my final, corrected version of messing up your SBCL with (safety 0) that will otherwise be caught at compile time is: (with-compilation-unit () (defun hi () "hi") (defun foo () (declare (optimize (safety 0))) (+ 2 (the fixnum (hi)))))
12:10:54
flip214
when I try stepping via swank, the next output is a (continue) call in SWANK:SLDB-NEXT. I'd have expected to get the next form after the (BREAK)
12:16:13
flip214
but the command going across the wire is "000038(:emacs-rex (swank:sldb-next 0) "COMMON-LISP-USER" 3 69)", and frame 0 is the function frame that I'm trying to step through?!
12:39:02
beach
flip214: I have never managed to get stepping to work to my satisfaction. It is of course possible that I am doing something wrong.
12:40:17
jcowan
"Removing run-time checks in production is like having life jackets in port but removing them before going to sea in order to carry more cargo."
13:51:20
jasom
jcowan: coincidentally, I just had a project that saved a large amount of money *because* assertions were disabled in production.
13:54:49
jasom
hardware docs said that both the "success" and "error" indicator bits wouldn't be set at the same time. error-injection testing caught this happening in aging parts after about a year and a half of testing due to the assertion. Analysis of behavior without the assert is that the driver will eventually reset the hardware and continue. No patch needed specifically for this problem.
13:59:28
jcowan
Yes, but you were lucky: it could have been that the program went off the rails in the presence of the hardware problem
14:00:01
jcowan
In Multics, the first thing the system did after being restarted from a crash was to attempt to dump the virtual memory to disk for postmortem debugging.
14:01:32
jcowan
On one memorable and scary occasion at a customer site, attempting to reload the tape produced "HODIE NATUS EST RADICI FRATER" and halted, ignoring all further attempts to recover.
14:02:14
jcowan
On tracing, this error message happened in the bootstrap if the left and right pointers of the root segment weren't null (-1 on Multics).
14:03:15
jcowan
Further investigation showed that the disk controller had failed, writing out part of the root segment as all zeros, and there was no recovery from that.
14:07:18
adlai
clearly, although posessing a reasonable sense of humor, they dropped out before receiving a diploma
14:14:45
jcowan
more detailed version at https://multicians.org/hodie-natus-est.html but with more Multics-specific jargon
14:28:20
beach
It is best if you tell us what kind of functionality you need. That way, people who don't know about snippets can help.
14:28:44
beach
jmercouris: Also, whether an expression is a form or not is not intrinsic to the expression. It has to do with its intended use.
14:29:24
beach
jmercouris: For example, (- (length list)) is probably a form if found at the top-level.
14:29:28
jmercouris
the functionality I need is the following, a program that can parse some form. The form is a form with some simple logic, some pre-filled text, and some spots that the user can fill int
14:29:48
jmercouris
the user will be prompted for a name, and inherits, and that value will be filled into a string
14:30:14
jmercouris
If I decide to roll my own snippets, which I probably will have to, syntax suggestions?
14:32:46
beach
jmercouris: Therefore it is not an intrinsic quality of an expression whether it is a form or not.
14:33:13
beach
jmercouris: Even (1 2 3) might be a form. It fails to evaluate, but perhaps the intention was to test the error that is signaled.
14:34:04
beach
jmercouris: In (let ((x 10) (y 20)) ...) (x 10) (y 20) are expressions but they are not intended to be evaluated.
14:36:42
beach
My point is that whether an expression is a form or not is not intrinsic to the expression.
14:37:25
jcowan
in any case, any special form can be implemented as a macro, hence the relevance of the minimal basis set
14:38:10
beach
jmercouris: Even in (let ((- (length list))) ...) you don't know whether (- (length list)) is a form or not, because you don't know whether the entire expression is.
14:39:40
splittist
jmercouris: you could do a survey of syntaxes; you could let the user choose; is the prompting going to be parameterised; will you have built-in validation, and, if so, how will that be signalled? Happy pedaling.
14:40:12
flip214
beach: my ~/.sbclrc has (safety 3) (debug 3) as default settings, yes. Thanks for the notice about stepping not working for you, too!
14:42:01
flip214
jdz: want to vote on https://github.com/quicklisp/quicklisp-projects/issues/1825 ? ;)
15:24:08
adlai
regrettably, my keyboard lacks the ability to disambiguate cases that were spelled identically in the variant of latin that I studied a decade ago.
15:24:37
jmercouris
splittist: what is parameterised prompting? I am thinking no validation, it is just for simple form input
15:25:27
adlai
jcowan: wrt #'if, clearly as a funcall to symbol-plist of one and zero; as a macro, however you like.
15:26:08
adlai
minority report votes for symbol-plists of t and nil, and they are wrong, due to being in the minority!
15:27:15
jcowan
That's like saying Smalltalk doesn't need if because true and false belong to different classes, which they do, but class dispatch obviously needs a conditional under the covers.
15:27:46
adlai
jcowan, sure, that's why you have an invariant, wherein the relevant function is located at a specific offset within the plist
15:28:33
jcowan
You can do a lot conditional-free, especially if you are willing to repeat work, but not everything.
15:39:51
Bike
you shouldn't need a conditional for dispatch though. you can use something like vtables, can't you?
15:40:14
Bike
i guess in a roundabout way that's the same as keeping the function in a dedicated spot in the symbol plist
15:46:57
Bike
and extending on that, you could say that the lisp runtime has a %COND slot in every object; in the %COND of NIL is (lambda (x y) y), and for every other object it's (lambda (x y) x); and then (if x y z) is (funcall (funcall (%cond x) (lambda () y) (lambda () z))) no problem.
15:47:11
_death
(defconstant true 'car) (defconstant false 'cdr) (defun if (test yes no) (funcall test (cons yes no))) ;; add funcalls for flavor
15:47:56
Bike
as such, in the next lisp revision IF should not be a special operator, thank you for coming to my TED talk
15:49:06
splittist
jmercouris: something like (prompt-for thing prompter), so people can specialize prompt-for for different prompting mechanisms (react, repl, terminal, chatbot...)
15:49:57
adlai
sure, although i'd hope that (function car) is short enough to be #'eq to (function car)
15:58:40
jmercouris
document classification is concerned with semantic understanding of documents and plotting them in a 2d vector space
15:58:48
jmercouris
usually with the idea to group related documents, or determine what they are about
16:00:52
jmercouris
you can use that to figure out what terms are relevant in the document, and cluster that in a space, for example
16:02:31
jcowan
When people ask me if I use emacs or vi, I reply that I am an "ex" troglodyte (not to be confused with an ex-troglodyte)
16:03:02
jcowan
There are 5m troglodytes in China today, some with running water and even electricity
16:05:13
adlai
clustering on a flat screen is mainly useful for people who like to criticise the output of an artificial neural network
16:05:26
_death
here's an old tfidf from some years ago https://gist.github.com/death/84c57eb0811421c1c51bf63f2fd716fd
16:05:33
jmercouris
when you find yourself adding more and more dimensions, good luck getting good clusters
16:05:40
Bike
what i should have said yesterday was that special operators don't express anything about inter-operator dependence - which i don't think would be very useful anyway - but express what a code walker has to know
16:07:54
adlai
jmercouris, my reason for skepticism about clustering within 2d spaces is that there are much stricter bounds on planar graph colorings
16:08:21
jasom
If you made canonical expansions of all macros and special-forms in the spec, kind of like fare-quasiquote does for the ` reader macro
16:09:51
Bike
_death: things like sbcl's named-lambda screw it up. probably other stuff, i haven't tried writing a portable walker myself
16:10:37
jmercouris
anyways, I'll try to utilize montezuma with some sort of interface first, that's a nice start
16:14:28
jcowan
I do use ed occasionally to work around bugs in vim, like its inability to substitute a pattern with a replacement containing a newline (you get a NUL instead) or the way that vim farts on very large files.