freenode/#lisp - IRC Chatlog
Search
9:27:37
ogamita
shrdlu68: I dare you write an implementation of LISP in Common Lisp. Call it (ql:quickload "lisp²")
10:14:36
d4ryus
hi, is there a way to create a in memory stream? I would like to pass one 'end' to a thread running uiop/run-programm and the other 'end' to a thread which reads from it.
11:06:03
lieven
the standard doesn't describe threads so adding those would be an exercise for the reader
11:07:51
d4ryus
but sadly uiop/run-programm does not write into the stream until the programm has finished :(
11:08:08
lieven
a good match for that problem is the mailbox API. it's native in lispworks and there are ports to other lisps
13:05:40
jmercouris
suggestons for ORM for CL? I'm already experienced with Crane but am open to other solutions
13:16:02
jmercouris
The problem that I have with ORMs is centered around issues with forein key relationships
13:16:07
jackdaniel
updating db deserves its own application-specific api but mixing it with object access isn't a fine idea (conceptually speaking)
13:17:06
jmercouris
do you have some sort of SQL directory where you write scripts that get executed manually to udpate the schema as necessary?
13:17:34
jmercouris
aka, how do you handle migrations, without an ORM that will generate them for you automatically
13:18:33
jackdaniel
keeping object relations and database relations model consistent is a hard (and unnecessary) thing.
13:18:56
jackdaniel
as I said, having abstraction to *access* database is fine, just mixing it with your objects is not
13:19:36
jackdaniel
as of keeping sql scripts in a directory: it is a fine idea like any other, but writing dsl for updating your relation and using this dsl in your migration functions is fine as well
13:22:12
jackdaniel
In other words you ask me how would I handle a problem without ORM which is introduced by ORM itself (automatic migration of class relations)
13:23:40
jmercouris
and we are just using raw SQL to access different columns and rows from a database
13:24:22
jmercouris
we'll change the code and change the query to also use the new column, however we have to ensure that when the new code is run, the database also has the new column
13:25:19
jmercouris
ok ok ok, so I re-read your message, and let me see if I understand what you are suggesting
13:25:49
jmercouris
you are suggesting that a SQL dir to update things is fine, and what-not, but you'd have something like a "DB-Access" package or something that you'd use to abstract getting data from the database
13:27:02
jmercouris
and you are saying that maintaining parity between the database structure and this DB-Access abstraction is not a huge issue since the code is all in one place, or what?
13:28:17
jackdaniel
I'm saying that your persistent data model is a separate thing than your runtime class hierarchy. When you change database schema, you need to write migration function (which calls dsl or loads hand-written scripts) which: a) updates schema, b) bumps databa schema version number
13:29:21
jmercouris
so, on the start of program execution, you make sure that these hand written scripts are run?
13:29:49
jmercouris
aka you check that the schema version number is as expected, and if not, you traverse your functions to get to your current version
13:30:16
jmercouris
do you maintain a separate table in your database for this? something like "schema-version"? that has an int or something?
13:30:49
jackdaniel
that's the way to do it. it may be a bit more general, like next-meta-information ;-)
13:30:53
jmercouris
have you found yourself doing this a few times? is there a library for this? do you think a library to do this would be useful?
13:31:54
jackdaniel
I'm working with a codebase which manages database that way and I find this abstraction very convincing. as of library: migration (if we skip dsl and actual migration script body) is a dozen of lines or so – such library wouldn't be useful
13:40:11
ogamita
jmercouris: ORM = impedence mismatch. Basically the problem is that to do it conveniently, you need to introduce a cache in the client host, and when each client has its own cache, then things break apart.
13:41:05
ogamita
jmercouris: you could have caches on the clients if they were integrated in a OO database, ie. synchronized with the other clients. But then, what do you think will occur when your OODB software needs to synchronise hundreds of clients!?!?
13:45:18
jmercouris
you are right, I actually want an object database, but none of them are mature enough to use
13:45:38
ogamita
Well, EOF-1 was not that bad, but it has been dropped by Apple, so it must have had some problem that I didn't see…
13:46:55
jmercouris
there was nothing enlightening in their marketing materials about how to obtain a copy
13:48:20
jmercouris
however I'm not interested in writing a CL object database at this time, I have enough on my plate
13:48:57
jmercouris
right, I mentioned that above, but it costs money and I don't even know how to buy it
13:48:59
dlowe
I've found through experience that the best DB abstraction is treating the whole DB like the backend for a very capable abstract collection.
13:49:50
ogamita
jmercouris: note that your objects can still know how to save and load themselves in a sql database!
13:49:51
dlowe
anything more granular and your abstractions will leak all over the place and you'll be writing bare SQL and cursing
13:51:36
jmercouris
however these defmethods will be within the db abstraction package and probably only used locally in functions
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).