freenode/#lisp - IRC Chatlog
Search
14:20:08
fe[nl]ix
phoe: I'm back from vacation and I'll take a look at the split-sequence issues sometime soon
14:22:42
vasu
I can chat here from weechat-matrix without any difficulty. But my riot app says "You do not have permission to post in this room". Weird
14:24:22
beach
vasu: Feel free to ask questions. Notice that this channel is dedicated to Common Lisp. For other dialects or comparisons between them, there is ##lisp. And for really trivial language questions, there is #clschool. Either way, you will be told if you are too much off topic so don't worry about it.
14:27:55
beach
vasu: Oh, and Common Lisp has several implementations, so it is a good idea to consult us before you choose your environment. It is easy to get it wrong.
14:35:16
jmercouris
while we are on this off-topic train, I have a problem I am trying to solve with ironclad, unfortunately it is not trivial
14:36:00
jmercouris
I want to store passwords in a database, encrypted, such that if someone were to get access to the database they could not figure out *what* the passwords are
14:36:29
jmercouris
I, as the administrator, want to be able to view the passwords in cleartext and know what they are
14:36:43
jmercouris
the only thing that comes to mind is encrypting the passwords using my public key
14:36:55
dtornabene
hey all, quick survey question: I've got a relatively simple web app, with postgres, written in CL using SBCL and I'm wondering what people use for hosting a site like that. Like, VPS, Cloud, something else? No wrong answers just trying to figure out where I want to head
14:37:37
jmercouris
so, to answer you rquestion literally, VPS, it gives you the most control, which can make a huge difference
14:38:32
jmercouris
you could also purchase a computer and run it in your house, but your VPS probably won't like that, Xach's solution is the closest you can realistically get to that without purchasing a business line
14:39:06
jmercouris
I know shinmera uses some swiss company who is apparently really good as well, I can't remember the name though
14:39:27
Xach
i had a website that processed tens of thousands of images per day on modest dedicated hardware with sbcl and it worked well for several years.
14:40:11
dtornabene
i'm leaning more toward at least checking out digital ocean given the secrutiy issues linode has had over the recent years
14:40:58
dtornabene
thanks y'all for the speedy replies, i'll send a link when its up if anyone is interested
14:41:36
Xach
it looks like it is still plugging away on common lisp. when i was running it, the only real maintenance needed was periodically cleaning up temporary files.
14:43:44
dlowe
jmercouris: force pw resets like the rest of the world and don't peek at your users' passwords
14:44:05
jmercouris
dlowe: I'm not peeking at them for my enjoyment, it is necessary to have a confidential string
14:44:12
Xach
dtornabene: well, i signed up many years ago, and am grandfathered in on some very cheap hardware. it has been very cheap and very reliable for years. i am not 100% sure what a new person signing up today would experience, but i have been very happy with my stable happy service.
14:44:24
jmercouris
that the administrator of the website I'm developing can peek at to do their job
14:45:20
jmercouris
ok, so the solution I came up with above, I just wanted to make sure there wasn't a smarter way then
14:45:49
jmercouris
I mean, I don't plan on the database being compromised or anything lol, but it would be nice for the data not to leak since it will be encrypted
14:46:09
jmercouris
now if the administrator's private key is compromised *AND* the database is compromised, then we have a shit show on our hands
14:46:45
Xach
another failure mode is the administrator is malicious and tries user passwords on other sites.
14:46:48
dlowe
though you're going to have to figure out a way to bring them together somehow in order to use them
14:47:16
jmercouris
if they were being malicious with this information, they would quickly go out of business
14:47:50
jmercouris
yeah I get that, I'm just saying, the admin will not be malicious, as it would be destroying their own business
14:49:02
Xach
sure. i have the luxury of not advising or working with someone who sets requirements like that.
14:49:05
jmercouris
dlowe: What did you mean by "you're going to have to figure out a way to bring them together somehow in order to use them"?
14:51:23
dlowe
jmercouris: if you are providing an interface to the secrets, then the interface must have access to both the private key and the db
14:53:21
ogamita
It's more a question of default assumption on the public, between #lisp and #clschool; In the later, it's assumed questioners don't know anything. In the former, it's assumed they already know CL, and a mere clhs reference is enough to answer their question… Plus in #lisp we have highly technical discussions about implementation of CL.
14:55:40
jmercouris
but again, it is not for their amusement or enjoyment or anything, it is so that they can do their job
14:56:11
jmercouris
kind of how you give a key to a repairman to come in and do some repair on your house while you are away from home
14:56:40
jmercouris
sure they could destroy your kitchen, make copies of your key, run a string of burgularies down the road etc, however if they want to stay in business, they won't do that...
14:56:54
wglb
dtornabene: Friends don't let friends use linode. I use digital ocean for simple mostly static web sites, and price is certainly reasonable.
14:57:55
jmercouris
anyone who has access to private information could extort you, your doctor could extort you as well using your private medical information they have access to, nevertheless they need that information to do their job
14:58:16
jmercouris
and if they did extort you, they would lose their job, its the exact same scenario here
15:04:46
scymtym
#clim encourages me to share these demos of the work-in-progress inspector rewrite with you: https://techfak.de/~jmoringe/new-inspector-1.ogv https://techfak.de/~jmoringe/new-inspector-2.ogv
15:07:23
phoe
fe[nl]ix: welcome back! There are still some things to be done there (some refactoring remarks from beach et al) - I'm waiting for my sickness to let go of me so I can properly focus and finish them.
15:07:40
Xach
I wish there was some audio narration - in some cases I don't understand what is happening on screen
15:08:46
beach
And it could be slowed down a bit so I have time to see the different options in the menus.
15:08:51
scymtym
Xach: sorry. these were originally meant for #clim participants who know clim's interaction model as well as the current inspector
15:13:10
scymtym
thanks for the feedback. maybe i can make a better demo when i'm further along. but the code will probably be available as a mcclim branch soon-ish anyway
15:47:11
shka__
well, now when you mentioned kerning i see it as well, but what struck me is how smooth fonts look
15:48:48
scymtym
shka__: jackdaniel: i'm using the default backend so all improvements must be due to changes in mcclim
15:50:13
scymtym
shka__: the default font size changed (increased) at some point. that may make other improvements more noticable
15:51:33
shka__
oddly enough, if not by those old school scrollbars it would look like modern-ish minimalistic design
16:47:47
hjudt
i need to catch errors at the top-level in a script that is called by sbcl --load. however, when i put e.g. (load ...) or (uiop:run-program ...) inside a handler-bind, then it errors out with "package uiop does not exist." what can i do about this?
16:49:46
sjl_
hjudt: it would be easier for us to debug if you can paste the code (or a minimal example) somewhere
16:50:22
hjudt
sjl_: https://github.com/container-lisp/s2i-lisp/blob/master/1.0/root/opt/app-root/install.lisp
16:53:21
hjudt
in short: (handler-bind ((error #'(lambda (condition) (format ...) (sb-ext:exit :code 1)))) forms...)
16:54:29
sjl_
(also you don't need handler-bind if you're just going to bail entirely, handler-case would be plenty, but that's orthogonal)
16:55:59
hjudt
ok, goal: try to execute all forms, if there are any errors exit with error code. the original error should be printed to give a clue what happened.
16:56:05
sjl_
Well if you wrap the whole file in it, then lisp will need to finish reading the entire form before it can start executing it
16:57:16
hjudt
i actually started defining a function exit-with-error to wrap single statements in it, that should help.
16:58:18
hjudt
sbcl doesn't seem to quit to the os with an error code when something fails, but i need it to do that, otherwise the build will be reported successful.
16:58:28
sjl_
I mean, you might be able to get away with just using `sbcl --disable-debugger --load ...`
18:57:25
minion
pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
21:53:26
jackdaniel
without peeking into repl: (let ((x 3)) (loop as x = x then 4 do (print x) (return)) ; what is printed?
22:07:12
jackdaniel
I don't know, I've treated it as a no-brainer to initialize a variable (and shadow it lexially)
22:08:04
jackdaniel
no-defun-allowed: are you sure you didn't peek in the repl? otherwise, what is your reasoning behind getting NIL first?
22:10:34
aeth
jackdaniel: I noticed this because I use :of-type a lot in my loops, which catches that.
22:10:54
Bike
well, for a "for x = x" binding i would expect nil, yes, because i've done it before and got some bullshit like that
22:12:12
Bike
"he for and as keywords are synonyms; they can be used interchangeably." oh, alright then
22:12:22
aeth
lol in this particular case in SBCL, of-type doesn't catch the NIL not being an integer it turns it to 0: (loop as x of-type integer = x then 4 do (print x) (return))
22:14:35
no-defun-allowed
jackdaniel: no, i did think about that one, since i've been bitten by that before
22:15:02
no-defun-allowed
LOOP binds new variables to NIL, so `(loop for foo = foo ...)` binds foo to NIL
22:15:36
no-defun-allowed
something like (let ((foo 42)) (loop for foo = foo then (next foo) ...)) doesn't work, since foo gets bound in the LOOP first
22:15:47
aeth
no-defun-allowed: except if you add "of-type integer" to the example code jackdaniel posted you get 0 in SBCL!
22:16:11
no-defun-allowed
didn't know that though, probably needs to get the uninitialized type right
22:16:46
no-defun-allowed
i don't want to read through MIT loop but it's probably in there, since the "uninitialized" value has to have an appropriate type
22:16:50
aeth
Well, I guess SBCL and CCL do the same thing that they do for array default values here.
22:17:17
aeth
as in, NIL unless it can't be NIL, in which case it's the appropriate type's 0 (e.g. 0 or 0f0 or 0d0) or #\Nul
22:31:56
specbot
Local Variable Initializations: http://www.lispworks.com/reference/HyperSpec/Body/06_abb.htm
22:31:59
pillton
"If the optional type-spec argument is supplied for the variable var, but there is no related expression to be evaluated, var is initialized to an appropriate default value for its type."
22:34:02
aeth
This doesn't work for every type because not every type has a default value. e.g. string (surprised it wasn't an empty string) or (integer 3 4)
22:34:32
aeth
Actually, I think (integer 3 4) should have an appropriate default value: the number closest to 0 (so in this case, 3) since 0 itself is off limits but would otherwise be the default
22:38:47
aeth
It would be nice to have a standard default value and a way to retrieve it given a type specification. So (type-default-value 'integer) would be 0 and (type-default-value '(integer 3 4)) would be 3 (closest to 0) etc. Then you could define your own. Obviously would have to rely on some portability library.
22:40:21
aeth
Even better if it handled types like '(or null foo) and was able to detect that NIL is preferable there even if foo has a default. Would be hard for something like '(or integer character) though.
22:44:28
aeth
Well, you would want to prefer NIL when NIL was possible. You'd also want to prefer the simplest 0 possible (probably 0 then 0f0 then 0d0 or something) for numbers.
22:46:00
aeth
You'd probably want to prioritize empty sequences, or sequences of default values of the minimum length if 0 is not allowed. Sequence hierarchy would probably be NIL before vector (i.e. #() if empty) before specialized vector (like string's "")
22:46:16
aeth
I can see why this wasn't standardized even though there are several places that rely on default values
22:53:52
aeth
pjb: Type rules would be the hard part to solve, but imo would be worth solving. It would mostly be AND/OR combinations as well as numbers and sequences that would be tricky. Hard, but a finite problem.
22:55:43
aeth
Satisfies would be impossible to solve here afaik. Would probably just be best to extend deftype at that point.
23:07:12
aeth
pjb: well, having a method that could override the default for a class would be preferable to a specified initial-element every time imo
23:08:45
aeth
Types are trickier. "Closest to 0 in a range and of the simplest type" probably makes the most sense for numbers. "Closest to length 0 and if not length 0 filled with elements of the default" makes the most sense for a sequence type. AND, OR, SATISFIES, etc., might be too hard, although I'd really like to see (or null foo) work at the very least.
23:18:52
pillton
I'm not sure all of this complexity is worth it. What is appropriate depends on the context as is illustrated by finding the maximum element of an empty sequence.
23:23:31
aeth
pillton: But it would be very useful for custom defstructs/defclasses where you provide a type and get a reasonable default value from that automatically, even if no implementation uses it for LOOP, MAKE-ARRAY, and wherever else the standard uses defaults.
23:25:10
aeth
Right now the only easy automatic default value is NIL, which requires the type to be (or null ...) or one of the handful of types that supports NIL (list, sequence, symbol, boolean, T, etc.)
23:26:26
aeth
You also see default values in gethash and a few other places (in the function calls themselves), which other macros/functions might want to override in a somewhat smart way.
23:43:39
pillton
For that case you could use the prototype object specified by MOP. (What I and pjb said before).