freenode/#lisp - IRC Chatlog
Search
15:29:20
Josh_2
Whats the go to way to update already dumped lisp images? Do you normally just tell users there is a new version and get them to swap them out? Surely they could just update their running image?
15:32:38
Josh_2
I dont want to tell a user that they have to keep changing out their lisp image, I'd rather they just ran a script and it updated itself while running, I'm sure someone has done this before
15:36:02
etimmons
Josh_2: I don't know of any way to switch images while running. But if you distributed fasls you could load those into a running image to "patch" it.
15:36:39
Josh_2
sorry I wasn't clear enough, I don't mean swap images, thats equivalent to just getting and starting a new binary
15:37:37
Nilby
Updating from code is fairly easy, but can have problems. Most Lisp's can't update the image and keep running said code.
15:38:49
etimmons
White_Flame: If you're going to distribute a MacOS binary that depends on libssl, I'd recommend using the OS provided libs instead of the ones from Homebrew.
15:38:55
phoe
you could also architect your image in a way that allows it to check for updates before running everything
15:39:30
etimmons
White_Flame: IIRC, Homebrew's openssl doesn't integrate with the system keychain to get certificates and such.
15:39:59
phoe
etimmons: AFAIK libcrypto.dylib fails on modern macos/apple silicon because it has an unversioned API and Apple decided to make this a breaking change
15:40:00
Josh_2
phoe: that could work because the program is user facing and could just receive a command to update which would stop and restart it
15:40:08
Nilby
I would just reload with asdf, and the next time it got a request it would run the new code.
15:41:10
Josh_2
I also want to be able to hotload code straight into my running image, so that modules can be added/removed from my project as the user chooses
15:41:55
etimmons
phoe: There's a patch to fix it in https://github.com/cl-plus-ssl/cl-plus-ssl/pull/115. You can also work around it until the PR is merged by loading the versioned dylib yourself and pushing :cl+ssl-foreign-libs-already-loaded to *features*
15:41:58
Josh_2
Okay cool beans. I've know very little about fasls files, I guess It's time to change that
15:43:18
etimmons
White_Flame: your pastebin has /usr/local/opt/openssl/lib/libcrypto.dylib as the path it's trying to load. I think that's the Homebrew path
15:44:18
White_Flame
hmm, so at startup sbcl doesn't search the library path for dylibs, but rather just hits the exact same path that was used when the image was saved?
15:44:36
etimmons
Nothing wrong with that per se, but if you're going to share it with people that don't have Homebrew installed, I think they'll have a not-so-great time when that lib looks for trusted certs where Homebrew installs them
15:46:12
etimmons
So if you load the foreign lib "libssl.so" then it'll search again on startup. But if you give an absolute path, it'll try using that path exactly
15:46:40
White_Flame
so whatever cl+ssl or whichever dependency is loading that determines how the load happens
15:47:26
etimmons
cl+ssl uses many hardcoded paths on Darwin: https://github.com/cl-plus-ssl/cl-plus-ssl/blob/master/src/reload.lisp#L44
15:49:56
etimmons
If you want more control over which is used, look at my message to phoe about loading the dylib manually
15:58:38
etimmons
No worries! libssl is always a bit of a difficult library due to potential integration with OS keychains and such
15:59:11
etimmons
Another solution for other libraries is to statically link them into the runtime (assuming you have static libraries and the license allows such a thing)
16:00:31
etimmons
I do that quite frequently with SBCL on Linux. I assume it's not much more challenging on MacOS
16:01:03
White_Flame
however, as you bring up the user's keychain issue, that certainly is intimately tied to what's going on in the deployed OS, and not just carried-along algos
16:04:01
White_Flame
hmm, as this is basically a localhost-only application, I probably should be looking to see if clack et al can be built without https dependencies instead
16:05:54
etimmons
Are you using Hunchentoot as the underlying webserver? If so, push :hunchentoot-no-ssl to features before loading it.
17:05:40
Xach
fun fact: i have had some weird errors when doing that, and the root cause was that different *features* contexts still used the same cached fasl
17:23:14
White_Flame
Xach: a make.sh that does rm -rf ~/.cache/common-lisp covers a great many compile-time sins :-P
17:31:55
White_Flame
well, that is the definition. It's sort of like C where anything non-zero is true, and zero is false (might not be correct to the C standard, but that's what's functionally done)
17:40:24
White_Flame
afair, readline isn't used at the plain terminal due to licensing incompatibilities
17:53:42
jasom
iekfkk: even if you don't use emacs as your editor, it's good to use SLIME as your REPL. I developed lisp that way for many years.
18:34:46
jasom
iekfkk: it's also idiomatic to define dynamic variables (similar to globals in other languages) with asterisks on the side *like-this*
18:36:49
White_Flame
for LET, function parameters, etc, you can't use T either as a local variable name
18:37:22
jasom
it's mildly annoying when writing parametric functinos where t is conventionally used, but otherwise not a big deal
18:39:49
jasom
iekfkk: according to wikipedia it comes from kinematics where the equations are parameterized on time
18:40:11
iekfkk
ahh math ok of course math was what i was thinking especially matrix A,B vs a,b small letters CL doesn't differentiate
18:41:03
jasom
_death: right but for math it often is just "people use t in this equation and it only stands for an abstract value" that's the only time I'm ever bothered by not having t available
18:41:45
jasom
and even then it hasn't bothered me enough to shadow cl:t so obviously not that big a deal
18:43:37
jasom
iekfkk: ":" is the package separator if you want to have a variable that contains ":" in the name you need to quote it e.g. |C:X| or c\:x
18:44:33
White_Flame
ACTION greps for "stupid" in his codebase and gets hundreds of lines of very ... verbosely named variable names & functions
18:45:03
specbot
Character Syntax Types: http://www.lispworks.com/reference/HyperSpec/Body/02_ad.htm
18:45:37
jasom
anything that's a "terminating macro char" can't be used unquoted as part of a symbol (and therefore as a variable name)
18:46:18
jasom
anything that's a "non-terminating macro char" (i.e. just #) cannot be used unqouted at the begining of a token
18:48:01
specbot
Valid Patterns for Tokens: http://www.lispworks.com/reference/HyperSpec/Body/02_ce.htm
18:55:52
jasom
iekfkk: yesl when I said you can't use "T" as a variable name, I actually lied. variables are named by symbols, not strings. COMMON-LISP:T is not allowed, but MY-PACKAGE:T *is* allowed. When you import most symbols from another package, but exclude a few, that's called "shadowing"
18:57:42
jasom
that being said, be kind to anybody who might read your code down the line, and don't shadow T. It will only confuse them.
19:01:31
jasom
you can use readtables to get case-sensitivity, but that is rarely used, and when I've seen it used usually case is inverted so "t" would be true and "T" would be free for use. If you do case preserving rather than case inverting your code looks like (DEFUN foo (bar baz &REST r) (LET (b) (CAR baz)))
19:07:40
White_Flame
iekfkk: also, #clschool is another channel that focuses on beginner answers. Complete answers are normally found here :)
20:30:19
mfiano
(multiple-value-bind (first-value second-value) values (declare (ignore first-value)) second-value)
20:47:19
White_Flame
(second (multiple-value-list (func....))) appears to be non-consing in sbcl when optimizations are cranked
21:33:38
VincentVega
Do compilers optimize away asserts on low safety levels? Or under some other conditions? I am thinking of replacing an assert with a when + error, because I want to signal a specific condition and not just simple-error, but it's in a somewhat intense place, so I am a bit unsure if I should do that. Tips?
21:38:55
Alfr
Maybe if the compiler can prove that it's always true, but otherwise it need to be checked.
21:39:18
White_Flame
you can always make your own compile-time decision whether or not to include checks with macros
21:40:08
White_Flame
I've made a bunch of this sort of thing where the flag can be compile-time off, runtime selectable, and depending on the flag's value per-situation checked
21:42:03
VincentVega
_death: gee, skimmed the page for it 3 times, only now I see that it's datum, thanks!
21:50:05
White_Flame
set it from the repl before recompilation to change between compile-time & runtime
21:51:06
VincentVega
Gotcha. Was hoping for maybe some sort of an asdf-level thing on system-load, but I guess this works too.
21:52:09
White_Flame
I've built way too many things to count, that ended up already being in, or eventually created in, asdf or alexandria :-P
21:53:09
White_Flame
but yeah, for this sort of thing we tend to have tons of debug tests that are either too huge on the logs to be readable, or too heavy on inner loops to keep on all the time, so flexibility is nice
21:56:04
phoe
_death: "you can give assert a condition to signal" an actual condition? isn't it just an error with a customizable report?
22:11:27
specbot
Condition Designators: http://www.lispworks.com/reference/HyperSpec/Body/09_aba.htm