becls/swish

Export async I/O capabilities for client implementations

Closed this issue · 6 comments

Swish provides Generic server and HTTP server interfaces. Those are dedicated to server applications. They can not come in handy without communication with others, like Database, Queue, Cache and APIs.

So I wonder does Swish support developing network clients? I find no references on Swish documentation.

Perhaps you are looking for connect-tcp to connect to a network service. If the service uses an HTTP-like protocol, http:read-status and http:read-header may help as well.

@payneca I see it in io.ss. But I did not find procedure named like connect-udp. What about the event loop for asynchronous sockets? Perhaps one should implement all these low-level ports on top of Swish. And It's like Swish needs more guides and API docs.

UDP isn't currently supported in Swish. It has never been a priority for us. An API could be exposed from osi.c to connect and communicate over UDP using libuv's primitives providing callbacks into Scheme to allow user-code to reassemble datagrams for an application.

Another option would be to create a separate C library (loaded via load-shared-object) that performs some amount of UDP packet handling. That library could use either osi_add_callback or osi_send_request to call back into Scheme for processing data.

Thanks for the details. As I understand more of Swish, I could make applications out of Swish that run in production. Bring the power of ChezScheme into the software industry, and help the community grow.

One more question I am curious about what editor or IDE do you use for writing ChezScheme code? I mean core members of Swish. I use Emacs, but very young to it.

That's right. Using swish-build, you can compile standalone applications that use any of Swish or Chez Scheme's runtime capabilities.

We use Emacs with Swish-Lint for navigation, code completion, and indentation.

I see. As I am not familiar with Emacs Lisp either, I will keep using built-in CMUScheme mode with paredit package.

Swish-Lint could be used in CI or VCS hooks. I am going to close the issue.

Thanks again.