IRC channel logs
2023-04-17.log
back to list of logs
<ArneBab>cow_2001: cyclic equal? is the only intrinsic failure of Guile on r7rs benchmarks (the other is just a regular timeout) <cow_2001>what's an intrinsic failure? one where the current architecture of Guile makes it impossible to pass? <cow_2001>but i want to just adapt this queue into a deque as exercise 3.23 told me <ArneBab>(actulally I wrote it for something else and then realized that only a little bit of extra work would make it implement srfi-134 :-) ) <cow_2001>nonononononono! i have to do it with this here tiny brain of mine <ArneBab>and then maybe steal the scaffolding that turns the deque into srfi-134? :-) <ArneBab>(more than half of srfi-134 are just wrappers) <dokma>ArneBab, cow_2001: lads, have you perchance used guile-websocket ?? <dokma>Is any of those the "standard" one? <dokma>Oh... I see at the top that the one you posted is an adaptation. <dokma>ArneBab: I have no idea what I should pass to make-websocket by dthompson. "wss:ws.vi-server.org" doesn't work. <ArneBab>dokma: yes, I hacked on it without any concern for generality <dokma>I tried wss: ws: 443: https: <ArneBab>I guess that uri is an uri: you’ll want something like make-uri <dokma>Like (make-websocket (make-uri "wss:blah")) = <dokma>(define (make-websocket uri-or-string) <dokma> "Create and establish a new WebSocket connection for the remote <dokma>resource described by URI-OR-STRING." <dokma>Though it states that it accepts URI-OR-STRING <ArneBab>see File: guile.info, Node: URIs, Next: HTTP, Prev: Types and the Web, Up: Web <ArneBab>The hint to that is in the imports: (web uri) ← that’s documented in the info manual. Approach to find it: open the info manual in emacs or with `info (Guile Reference)` and then use C-s uri- C-s to full-text-search it :-) <dokma>I'm reading it already. But it seems to me that make-websocket should accept "wss:server" <dokma>Am I wrong in that assumption? <dokma>I tried wss://server as well but it does not work either <ArneBab>I don’t know — my version is older and accepts a socket. <ArneBab>It looks like it will accept (build-uri 'wss … ) <dokma>I used gdb to track the problem to the fact that when I pass wss:blah, C lib's getaddrinfo gets 0x0 for the server part ... <ArneBab>good luck! I wish we had more examples in the code … <ArneBab>It would be cool if you could write an example for the README and send it as patch to dthompson once you got it running! <dthompson>dokma: the client and server work with unencrypted connections <dthompson>you'd need to do some guile-gnutls integration to use encrypted connections <dthompson>back when I wrote this I tested that I could use the guile websocket client or a web browser to talk to a guile websocket server. <dokma>But this doesn't fly: (make-websocket (string->uri "ws://ws.vi-server.org")) <dokma>ERROR: In procedure getaddrinfo: <dokma>In procedure getaddrinfo: Servname not supported for ai_socktype <dthompson>I recommend trying to connect to a local server first <dthompson>looks like something unrelated to guile-websocket is going on there <dokma>clib's getaddrinfo receives NULL for the host part when I debug in gdb <dthompson>or use guile's socket API to connect to that host directly and see if it worsk <dthompson>I haven't actually used this code in years. I wrote it before guile's web API had built-in support for TLS connections even. <dokma>I see... maybe open-socket-for-uri is the better choice? <dthompson>dokma: ooh yes! that did not exist when I wrote this code. <dthompson>give that a shot. if you get something that works I would totally take a patch. <ArneBab>dokma: for SSL I use nginx as ssl-terminator <dthompson>ArneBab: that's good for the server side of things but dokma is using the client right now <dokma>Yes, I am trying to connect to the Binance socket to access the exchange data. <dokma>I want to do some trading algos in Scheme in order to allow me to write algos that would take the trading algos and attempt to improve them. <dokma>From what I've learned, Scheme is basically ideal for these kinds of tasks. <wklew>literally watching the news as we speak about binance doing massive obvious fraud (no surprise) <old>can't be worse than Celcius <old>or maybe it can actually <wklew>maybe. that took a long time to fully unpack, i guess this will probably be similar. <dokma>wklew: I don't trade there. I just take their data as they're one of the largest exchanges. <wklew>seems like an incredibly bad and harmful idea to do any of it but whatever <old>unmatched-paren: I think you can't return a value in an exception handler without unwinding the stack <old>you have to throw another exception <old>or restart the continuation if using call-with-abort-prompt <RhodiumToad>(raise) raises an exception in a non-continuable context, so the exception handler can't just return <old>If you want to have acccess to the stack frames, e.g. for printing a backtrace and returning a value <old>you have to use two handlers. a pre-unwind and a post-unwind <old>that's what `catch' does I think <RhodiumToad>(raise-exception blah #t) raises a continuable exception, which means if the exception handler returns a value, it becomes the value returned by raise-exception <RhodiumToad>er, might be (raise-exception blah #:continuable? #t) <old>Right the continuation cna be restarted in that case from the handler if nothing is thrown <unmatched-paren>how do i suppress this warning? "imported module (...) overrides core binding `&error'" <unmatched-paren>my condition support module re-exports most things from SRFIs 34 and 35, which seems to be causing it to complain <RhodiumToad>btw, if you ever find yourself needing #:duplicates, be aware that there's a horrible bug <RhodiumToad>specifically, it's processed too late, though there is a workaround by using (define-module) twice, first with just the #:duplicates clause, then with everything else <RhodiumToad>this is especially an issue when using goops and merging of generics