freenode/lisp - IRC Chatlog
Search
14:30:33
beach
In fact, the standard Linux kernel can't handle a synthesizer program correctly. It requires special kernels options.
14:30:40
bobross
https://bin.privacytools.io/?1bfac7ec8036a25c#iDiwwxT7hu3R2UZ6vaKsnna/LLtrzBQDj0IaLi8a2gg= this is the code, if someone could have a look. Trying to handle the connection in 'ssl-handler'
14:32:18
phoe
if cl+ssl handles this correctly, then this will flush the buffers and send all data stored there to the server
14:34:44
phoe
bobross: does that come from the client or the server? could you paste the stacktrace somewhere?
14:35:36
bobross
As far as I can tell it comes from trivial-utf-8:read-utf-8-string. Will post stack trace, 1 moment.
14:36:20
bobross
https://bin.privacytools.io/?89260da78d6ba548#LfRQc/oOOxDH61J9k5yoRAsJlg8mctnYK9ErIe0qfsY=
14:37:09
bobross
Yea, I'm using trivial-utf-8 because the application I will use it for needs to use UTF-8 encoded messages. But really, that call could be replaced with a "read-bytes" of some sort. Not sure how to do this in CL.
14:40:00
bobross
Hmm. What's strange is that earlier I managed to read the request after closing the connection of the client (using an external application for the client)
14:48:05
bobross
A side note: when using the 'bombadillo' client I can send a request with 'bombadillo gemini://127.0.0.1:61111/test', which hangs, but once I ctrl-C the request is received successfully
14:50:32
bobross
Honestly I'm not sure. I found the documentation a bit vague. But the clients I mentioned in the previous comment should setup TLS correctly.
14:52:40
bobross
I've looked at that code, and from what I can tell the primary difference is that in the handler 'cl+ssl::*ssl-global-context*' is set directly, and that 'read-line-crlf' (from cl+ssl docs) is used to read from the stream. I couldn't get the 'read-line-crlf' function to run on my end
14:53:43
bobross
There are some short examples for cl+ssl here: https://github.com/cl-plus-ssl/cl-plus-ssl/blob/master/example.lisp
15:47:52
bobross
phoe: After some fiddling the error stops when not using '(usocket:socket-close socket)' on the client, and the request can be read by looping read-byte
15:49:24
bobross
Yep I agree. I would have thought you could read a "TCP message" completely with a single command?
15:50:27
phoe
I think there might be some sort of weirdness happening if you pull the carpet from under cl+ssl while it does its work - that's why I suggested first closing the tls-stream and then closing the socket stream
15:53:25
bobross
Still getting the same error in that case. But from how I interpret the documentation https://common-lisp.net/project/cl-plus-ssl/ the stream should be closed automatically
15:55:45
bobross
TwoNotes: so since it is a byte stream it is not possible to "read the single TCP message" without reading byte by byte and detecting the end of the message?
15:56:49
phoe
ultimately, TCP is a stream protocol, meaning that you get a stream of bytes instead of a stream of messages
15:57:11
phoe
that's different than e.g. UDP, where each packet is its own message, or SCTP, which has a concept of messages.
16:00:41
phoe
when working with raw TCP sockets and nonetheless doing messaging over the stream, usually you read whatever you can and then check if you can "pop" a complete message off the stream
16:01:19
phoe
if you do so, you copy it from the buffer, send into the system, and flush the buffer to remove the already processed bytes
16:01:39
TwoNotes
protocols built on top of TCP define their own 'message' boundaries. Some use prefix byte counts
16:02:10
bobross
So what you mean is that I create in Lisp a "buffer" (e.g. array), read byte by byte, stop at some point, convert the message to e.g. string, then handle it?
16:02:55
TwoNotes
Yes. Just remember that when you start doing that, the end of your 'message' may not have yet arroived over the stream.
16:03:25
TwoNotes
A TCP impolementation that delivers data to you two bytes ata time is perfectly valid.
16:03:58
bobross
Right, but they are guaranteed to be in the correct order due to the protocol right?
16:09:20
bobross
Thank you both very much. Btw I get an error when trying (read-line ...) https://bin.privacytools.io/?043fafaff2b73aab#hGRcZWXG7y/LsZvbrlBxJAr2aRkQWeOS7c8qPxjxON4=
16:12:44
bobross
I will try a similar approach to read-line-crlf in https://github.com/cl-plus-ssl/cl-plus-ssl/blob/master/example.lisp I guess
16:15:32
phoe
https://github.com/cl-plus-ssl/cl-plus-ssl/blob/2b823f11ec69f32ebb94bb96031682009374d4f7/test.lisp#L181
16:20:18
phoe
you could try passing :external-format '(:utf-8 :eol-style :crlf) to the created stream and use characters/strings
16:20:20
bobross
I'm trying to implement a Gemini server following the protocol, which says all headers must be UTF-8
16:20:59
bobross
Oh I see. I will try that later, thank you! Really need to go to walk my dog. I might drop by later.
16:51:59
rogersm
On windows, .dll files should be put in one of the directories listed in the PATH environment variable.
17:25:23
bobross
phoe: Reading/writing through the TLS stream seems to work using ":external-format '(:utf-8 :eol-style :crlf)" as you suggested!
17:58:54
emacsomancer
for SBCL compiled binaries, what is the source of a "Can't find core file relative to ...." error?
18:04:47
max3
"a Symbol identifying the kind of expression. A symbol is an interned string identifier (more discussion below)."
18:18:00
axion
We wanted all of our game algorithms in one repository/system, so there is only a single system now.
18:18:15
pjb
minion: memo for beach: quicksort optimization (branchless Lomuto partitioning): https://blog.reverberate.org/2020/05/29/hoares-rebuttal-bubble-sorts-comeback.html
18:22:53
axion
There was a backwards-incompatible change with all my Quicklisp releases anyway, in that I adopted reverse domain name notation for system/package names, now that PLN is widespread enough, as some of my systems and packages were rather generic and not fair to the ecosystem and Lisp image
19:00:35
emacsomancer
maybe related to the "can't find file relative to core..." errors, does uiop:run-program expect a full path (for a compiled binary)? [e.g. is (uiop:run-program "bash") ok, or should it be (uiop:run-program "/usr/bin/bash") ? ] - I would have assumed it would just check the relevant $PATH
19:15:13
phoe
wait a second though - could you paste the full error along with the stacktrace anywhere?
19:16:38
emacsomancer
phoe: I'm getting reports from someone else, so this is all I have currently: http://dpaste.com/0PNDSZ8
19:17:27
emacsomancer
(I'm still wondering if asdf:progam-op shouldn't be sufficient - e.g. next browser (which is relatively complex with a number of moving pieces) builds everything with asdf:progam-op)
19:19:54
emacsomancer
when I build and run on my own system, they run find, no matter where I run them from
20:13:31
bobross
phoe: Another update... Successfully managed to load a file with an external Gemini client now :D
20:27:14
_death
hmmm.. define-modify-macro in the clhs takes a parameter named "function" which is a symbol.. but I don't see anything saying it should be the name of a function.. since it shows an equivalency I claim it should work with names of other kinds of operators as well, say (define-modify-macro andf (&rest args) and) .. apparently the message introducing d-f-m ( http://cl-su-ai.lisp.se/msg05411.html ) uses that name and it's just been kept
20:27:15
_death
as-is.. I don't yet understand the define-setf-expander ("define-setf-method") example there btw..
20:30:42
bobross
Will do! I am planning to make the source code available when I feel it's in a good state... Will let you know at that point
20:43:40
Bike
_death: the define-setf-method thing seems to be defining a destructurer. like (let (x y) (setf (cons x y) (list 1 2 3)) (values x y)) => 1, (2 3)
20:48:41
_death
that makes sense.. but what functionality does get-destructuring-backquote-setf-method give (as opposed to get-setf-method/expansion) .. maybe it's more like (setf `(,x ,y) ...) ?
20:51:30
pfdietz
Xach: I will deal with that finalize-inheritance problem in sel within the next couple of days. It's problematic.
20:56:55
_death
Bike: I guess it was still not exposed.. it's a good question whether get-destructuring-backquote-setf-method is actually get-setf-expansion
21:38:35
scymtym
lessandro`: the channel topic has links to multiple websites with logs. one is https://irclog.tymoon.eu/freenode/%23lisp
21:44:22
pve
hi, is something like #\Newlin|e| allowed syntax? (it works on sbcl and gives #\Newline)
21:50:58
phoe
"When the token x is more than one character long, the x must have the syntax of a symbol with no embedded package markers. In this case, the sharpsign backslash notation parses as the character whose name is (string-upcase x)"
21:56:25
phoe
oh right, if I understand correctly, then the \ in #\Newline is re-interpreted as a single escape