libera/#commonlisp - IRC Chatlog
Search
4:02:33
paulapatience
<elderK> ":) Also, back to the debugging..." <- Sly provides stickers that store the values of forms when they are executed, and you can play them back at will (I don't know about Slime, as I don't use it). Also, you can insert (break) statements where you will. There's also (trace).
4:08:23
beach
paulapatience: But here is my favorite scenario: My program encounters a condition that is caught by the debugger, and there is a restart that I can use, and the restart will continue executing one of the functions already on the stack, say F. Before continuing, I would like to put a breakpoint in F at some point after the current function call done by F.
4:08:25
beach
But I can't. To use a BREAK form, I have to recompile F, and then it is not the same function as the one on the stack. In general, debugging techniques that require you to debug a different program from the one that exposed the issue are not desirable.
4:24:24
beach
But if we had a real debugger and if our Common Lisp systems allowed us to set breakpoints in existing compiled code, I could have done it.
4:26:01
beach
Since you can't set an arbitrary breakpoint, you can't execute up to a break point and then step after that. You have to step from the beginning.
4:26:43
paulapatience
Hah, I never thought about that. I didn't realize that we can't set breakpoints like in other languages
4:27:29
beach
paulapatience: It is not the language. It is just that our free Common Lisp implementations don't allow it, or at least not in a way that can be exploited.
4:28:47
beach
I researched the capabilities of all commonly used Common Lisp implementations for this paper: http://metamodular.com/SICL/sicl-debugging.pdf
4:28:53
paulapatience
I've already used edebug for elisp, but I never got around to wondering why I couldn't do that in CL
4:30:04
beach
The sad thing is that SBCL maintained the breakpoint capability of CMUCL, but it is used only for tracing.
4:30:48
beach
Since it is not documented, I am not sure this mechanism would be safe to use in a debugger. Plus, of course, we don't have a debugger in the first place.
4:35:08
beach
So here we are, with an excellent language with excellent capabilities for introspection, and with a fantastic condition system. But it is more comfortable to debug C programs with GDB than to debug Common Lisp programs with our current free tools.
4:39:26
paulapatience
So if I understand correctly, we can't reuse SICL's debugger in other implementations
4:39:58
paulapatience
But the section describing Clordane seemed to suggest you could compile the application with SICL and then run it in another implementation
4:40:13
beach
You would need to convince the maintainers of existing Common Lisp implementations to add such support.
4:42:12
beach
You could of course develop your program with a Common Lisp implementation that allows all this debugging support, and then run it in production after compiling it with (say) SBCL.
4:43:16
beach
We do execute SICL code inside a host Common Lisp system, but only for the purpose of bootstrapping.
4:44:58
paulapatience
What is the general status of SICL, anyway? I first heard about it in #clasp, so I guess parts of it are used there
4:46:36
Bike
there's also a few bits of sicl in the runtime, like the definitions of shiftf and rotatef off the top of my head.
4:49:35
paulapatience
(Currently really hypothetically, since I'm quite busy with my studies at the moment, but possibly eventually)
4:49:50
beach
paulapatience: Currently, it is not practical to contribute to the essence of SICL, which is the bootstrapping procedure. But you could work on a library that implements some standard feature, like Parcl for the package system, for instance.
4:51:52
beach
paulapatience: The thing with SICL is that we seem to move towards a situation where there is pretty much only the bootstrapping procedure left, and the rest is imported as implementation-independent libraries.
4:52:42
paulapatience
Bike: Keeping in mind that I've never worked on a compiler before, this is something that would definitely interest me
4:53:09
beach
They are "implementation independent", but in fact, it is pretty much required to use something like SICL bootstrapping procedure in order to make them part of a new Common Lisp implementation.
4:54:40
paulapatience
beach: Working on those libraries sounds good to me as well. I've perused a few of them to try to learn things
4:55:17
beach
Well, these are libraries that implement some part of the standard, so special care would have to be taken in the implementation strategy.
4:55:53
Bike
(clasp also uses the CLOS discrimination mechanism beach came up with, but it's an original implementation instead of reused code)
4:56:25
paulapatience
Bike: Well, ok, if you find some self-contained, not urgent task you think might be good for me, I'd gladly give it a shot
4:56:30
beach
And I would like to turn phoe's condition system into one that can be used intrinsically too.
4:59:25
Bike
"self-contained" might be a challenge... some stuff i'd like to do is witch to using trucler instead of its homegrown environment system, and porting the various particular type derivers and optimizations that are currently clasp-specific (but shouldn't require much understanding of clasp)
5:02:12
paulapatience
Bike: where in the source should I start reading? (I can start familiarizing myself with it, but writing any code will have to wait until I finish my predoc exams in two weeks)
5:04:44
paulapatience
That's good. I also tend to take on more projects than I am able to handle at once, but I've been wanting to contribute to SICL, Clasp, etc., for some time
5:05:17
Bike
i would start with the documentation website, and the cleavir-example system to get an idea of how things function overall
10:26:11
Shinmera
Pathnames on their own without open/etc are fairly useless, and those you can only implement if you can implement streams, etc.
10:27:46
Shinmera
I have written two libraries to help with wrangling pathnames; pathname-utils and filesystem-utils.
10:34:46
buffet
question about specificity with multiple inheritence: if i have A extends B, and X extends Y, then i make a new class K which extends A, X. does B or Y have higher specificity for K?
10:41:08
jackdaniel
buffet: this describes the algorithm for standard classes: http://www.lispworks.com/documentation/HyperSpec/Body/04_ce.htm
10:43:14
pve
Wow, I was just wondering how the class precedence list is computed, and then a link magically appears :)
10:55:44
buffet
struggling a bit to invoke c2mop:compute-class-precedence-list, i got http://0x0.st/oCII.txt
11:28:08
jackdaniel
it is nice if your implementation provides a method specialized on a symbol but it is not required
11:28:54
jackdaniel
unless you really really insist on the implementation doing the work to compute it /again/
13:46:25
phantomics
Does anyone have an idea what the overhead of (adjust-array) is? I'm using it to reference small bits of a big array, changing the displaced-index-offset to do so, but it's a bit annoying that I have to pass the shape and :displaced-to every time rather than just being able to assign a new offset
13:48:52
phantomics
Ok, I don't change the length though, just the offset but it needs to calculate for the new length each time?
13:49:14
phantomics
How do I do that, afaik (adjust-array) requires you to give the desired shape each time
13:49:19
pjb
No, the length of the displaced array is the size of your window, it's unrelated to the size of the original array. Only it has to fit within.
13:50:23
phantomics
Got it, in my case I'm already storing the window dims and then just referencing them for every (adjust-array) invocation
13:50:52
phantomics
IIRC it also requires that I pass the :displaced-to each time even if it's the same as last time
13:52:02
Bike
adjust-array may not be super optimized, but if you give it an adjustable array it should at least be O(1). it looks like sbcl will inline adjust-array, but the inline body does a lot of checks
13:52:19
pjb
(adjust-array da (length da) :displaced-to (array-displacement da) :displaced-index-offset new-index)
13:52:41
phantomics
I don't know if it could optimize away doing the shape calculation if I'm keeping the same shape every time
13:53:26
pjb
(adjust-array da (array-dimensions da) :displaced-to (array-displacement da) :displaced-index-offset new-index)
13:54:01
phantomics
Could SBCL's compiler recognize the above code and optimize to just change the offset?
13:54:05
pjb
since they're accessors, you can consider the displaced array as an object or structure with the fields containing your pre-computed values.
13:55:39
Bike
it doesn't look like sbcl inlines unless the new dimensions are an integer. you might have to look deeper yeah...
13:57:44
phantomics
I see. Could be worth asking about. The window can't be a vector because the neural net I'm using requires a column as its input - it's a vector with 1 appended to its dims
14:00:49
Bike
i don't know how familiar you are with interpreting these, but the second lambda list with (array integer ...) indicates that this transform is only applied when the second argument is derived to be an integer. which it sounds like will not be the case for you.
14:10:11
pjb
phantomics: if you want to optimize, you could consider changing the order of the indices, so you can displace a vector.
14:12:57
phantomics
Bike: that's correct, I could see about modding the code that accepts it to handle vectors, but that gets into another realm of array stuff
14:14:07
phantomics
I could also render the big source array into a vector of X by 1 column arrays to save compute time, but that would be really wasteful of memory
14:33:52
Bike
phantomics: multidimensional arrays are probably not going to be as optimized as vectors generally. i would represent a column vector as a vector if at all possible.