freenode/#lisp - IRC Chatlog
Search
15:36:20
attila_lendvai
there's also cffi/c2ffi for autogenerated FFI's. here's a simple example using it: https://github.com/attila-lendvai/hu.dwim.bluez
15:36:51
Shinmera
shka: This is so that Radiance can know what to change when you make a redefintion.
15:38:56
samla
Fucking he'll, why didn't I bring with me my copy of coders at work for him to sign. I'm a failure
15:41:52
makomo
Shinmera: i have to say, i'm always surprised by the amount of stuff you have produced :-)
15:42:25
makomo
for example, seeing some of your projects and then a line like "it uses X, Y and Z under the hood". following the links you discover that all of X, Y and Z are also made by you :-)
15:43:43
makomo
i would like to ask, is there a general description of the problems web frameworks in general are supposed to solve
15:43:43
shka
Shinmera: i wonder how i should handle redirecting from account creation to my main page
15:44:02
makomo
or rather, the individual components of web frameworks maybe. for example, "routing"
15:44:29
makomo
i have a vague understanding of what routing is supposed to do/does, but is there an actual book/article explaining in detail the abstract notion of such stuff
15:44:34
Shinmera
makomo: People have different ideas about what a framework is or should be, so, not really.
15:46:32
Shinmera
I don't think there's currently a way for registration. There is one for logging in, at least.
15:46:52
makomo
Shinmera: nice work though! i like when the documentation is prose, rather than just a huge reference. imo, the first thing in the documentation should always be the definition of the problem the library is trying to solve, or a concept/motivation of some sort
15:47:07
Shinmera
Which is to simply put the URL to redirect to as a get/post parameter called "landing-page"
15:51:16
Xach
borodust, Shinmera - you are two folks who provide custom dists. Are you up for starting to sign your dists with opengpgpgpg?
15:51:55
Xach
There is no procedure yet, but I am wondering: do you have a key, are you willing to use it, etc.
16:01:09
borodust
Xach: yes, if that would be fairly easy to do (sign a dist) i'm certainly up to it
16:02:04
sjl
Xach: is there any way library authors can subscribe to QL's build/test process so we get notified when our projects break?
16:02:20
sjl
right now my strategy is basically "happen to see the quicklisp account post something on twitter"
16:02:57
sjl
Shinmera: that's a start... per-project feeds would be great, because I really only care about a few particular ones (mainly my own)
16:09:53
Xach
They are always all posted to http://report.quicklisp.org/ also, but that's a view that maximizes my convenience, not anyone else's
16:12:03
Xach
sjl: I've sometimes thought about auto-posting github issues, but I can think of so many failure modes that I hesitate.
16:12:31
Shinmera
There is that thing with github where you can be an "application" like travis that shows build success on commits and PRs
16:12:56
Shinmera
It won't notify you about it, but when you look at a commit it'll show you whether it passed a check or not.
16:34:18
malice
Hi! Is there a Common Lisp standard available on ANSI page? I tried looking for it but I couldn't find it. I want to reference it, I don't want to buy it and I'm aware of its low quality.
16:35:15
beach
malice: ANSI is a for-profit company, so they would not give their standard for free.
16:35:23
Xach
malice: https://webstore.ansi.org/RecordDetail.aspx?sku=INCITS+226-1994%5BS2008%5D perhaps
16:36:17
malice
Xach: I'm writing my Bachelor thesis and wanted to provide a reference to Ansi standard when I'm mentioning that CL has one
16:37:00
shka
https://stackoverflow.com/questions/44389464/align-the-form-to-the-center-in-bootstrap-4
16:37:52
sjl
malice: there's a bibtex hunk for it at http://ftp.math.utah.edu/pub/tex/bib/ansistd.html
16:38:46
shka
Xach: because I am at the point that I want to pull the middle finger, and quit this farse
16:38:52
sjl
Assuming you just want to reference the standard as a whole and not some particular page/section.
16:40:29
shka
Xach: that to, but this thing I can do calmly, believe it or not I am trying to get my bachelor degree as well
16:41:03
Xach
shka: I don't really care what you personally use but please don't recommend it as a primary reference to someone who might not know better.
16:41:09
beach
malice: Did you get what you needed. Otherwise, look in SICL/Papers/Type-inference/type-inference.bib
16:43:12
shka
Xach: but why? cltl2 is a good book IMHO. It's only drawback is that it was written before standard was finalized.
16:44:11
Xach
shka: it has good prose, and is good to supplement or augment the reference material, but there are areas where it describes non-standard behavior as standard. It should not be encouraged as someone's first primary reference.
16:44:43
Xach
I really liked reading it cover to cover. It has some warmth and humor and fills in some historical details with sloppy but enjoyable writing.
16:45:30
Xach
And I mean "sloppy" in the sense of being a little convoluted and human, rather than the dry and precise stuff in the final spec.
16:45:36
jackdaniel
last time I've checked CSS doesn't look like sexprs, so if LASS is still CSS – it doesn't neither ;)
16:46:04
Shinmera
jackdaniel: What makes CSS painful is all the options and values and how they model the UI. That does not change with LASS.
16:46:08
loke
ACTION agress with Xach. I don't think I would have appreciated CL as much if it wasn't for the fact that my boos gave me a copy of the book back in... hmm... late 90's?
17:33:23
shka
Shinmera: so i was wondering, how I should handle submit if i don't want to use templates?
17:39:04
Shinmera
Typically form submission should happen to API endpoints so that they can be used programmatically as well
17:42:05
Shinmera
The page will output whatever you return from it, or whatever you explicitly store in the response object's data
17:55:29
shka
Shinmera: anyway, whole gist of define-api is that code is launched on :submit, is that correct?
17:56:52
Shinmera
When you have a form and the user clicks submit, the browser opens another page with the form data as parameters.
17:57:29
Shinmera
API endpoints are pages that do argument parsing for you to some extent and have a stricter scheme about how they can be reached.
18:22:36
Shinmera
(define-api foo ()) will be reachable at /api/foo, (define-api foo/bar/baz ()) will be reachable at /api/foo/bar/baz
18:30:58
shka
Shinmera: well, that would be it for today, I must say that you were of great assistance to me today, thank you
18:32:24
osune
while we are talking webframeworks on CL: Currently I run my Telegram Bot in long poll mode, but I can use a single webhok too. Assuming I'm a embedded C programmer (no significant server side expirience) , should I even look at radiance or is something barebones like lack a better start for me to provide a single uri which gets POST requests with json data ?
18:34:41
Shinmera
One of the core points of Radiance is to allow you to run multiple web applications in a shared environment. So if what you're developing is a component that could be reused by other people, then Radiance is a good fit.
18:37:34
osune
So if I would want create a full blown REST api Radiance would be a good fit? I assume I need to know how the server under the framework works to use/understand any framework?
18:38:06
Shinmera
Well if you create an API or web thingy that might be useful to other people then sure.
18:40:50
Shinmera
osune: The server is basically just responsible for listening on a port and translating the HTTP structure to some internal format. Typically an object.
18:42:08
Shinmera
So all you need to understand is on which URL your functionality will be reachable, how to access request data, and how to return response data.
18:43:46
osune
For the telegram bot I need to provide a customized URL ( https://www.example.com/<bot-token> ). So far I understand that the server does no routing and I would need a Framework which can dispatch on a URL. Did I got this right?
18:44:15
Shinmera
Well you can do the routing yourself. Which is trivial especially if you only have one thing to reach :)
18:45:13
Shinmera
Routing in Radiance is a bit more complicated, but in most frameworks all it is is a list of "pages" and some regex that the current request is compared against.
18:47:14
Shinmera
Anyway, just have a look at Hunchentoot's documentation. It's good and shows a simple example that should get you started in no time.
18:50:00
osune
If I would using python , probably would take flask ( I dabbled a bit with cherry-py a few years ago ) for this task. So I wondered where to start with CL. Thanks for the starters
18:54:22
osune
jackdaniel: I took a look at the ecl cffi backend. They use quite excessive the uffi compatible interface, which is somewhat marked as "depricated". I feel conflicted if I should use it or not (the uffi interface would staisfy my needs). Can you give me absolution?
19:00:09
osune
I must have over estimized the meaning of "New code shouldn’t use this interface preferring CFFI." , because the SFFI interface is said "to be only used if ECL is your deployment platform". I understood it as you should use CFFI if possible , and SFFI as fallback.
19:00:47
jackdaniel
UFFI is ECL's exported interface for FFI (which is interface-compatible with original UFFI)
19:01:05
jackdaniel
CFFI is portability layer between implementations which makes a portable interface for FFI
19:01:46
jackdaniel
in case of ECL, it uses UFFI-compatible interface, because that's what ECL provides. In case of SBCL it will use sb-alien package interfaces etc. If you use sb-alien package, you can't expect it will work on other lisps
19:01:53
osune
but one can use UFFI in a static context too, at least that is what I got out of the ecl backend in cffi?
19:03:45
jackdaniel
CFFI can use static ffi of ECL as well, that's just the way how calls are compiled
19:06:23
osune
ok so all this is a understanding on my side regarding the manual which I had prior to taking a look at the ecl backend in cffi as you suggested. Thanks for the confirmation :)
19:24:04
osune
jackdaniel: another question still bugs me since yesterday: where is cl_load defined? in c/load.d is LOAD defined and it uses cl_load, so it is already in available in ecl_min. When searching for cl_load (https://gitlab.com/search?utf8=%E2%9C%93&search=cl_load&group_id=&project_id=178692&search_code=true&repository_ref=develop) I can see the mapping of LOAD and cl_load and the external declaration. But if LOAD uses cl_load, how or where
19:26:29
Devon
Any package out there to write files with Emacs-style safety, e.g., to update foo write to #foo# then rename #foo# to foo while holding a lock as a symlink .#foo -> HOST.PID
19:27:00
Xach
Devon: I haven't heard of such a thing. I do that manually when I care (but without the locking part)
19:28:35
Xach
I would be interesting in seeing just what each implementation actually does for each of those open options.
19:28:42
Shinmera
The :rename-and-delete option is pretty weird: "The existing file is renamed to some other name, then it is deleted but not expunged, and then a new file is created."
19:29:10
Devon
open [Function] ... :supersede ... If possible, the implementation should not destroy the old file until the new stream is closed.
19:36:34
pjb
eg. emacs renames the current file foo as foo.~1~ and then deletes (at a later time) the older backup files.
19:38:29
Devon
Emacs first checks for */.bzr/checkout/format, */.git, */.hg, */_MTN/format\0, .src/*, .src/*,v, RCS/*, RCS/*,v, s.*, SCCS/s.* and who knows what else, before saving *.~1~
19:39:27
pjb
Devon: of course, and it doesn't even save it necessarily in the same directory or file system.
20:00:01
fe[nl]ix
Devon: one recent Linux kernels it is possible to supersede atomically, but I know of no language library that exposes it
20:01:46
fe[nl]ix
there's a syscall for creating an unreferenced inode (temporary file), and a new way to atomically replace the inode pointed by a path
21:34:19
rpg
oh, dear. I *really* don't want to try to figure out darcs. It could be arbitrarily better than git without being worth my learning it.
21:50:59
rpg
jasom: The problem with that is that the remote, authoritative repo will still be darcs when I have my git repo! :-/
21:53:09
rpg
jasom: I'm sorry -- you are right. When I first skimmed this page I got stuck at "migrating ... from darcs to git..." and missed the "can be used to create git mirrors of active darcs repositories."
21:54:56
Shinmera
Could also try to convince Xach that your git repo will be the new authoritative source
21:55:28
rpg
Shinmera: The last thing either the CL community or I need is for me to own another authoritative repo!
21:58:15
Shinmera
You could also try to convince Xach to move it to sharplispers to make it more accessible to contributions.
22:01:19
rpg
That would really be up to Attila. If he prefers to keep it in darcs, I will not (or at least try not to) complain.
22:38:39
pjb
rpg: indeed, darcs is better than git, but when git appeared, it was suffering from a few bugs, which let git take over. Now it's essentially finished.
23:41:21
rpg
pjb: It didn't help that initially it seemed one always had to build darcs oneself, requiring a huge haskell toolchain, and it was never very fast.
23:42:12
pjb
Why? It was a good motivation to install the Haskell toolchain and start programming in Haskell!
23:42:37
pjb
We should do the same in lisp. Make a widely used utility in lisp, and have all distributions and users install a lisp system!
23:43:30
aeth
pjb: There is a widely used utility in Lisp that encourages Lisp, it just encourages a limited, outdated, and slow Lisp instead of Common Lisp
23:43:40
jasom
When I last used darcs significantly I found that darcs was, in theory, better than git, but git was, in practice, better than darcs. In particular darcs was quite slow.
23:44:49
aeth
But the final nail in the coffin was sites switching from multiple version control systems to just git, effectively killing darcs and hg
23:44:53
pjb
anyways, it's over, nowdays you would need to justify not using git with a very large consulting project, and reports and white papers etc.
23:46:13
aeth
Interestingly, SVN is alive because it offers something git doesn't: better support for binary files
23:46:44
rpg
aeth: And svn externals are about a zillion times better than git submodules or subtrees.
23:48:06
rpg
My main issue is that my brain only has room for one distributed VCS, which means that I cannot afford to figure out bzr, hg, darcs, etc., no matter how wonderful they might be.
23:50:06
pjb
aeth: SVN is still alive because it offers something most others don't: ginormous repositories that are very hard to migrate.
23:50:39
aeth
pjb: You can migrate from SVN to git. You will probably produce multi-GB repos, though
23:51:14
pjb
At the clients' I've seen, the project of thinking about migrating to git would be multi-man-year consulting projects, and the migrations would involve duplicating the available server hardware, and be multi-man-month projects.
23:51:32
pjb
Basically they've been talking about migrating for years, but just cannot invest the required cost.
23:54:58
jasom
pjb: I wrote a tool in lisp to migrate our internal svn to git, so I could do fast local querries against the history. It was indeed very non-trivial
23:55:29
rpg
I remember thinking "oh, I'll just take my svn repo on the road using git-svn so I can get something done on the plane." Ha-ha. Ran the export overnight. The next morning, it wasn't done.
23:55:41
pjb
jasom: there's reposurgeon to do it too (written in python by ESR, also he regreted not having used lisp).
23:56:25
rpg
I still maintain that svn externals are a huge boon. People where I work just hate to start up a new project that uses git, because getting all the git repos working together is such a mess.
23:56:44
jasom
simple things like sometimes /trunk/module becomes /branches/foo othertimes /trunk is copied to /branches/bar. Sometimes /trunk/module is copied to /branches/baz then /branches/baz is deleted then /trunk is copied to /branches/baz
23:58:41
rpg
We used gitslave once, and it pretty much works, but if it ever doesn't you're in real trouble because it's a big snotball of code
23:59:15
rpg
There's subtrees, but right in the middle the git folks tell you right away that they have done it wrong and left in a huge way for you to shoot yourself in the foot.
23:59:34
jasom
pjb: my tool found several bugs in pathname support. There were file names in our svn repository that sbcl couldn't handle and file names that ccl couldn't handle
0:00:15
pjb
jasom: I don't know it that's bugs. It may be a regretable misfeature, but the specification doesn't presuppose you can manipulate all native paths.
0:02:58
jasom
git-svn shells out to a command that does a lot of work just to see if a branch exists. In an inner-loop.
0:03:54
jasom
it also uses an O(N*M) algorithm where N is the number of commits and M is the number of branches. We have ~100k branches in our repository
0:04:58
rpg
jasom: maybe I'll try it again some time. It does seem like there ought to be some way to drag less of the history if all one wants to do is to hack on an airplane. I know that it's more than that, and maybe what I need is just automated support for the cheap trick of taking your working copy and jamming it into a temporary git repo.
0:06:47
jasom
rpg: I don't know if the change ever made it upstream. I sent a "I'm not using this tool anymore, so can't really work on a patch, but here's my change that sped it up by a huge amount" to the list and never checked to see what became of it.
0:07:48
jasom
pjb: my dad says that movie doesn't work hard on defense and never really tries, except during the playoffs.
0:19:33
p_l
pjb: I'm tempted to watch Mayday. Or bring manuals/emergency checklists for the plane I'm flying
1:14:45
aeth
pragmaticmonkey: Lisp is good for many things, but finding a job is not one of those things.
1:21:52
malice
Xach: I am explaining methods in CL and when reading Keene I noticed that she mentions that you have to invoke method through the generic function.
1:22:25
malice
I was curious whether it was always the case, or if you could, by some other mechanisms, retrieve a method object and then invoke it on some arguments, bypassing the generic function, though perhaps doing the same work as it would.
1:24:49
Bike
in an implementation with mop you can get the method function. but calling methods like that is not normal or anything, and pretty hairy to do.
1:24:55
sjl
is there a less awful way of handling the if-exists argument here? http://paste.stevelosh.com/5a5ea5a9e5abd80008d72afb
1:25:33
jasom
malice: if you know you are going to do it ahead of time, you can implement the method with a vanilla function and then inline the function into the method
1:25:42
sjl
I want to pass along the if-exists to the with-open-file, but passing nil and not passing it are two different things
1:26:19
sjl
and I can't hack around it with (apply ... (if if-exists-given `(:if-exists ,if-exists) nil) because w-o-f is a macro
1:28:54
jasom
you could open-code the wtih-open-file using unwind-protect, or you could manually calculate the default value
1:30:03
sjl
If you're writing a new file and get an error, it tries to clean up the partially-written file for you
1:30:42
sjl
I mean, I can reimplement that too... but I think I can live with the ugly if that's the solution
1:35:46
jasom
something like (defun write-foo-to-file path data &key (if-exists (if (eql (pathname-version (pathname path)) :newest) :new-version :error)
1:55:18
Xach
I tease. I really do think you can indent how you like. The last IF is the only style I like.
1:57:30
Xach
sjl: Really? I have never seen your style before. The only similar variant I've seen is the dedented ELSE clause, but that seems to be from people with lisps that have an implicit progn in else.