Tech News
← Back to articles

Vali, a C library for Varlink

read original related products more articles

Announcing vali, a C library for Varlink 2025-10-04

In the past months I’ve been working on vali, a C library for Varlink. Today I’m publishing the first vali release! I’d like to explain how to use it for readers who aren’t especially familiar with Varlink, and describe some interesting API design decisions.

What is Varlink anyways?

Varlink is a very simple Remote Procedure Call (RPC) protocol. Clients can call methods exposed by services (ie, servers). To call a method, a client sends a JSON object with its name and parameters over a Unix socket. To reply to a call, a service sends a JSON object with response parameters. That’s it.

Here’s an example request with a bar parameter containing an integer:

{ "method" : "org.example.service.Foo" , "parameters" : { "bar" : 42 } }

And here’s an example response with a baz parameter containing a list of strings:

{ "parameters" : { "baz" : [ "hello" , "world" ] } }

Varlink also supports calls with no reply or with multiple replies, but let’s leave this out of the picture for simplicity’s sake.

Varlink services can describe the methods they implement with an interface definition file.

... continue reading