libera/commonlisp - IRC Chatlog
Search
12:16:23
random-nick
the lack of a generic object equality test was an intentional choice, see https://www.nhplace.com/kent/PS/EQUAL.html
12:16:41
Equill
mzan: It looks like we have some interests in common beyond Lisp. This knowledge-base language: is it for automated reasoning/ML, or for human interaction?
12:17:22
mariari
yeah I've read about that before when I've brought up this, though I do have one issue with my equality strategy. Is there a generic way to grab the fields of structs I know c2mop can do it but that is undefined behavior
12:18:57
mzan
Equill: it is far for being publishable, so I don't like to discuss details. But I can listen you ;-) BTW, it is for human interaction, and it is a simplified version of RDF, OWL, Datalog and so on. You use it only for specifying basic relationships between chunk of data. All other functionalities had to be in ad-hoc systems.
12:21:35
Equill
mzan: We should take this into #lisp-cafe, but we definitely have a shared interest there. My IT-infrastructure management thing turned into a KMS engine that happens to be useful for managing IT infrastructure :)
12:34:28
mzan
random-nick: regarding https://www.nhplace.com/kent/PS/EQUAL.html nice lecture, but I note that objective-C and other similar OOP languages solved this problem better. They have weak and strong references. If you copy/clone an object, you copy the weak references
12:34:49
mzan
(i.e. they remain reference to the same object), while you copy/clone the strong references
12:35:15
mzan
If you compare two objects they are the same if they share the same exact weak references
12:38:01
_death
the point of that article is that equality and copying are context dependent.. if you pick some definition without consideration of context it may appear arbitrary and unsuitable.. you're just saying they picked one
12:38:53
mzan
annotating strong and weak references in an OOP hierarchy, can solve this problem, or it can help a lot. But I'm sure that or I can extend CLOS with this functionality, or there is already a library doing this, or maybe it is already part of the standard
12:40:13
_death
again, it does not solve the problem, unless you also provide a context (the article uses the term "intent")
12:42:21
_death
I've not heard of it (in those terms).. to me strong and weak references are related to garbage collection
13:14:58
_death
anyway, it's easy to imagine that there could be some language to define such semantics, like say (define-copy-semantics my-context (another-context) :deep ((class1 slot1)) :shallow ((class1 slot2))) or something.. but then it may be easier (and more general) just to the define the specific operation procedurally
13:57:15
mzan
_death: you are right. Nowdays weak reference means usually a garbage collectable reference. Deep and shallow are better terms. In a GUI toolkit, a reference is deep if the slot point to an object owned by a container. It is shallow if it is a link to an external object. So a Document object owns its paragraphs, but it can have links to the author, and to the page format.
13:57:38
mzan
If you clone/copy the document, you deep clone the paragraphs but not the autor or page format descritpion.
13:59:14
mzan
If you model some OOP hiearchy with these annotations, it is easier to reason about what is copy and what is equal. Maybe not in all cases, but in a lot of them. For CL lists, hash-tables and other data structures, the problem remain.
14:04:28
mzan
It is a part <--> owner relationship. The author of a document is not a part of a document, while a paragraph is a part of a document.
14:06:46
_death
possibly a frame representation language can provide more hints about the context, since it can support more relations than is-a/has-a
14:08:52
_death
but ideally a context can be supplied ad hoc, if a general mechanism of copy/equal is assumed
15:43:42
kakuhen
Your multiple threads might be ran on distinct cores, or they won't. It depends what your OS scheduler does
19:05:03
nij-
kakuhen hmmm but there are some languages that do not run on multiple cores, if I understand correctly (e.g. python)
19:08:56
mfiano
That effectively means one OS thread can only be executing something at any given time
19:15:41
mfiano
A lot of Python people tend to just FFI out to C for that sort of heavy lifting, or compute with multiple OS processes with some stdlib API. It's literally been about 20 years since I used Python, and it hasn't changed much since then, relatively speaking.
19:19:38
Fade
when I was still a python programmer, the GIL caused my general interest in message passing architectures.
19:21:56
mfiano
Which is why it would have made more sense, with it adopting the actor paradigm from what I remember.
19:23:17
nij-
"That effectively means one OS thread can only be executing something at any given time"
19:23:18
mfiano
I saw Fare reply to my message in here just the other day, so I know he still comes around.
19:26:29
Bike
most lisps do more compilation than interpretation, so you're not gonna have a grand interpreter lock or whatever it is GIL stands for
19:29:07
mfiano
I don't know how it works, but it sounded like some kind of mutex that prevents only 1 thread from entering the runtime to give results and receive more work, or something like that.
19:30:23
mfiano
It's the subject of a lot of controversy, but the CMUCL Python is a better topic anyway.
19:37:08
mfiano
Oh, by the way, in case it wasn't clear from not being in the other Lisp channels I frequent, as of yesterday, I'm back to making libraries in CL. I cannot consider Julia as a serious language anymore, for it has deceived me after 7 years of research.
19:41:49
Fade
from my memory, the interpreter runs in one system process, and all threading inside that process is scheduled by the python interpreter as 'green' threads.
19:42:06
Fade
this may have changed in the past ten years, because it was a pain point even ten years ago.
19:42:54
mfiano
I want to say that it is too pragmatic, but that sounds wrong. Basically, it took shortcuts, and the memory model of the host leaks in, in very unexpected and surprising ways. The most surprising part though, is only after 7 years of following Julia's evoluation, did I just learn that the core team has generally agreed to follow C++'s memory model. To use Julia effectively, you not only have to
19:42:55
mfiano
know Julia, but how the different passes of the Julia compiler work, the semantics of the C++ memory model, particularly the undefined behavior, and the behavior employed by LLVM, which is surprising even for undefined.
19:45:02
Fade
I'm glad you're back, mfiano. sorry for all the tooling entropy you seem to have been experiencing.
19:46:31
mfiano
That is true. I am disabled and a hobbyist programmer. So I have time to learn new things.
19:47:20
mfiano
It is disappointing, yes, but I do enjoy CL, with its many warts and all, so I am not as disappointed as I am glad to be back.
19:49:59
mfiano
The truth is, I needed new scenery, both on the computer and IRL, due to trying to manage some mental health issues. But that seems to be under control now.
19:51:35
mfiano
Said issues probably resulted in a very bleak image painted of CL in my recent blog article. I apologize for that.
19:54:20
mfiano
Now that I got that situation under control that was really affecting my life and making it hard to think clearly, I actually enjoy programming. I feel like I got a ton of code written for a new CL project today, with 130 tests passing. Something I would have struggled with a couple months to a couple years ago.
19:56:45
mfiano
It's a secret experiment. I don't even know if it will work out as a cohesive whole yet, so I'm not going to talk about it. It's just a bunch of sketches in my notebook and a fragment of code at this point.
20:29:25
nij-
I wonder are there JS code that are hard to be written from parenscript (up to semantic equivalence)?
20:30:01
Josh_2
is it es6 idk but the shorthand for things like promises doesn't exist which is very annoying
20:49:42
varjag
when using SORT on a list, there's no guarantee in the language that it's going to do that by rplacd'ing around the same cons cells, right?
20:58:33
NotThatRPG
Does anyone have a recommendation for a portable CL random number generator? It doesn't have to be brilliant, but I want something that will let me have replicable results across implementations when I supply a seed -- otherwise I need to write different tests for different implementations, which is painful
20:59:46
NotThatRPG
I suppose I could just make a mock RNG for use in testing, but without something like a portable ADVISE that seems strictly harder than finding a portable random library.
21:05:55
NotThatRPG
Thanks! I had used cl-random before, but would prefer something that is maintained.
21:47:03
NotThatRPG
Shinmera: just a thought -- would you entertain a PR that pushed the documentation out into `random-state/documentation` ? The reason I ask is that the documentation introduces a dependency tail that I don't think is necessary just to use the library.