libera/commonlisp - IRC Chatlog
Search
5:14:42
beach
nij-: I am not talking about RAM, but about virtual memory. You are about to implement your own virtual memory it seems.
5:20:05
beach
Or SSD. That's what virtual memory does. And it seems to me that you want to use external memory anyway, to implement a specific "virtual memory" yourself, which is bound to be worse.
5:21:40
beach
Either way, if you are going to use disk memory, you are talking many orders of magnitude slower than RAM, so you are probably in for some performance problems anyway.
5:22:29
beach
With a week or so worth of salary (which is at least what it is going to take you to implement your virtual memory), you can buy a decent computer.
5:24:55
hayley
(Reminds me to get back to my FPGA stuff; my back-of-hand estimations for the space and time needed aren't pretty, and so I am looking into custom hardware.)
5:25:05
beach
I suppose that depends on your computer. But RAM is not very expensive these days. At least not compared to the effort you will have to make to get this thing to work.
5:28:21
beach
nij-: Did you check how much RAM that computer can have? It has got to be in the specifications for it.
5:28:36
hayley
Using the internal SSD as swap space should be...bearable. From memory, macOS will let you swap until you run out of disk space.
5:31:12
beach
In my book, the best approach is what makes me do the least amount of work, within a reasonable cost, of course.
5:35:20
beach
nij-: That question is way too general. It depends on the density of your data for one thing.
5:35:53
beach
If it is very dense, an array is fine. If it is sparse, there are tons of possibilities depending on the exact structure.
10:31:48
pjb
sabra: there was a paper "Reasoning about qualitative temporal information with S-words and S-languages"
10:31:49
pjb
Irène Durand Sylviane Schwer ELS 2008 https://www.european-lisp-symposium.org/static/proceedings/2008.pdf ; perhaps also useful: https://dept-info.labri.fr/~idurand/enseignement/lst-info/PFS/
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.