freenode/#lisp - IRC Chatlog
Search
6:46:33
splittist
I don't see any need for a 2e of TCLCS (I don't have any problems with the style). Perhaps a companion volume in a few years: ITCLCSB - Implementing the Common Lisp Condition System in Blub
7:18:22
phoe
splittist: I actually thought that a second edition of TCLCS could include such a chapter - e.g. a description of implementing a CS in Java (see cafe-latte), and maybe in a non-memory-managed language too if we want to be extra risky
7:21:41
phoe
and there is still stuff that needs to get integrated into the main body from the appendices
7:27:12
phoe
I don't think that a ITCLCSB would be large enough to warrant its own existence, unless we actually do the work and implement those in multiple distinct languages, noting the quirks everywhere
7:33:53
splittist
phoe: I was thinking of your next N papers (as co-author as necessary) as Implementing TCLCS in X, and then the book as a compendium (:
7:43:50
splittist
or just have others write the papers and you can be the editor of the book - "Phoe on Condition Systems" ...
7:45:50
splittist
ACTION imagines the "International Condition Systems Conference" co-located with ELS
7:48:15
no-defun-allowed
"Here we have phoe representing the Common Lisp condition system, and here is psoe representing the Dylan condition system."
7:49:30
p_l
no-defun-allowed: and ploe on "adventures in mandatory stack unwinding land - systemwide exception and condition system in NT"
7:52:07
splittist
Isn't Success (TM) in Academia (TM) mainly about gaming the system? (As opposed to excellence in being an academic, which doesn't seem to be particularly valued.)
7:53:10
p_l
> The machine state of the thread in which the exception occurred is saved in a CONTEXT structure. This information (called the context record) enables the system to continue execution at the point of the exception if the exception is successfully handled.
7:53:35
p_l
so... I can do CL-like conditions in C, so long as it's WinNT and preferably compiled with MSVC
7:54:55
no-defun-allowed
We also have xoe with the intermediate Ralph condition system in the middle.
7:55:53
p_l
so you get cases like ReFS "forking" NTFS driver because of fear of modifying working code
7:56:54
p_l
despite how NTFS logical structure makes it easy to extend (just like ZFS) while most FFS derivatives are hard
7:57:37
phoe
we have somehow strayed from the true path of #lisp on-topic onto the paths of windows kernel quirks
7:57:40
p_l
moon-child: I/O can be plenty fast, especially when you go native, process init is due to different ideas on handling things in NT/VMS vs Linux, which don't really matter for lisp programs
7:59:46
moon-child
my understanding is that nt's i/o is modular in a way that prevents effective caching
7:59:48
splittist
lukego: for playing with CLIME, one would work with your forks of McCLIM and SLIME?
8:01:24
p_l
moon-child: nothing prevents caching, native referred to async I/O instead of sync wrappers, and modularity is problem mainly in the form of annoying other crap injecting itself between cache and your program
8:05:51
no-defun-allowed
I want to implement green threads in SICL. It's not portable across implementation-space, but you can make all your synchronous code "asynchronous" enough.
8:12:25
lukego
splittist: Right. If you check them out and e.g. link the McCLIM into your ~/quicklisp/local-projects/ and put (load "~/git/slime/slime.el") into your .emacs then you should be in business
8:13:34
lukego
(the idea is very much to upstream all this ASAP but I haven't really engaged with that problem yet)
8:19:24
lukego
I've finally (?) fixed some weirdness in Emacs ignoring properties that I put onto images like mouse regions for presentations, the workaround is bizarre but it seems to work now.
8:20:17
lukego
I've also implemented like 80% of ACCEPT now. On the Lisp side you can call the CLIM ACCEPT function and it will bounce that over to Emacs and back to get you an object. the only catch is that Emacs will currently choose that object arbitrarily :). I'm looking at how to do Emacs mouse events now...
8:21:21
lukego
Maybe 80% is a stretch, depends how Emacs will feel about me updating the list of mousable regions on images. maybe I could look at that right now
8:24:53
lukego
that handle is meant in the spirit of carefree innocent hackery, as depicted by e.g. https://www.shutterstock.com/image-vector/two-funny-cheery-exuberant-characters-dressed-114750592, but is probably a poor choice :)
8:30:29
waleee-cl
does anyone know how to explicitly select the gtk3-namespace with https://github.com/andy128k/cl-gobject-introspection ?
8:32:11
waleee-cl
(gir:ffi "Gtk") has the sad property of returning the namespace for gtk4 on my gtk4-recently-added linux distro
8:38:19
waleee-cl
... and (gir:ffi "Gtk" "3.0") fails for reasons. While (gir:ffi "Gtk" "2.0") works peachy
9:27:20
splittist
lukego: I'm getting "CLIME-ACCEPT-IN-EMACS" not found in SWANK package. (And swank-clime.lisp is essentially empty.) I'm sure it's user error...
9:33:24
lukego
Maybe you pulled the clime branch before I pushed that? it went in here: https://github.com/nuddyco/slime/commit/f930f6473b1f4af57d561d62d6cbefd4492015a9. But ahem I see a typo in that commit so let me check and fix that now.
9:38:08
splittist
lukego: same thing. I feel I should be loading the clime contrib somehow (but I'm not)
9:41:11
lukego
Sorry this is horrible for of me to have not tried it on my other computer or at least in a fresh emacs :(
9:43:43
lukego
splittist: okay I tried this in a fresh Emacs now and it worked - got the red circle in the repl - but also an error message that I'll take a look at
9:44:47
lukego
(there's something funny happening where the shape is drawn after the new REPL prompt rather than before it. must be a recent goof. fixing.)
10:07:16
splittist
lukego: On the red circle example I get "error in process filter: Text is read-only", but also a black circle (and a giant cursor afterwards). So I'd call that a qualified success (:
10:07:51
lukego
great perseverance! thanks and congrats! :) the fix I pushed is for that "error in process filter" glitch
10:10:03
lukego
if you're feeling brave you can try https://gist.githubusercontent.com/lukego/e6707cb121224a0d4092577d102a9690/raw/fba491ced67cd93a1e5c83a775054a7e01f40500/gistfile1.txt
10:10:25
lukego
which is supposed to look like https://twitter.com/lukego/status/1389180878757273602/photo/1 including the tooltips over the presentations
10:15:35
lukego
if you hop into *slime-events* and search backwards from the end for :write-clime you can see the SVG code that came over. (Or indeed if you place the Emacs cursor on the image and eval '(text-properties-at (point))'.) but as you say this is already a qualified success :)
10:16:02
lukego
I'm always using absolute RGBA values so there shouldn't be any funny business about color names missing from one side etc.
10:18:06
splittist
lukego: the svg looks right (the 100% is first for +red+, second for +green+ etc.). I'll look at the state of svg support for Windows emacs.
10:19:19
lukego
in the sense that this is covering quite a lot of untested ground and one might have expected much more to have gone wrong :)
10:21:31
splittist
lukego: I want it to work - it would make development of all sorts of things (including McClim) really interesting.
10:22:49
lukego
btw if you want to experiment you can try pasting that SVG into a file and opening that with `C-x C-f` find-file. Emacs should default to rendering it as an SVG and then you can toggle to editing mode with `C-c C-c` to tweak and then again to see the result.
10:23:55
lukego
I've been getting all kinds of surprising results from my calls to create-image in elisp that don't make much sense so spending a lot of time looking for examples that work and trying to compare what I have to those.
10:40:07
p_l
no-defun-allowed: green threads are a bit problematic if the system thread executing them is stopped on an external lock
11:11:10
no-defun-allowed
You could have a relatively not-useless all-Common Lisp networked program, I believe. The only tricky part would be putting your faith into CL-TLS into CL+SSL/OpenSSL.
11:13:18
jackdaniel
aun: fwiw this has "How do I..." section https://common-lisp.net/project/usocket/api-docs.shtml
11:14:53
aun
this is has simple parts that I already figured out and too advanced parts that I m not ready for unfortunately)
11:15:28
aun
I guess the important question is -- whenever it starts listening by default it cannot do anything else (including prints) cuz its all single threaded?
11:15:48
jackdaniel
speaking of encryption, I've always wondered how much of the complexity is due to superficial requirements and how much is required to cover all bases
11:17:30
jackdaniel
when you wait for input, you may specify the timeout (i.e 0 for non-blocking operation)
11:17:55
MichaelRaskin
jackdaniel: there is some inherent complexity of needing to move forward all the way becuase of new kinds of attacks considered. Also a lot of coordination complexity because some systems won't allocate resources to use keys that are not on the edge of being too weak. And it is so much you need a kinf of sliding-window upgrade. And then it's horribly complex.
11:18:59
MichaelRaskin
aun: accept on a socket without timeout or explicit threading is expected to be blocking.
11:19:00
jackdaniel
MichaelRaskin: sure, I'm not saying that encryption is easy, I'm wondering how much complexity comes from quite uncommon requirements
11:19:33
jackdaniel
like this horrible push to new http protocols to gain 0,01% performance bump (which doesn't matter for folks who are not running server farms like google :)
11:21:00
no-defun-allowed
There's also something about dropping connection latency by sidestepping TCP handshakes, but that's silly and indeed off-topic.
11:21:28
aun
jackdaniel MichaelRaskin okay, does IRC have code highlight or should i do pastebin or whatever
11:23:53
no-defun-allowed
Does IRC require newlines at the end of each message? I don't know too much about it.
11:24:58
jackdaniel
aun: instead of calling receive right away, check first whether there is input available
11:25:05
no-defun-allowed
i.e. write (write-line "PASS <password>" stream) or (format stream "PASS <password>~%")
11:25:17
jackdaniel
(listen (usocket:socket-stream your-socket)) ; will return T if there is available input
11:25:40
jackdaniel
it is in that "How do I ..." FAW I've mentioned earlier under "... check whether reading from a socket stream will block? "
11:28:47
jackdaniel
(loop repeat 5 (if (listen …) (return (receive)) (progn (print "Retrying") (sleep .5)))
11:30:03
jackdaniel
the latter will initiate flushing buffers and carry on, while the former will wait until all data is send
11:35:40
aun
I changed it https://codeshare.io/5DLXgW -- and I think if i dont send anything it doesn't send me anything either. Also, I m getting a no-applicable-method error now on my send
11:49:22
aun
see,like, you know about usocket and a friend who "explains" web to me knows F# and has a small snippet of F# code that I m trying to roughly translate)
11:53:40
nij
Hello! Anyone knows how MOP allow us to "hack" defclass, in the sense that you can put more things in it? For example, in the class in the link, there's something called :invariants - https://bpa.st/USJQ
11:55:30
minion
nij: look at amop: AMOP: The Art of the Metaobject Protocol, an essential book for understanding the implementation of CLOS and advanced OO. See <http://metamodular.com/CLOS-MOP>
11:57:07
nij
When, defclass "sees" a nonstandard metaclass, it starts following different instructions?
11:58:43
no-defun-allowed
DEFCLASS expands to MOP:ENSURE-CLASS, which will then call MAKE-INSTANCE on the metaclass with some parameters based on the superclass list and slot list and then the rest of the arguments.
11:59:03
jdz
CLOS follows a protocol (described in AMOP), so in a sense, yes, by providing a custom metaclass (not STANDARD-CLASS), CLOS uses different implementations of generic functions used in CLOS machinery.
12:00:58
aun
jackdaniel anyway, this is how it looks like, https://codeshare.io/5DLXgW if you have time/interest to look at it, I ll appreciate it. Its fine anyway, maybe someone else will help, so dont worry too much)
12:01:16
no-defun-allowed
Look at the shape that <https://github.com/robert-strandh/SICL/blob/master/Code/CLOS/defclass-support.lisp#L279> generates from a DEFCLASS form.
12:01:35
nij
jdz: By the was, do you recommend me read CLOS (Keane's?) and then amop? It sounds like a larger topic.
12:02:10
no-defun-allowed
aun: Note that the F♯ code uses WriteLine but you haven't generated any newlines.
12:02:39
jdz
I did not get much value out of Keene's book, but that was a very long time ago, and maybe I just was reading it wrong, or had preconceptions. AMOP, on the other hand, was an eye opening experience for me.
12:03:08
no-defun-allowed
Just write (write-line "PASS <password>" stream) or (format stream "PASS <password>~%")
12:03:52
nij
jdz: How about this.. How much CLOS do I need to know before jumping to AMOP? I can write simple programs, know gen.fun and methods, know some basics combination of methods.
12:04:27
jackdaniel
amop basically explains clos, so you don't need to know it by heart to read the book
12:05:16
jimka2001
Keene was my first organized introduction to OO.. Prior to that I was really confused by using an object system in a different lisp, which was heavily influenced by CLOS but was a partial implementation which supported single inheritance and single dispatch.
12:06:18
jackdaniel
I've tried your snippet with dummy data and adding newlines makes the server answer with something intelligible
12:06:46
aun
that is such a dumb mistake especially considering that was my first thought when I saw that code
12:06:52
no-defun-allowed
nij: What I am saying is to look at the general shape of the call to ENSURE-CLASS generated. That is how DEFCLASS ends up making an instance of a metaclass
12:08:54
no-defun-allowed
Some form like (defclass foo (bar baz) ((foo)) (:metaclass metaclass) (:random-initarg this)) ends up calling something like (make-instance 'metaclass :name 'foo :direct-superclasses (list (find-class 'bar) (find-class 'baz)) :direct-slots '((foo)) :random-initarg '(this)) from memory.
12:17:07
Duuqnd
nij: If I remember correctly I think the method IRC:PRIVMSG sends messages to channels
12:18:14
pjb
I've got several bot examples in https://github.com/informatimago/lisp/tree/master/small-cl-pgms
12:24:00
nij
I can't figure out why a stream is closed when I create a thread.. could someone helpout? https://bpa.st/L36A
12:27:11
nij
jdz I put the bt:make-thread in the form of the first (and the only one, currently) with-open-file form.. so I don't see why it's closed.
12:27:51
jdz
You create a thread, and by the time thread runs the DISPATCH method is done, and the file is closed.
12:28:47
jdz
The solution is simple: if you want to have the file open in your thread then don't close the file.
12:31:06
no-defun-allowed
You can't depend on when the thread will start relative to when the file is closed.
12:31:10
nij
And within that 0.1~0.2 sec delay, DISPATCH has ended; in particular, the form WITH-OPEN-FILE has ended.
12:31:21
jdz
That's the problem with threads: you don't control when they run. So you must ensure that your code works in all kinds of situations.
12:31:48
no-defun-allowed
In my opinion you should do the writing in one WITH-OPEN-FILE form, then have the thread re-open the same pathname - yes.
12:33:16
nij
no-defun-allowed: Ah! I didn't know you can reopen a file. Lemme see how to do it. Thank you!
12:33:16
no-defun-allowed
You could write a CALL-WITH-LOG-FILE function, then if you so please implement WITH-LOG-FILE from that.
12:34:53
no-defun-allowed
(For your mis-information, I find thread creation and joining to take about 55µs on my laptop.)
12:36:25
no-defun-allowed
But I would ensure the log is closed before the thread is started, and then have the thread open a new stream. Or even have the thread do all of the work!
12:37:01
flip214
hunchentoot even opens/closes the file each time.... so that it can be renamed (eg. via logrotate)
13:15:41
pjb
nij: the closed stream still carry some information you may want to use, notably the pathname (pathname closed-stream).
13:16:19
pjb
nij: you can just use OPEN in dispatch and close the stream in the thread (but use an unwind-protect to ensure you will close it!)
13:17:04
pjb
nij: however, some impementations have protections against sharing streams in threads. notably ccl. You may want to read the implementation documentation about opeon and see if there's an option to deal with those cases (cf :sharing option in ccl OPEN).
13:18:36
pjb
nij: therefore it may be better, easier and more portable to open and close the stream in the thread that uses it.
14:22:47
jcowan
beach: You asked about how C++ compilers do multiple inheritance. The answer is in Stroustrup's book, but more accessibly at https://shaharmike.com/cpp/vtable-part2/ (which is about clang, but gcc uses the same strategy)
14:32:41
beach
What I do remember asking is whether the C++ standard requires a particular implementation. If not, they should replace their vtables and use my generic-dispatch technique instead. :)
14:36:44
pfdietz
I really liked the code snippet idea for SICL presented at ELS. This should make SLOT-VALUE as fast as struct field access in common cases.
15:13:57
jmercouris
hello everyone, Nyxt 2, pre-release 7 is now available: https://nyxt.atlas.engineer/article/release-2-pre-release-7.org
15:14:11
jmercouris
I would appreciate any feedback about bugs since this is the final release we'll do before 2.0.0
16:01:27
frgo
Hello all. I have that question again ... Yes, I know out there are thousands of Lisp interpreters written in C. But ... I am looking for recommendations from you people. I can use C or C++ - on ARM (this is going to be deployed on a XILINX ZYNG FPGA). So - anyone recommend a specific one? Big thanks!
16:13:12
jcowan
There are some choices I would have made differently, like using defparameter rather than defvar, though in the environment they are the same thing.