jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
<bike> and no, i just meant sbcl has a different kind of global binding as an extension
<nij-> Ah, I see..
<_death> nij: you say "Something like that".. so maybe now it's time for you to think through the consequences.. how will the patching look like, what would be the new semantics of the code..
<nij-> patching?
<bike> i don't think there would need to be patching. there's nothing preventing non-global specials from being bound specially or lexically, of course, so old code that binds a no-longer-global special would just continue to bind it as locally special
ryanbw has joined #commonlisp
<_death> suppose that could work.. why would then one wish to unspecial
<bike> well, that i couldn't tell you. i guess the general principle that you can undo anything you can do, but that's pretty weak
X-Scale has quit [Quit: Client closed]
tfb has quit [Ping timeout: 255 seconds]
<_death> it does sound like a reasonable implementer strategy though ;) like unintern, could easily create "interesting" situations for users if they're not too careful
jonatack has quit [Ping timeout: 272 seconds]
amb007 has joined #commonlisp
<_death> then you may also want a "lexical" (nonspecial? ordinary?) declaration, and there'll be the defensive people coming up with a lexical-let operator, and the war between the specials and lexicals raged on through the ages
<nij-> hmm
* nij- lost
amb007 has quit [Ping timeout: 260 seconds]
<_death> it's a joke, when a decision becomes reversible.. some would declare symbols special en mass, "user can always reverse it"..
tfb has joined #commonlisp
<_death> *masse
<nij-> Not really a good practice though. I can't think of any useful scenario. This was just out from my curiosity.
<nij-> After all users should have good control about symbols. And I'm surprised that users can't control/reverse such basic property.
<nij-> Shinmera If you don't mind - How do you upgrade your libraries after some time they are developed? I find it really difficult to bring my projects forward after some time.. because I'm too scared whether I'd change its surface APIs..
random-nick has quit [Ping timeout: 256 seconds]
younder has joined #commonlisp
X-Scale has joined #commonlisp
<nij-> Why does asdf signal fatal error when there is no actual error during compilations? I got - compilation unit aborted: caught 1 fatal ERROR condition, caught 4 WARNING conditions, caught 2 STYLE-WARNING conditions, printed 1 note
<nij-> There is one fatal error, but that is the uiop/lisp-build:compile-file-error itself.
mesuutt has joined #commonlisp
<nij-> Does it, for some reason, default to error out while seeing (harmless) warnings?
jonatack has joined #commonlisp
<paulapatience> Yes
<paulapatience> See ASDF:*COMPILE-FILE-WARNINGS-BEHAVIOR*
<bike> warnings are generally not harmless. they indicate that the compiled code will have a serious problem come runtime.
<bike> ::clhs 3.2.5
<ixelp> CLHS: Section 3.2.5
<bike> so, if compile-file signals a warning, the compilation is considered a failure. that's not asdf, it's part of how compile-file is defined
<nij-> Oh.. I gotta fix the warnings then..
<gilberth> That's not always the case. I might have missed an IGNORE declaration. Annoying about that is whether there is a warning or not may depend on the cleverness of the particular compiler used.
mesuutt has quit [Ping timeout: 252 seconds]
<gilberth> Or there might be a forward reference to a function to be defined elsewhere.
<nij-> Right; bike doesn't mean that any warning is always fatal.
<gilberth> "they indicate that the compiled code will have a serious problem come runtime." That's "will" not "might".
maxwell_ has joined #commonlisp
<bike> those are usually style warnings
<bike> which i suppose i could have clarified are different from full warnings, but 3.2.5 goes over it
<gilberth> Hmm.
<bike> a style warning isn't a failure and doesn't indicate a serious runtime problem
<bike> and i don't think it will fail asdf compilation by default
<bike> doesn't _necessarily_ indicate, i should say, if a function isn't defined it may or may not result in an error later, depending on whether it was just forward referenced or truly undefined
<paulapatience> In my experience, if there are many many style-warnings, the compilation fails
lucasta has quit [Quit: Leaving]
<paulapatience> Rather, ASDF indicates failure. Unless ASDF:*COMPILE-FILE-WARNINGS-BEHAVIOR* is adjusted
<gilberth> Ok. Right, those are style warnings. I missed that part.
<paulapatience> (Though perhaps there was a warning in those cases that I missed)
<gilberth> But when warnings indicate a serious problem does that mean that SBCL doesn't allow for functions being redefined?
<bike> sbcl might complain with a full warning if you redefine a function in such a way that a previous ftype proclamation for it is invalidated
<bike> maybe also if you have two definitions for the same function in the same compilation unit? i think that's undefined behavior
<gilberth> It is suffice to redefine a function from elsewhere. On the REPL or via c-c c-c. And this indeed may very well break. And has nothing to do with FTYPE.
tfb has quit [Ping timeout: 245 seconds]
tfb has joined #commonlisp
<aeth> ime, C-c C-c can break in SBCL if the inferred (not declared) type changes within the same file (because the safe move is a C-c C-k file recompile)
mesuutt has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
mesuutt has quit [Ping timeout: 268 seconds]
istewart has joined #commonlisp
waleee has quit [Quit: WeeChat 4.1.2]
josrr has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
tok has quit [Remote host closed the connection]
mesuutt has joined #commonlisp
mzan has joined #commonlisp
mariari has quit [Quit: WeeChat 4.2.2]
mesuutt has quit [Ping timeout: 245 seconds]
mariari has joined #commonlisp
<nij-> Just got back. Hmm. *compile-file-warnings-behaviour* is :warn. I wonder why it erred out.
<paulapatience> Did you try putting :ignore (I think it was)
<nij-> (let ((asdf:*compile-file-warnings-behaviour* :ignore)) (ql:quick..)) -> erred out.
istewart has quit [Quit: Konversation terminated!]
<nij-> I have resolved the style warnings. Lemme resolve the warnings too..
<paulapatience> Hmm, actually what I have in my .sbclrc is (setf asdf:*compile-file-failure-behavior* :warn)
<nij-> Yeah. I read the source code of asdf. Seems fine.
* nij- facepalm. Ah, I have a perform-op which I copied from elsewhere, waiting to be populated.
<nij-> OK. That doesn't sound like the problem either.
<nij-> (I've commented them out and still.)
<nij-> Ok, all warnings and style-warnings are gone. ASDF is happy now.
<nij-> I wonder why though. This is not the first time.
amb007 has quit [Ping timeout: 260 seconds]
<nij-> paulapatience The docstring of *compile-file-warnings-behaviour* says it's about warnings.
<nij-> However, where it's actually used, the condition description reads "Lisp compilation had style-warnings".
<nij-> I think this is one thing that asdf could improve slightly.
rainthree has joined #commonlisp
<nij-> The error is signaled by check-lisp-compile-results (https://bpa.st/M7IA) (it's first form in the body). Runtime value for OUTPUT was NIL indeed (inspected from the frame). This doesn't seem to be what suggests to do.
ym has joined #commonlisp
<nij-> Another problem.. anyone used ASDF's perform test-op? https://bpa.st/6ZBQ This doesn't stop the loading process, nor does it print out any strings..
<ixelp> View paste 6ZBQ
mesuutt has joined #commonlisp
<bike> load-op doesn't depend on test-op by default
pillton has joined #commonlisp
<bike> is there a reason you expected it to
<nij-> I have to admit I haven't read through the whole manual.. maybe I should do that. I always loaded. I didn't know there's other thing I can perform.
<bike> asdf:load-system is short for doing load-op. there's also compile-op and build-op and such.
<bike> and test-op, which you can use via asdf:test-system
<nij-> My newb habit since day 1 follows me until today. I still (ql:quickload ...) without thinkin'. Ok, it's time to learn asdf in depth.
mesuutt has quit [Ping timeout: 255 seconds]
decweb has quit [Ping timeout: 260 seconds]
tfb has quit [Ping timeout: 255 seconds]
ym has quit [Ping timeout: 255 seconds]
<bike> i mean load-op is enough for most things
<nij-> Right. I figure that out.. load, compile, test.
<nij-> Does :Static-file actually mean anything programmatically?
<nij-> I tried putting a non-existing file - no error. I tried putting an existing file, compile, modify file content, recompile; but recompilation was skipped as if it doesn't recognize the content change.
tfb has joined #commonlisp
maxwell_ has quit [Remote host closed the connection]
ymir has joined #commonlisp
wacki has joined #commonlisp
nij- has quit [Ping timeout: 256 seconds]
tibfulv has quit [Read error: Connection reset by peer]
tibfulv has joined #commonlisp
amb007 has joined #commonlisp
mesuutt has joined #commonlisp
amb007 has quit [Ping timeout: 255 seconds]
mesuutt has quit [Ping timeout: 252 seconds]
tfeb has joined #commonlisp
tfb has quit [Ping timeout: 256 seconds]
tfeb has quit [Ping timeout: 256 seconds]
<Shinmera> nij-: I just do it. Idk. It's extremely rare that any existing function needs to be changed in behaviour
tfb has joined #commonlisp
grawlinson has quit [Ping timeout: 240 seconds]
ym has joined #commonlisp
amb007 has joined #commonlisp
ymir has quit [Ping timeout: 264 seconds]
mesuutt has joined #commonlisp
pve has joined #commonlisp
Inline has joined #commonlisp
bilegeek has joined #commonlisp
dom2 has quit [Ping timeout: 245 seconds]
shka has joined #commonlisp
dom2 has joined #commonlisp
Inline has quit [Ping timeout: 255 seconds]
Inline has joined #commonlisp
tfb has quit [Ping timeout: 256 seconds]
mesuutt has quit [Remote host closed the connection]
mesuutt has joined #commonlisp
Pixel_Outlaw has quit [Quit: Leaving]
tfb has joined #commonlisp
amb007 has quit [Ping timeout: 245 seconds]
rgherdt has joined #commonlisp
mesuutt has quit [Ping timeout: 240 seconds]
mesuutt has joined #commonlisp
amb007 has joined #commonlisp
scymtym has quit [Ping timeout: 268 seconds]
agm has joined #commonlisp
<agm> someone mentioned kons-9; that project looks interesting, but it's not been updated for a while: do you know about it?
<holycow> i have used it
<holycow> there was a bit of a disagreement about which gl back end to support and why, and someone volunteered to do some porting from an already written gl version to complete the implementation
<holycow> somehow that never happened (the people in the project are high level, talented with families so understandable)
<agm> oh, I see
<holycow> and the project just kind of went a bit quiet. it's not abandoned, and it works. it's great.
<agm> I'll try it!
<holycow> i recommend it. the example files are really great. super easy to modify and play with the code.
<beach> Wow, it uses Clobber. I didn't think anybody used it.
<holycow> there was a large conversation about what to use in that area. all of that is way over my head though, didn't really understand it.
<agm> holycow: I'll try the examples, since I'm just a beginner with 3d graphics
jrx has joined #commonlisp
rgherdt has quit [Read error: Connection reset by peer]
scymtym has joined #commonlisp
scymtym has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
scymtym has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
scymtym has quit [Read error: Connection reset by peer]
rtypo has joined #commonlisp
pillton has quit [Remote host closed the connection]
scymtym has joined #commonlisp
scymtym has quit [Read error: Connection reset by peer]
dino_tutter has joined #commonlisp
jrx has quit [Quit: I have to go, bye !]
anticomputer has quit [Ping timeout: 260 seconds]
d4ryus has quit [Ping timeout: 260 seconds]
anticomputer has joined #commonlisp
d4ryus has joined #commonlisp
tfb has quit [Quit: died]
donleo has joined #commonlisp
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #commonlisp
phadthai has quit [Read error: Connection reset by peer]
scymtym has joined #commonlisp
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
phadthai has joined #commonlisp
bilegeek has quit [Quit: Leaving]
Jach has quit [Ping timeout: 260 seconds]
attila_lendvai has joined #commonlisp
Jach has joined #commonlisp
Inline has quit [Ping timeout: 268 seconds]
Inline has joined #commonlisp
grawlinson has joined #commonlisp
X-Scale has quit [Quit: Client closed]
danse-nr3 has quit [Ping timeout: 264 seconds]
X-Scale has joined #commonlisp
pranav has joined #commonlisp
danse-nr3 has joined #commonlisp
cmack has joined #commonlisp
varjag has joined #commonlisp
tok has joined #commonlisp
mesuutt has quit [Ping timeout: 260 seconds]
lxsameer has joined #commonlisp
awlygj has joined #commonlisp
mesuutt has joined #commonlisp
ryanbw has quit [Quit: I'll be back.]
nij- has joined #commonlisp
nij- has quit [Ping timeout: 260 seconds]
mesuutt has quit [Ping timeout: 245 seconds]
zetef has joined #commonlisp
mesuutt has joined #commonlisp
chomwitt has joined #commonlisp
chomwitt has quit [Ping timeout: 268 seconds]
pranavats has joined #commonlisp
zetef has quit [Remote host closed the connection]
pranavats has left #commonlisp [#commonlisp]
_cymew_ has joined #commonlisp
X-Scale has quit [Quit: Client closed]
danse-nr3 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
pranavats has joined #commonlisp
rgherdt has joined #commonlisp
danse-nr3 has quit [Ping timeout: 264 seconds]
amb007 has quit [Ping timeout: 256 seconds]
ixelp has quit [Ping timeout: 255 seconds]
gilberth has quit [Ping timeout: 268 seconds]
random-nick has joined #commonlisp
ixelp has joined #commonlisp
amb007 has joined #commonlisp
rgherdt has quit [Ping timeout: 268 seconds]
amb007 has quit [Ping timeout: 255 seconds]
amb007 has joined #commonlisp
decweb has joined #commonlisp
rgherdt has joined #commonlisp
danse-nr3 has joined #commonlisp
slyrus_ has joined #commonlisp
slyrus has quit [Ping timeout: 272 seconds]
yitzi has joined #commonlisp
danse-nr3 has quit [Ping timeout: 252 seconds]
danse-nr3 has joined #commonlisp
X-Scale has joined #commonlisp
agm has quit [Read error: Connection reset by peer]
agm has joined #commonlisp
prokhor has quit [Ping timeout: 246 seconds]
nij- has joined #commonlisp
<nij-> sbcl 2.4.1 : (let ((v (make-array 2 :fill-pointer 2))) (vector-push-extend 1 v) (array-total-size v)) ; => 4
<nij-> Does this violate the spec "Extension is the minimum number of elements to be added to vector if it must be extended." ? https://novaspec.org/cl/f_vector-push
<ixelp> vector-push, vector-push-extend | Common Lisp Nova Spec
prokhor has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
<beach> No, you didn't give an EXTENSION optional argument, and the standard says that the default is implementation dependent.
<beach> Plus, that argument is the minimum number. So more can be added.
<nij-> Oh, I see. I thought `Extension` is referring to the behavior one sentence before.
<nij-> Thanks.
<beach> Sure.
pranavats has joined #commonlisp
pranavats has left #commonlisp [#commonlisp]
<nij-> Hmm.. this page doesn't say what should happen if the pushed element is not of the type of array's element type..
<nij-> sbcl signals an error though
<nij-> e.g. (vector-push 1 (make-array 3 :element-type 'character :adjustable t :fill-pointer 0))
<beach> Right. It should have said that storing the element is done as if with (SETF AREF).
<beach> But then (SETF AREF) doesn't say what happens either.
<nij-> Will write wscl.
<beach> I believe we have a WSCL issue for the latter, but not for the former.
<nij-> Will check.
pfdietz has joined #commonlisp
oneeyedalien has joined #commonlisp
jonatack has quit [Ping timeout: 256 seconds]
oneeyedalien_ has joined #commonlisp
oneeyedalien has quit [Ping timeout: 256 seconds]
nij- has quit [Ping timeout: 260 seconds]
oneeyedalien_ has quit [Quit: Leaving]
edgar-rfx has joined #commonlisp
pranavats has joined #commonlisp
edgar-rft has quit [Ping timeout: 245 seconds]
chomwitt has joined #commonlisp
mgl_ has joined #commonlisp
tassleoff has joined #commonlisp
jonatack has joined #commonlisp
danse-nr3 has quit [Ping timeout: 252 seconds]
mgl_ has quit [Ping timeout: 260 seconds]
jonatack has quit [Ping timeout: 272 seconds]
danse-nr3 has joined #commonlisp
danse-nr3 has quit [Remote host closed the connection]
danse-nr3 has joined #commonlisp
waleee has joined #commonlisp
thuna`` has joined #commonlisp
thuna`` has quit [Client Quit]
nij- has joined #commonlisp
<nij-> Is putting (eval-when (:compile-toplevel) (declaim (optimize (debug 3) (safety 3)))) on the top of each file a safe way to enforce (debug 3).. without side-effects after compile time?
<nij-> By figure 3-7 (eval-when processing), it says that the compiler would evaluate the declaim form. But I don't know if that continues to affect after compile time.
<bike> it is implementation defined
<nij-> Also, putting this on top of each file is a bit too cumbersome.. is there anyway to do this once for each system, without side-effect after system compiliation?
<nij-> bike - Oh no. Any way to do it safely file-wise?
<nij-> safely - no side-effects at all after compilation time
<bike> not portably, i believe.
<nij-> I don't want the user to have a global effect after loading this system.
<bike> asdf has an around-compile hook that you may be able to use https://asdf.common-lisp.dev/asdf.html#Controlling-file-compilation
<ixelp> ASDF Manual
<bike> on sbcl you could use the :policy option of with-compilation-unit
<nij-> Hmm. I will study sbcl's compilation policy. Thanks.
<bike> it's described in the w-c-u docstring. and probably the manual
<nij-> But in any case (declaim ..) only works for that file for sure, right? Or does it make a global declaration?
<bike> ::clhs declaim
<beach> nij-: You probably don't want to set OPTIMIZE in each file, because then you are dictating how the users would want to compile it.
<ixelp> CLHS: Macro DECLAIM
<bike> "As with other defining macros, it is unspecified whether or not the compile-time side-effects of a declaim persist after the file has been compiled."
<bike> also yes what beach said, that's a factor
<ixelp> SBCL 2.4.4 User Manual
<beach> nij-: What I do is I set my OPTIMIZE qualities in my .sbclrc file.
<beach> nij-: Then I get what I want when I develop, and users can do as they please.
<nij-> beach Do you proclaim a global declaration?
<nij-> Is there any portable way to check which "mode" the compiler is in? This feature seems quite opaque..
<beach> Yes, I do it globally.
<nij-> Good idea. Let me do that too.
<nij-> There are some projects online that do interesting things. But when you start reading its source code.. inevitably there are some bad practices. I guess it's just difficult to do everything right.
<beach> It is worse than that. People don't agree on what is right.
<nij-> I think in that case, it's fine.
<beach> No it's not. At least not most of the time.
<nij-> But in some case, it's clear that something is better, and the authors may also agree that they haven't thought much on it.
<nij-> Hmm..
<beach> You can't assume that every online project was created with a person with sufficient experience.
<beach> *by a person
<beach> I mean, people can obviously do what they want, including with online projects. But I think it is unfortunate that some inexperienced people are often convinced that they are doing the right thing, despite their lack of experience.
<beach> I guess it's similar to the Dunning-Kruger effect.
yakubin has joined #commonlisp
<nij-> In my case, I know that i just didn't know..
<nij-> But without helps on IRC, I don't know how I would ever know; at least not all details.
<nij-> It may be nice to have a linter. I just checked sblint, but it doesn't seem to complain to my code so far. (I think that implies it's not "strong" enough ;) )
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
<beach> I think scymtym is planning to include linting-like functionality in the code analysis tool he is working on for Second Climacs and similar editors. Then you will get linting at typing speed.
<beach> In fact, there is already some such functionality included.
<yakubin> Hello. Disclaimer: I haven’t learnt Common Lisp yet. I only know some Scheme. I’ve been recently thinking a lot about the debugging tools available in different languages. One of really annoying problems I stumbled into at $dayjob was that watchpoints in GDB are rather slow, if you want more than 4, since x86 supports only 4 hardware watchpoints. If you want more, GDB will just single-step everything and emulate watchpoints in software, which (a)
<yakubin> makes it very slow; (b) it single steps just one thread, which is pretty useless in multi-threaded applications. The issue I was investigating was some kind of memory corruption, where an enum-typed variable had a value completely outside of its range. So I wanted to set a conditional watchpoint, which would stop the program and print a backtrace when it detected that a value out-of-range was assigned to the memory address that the variable resided
<yakubin> at. As I already said, GDB was pretty useless for this task. I’ve been wondering though how tools in other languages would deal with such a problem. I’ve been trying to find some information about watchpoints in Common Lisp debuggers, but there doesn’t seem to be too much written about the topic. Do Common Lisp debuggers have watchpoints? Do they have conditional watchpoints? What is their performance like? What are their limitations?
cmack has quit [Ping timeout: 252 seconds]
<beach> yakubin: You are pretty much out of luck, though perhaps not if you are using a commercial Common Lisp implementation. Debugging is in a very sad state for free Common Lisp implementations.
<yakubin> Hmm. Alright. :(
<beach> yakubin: You can read the "Previous work" section of this paper: http://metamodular.com/SICL/sicl-debugging.pdf
<yakubin> beach: thanks. Will do.
<beach> yakubin: In most free Common Lisp implementations, you can't even set a breakpoint.
danse-nr3 has quit [Ping timeout: 246 seconds]
chomwitt has quit [Ping timeout: 268 seconds]
dlowe has joined #commonlisp
rgherdt has quit [Read error: Connection reset by peer]
rgherdt has joined #commonlisp
danse-nr3 has joined #commonlisp
<skin> yakubin: there are other ways of getting what you want. simply adding (cerror "hi") into wherever you'd want a break point would drop you into the debugger, where (on sbcl) you could inspect and interact with the stack and variables.
varjag has quit [Quit: ERC (IRC client for Emacs 27.1)]
<skin> and if the sources unavailable you could monkey patch the symbols so that they gave you a cerror during your debugging session
PuercoPop has quit [Ping timeout: 245 seconds]
<yakubin> Here I’m thinking specifically about watchpoints. Normal breakpoints don’t help. So I’d like to intercept all writes to a given memory cell, regardless of where they’re coming from. In the case of CLOS slots I think I could just write a custom setf for a given slot, but that assumes the modifications are made in a memory-safe and thread-safe way. If the modification is a result of a data race, then it may just be a result of memory corruption
<yakubin> which wouldn’t be caught by such a custom setf. It looks like the debugging story is best on Allegro CL, but even it lacks watchpoints.
<yitzi> For CLOS you could override slot-value-using-class ... the accessors and readers will use that.
<yitzi> Its in the MOP.
<yakubin> With data races writes will often circumvent accessors.
josrr has joined #commonlisp
<yitzi> race conditions still happen, but in the case of a race condition that doesn't mean the accessor is "circumvented." TBH I don't know what you mean there.
waleee has quit [Quit: WeeChat 4.1.2]
<beach> yitzi: I am not so sure that slot accessors call slot-value-using-class.
<yitzi> Oh?
<beach> In fact, I hope they don't, because that would be very very slow, and I would then have to rewrite Clostrophilia.
<beach> But there are probably some cases where it is required behavior.
<yitzi> Hmmm. I have used them in common-lisp-jupyter to implement custom class slots of various kinds.
<beach> I think if you have custom slots, then yes, that might be required.
<yitzi> Basically, used them to implement notification messages for slot changes
<yitzi> Maybe required for custom metaclass.
<beach> Yes.
<yakubin> yitzi: what I’m thinking of is that due to data races one region of memory can be interpreted by one thread to be of one type and by another thread to be of another type, which will lead to just one of these threads using the proper accessors. Maybe I’m wrong in the case of CLOS though. That’s just my intuition carried from other languages.
<beach> I think that, since you are not allowed to define methods that are applicable when given only instances of specified classes, then in most cases, you don't have to go through slot-value-using-class.
waleee has joined #commonlisp
<beach> yakubin: If that happens with your custom methods, then it would also happen without your custom methods, and then the implementation would be buggy, or at least not thread safe.
<yakubin> beach: yes. That’s the point. I’m trying to find the tools to help me narrow down the bug. :)
yitzi has quit [Remote host closed the connection]
<beach> yakubin: No, I mean, I don't think there is any risk of data race when you define a custom method, unless the implementation is already not thread safe.
<beach> Oh, wait, maybe you are saying that you are trying to find a bug due to data race?
<beach> If so I misunderstood.
<yakubin> beach: yes.
<beach> If the Common Lisp implementation is not buggy, you should not have such data races.
<beach> So if you port your application to Common Lisp the problem will go away. :)
<beach> I mean, there can still be data races due to bad programming of course.
<yakubin> So CLOS multimethod resolution is thread-safe, relative to concurrent writes to the same region of memory? Like Thread A writes an object of type A and Thread B writes an object of type B to the same region of memory.
<beach> But not as a result of modifying a single slot.
<beach> yakubin: Common Lisp does not discuss "regions of memory" at all.
<yakubin> What about array elements then?
<yakubin> Ah. They’re probably boxed though.
<beach> Access to arrays go through AREF and similar operators, so if the implementation is doing the right thing, each access is safe.
<yakubin> Ok.
<beach> That said, we don't (yet) have a memory model for Common Lisp, but bike has been working on one.
waleee has quit [Quit: WeeChat 4.1.2]
<bike> array elements are sometimes unboxed. but even then you can't do that type punning stuff.
waleee has joined #commonlisp
<Inline> erm, are you talking of jvm like thing ?
<bike> not even a little.
<beach> Indeed, I didn't read that very carefully.
<beach> yakubin: Common Lisp uses what I call "uniform reference semantics", so if thread A writes an object of type A and thread B writes an object of type B to the same location, then each write is an aligned memory word, so there is still no data race. One of them will win entirely.
rgherdt has quit [Ping timeout: 260 seconds]
<beach> yakubin: The objects themselves are located on the heap.
X-Scale has quit [Ping timeout: 250 seconds]
<yakubin> And the one that loses can’t cache the old address of a method that it was going to call later, calling it on an object that is now of a different type?
<bike> there could be a problem if you have an array of unboxed octets (or sub-octets) since then it's not all words. i think you would have to be more careful, e.g. implement a safe (setf bit) with an atomic read-modify-write operation instead of just a store.
<yakubin> (basically calling accessor from class A on an object of type B)
<beach> yakubin: You don't call methods in Common Lisp. You call generic functions, and the generic function selects applicable methods based on the class potentially of each required argument.
ocra8 has quit [Quit: WeeChat 4.2.2]
<beach> yakubin: Classes don't have accessors. An accessor is a generic function that has a method specialized to the class in question. If you give it an instance of a different class, then the method will no longer be applicable.
<bike> rather than caching, that could happen if one thread change-class-es an object while another thread is in the middle of dispatch.
<beach> Yes, I was going to say that there are situations where the protocol is not respected.
younder has quit [Remote host closed the connection]
<beach> And the implementation can't necessarily check for those situations.
<yakubin> Oh. I was about to ask about that. Thanks.
chomwitt has joined #commonlisp
X-Scale has joined #commonlisp
chomwitt has quit [Ping timeout: 256 seconds]
<beach> And the other important thing related to the types A and B, objects in Common Lisp are typed, so you can't read or write a variable and get the type wrong, unless you do some nasty stuff with unsafe declarations.
danse-nr3 has quit [Ping timeout: 256 seconds]
danse-nr3 has joined #commonlisp
cage has joined #commonlisp
mesuutt has quit [Ping timeout: 255 seconds]
ocra8 has joined #commonlisp
younder has joined #commonlisp
danse-nr3 has quit [Ping timeout: 272 seconds]
mesuutt has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 252 seconds]
tibfulv has joined #commonlisp
rgherdt has joined #commonlisp
jonatack has joined #commonlisp
mesuutt has quit [Ping timeout: 255 seconds]
X-Scale has quit [Ping timeout: 250 seconds]
anticomputer_ has joined #commonlisp
chiselfuse has quit [Ping timeout: 260 seconds]
anticomputer has quit [Ping timeout: 260 seconds]
chiselfuse has joined #commonlisp
pfdietz has quit [Ping timeout: 250 seconds]
yitzi has joined #commonlisp
Posterdati has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
Posterdati has joined #commonlisp
X-Scale has joined #commonlisp
gilberth has joined #commonlisp
mgl_ has joined #commonlisp
mgl has joined #commonlisp
johnjaye has quit [Ping timeout: 245 seconds]
johnjaye has joined #commonlisp
pfdietz has joined #commonlisp
chomwitt has joined #commonlisp
scymtym has quit [Ping timeout: 260 seconds]
scymtym has joined #commonlisp
chomwitt has quit [Ping timeout: 245 seconds]
josrr has quit [Remote host closed the connection]
josrr has joined #commonlisp
ymir has joined #commonlisp
tfeb has joined #commonlisp
rainthree has quit [Ping timeout: 268 seconds]
chomwitt has joined #commonlisp
anticomputer_ has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
tfeb has quit [Quit: died]
mesuutt has joined #commonlisp
chomwitt has quit [Ping timeout: 256 seconds]
mesuutt has quit [Ping timeout: 268 seconds]
ymir has quit [Ping timeout: 256 seconds]
X-Scale has quit [Quit: Client closed]
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
jamesmartinez has joined #commonlisp
ymir has joined #commonlisp
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tassleoff has quit [Ping timeout: 250 seconds]
mesuutt has joined #commonlisp
ymir has quit [Ping timeout: 268 seconds]
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
mesuutt has quit [Ping timeout: 264 seconds]
zetef has joined #commonlisp
wacki has joined #commonlisp
ymir has joined #commonlisp
awlygj has quit [Quit: leaving]
zetef has quit [Ping timeout: 245 seconds]
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
pranavats has quit [Excess Flood]
pranavats has joined #commonlisp
mesuutt has joined #commonlisp
wacki has quit [Read error: Connection reset by peer]
pranavats has left #commonlisp [#commonlisp]
jamesmartinez has quit []
wacki has joined #commonlisp
<younder> In CLIM the function for a point* should have the arguments: sheet x y &key ink clipping-region transformation line-style line-thickness line-unit
<younder> Instead in McClim for point* I get the arguments: sheet x y &optional g0 .. What is g0?
varjag has joined #commonlisp
<younder> Read 'should have' as ''in the LispWorks CLIM specification'.
pfdietz has quit [Quit: Client closed]
Pixel_Outlaw has joined #commonlisp
<younder> Duh! I missed the &allow-other-keys. The options like :ink work fine
danza has joined #commonlisp
<younder> Still what is g0 and isn't mixing &optional and &key a no-no?
<younder> Oh wait &optional and &key is fine, &rest and &optional on the other hand..
ec has quit [Ping timeout: 260 seconds]
ec has joined #commonlisp
<bike> optional and key together is generally a no no
<bike> optional and rest is weird but less surprising
pfdietz has joined #commonlisp
<younder> That's why I wonder about: stream x y &optional g0 &allow-other-keys
<younder> Is g0 what gets passed when you look for other keys?
<bike> no, it won't be parsed as a key
<bike> also if there's no &key that lambda list is just wrong.
tfeb has joined #commonlisp
zetef has joined #commonlisp
alcor has joined #commonlisp
_cymew_ has quit [Ping timeout: 264 seconds]
danza has quit [Ping timeout: 272 seconds]
<alcor> green_ (or anyone else): Are the commits on the ocicl repository by Daily Price Depot Droid legitimate? I'm a bit wary of commits containing binary blobs that are performed by suspicions-looking user names.
edgar-rfx is now known as edgar-rft
<alcor> I mean the last 6 ones here: https://github.com/ocicl/ocicl/commits/main/
<ixelp> Commits · ocicl/ocicl · GitHub
zetef has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
agm has quit [Read error: Connection reset by peer]
agm has joined #commonlisp
waleee has joined #commonlisp
reb has quit [Remote host closed the connection]
<green_> haha.. yes, they are. I need to fix that.
<alcor> Thanks for the clarification, that scared me a bit.
rgherdt has quit [Ping timeout: 255 seconds]
tfeb has quit [Quit: died]
Posterdati has quit [Ping timeout: 245 seconds]
<Pixel_Outlaw> What's the rule of thumb when making functionality for CLOS objects? Start with methods, or define functions until further complexity is needed?
<Pixel_Outlaw> I've jumped the gun with my turtles I think: https://github.com/RyanBurnside/ldemo/blob/main/turt.lisp
<ixelp> ldemo/turt.lisp at main · RyanBurnside/ldemo · GitHub
Posterdati has joined #commonlisp
mgl has quit [Quit: Client closed]
ymir has quit [Ping timeout: 245 seconds]
rgherdt has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
<aeth> Pixel_Outlaw: DEFUN and DEFMETHOD are similar for a reason imo
<aeth> Pixel_Outlaw: DEFUN until you need polymorphism (or, more rarely, before/after/around)
<paulapatience> Pixel_Outlaw: Your set* methods are redundant. Just use (setf foo).
<aeth> oh, and even simple polymorphism has to compete with a three-line TYPECASE
<paulapatience> (defmethod (setf foo) (...) ...)
<Pixel_Outlaw> @paulapatience, well, those are abstractions for people who want to type in LOGO commands rather than setf ing.
<paulapatience> Oh I see
<Pixel_Outlaw> I'm not going to implement all of LOGO but it's nice for people who have some of those heavily memorized. :)
<paulapatience> Also, if you are intending for users to be able to extend library, you can start with methods
<paulapatience> If not, it doesn't really matter
<paulapatience> s/extend library/extend your library/
tfeb has joined #commonlisp
ym has quit [Ping timeout: 268 seconds]
ymir has joined #commonlisp
<Pixel_Outlaw> I see. I was thinking they might want to use multimethods, especially things like :around to capture state do one of my things then do something different.
<Pixel_Outlaw> Common Lisp is almost too flexible and you have to form your putty roughly in the direction you expect things to go I suppose.
<Pixel_Outlaw> But flexibility is why I like it.
<Pixel_Outlaw> Give me thinking putty any day over something like Rust.
<Pixel_Outlaw> Get a project 70% done and realize some lifetime causes a foundational breakdown.
tfeb has quit [Quit: died]
cage has quit [Quit: rcirc on GNU Emacs 29.3]
attila_lendvai has quit [Ping timeout: 272 seconds]
agm has quit [Ping timeout: 240 seconds]
yitzi has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 272 seconds]
<aeth> Pixel_Outlaw: I think the real question here for your DEFUN vs DEFMETHOD is if it would make sense to subclass turtle
<Pixel_Outlaw> Could be. Sure. Maybe the'll want to implement a terrapin that has three markers to draw with extending the turtle. :P
<aeth> also, since this is for a programming language exposed to the user, you may want to think about how you are going to expose type errors when the users use the wrong typed arguments
<aeth> perhaps defining a second method, not on turtle, and ERRORing a custom condition that you define would be the way to do it?
<aeth> but if the method is just turtle-or-not-turtle then making it a DEFUN and putting a WHEN at the top may be clearer (though less extensible)
<aeth> and either one of those approaches sounds kinda like boilerplate, so perhaps you want a define-turtle-function macro that handles it for you
amb007 has quit [Ping timeout: 245 seconds]
dom2 has quit [Ping timeout: 268 seconds]
chomwitt has joined #commonlisp
<Pixel_Outlaw> I was thinking along those lines too. When I say "user" it'll still be a Common Lisp programmer. These are just to expose (relative geometry?) tto the programmer so he can describe movement in a natural way.
dom2 has joined #commonlisp
<Pixel_Outlaw> Exception handling would be nice though...
<aeth> e.g. ,(progn (defclass turtle ()) (defmethod home ((turtle turtle))) (defmethod home (obj) (error "no")) (home 42))
<ixelp> (progn (defclass turtle ()) (defmethod home ((turtle turtle))) (defmethod home (obj) (error "no")) (home 42)) ERROR: (TURTLE NIL) can't be destructured against the lambda list (CLASS-NAME CCL::SUPERCLASSES CCL::SLOTS &REST CCL::CLASS-OPTIONS), because it does not contain at least 3 elements.
<aeth> oops
<aeth> ,(progn (defclass turtle () ()) (defmethod home ((turtle turtle))) (defmethod home (obj) (error "no")) (home 42))
<ixelp> ERROR: no
<aeth> as opposed to ,(progn (defclass turtle () ()) (defmethod home ((turtle turtle))) (defmethod home (obj) (error "no")) (home (make-instance 'turtle)))
<ixelp> (progn (defclass turtle () ()) (defmethod home ((turtle turtle))) (defmethod home (obj) (error "no")) (home (make-instance 'turtle))) ;Compiler warnings : ↩ ; In (HOME (T)) inside an anonymous lambda form: Unused lexical variable OBJ ↩ => NIL
<aeth> But, as I said, if you're generating it in a define-turtle-function macro, anyway, you can just as easily use DEFUN with a WHEN at the top of the body if it's not a turtle.
shka has quit [Ping timeout: 256 seconds]
wacki has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dom2 has quit [Ping timeout: 252 seconds]
pranavats has joined #commonlisp
dom2 has joined #commonlisp
alcor has quit [Ping timeout: 240 seconds]
ymir has quit [Ping timeout: 245 seconds]
pve has quit [Quit: leaving]
varjag has joined #commonlisp
lxsameer has quit [Ping timeout: 256 seconds]
josrr has quit [Remote host closed the connection]
josrr has joined #commonlisp
varjag has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.2)]
varjag has joined #commonlisp
rgherdt has quit [Quit: Leaving]
ymir has joined #commonlisp
zaymington has quit [Remote host closed the connection]
zaymington has joined #commonlisp
amb007 has joined #commonlisp
ymir has quit [Ping timeout: 256 seconds]
yakubin has left #commonlisp [Bye]
jonatack has quit [Ping timeout: 252 seconds]
ymir has joined #commonlisp
dino_tutter has quit [Ping timeout: 245 seconds]
fitzsim has quit [Ping timeout: 252 seconds]
zetef has joined #commonlisp
mgl_ has quit [Ping timeout: 260 seconds]
amb007 has quit [Ping timeout: 256 seconds]
mesuutt has quit [Ping timeout: 264 seconds]
mesuutt has joined #commonlisp
donleo has quit [Ping timeout: 260 seconds]
zaymington has quit [Ping timeout: 245 seconds]
rtypo has quit [Ping timeout: 256 seconds]
zaymington has joined #commonlisp
tok has quit [Remote host closed the connection]
varjag has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.2)]
chomwitt has quit [Ping timeout: 268 seconds]
yitzi has joined #commonlisp