freenode/#lisp - IRC Chatlog
Search
16:54:31
jmercouris
is there a way to run SBCL and have it ignore ~/.config/common-lisp/source-registry.conf.d/user-lisp.conf ?
16:55:36
loli
jmercouris: --no-userinit maybe? I know in script mode it does not read the user default config
17:02:19
jdz
But in general why do you have ~/.config/common-lisp/source-registry.conf.d/ if you don't want it?
17:02:50
jmercouris
however, the tool 'quicklisp-to-nix' breaks when this file is present and populated
17:03:41
jdz
Pretty sure for reproducible builds you do not want to read any system or user initfiles, and provide everything on the command line.
17:09:43
nij
Hello! What's the best timer you've used before? I just realize today that a robust timer isn't very easy to design.. currently the best I have is systemd.timer, but it isn't lispy at all.
17:26:07
nij
I should say systemd.timer supports scheduling a job at a certain time, e.g. [2022-01-01 10:53:46]. It saves a comprehensive backlog of states and outputs/errors from the program. If the machine misses, by being off for example, the job, it will launch the job immediately next time the timer starts.
17:26:40
nij
(I don't like the last feature by the way.. I think it's better for the system to inform the user.. but not force it happens at a time the user wasn't even aware of.')
18:27:02
nij
mcron is more like crontab.. which is small and cool, but not robust: https://opensource.com/article/20/7/systemd-timers
18:34:42
nij
But systemd.timer is something that's "not really needed for service management, but helpful".
18:34:54
jdz
All you talk about here is how you want systemd with lispy syntax, and now object that shepherd is a service manager?
18:36:45
nij
That's right. But with systemd, you do not really need a systemd.timer. And that's, afaik, the case for shepherd.
18:39:44
Nilby
nij: It sounds like you want an unix operating system controled and configured by Lisp, which is great, but you can't execpt that someone has done it for you already. The closest might be Guix with guile scheme.
18:40:49
nij
There are actually many attempts out there, including mcron (scheme), cl-cron, clerk.. But they are not a full-fledge timer.
18:41:00
Nilby
On the other hand if you just want something to happen at a certain time inside a lisp process, that is not hard. Just use sleep or the system interval timer.
18:41:20
nij
But I agree, I cannot expect that someone has done that. I might write my own once I'm convinced there isn't any.
18:47:17
Nilby
nij: Then you've probably already researched it more than most. It sounds like you might then have, fix up, or make the next best Lisp cron.
18:49:29
Nilby
When I want just a simple timer inside a lisp image, I just use a simple macro: (do-at <time>) &
18:51:49
Nilby
but it's helpful to have a nice date/time parser, and a convenient in-a-thread thing like use "&"
19:06:02
nij
And so it makes sense why systemd.timer is designed "under" systemd, for the later is a robust service manager.
19:07:19
nij
A process, if want to be scheduled robustly, should be first wrapped into a service. Calling a service needs to take care of all issues, including full-logging.
20:36:30
motersen
Hey everyone, I am having trouble with a strange condition/restart/recursion situation.
20:36:43
motersen
On CCL this does what I would expect it to. It runs #'always-fail 3 times, then fails. But on SBCL, the value of retries is reset every time the handler is run. Is behaviour in this situation undefined? Am I going about this all wrong?
20:40:55
Bike
"bug fix: HANDLER-BIND evaluates the forms producing handler functions only once. (#1916302, reported by Christophe Junke) " in 2.1.2
20:46:59
motersen
ah okay, will do so. Then i'll just install the new version locally. Thank you all, that was a quick case!
20:50:15
Xach
python476: you have to also download the quicklisp public key - https://beta.quicklisp.org/release-key.txt is one way to get it.
20:54:46
|3b|
Xach: i have some TTF fonts that start contours on a curve control point (so not on-curve-p), which confuses zpb-ttf:do-contour-segments/do-contour-segments*, do you think it would be better to rotate the control points so the contour starts on the curve, or to make d-c-s smarter to handle that case?
20:55:51
|3b|
ACTION thinks adjusting the data to start on the curve would be easier, but also somewhat dislikes changing it from what's stored in the file :/
20:58:52
|3b|
actually i guess fixing it in d-c-s* might not be too hard at the cost of some efficiency when it sees that case, if it just builds a modified copy when needed and uses that with existing code
21:01:55
Nilby
|3b|: A long time ago I worked on a TTF rasterizer and there were a number of fixes for degenerate fonts in it, so I guess it's not uncommon. Maybe just make sure to compare the output against other rasterizers.
21:03:28
|3b|
the points before and after that point are on the curve, and the 3 points together make the desired shape
21:05:14
|3b|
hmm, slightly uglier than i thought to fix it that way in d-c-s/d-c-s* since code would have to be duplicated in both
21:08:50
Nilby
Like lisp implemntations, I think font rasterizers sometimes have a hidden consensus of what to do with weird or unspecified input.
21:09:51
Xach
i bet there were certain buggy fonts you had to live with because they were common in the world
21:09:52
|3b|
in this case "make the curve go through a point that is specified to not be on the curve" is pretty obviously wrong :)
21:11:48
|3b|
the font is doing something i might not have expected, but that doesn't seem completely unreasonable having seen it
21:12:07
python476
I remember something about MS font handling code that could bring out the entire rendering stack
21:13:41
Xach
well, i have the luxury of not needing it to be interactively fast and fit in half a kilobyte and work with buggy files etc
21:30:29
|3b|
hmm, i guess there probably isn't any requirement for there to actually be any explicit on-curve points, is there, so maybe trying to always start on the curve won't be completely correct either
2:16:15
nij
Hello #lisp! I'm trying to understand how CL extension got bootstrapped. One specific example I'm looking at is sbcl's timer. In CLHS, there's no timer; while in sbcl, there's timer. However, sbcl bootstraps itself.. but the support for timer must come somewhere. After digging into the repo, it seems that the magic is #'alien-funcall. However, I fail to dig more into it. Could someone explain or provide some hint - how are extension
2:17:38
Bike
it's not really a matter of bootstrapping. alien-funcall is an extension to call C ABI functions.
2:17:51
Bike
https://sbcl.sourceforge.io/manual/index.html#The-alien_002dfuncall-Primitive described here
2:20:23
no-defun-allowed
SBCL doesn't use timers as part of bootstrapping, so it's perfectly reasonable.
2:21:07
no-defun-allowed
Yes, once there is an SBCL compiler running, it can generate the code to ALIEN-FUNCALL.
2:24:53
nij
Hmm.. just found out that bd threads on sbcl are just some alias of sb threads.. why should i use bd-threads then? For portability?
2:25:20
nij
If it's for portability, I still have to worry if bd thread is correctly implemented over other implementations..
2:26:21
no-defun-allowed
Yes, Bordeaux-threads should be used for portability, and it is implemented correctly for any implementation I have used.
2:28:06
no-defun-allowed
If you want to argue that, the threading implementation in SBCL could be broken too. And then you'd have to fix up all your code to work on another implementation.
2:28:06
nij
I should only say that it's tested and designed for sbcl.. it might behave unexpectedly for other impls.
2:30:48
nij
Is there any system-level timer abstraction? For sbcl we have its timer.. but while sb-threads are abstracted by bd-threads, sb-timers do not seem to be.
2:31:28
no-defun-allowed
Of course SB-THREAD would only work on SBCL, but (as I understand it) the Bordeaux thread protocol is derived from B.2 and B.3 of the CLIM specification (Multi-processing and Locks respectively).
2:32:26
nij
Bike, does trivial-timer call system timer? Or it's an abstraction over bd-threads? Based on its dependency, I don't see how it calls system timers.
2:32:37
no-defun-allowed
I recall that handled ERROR strangely on Clozure, because it would fall back to creating a new thread which has none of the condition handlers set up.
2:35:59
no-defun-allowed
nij: It uses SBCL's timers on SBCL, but falls back to a portable thread implementation.
2:36:38
nij
Hmm.. for common lisp to "grow", we cannot alter the standard (ie those described by CLHS). Instead, we should implement them in new implementations. But then after a period of time, someone should come out and unify them, like bd-threads for threads.. right?
2:37:25
nij
no-defun-allowed: If trivial-timer is portable, then what timers does it call on other implementations?
2:39:02
nij
Oh.. so on sbcl it's sbcl's.. but on other implementations it abstracts over threads to make a timer.
2:44:36
nij
Hmm.. suppose I have a function (lambda () ...), how do I call it with all outputs redirected to some file?
2:46:42
no-defun-allowed
(with-open-file (*standard-output* pathname :direction :output ...) (funcall function))
2:58:42
Bike
of course if you output to some other stream that won't be redirected, but *standard-output* is the default output stream
3:23:55
muyinliu_
cl-disruptor, a high performance inter-thread messaging library, a port of LMAX Disruptor in Common Lisp, https://github.com/muyinliu/cl-disruptor