libera/commonlisp - IRC Chatlog
Search
10:32:52
pjb
sabra: https://www.google.com/search?q=%22common+lisp%22+%22modal+logic%22 gives some links, but you will have to sort them out.
10:36:19
pjb
but clearly, lisp is under-utilised, and a good modal logic library would be a good project idea.
11:08:06
rainthree
https://cffi.common-lisp.dev/manual/html_node/defcenum.html how to combine enums with logical or, logical end, etc ? Using "foreign-enum-value" would defeat the purpose of enums, wouldn't it ?
11:10:56
pjb
rainthree: yes. enums can be used for two purposes, and in lisp, we have to choose one.
11:11:33
pjb
If you want to combine with logical or, you need values, so a defenum macro that generates defconstant.
11:13:36
_death
if you just need logior, maybe defbitfield makes sense.. otherwise, you can write your own operator that takes an enum type and expression and computes the right value
12:20:34
sabra
pjb:Thank you. I had already collected the first two pages of google search, but that did not give me some of the other suggestions you have.
12:42:12
pjb
nij-: you may call (room t), this may call the gc. Otherwise, you should use implementation specific API to call the GC; after all, your implementation may have NO gc!
12:50:08
nij-
room outputs to string, but doesn't give me float numbers indicating the usage of heap
12:50:16
hayley
And SBCL will trigger garbage collection every time you cons up 1/20 of the heap. What should happen if you use more than 80% of the heap?
12:51:10
hayley
(SWCL (note second letter) also has a panic mode which collects more aggressively if the heap is more than ~85% used from memory.)
12:53:56
nij-
So the question is, how to write certain-condition that indicates heap usage in percentage?
12:55:13
hayley
There isn't a standard way to do it; you should peer into src/code/room.lisp (from memory) to figure out how to do it in SBCL.
12:55:26
mfiano
The heap is not anything the language is concerned with. You're going to have to dig into each implementation for that, and it's going to be unreliable at best.
12:56:38
mfiano
Because dynamic space usage can fluctuate wildly during different levels of generational clensing.
12:57:02
hayley
As Gil Tene once said, what would happen if your heap usage-watching thread decided to not feel like running for five minutes?
13:01:30
hayley
Hard to say why, but it does suggest that you might be too late to force GC if your thread reacts slowly, for whatever reason.
13:01:43
hayley
The original quote, for reference, was "What could happen (and sneak in) if this one instruction takes 10 minutes to execute?"
13:03:20
nij-
Ok I'm in room.lisp now. This line calls +all-spaces+. https://github.com/sbcl/sbcl/blob/0492f5bc2c807448d9d6cbd5d22af37bb9fcfae7/src/code/room.lisp#L1057
13:03:39
nij-
But when I evaluate +all-space+ in the package "SB-VM" manually, it says it's unbound.
13:09:49
Shinmera
I don't want the engine to be unusable just because some reporting function isn't supported.
13:10:46
nij-
Emit a warning or something. Anyway, it's your toolkit. I'm just wondering. Thanks anyways.
16:07:35
beach
I have two ASDF systems in two different files. The two share a significant number of component files. So I was thinking of a read-time form like #.*COMPONENTS* in the :components part of each system definition. But this idea requires a different file to be read first, so that in this different file, I can set the value of *COMPONENTS*.
16:07:36
beach
The problem with this idea is of course that nothing happens until the ASDF system definition file is read, so nothing can happen before that. So I guess I need ideas for a different solution to this problem. Any ideas? The solution might be simple. I just don't see it.
16:08:39
beach
I suppose I could try to use REINITIALIZE-INSTANCE on my system definitions once the variable has been set.
16:11:41
beach
I can't split out a common parent system, because, although there are many components in common, an essential component differs between the two, and must be compiled and loaded before the others.
16:13:52
beach
Actually, let me explain it more precisely. The main difference between the two systems is that each one starts with a different file "packages-a" and "packages-b", and the list of common components must follow the "packages-x" file.
16:18:12
beach
If so, I could define a separate system for each of the "packages-x" files, and one common parent system for the common files. Then the two final systems would have two dependencies, with the packages system first.
16:20:34
beach
As in (defsystem packages-a :components ((:file "packages-a"))) in one file (defsystem packages-b :components ((:file "packages-b"))) in another file, (defsystem common :components (<lots>)), and finally (defsystem final-a :depends-on (packages-a common)) and (defsystem final-b :depends-on (packages-b common))
16:32:10
_death
maintaining two lists instead of one to avoid such complexity doesn't sound too bad to me
16:36:52
beach
I often find that although ASDF is defined to be very flexible, there are simple (and I presume fairly common) things like this that cannot be expressed easily. At least not with my knowledge of ASDF.
16:36:53
_death
it may also be possible to have the two systems defined in a single file (and a symlink?)
16:40:53
_death
others may know better solutions.. I try to keep my asdf-related use to the basics, and so don't delve much into it
18:28:39
pjb
beach: basically: #.(with-open-file (in (merge-pathnames "common.sexp" *load-truename*)) (read in))
19:40:32
pjb
The alternative is to use #+/#- to select packages-a or package-b in the common system.