logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git
commit: d4501dafce546ee27f9901161354a0a4dd5ad059
parent 394261484238d969ec54e96a28b9a760299bd44a
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 16 May 2021 13:38:22 -0400

Status update, May 2021

Diffstat:

Acontent/blog/Status-update-May-2021.gmi45+++++++++++++++++++++++++++++++++++++++++++++
Acontent/blog/Status-update-May-2021.md66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 111 insertions(+), 0 deletions(-)

diff --git a/content/blog/Status-update-May-2021.gmi b/content/blog/Status-update-May-2021.gmi @@ -0,0 +1,45 @@ +Hello! This update is a bit late. I was travelling all day yesterday without internet, so I could not prepare these. After my sister and I got vaccinated, I took a trip to visit her at her home in beautiful Hawaii — it felt great after a year of being trapped within these same four walls. I hope you get that vaccine and things start to improve for you, too! + +In SourceHut news, I’ve completed and shipped the first version of the builds.sr.ht GraphQL API. Another update, implementing the write functionality, will be shipping shortly, once the code review is complete. The next one up for a GraphQL API will probably be lists.sr.ht. After that it’s just man.sr.ht, paste.sr.ht, and dispatch.sr.ht — all three of which are pretty small. Then we’ll implement a few extra features like GraphQL-native webhooks and we’ll be done! + +Adnan Maolood has also been hard at work improving godocs.io, including the now-available gemini version. I wrote a post just about godocs.io earlier this month. + +=> gemini://godocs.io godocs.io via Gemini + +Here’s some secret project code I’ve been working on recently: + +``` +use errors; +use fmt; +use linux::io_uring::{setup_flags}; +use linux::io_uring; +use strings; + +export fn main() void = { + let params = io_uring::params { ... }; + let ring = match (io_uring::setup(32, &params)) { + err: io_uring::error => fmt::fatal(io_uring::strerror(err)), + ring: io_uring::io_uring => ring, + }; + defer io_uring::finish(&ring); + + let sqe = match (io_uring::get_sqe(&ring)) { + null => abort(), + sqe: *io_uring::sqe => sqe, + }; + let buf = strings::toutf8("Hello world!\n"); + io_uring::write(sqe, 1, buf: *[*]u8, len(buf)); + io_uring::submit_wait(&ring, 1)!; + let cqe = match (io_uring::get_cqe(&ring, 0, 0)) { + err: errors::opaque => + fmt::fatal("Error: {}", errors::strerror(err)), + cqe: nullable *io_uring::cqe => { + assert(cqe != null); + cqe: *io_uring::cqe; + }, + }; + fmt::errorfln("result: {}", cqe.res)!; +}; +``` + +The API here is a bit of a WIP, and it won’t be available to users, anyway — the low-level io_uring API will be wrapped by a portable event loop interface (tentatively named “iobus”) in the standard library. I’m planning on using this to write a finger server. diff --git a/content/blog/Status-update-May-2021.md b/content/blog/Status-update-May-2021.md @@ -0,0 +1,66 @@ +--- +title: Status update, May 2021 +date: 2021-05-16 +outputs: [html, gemtext] +--- + +Hello! This update is a bit late. I was travelling all day yesterday without +internet, so I could not prepare these. After my sister and I got vaccinated, I +took a trip to visit her at her home in beautiful Hawaii &mdash; it felt great +after a year of being trapped within these same four walls. I hope you get that +vaccine and things start to improve for you, too! + +In SourceHut news, I've completed and shipped the first version of the +builds.sr.ht GraphQL API. Another update, implementing the write functionality, +will be shipping shortly, once the code review is complete. The next one up for +a GraphQL API will probably be lists.sr.ht. After that it's just man.sr.ht, +paste.sr.ht, and dispatch.sr.ht &mdash; all three of which are pretty small. +Then we'll implement a few extra features like GraphQL-native webhooks and we'll +be done! + +Adnan Maolood has also been hard at work improving +[godocs.io](https://godocs.io), including the now-available [gemini +version](gemini://godocs.io). I wrote a post just about godocs.io [earlier this +month](https://drewdevault.com/2021/05/07/godocs.io-six-months-later.html). + +Here's some secret project code I've been working on recently: + +```hare +use errors; +use fmt; +use linux::io_uring::{setup_flags}; +use linux::io_uring; +use strings; + +export fn main() void = { + let params = io_uring::params { ... }; + let ring = match (io_uring::setup(32, &params)) { + err: io_uring::error => fmt::fatal(io_uring::strerror(err)), + ring: io_uring::io_uring => ring, + }; + defer io_uring::finish(&ring); + + let sqe = match (io_uring::get_sqe(&ring)) { + null => abort(), + sqe: *io_uring::sqe => sqe, + }; + let buf = strings::toutf8("Hello world!\n"); + io_uring::write(sqe, 1, buf: *[*]u8, len(buf)); + io_uring::submit_wait(&ring, 1)!; + let cqe = match (io_uring::get_cqe(&ring, 0, 0)) { + err: errors::opaque => + fmt::fatal("Error: {}", errors::strerror(err)), + cqe: nullable *io_uring::cqe => { + assert(cqe != null); + cqe: *io_uring::cqe; + }, + }; + fmt::errorfln("result: {}", cqe.res)!; +}; +``` + +The API here is a bit of a WIP, and it won't be available to users, anyway +&mdash; the low-level io_uring API will be wrapped by a portable event loop +interface (tentatively named "iobus") in the standard library. I'm planning on +using this to write a [finger](https://datatracker.ietf.org/doc/html/rfc1288) +server.