<flip214>
I'm just trying to reproduce with a minimal example
<no-defun-allowed>
Tell that to the jsown maintainer?
nicktick2 has quit [Quit: Leaving.]
Necktwi has joined #lisp
nicktick has joined #lisp
<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
<beach>
aeth: The fact that something is no less safe than C is a very weak argument.
jackdaniel has quit [Ping timeout: 256 seconds]
jackdaniel has joined #lisp
<beach>
adlai: "launchpad" would be my guess.
<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)))))
<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)
<adlai>
beach: thanks; so it's probably for a specific project? since specbot is in #sbcl too, there's even a usual suspect :)
<aeth>
My example is also bad in one other way... (+ 0 ...) won't mess things up, but any other number probably will
<jdz>
aeth: That's why I have (sb-ext:restrict-compiler-policy 'safety 1) in my ~/.sbclrc
<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...
<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
Cymew has joined #lisp
<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.
<aeth>
if
<aeth>
There definitely are cases where you know it can't go out of bounds but SBCL does not (yet) know this
<aeth>
I rarely encounter these, and even then never really care about the check, though.
revtintin has joined #lisp
z0d has joined #lisp
<aeth>
I generally use fixed-size arrays when I want performance, though. Then there's no need to play any games around bounds checking.
<beach>
aeth: I don't think THE is worse than a type declaration.
<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)))))
<aeth>
It probably won't get really nasty until you start SETFing the wrong things, though.
revtintin has quit [Ping timeout: 256 seconds]
tiwEllien has joined #lisp
Necktwi has joined #lisp
m00natic has joined #lisp
Codaraxis has quit [Read error: Connection reset by peer]
Codaraxis has joined #lisp
Necktwi has quit [Ping timeout: 256 seconds]
jsatk has quit [Ping timeout: 256 seconds]
parisienne_ has quit [Read error: Connection reset by peer]
parisienne_ has joined #lisp
jsatk has joined #lisp
Codaraxis_ has joined #lisp
Necktwi has joined #lisp
Codaraxis has quit [Ping timeout: 260 seconds]
nicktick1 has joined #lisp
nicktick1 has quit [Client Quit]
orivej has joined #lisp
nicktick has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
ggole has joined #lisp
nicktick has joined #lisp
efm_ has joined #lisp
efm_ has quit [Client Quit]
efm has quit [Ping timeout: 256 seconds]
efm has joined #lisp
nicktick has quit [Quit: Leaving.]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
kopiyka has joined #lisp
Necktwi has quit [Ping timeout: 260 seconds]
nicktick has joined #lisp
datajerk has quit [Ping timeout: 256 seconds]
micro has quit [Remote host closed the connection]
nicktick has quit [Quit: Leaving.]
datajerk has joined #lisp
revtintin has joined #lisp
markoong has joined #lisp
loke` is now known as loke
m00natic has quit [Remote host closed the connection]
revtintin has quit [Quit: WeeChat 1.9.1]
markoong has quit [Client Quit]
Lord_of_Life_ has joined #lisp
m00natic has joined #lisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
m00natic has quit [Ping timeout: 265 seconds]
chipolux has quit [Quit: chipolux]
adam4567 has quit [Remote host closed the connection]
iAmDecim has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
iAmDecim has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
lavaflow has quit [Ping timeout: 265 seconds]
lavaflow has joined #lisp
narimiran has quit [Ping timeout: 250 seconds]
grumpyvegetable has quit [Quit: Connection closed for inactivity]
hdasch has quit [Ping timeout: 265 seconds]
narimiran has joined #lisp
hdasch has joined #lisp
Necktwi has joined #lisp
hdasch has quit [Ping timeout: 260 seconds]
hdasch has joined #lisp
bendersteed has joined #lisp
cosimone has joined #lisp
hdasch has quit [Ping timeout: 260 seconds]
hdasch has joined #lisp
cosimone has quit [Quit: Terminated!]
wheelsucker49 has quit [Remote host closed the connection]
cracauer has quit [Ping timeout: 256 seconds]
Steinberg2010 has joined #lisp
ukari has quit [Remote host closed the connection]
ukari has joined #lisp
<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)
Kundry_Wag has joined #lisp
<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?!
<flip214>
hmmm, I'm landing in SLDB level 1 instead of staying on the first sldb level
Bike has joined #lisp
nicktick has joined #lisp
sh_zam has joined #lisp
iAmDecim has quit [Ping timeout: 258 seconds]
cosimone has joined #lisp
terpri has quit [Read error: Connection reset by peer]
terpri has joined #lisp
<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.
<beach>
flip214: Can I assume that you are using level 3 of the DEBUG optimize quality?
<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."
nicktick has quit [Quit: Leaving.]
nicktick has joined #lisp
EvW has joined #lisp
nicktick has quit [Client Quit]
nicktick has joined #lisp
Yardanico has joined #lisp
sunwukong` has joined #lisp
nicktick has quit [Read error: Connection reset by peer]
ayuce has joined #lisp
Steinberg2010 has quit [Ping timeout: 265 seconds]
Kundry_Wag has quit [Ping timeout: 265 seconds]
iAmDecim has joined #lisp
sendai_ has quit [Quit: Leaving]
sendai_ has joined #lisp
sunwukong` has left #lisp [#lisp]
iAmDecim has quit [Ping timeout: 265 seconds]
sunwukong has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
wxie has joined #lisp
dddddd has joined #lisp
Steinberg2010 has joined #lisp
luni has joined #lisp
bitmapper has joined #lisp
lavaflow has quit [Ping timeout: 256 seconds]
Inline has joined #lisp
Steinberg2010 has quit [Ping timeout: 260 seconds]
<jasom>
jcowan: coincidentally, I just had a project that saved a large amount of money *because* assertions were disabled in production.
<jcowan>
How was that?
<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.
<jasom>
not saying that your previous statement was wrong, just laughing at the timing.
<jcowan>
Yes, but you were lucky: it could have been that the program went off the rails in the presence of the hardware problem
<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.
<jcowan>
Now Multics VM was a tree of fixed-size segments rather than a flat space.
<jcowan>
s/disk/tape
<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.
<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).
<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.
<jcowan>
Except to wipe everything, reload the OS, and restore customer stuff from backup.
FreeBirdLjj has joined #lisp
<adlai>
clearly, although posessing a reasonable sense of humor, they dropped out before receiving a diploma
<adlai>
any wreathed scholar would've printed `semper ubi sub ubi'
FreeBirdLjj has quit [Ping timeout: 260 seconds]
cosimone has quit [Quit: Terminated!]
ahungry has joined #lisp
<jcowan>
I think Bernie Greenberg learned his Latin in choir
<jasom>
Boatum est upsettum, magno cum grandine venti.
<jmercouris>
something like yasnippet exists for CL?
<jmercouris>
or will I have to write my own?
<jmercouris>
I'm not asking about snippets FOR CL
<jmercouris>
I'm asking about a snippet expander implementation in CL
<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.
<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.
<beach>
jmercouris: For example, (- (length list)) is probably a form if found at the top-level.
<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
<jmercouris>
for example (defclass ${1:name} (${2:inherits})
<beach>
jmercouris: But in (let ((- (length list))) ...) it is very likely NOT a form.
<jmercouris>
the user will be prompted for a name, and inherits, and that value will be filled into a string
<jmercouris>
If I decide to roll my own snippets, which I probably will have to, syntax suggestions?
<jmercouris>
so, if the user supplied name = goldfish, and inherits = salmon
<jmercouris>
then (defclass goldfish (salmon) would be the output from the above snippet
<jcowan>
No? It looks like a form to me, whose value will be locally bound to -.
<jmercouris>
beach: let's start with a most basic question, what *is* a form?
<beach>
jcowan: (length list) is a form, but not (- (length list)).
<beach>
jmercouris: It is an expression that is intended for evaluation.
<jcowan>
oops, sorry for the noise
<jcowan>
O NOES, forms again
<beach>
jmercouris: So it depends on the intention of the person who wrote it.
<beach>
jcowan: I was asleep and noticed that the discussion was all wrong.
<beach>
jmercouris: Therefore it is not an intrinsic quality of an expression whether it is a form or not.
<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.
<jmercouris>
when do you write code with the intent of it not being evaluated?
<jmercouris>
when do you write an expression that will not be evaluated?
<beach>
jmercouris: In (let ((x 10) (y 20)) ...) (x 10) (y 20) are expressions but they are not intended to be evaluated.
<jcowan>
As a silly way of signaling a particular condition
pve has joined #lisp
<beach>
jmercouris: So is ((x 10) (y 20)).
<jmercouris>
oh I see
<beach>
jmercouris: So is LET
<jmercouris>
because the let macro is just using them as data
<jcowan>
I have written things like (/ 1 0) to generate an ad hoc exception
<jmercouris>
to say yes, we want to lexically bind x to 10 or whatever
<beach>
Sort of, except that LET is a special operator, not a macro.
<jmercouris>
OK, but we pretend its a macro for this discussion
<jcowan>
beach: Did you see the discussion of the minimal basis for CL syntax?
<jmercouris>
the one we had some years ago?
<jmercouris>
or a more recent one?
<beach>
jcowan: If I did, I did not pay any attention to it.
<jcowan>
Yesterday
<jmercouris>
you definitely paid attention to it
<jmercouris>
oh, different conversation
<jmercouris>
nevermind
<beach>
jmercouris: Why do you care whether it is a macro or a special operator.
<jmercouris>
i don't care really
<jmercouris>
i was just glossing over the detail
<jmercouris>
saying, it doesn't matter
<jmercouris>
I get your point
dale_ has joined #lisp
<beach>
My point is that whether an expression is a form or not is not intrinsic to the expression.
<jmercouris>
yes, I get it
<jmercouris>
it is intrinsic to whether it is intended to be evaluated
<jmercouris>
or if it is just data
dale_ is now known as dale
<beach>
But you can't know that by just looking at it.
<jcowan>
in any case, any special form can be implemented as a macro, hence the relevance of the minimal basis set
<jcowan>
most of the talk was how to implement IF (other than with COND, obvs)
<jmercouris>
more stuff to think about while I go on my bike ride
<jmercouris>
anyways, I'll be back later, syntax suggestions welcome!
<jmercouris>
for snippets
<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.
Kundry_Wag has joined #lisp
<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.
holycow has quit [Quit: Lost terminal]
Necktwi has quit [Ping timeout: 256 seconds]
<flip214>
beach: my ~/.sbclrc has (safety 3) (debug 3) as default settings, yes. Thanks for the notice about stepping not working for you, too!
<beach>
Sure.
<flip214>
I was wondering whether my nvim/vlime setup was broken in that regard.
<adlai>
jcowan, esto perpetuum hippopotamo, n'est-cepas?
revtintin has quit [Ping timeout: 256 seconds]
<jcowan>
adlai: Seems like good advice, assuming hippopotamo is ablative
jprajzne has quit [Quit: Leaving.]
<jcowan>
hippos can be nasty and staying away is safest
<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.
<jmercouris>
splittist: what is parameterised prompting? I am thinking no validation, it is just for simple form input
Bourne has quit [Ping timeout: 258 seconds]
<adlai>
jcowan: wrt #'if, clearly as a funcall to symbol-plist of one and zero; as a macro, however you like.
<adlai>
minority report votes for symbol-plists of t and nil, and they are wrong, due to being in the minority!
<jcowan>
Thing is, you can't search a plist without an existing conditional operator
<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.
<adlai>
jcowan, sure, that's why you have an invariant, wherein the relevant function is located at a specific offset within the plist
<adlai>
iirc, cl-user mucking with cl plists leads to jokes plagiarised from aristophanes
<jcowan>
You can do a lot conditional-free, especially if you are willing to repeat work, but not everything.
<jcowan>
Ingenious; I have to think about that one
<jcowan>
You'd have to be sure that (setf get) maintains the invariant
grabarz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adlai>
verify in the macro, abuse via manual macroexpansion
Necktwi has quit [Ping timeout: 260 seconds]
Kevslinger has joined #lisp
EvW has quit [Ping timeout: 260 seconds]
revtintin has joined #lisp
<Bike>
you shouldn't need a conditional for dispatch though. you can use something like vtables, can't you?
fengshaun has quit [Quit: bibi!]
<Bike>
i guess in a roundabout way that's the same as keeping the function in a dedicated spot in the symbol plist
fengshaun has joined #lisp
sunwukong has quit [Quit: Leaving]
Necktwi has joined #lisp
cosimone has joined #lisp
<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.
terpri has quit [Remote host closed the connection]
<_death>
(defconstant true 'car) (defconstant false 'cdr) (defun if (test yes no) (funcall test (cons yes no))) ;; add funcalls for flavor
terpri has joined #lisp
<Bike>
as such, in the next lisp revision IF should not be a special operator, thank you for coming to my TED talk
terpri has quit [Remote host closed the connection]
<splittist>
jmercouris: something like (prompt-for thing prompter), so people can specialize prompt-for for different prompting mechanisms (react, repl, terminal, chatbot...)
<adlai>
_death: why not (function car), etc?
<Bike>
in case you want to redefine car and cdr later, obviously
<jmercouris>
splittist: yes, there will be that
<_death>
adlai: because it's not guaranteed to be constant
<adlai>
sure, although i'd hope that (function car) is short enough to be #'eq to (function car)
<Bike>
oh, yeah, if the implementation evaluates it at compile time it can't be dumped
<adlai>
maybe i am just an inveterate optimist.
<jmercouris>
I'm an invertebrate optimist
<jmercouris>
you may not know this, but I am a trilobyte
orivej has quit [Ping timeout: 256 seconds]
<jmercouris>
s/trilobyte/trilobite
<_death>
currently we're troglodytes
<jmercouris>
lol
<jmercouris>
anyone have any document classification in CL?
<jmercouris>
anyone done it?
<jmercouris>
I see some old articles on it
<jmercouris>
but no source...
<splittist>
jmercouris: what is document classification?
iAmDecim has joined #lisp
Steinberg2010 has joined #lisp
lavaflow has joined #lisp
<jmercouris>
document classification is concerned with semantic understanding of documents and plotting them in a 2d vector space
<jmercouris>
usually with the idea to group related documents, or determine what they are about
<jmercouris>
what i'm trying to do here is group tabs by content, for example
<jmercouris>
automatically
<jmercouris>
a common/basic example is TF/IDF
<jmercouris>
term frequency, inverse document frequency
Kundry_Wag has quit [Remote host closed the connection]
<jmercouris>
when you find yourself adding more and more dimensions, good luck getting good clusters
<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
<Bike>
code walking is hard/impossible in lisp for other reasons, unfortunately
<jmercouris>
adlai: also k means requires you to know how many clusters there are
<jmercouris>
my favorite clustering is db scan
<jmercouris>
because I don't like to make ANY assumptions about the document space
Necktwi has quit [Ping timeout: 240 seconds]
<jmercouris>
sure I'll make assumptions about the max distance between nodes etc...
<_death>
dbscan is nice, but slow
<jmercouris>
but even that can be self tuning
<jasom>
Hmm, it would probably be possible to make a working CL code-walker
<adlai>
jmercouris, my reason for skepticism about clustering within 2d spaces is that there are much stricter bounds on planar graph colorings
<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
Bike has quit [Read error: Connection reset by peer]
<_death>
jmercouris: dbscan requires a metric, so you're making assumptions
<jmercouris>
yeah I know
<jmercouris>
thats what I mentioned about above
Bike has joined #lisp
<jmercouris>
still, far better than assuming amount of clusters
<jmercouris>
unless we are making a program called strawberry or not strawberry
<jmercouris>
in which case sure, we can use k means lol
<Bike>
_death: things like sbcl's named-lambda screw it up. probably other stuff, i haven't tried writing a portable walker myself
<jmercouris>
adlai: understood
<jmercouris>
anyways, I'll try to utilize montezuma with some sort of interface first, that's a nice start
<_death>
Bike: yeah.. maybe a portable walker must be extensible
<jcowan>
dlowe: I am willing to trade a little standardosity for a little convenience.
<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.
<jasom>
jcowan: vim totally lets you substitute a pattern with a replacement containing a newline?
<jcowan>
in ex mode?
<jcowan>
s/foo/bar\
<jcowan>
baz/ does not work, you end up with a line "opening bar^@baz closing"
<jcowan>
this is a very very longstanding bug
<jcowan>
At least vim 7.0 fixed the bug whereby undo in ex mode would rewind you to the last time you were in vi mode, which in my case is the beginning of editing!
<beach>
How is all this related to Common Lisp?
iAmDecim has quit [Ping timeout: 258 seconds]
gko has quit [Ping timeout: 265 seconds]
<edgar-rft>
Everything is related to Common Lisp, but most of it is not conforming.
<dlowe>
... when editing common lisp code
<pjb>
Well, I already have an ed(1) in CL. Somebody could extend it to make it a vi(1), but indeed, it would require non-conforming libraries…
<pjb>
On the other hand, the problem mentionned above is in the regexp library, so this can be implemented and corrected conformingly.
z147 has joined #lisp
iAmDecim has joined #lisp
dreamcompiler has joined #lisp
iAmDecim has quit [Ping timeout: 240 seconds]
terpri has joined #lisp
dreamcompiler has quit [Client Quit]
<jasom>
pjb: you could implement emacs in CL, and then just use evil-mode to get vim
ggole has quit [Quit: Leaving]
<jcowan>
pjb: pointer?
<dlowe>
jasom: someone tried this but was unable to get sufficient buy-in
asarch has joined #lisp
joels has joined #lisp
<flip214>
jcowan: is vim 7 still relevant? there's vim 8.2.0510, and neovim...
<jcowan>
vim 6 and before: bug. Vim 7 and after: no bug
<jcowan>
I sent Bram Molenaar a Google peer award for releasig vim 7 while we were both working there
<pjb>
jcowan: unfortunately, I haven't completed my regexp library. You will have to hook it to cl-ppcre.
<asarch>
ed!
<eta>
is the standard text editor?
<jcowan>
LGTM. I want to use it as a library: would you consider dual licensing under the LGPL?
<pjb>
No, I will stay with AGPL3 for the foreseable future. You might get lucky, and find an old version licensed under LGPL, but I don't distribute it anymore.
<asarch>
sam!
Inline has quit [Ping timeout: 246 seconds]
<asarch>
wily!
iAmDecim has joined #lisp
Bourne has joined #lisp
xuxuru has joined #lisp
v0|d` has joined #lisp
v0|d has quit [Ping timeout: 265 seconds]
v0|d` has quit [Ping timeout: 265 seconds]
asarch has quit [Quit: Leaving]
wsinatra has quit [Quit: WeeChat 2.7]
cracauer has joined #lisp
chipolux has joined #lisp
revtintin has quit [Quit: WeeChat 1.9.1]
gravicappa has joined #lisp
jmercouris has quit [Ping timeout: 250 seconds]
EvW has joined #lisp
karlosz has joined #lisp
Inline has joined #lisp
<splittist>
bravo!
<jcowan>
I like sam, but I think its command mode could use a few improvements