libera/#commonlisp - IRC Chatlog
Search
16:22:26
jcowan
mfiano: I'd say banning is over the top, but I am careful about what I say on #haskell on the rare occasions I join it, as I don't especially want to attract the attention of a meany. That said, the person to ask is probably a standardizer and it would help if you are having a drink/coffee with them rather than ask an embarrassing question in a public place.
16:22:59
jcowan
(This does not mean that I am opposed to OT or that I refuse to answer embarrassing questions about R7RS standardization.)
16:34:56
jcowan
I kept myself off freenode#lisp for a long time because of the attacks of a similar meany who I do not choose to name (but an important person in the CL community).
16:44:12
mfiano
I honestly have no idea what we are talking about, unless we no longer have a surplus of six streams.
19:15:00
gendl__
Hi, is there a way from inside a CL to detect whether swank is running and if so, on what port it's listening
19:23:17
semarie
gendl__: swank::*servers* might be a way. => "A list ((server-socket port thread) ...) describing the listening sockets. Used to close sockets on server shutdown or restart."
19:58:05
Josh_2
yitzi: with shasht how can I dynamically append keys to a json object? I have a hash table and I want to serialize that as part of an object, not as separate object
19:59:46
Josh_2
I have (shasht:with-json-object stream (shasht:print-json-key-value ...) ;;my hash (maphash (lambda (key val) (shasht:print-json-key-value ..))) .. next hash ..) but I get no output from the hash tables
20:01:42
yitzi
Do you have some code somewhere... or a paste I can look at? I think I understand what you mean...just want to be sure.
20:09:58
yitzi
If you are doing this a lot you could write a general print method that automatically does this for hash table slots.
20:11:17
yitzi
If you look in write.lisp there is a print-json-mop function that you could tweak. Just an idea.
20:11:52
Josh_2
There is a lot of variable information for that class so I decided I'd store it as JSON in postgres rather than tweak my db everytime I come up with a new key
20:14:03
Josh_2
Each slot is a column and the hash tables are jsonb, but when the end user receives a serialized version of the class I wanted the key/vals from those 3 hash tables appended rather than as slot name -> object pairs
21:38:36
Josh_2
When telling another service about the current configured timezone in my system, whats the best way? Should I just use the offset relative to UTC? Along with the location used?
2:06:09
elderK
It's been a pretty long time since I posted here: There seem to be some neat new developments floating about like rpav's cl-autowrap and c2ffi.
2:06:46
elderK
I was wondering if there are any good resources, bar the GitHub page itself, describing how to best use cl-autowrap?
2:06:46
elderK
Could anyone give me a rundown as to why I'd want to use it vs. CFFI's groveler and stuff?
2:07:17
phoe
elderK: a brief and bad example of cl-autowrap is https://github.com/phoe/cl-lzma/blob/master/cl-lzma.lisp
2:08:00
elderK
Also, as a kind of side question: How do you debug your programs? I'm curious as to how you say, step through a Lisp program.
2:08:00
elderK
On YouTube, I've seen some people edit quite complex programs through SLIME. Say Baggers with his graphics videos.
2:08:00
elderK
I was wondering how this works if you have a multithreaded program? Do you have one thread dedicated to running the REPL? Is it simpler than that, more complex?
2:09:06
phoe
depending on the structure of your program, maybe the erroring thread can "forward" the condition to another thread and wait for it to get somewhat handled there - but that is something of a more complex approach where you also don't have the stack visible by default in the slime debugger
2:09:22
phoe
so probably the best way is to let the thread crash and enter the debugger at which point you can, well, debug that thread
2:09:26
elderK
Interesting. I was curious how like, recompiling parts of a program would work in a multithreaded environment.
2:10:15
phoe
if you have anything more complex than that, like needing to replace several bindings at once, you may need to stop other threads before doing this
2:10:33
elderK
I've recently decided I'd like to start moving to CL for pretty much all my personal projects. I'm starting to grow a little disenchanted with modern C++ and stuff. Sure, it's great and has lots of features but keeping up to date is increasingly hard and template metaprogramming remains black magic.
2:10:33
elderK
CL seems much more inviting: The metaprogramming language is the same as the core language.
2:11:07
elderK
Phoe: So to be safe, you kind of need to develop your software with reloading in mind?
2:11:55
phoe
depends on what you mean by reloading and what is the "transaction" that contains things that are to be reloaded
2:12:27
Bike
slime usually has a thread for the repl and some other threads. you can run it in a single threaded mode if you want, though
2:14:43
elderK
Another question I have is how does reloading the entire program, or parts of the program, work when you are using the FFI?
2:14:43
elderK
Unless you handled it nicely in some way, wouldn't you leak resources or maybe just crash entirely?
2:18:20
elderK
:) Also, back to the debugging question: How do you debug your stuff? How do you go about setting breakpoints and stuff?
2:19:17
phoe
the FFI stuff is not a problem unless you unwind your stack, because of UNWIND-PROTECTs along the way
2:19:37
phoe
and most of the time when debugging live programs you do not unwind past the point of freeing these resources
2:22:39
elderK
Is there any point in using CFFI directly as opposed to cl-autowrap? I guess the same can be asked about your implementation's FFI layer directly.
2:24:18
elderK
I figure if you're only going to be using a few functions from some library, you might as well just wrap those yourself.
2:25:10
elderK
I've seen repos that contain a lot of "spec" files I assume are generated by cl-autowrap via c2ffi. It seems to support everything, you'd need to do a build on all platforms.
2:27:46
phoe
ideally the community comes in on every step of the software development process where it is necessary
2:30:51
elderK
Other than just diving in and starting to build stuff, is there anything I can do to learn about CL as quickly as possible?
2:30:51
elderK
As it is, I like to read about Lisp although since I've not really used it for serious work, much of what I have read has decayed.
2:31:25
minion
elderK: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
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.