logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git

Status-update-May-2021.md (2676B)


  1. ---
  2. title: Status update, May 2021
  3. date: 2021-05-16
  4. outputs: [html, gemtext]
  5. ---
  6. Hello! This update is a bit late. I was travelling all day yesterday without
  7. internet, so I could not prepare these. After my sister and I got vaccinated, I
  8. took a trip to visit her at her home in beautiful Hawaii — it felt great
  9. after a year of being trapped within these same four walls. I hope you get that
  10. vaccine and things start to improve for you, too!
  11. In SourceHut news, I've completed and shipped the first version of the
  12. builds.sr.ht GraphQL API. Another update, implementing the write functionality,
  13. will be shipping shortly, once the code review is complete. The next one up for
  14. a GraphQL API will probably be lists.sr.ht. After that it's just man.sr.ht,
  15. paste.sr.ht, and dispatch.sr.ht — all three of which are pretty small.
  16. Then we'll implement a few extra features like GraphQL-native webhooks and we'll
  17. be done!
  18. Adnan Maolood has also been hard at work improving
  19. [godocs.io](https://godocs.io), including the now-available [gemini
  20. version](gemini://godocs.io). I wrote a post just about godocs.io [earlier this
  21. month](https://drewdevault.com/2021/05/07/godocs.io-six-months-later.html).
  22. Here's some secret project code I've been working on recently:
  23. ```hare
  24. use errors;
  25. use fmt;
  26. use linux::io_uring::{setup_flags};
  27. use linux::io_uring;
  28. use strings;
  29. export fn main() void = {
  30. let params = io_uring::params { ... };
  31. let ring = match (io_uring::setup(32, &params)) {
  32. err: io_uring::error => fmt::fatal(io_uring::strerror(err)),
  33. ring: io_uring::io_uring => ring,
  34. };
  35. defer io_uring::finish(&ring);
  36. let sqe = match (io_uring::get_sqe(&ring)) {
  37. null => abort(),
  38. sqe: *io_uring::sqe => sqe,
  39. };
  40. let buf = strings::toutf8("Hello world!\n");
  41. io_uring::write(sqe, 1, buf: *[*]u8, len(buf));
  42. io_uring::submit_wait(&ring, 1)!;
  43. let cqe = match (io_uring::get_cqe(&ring, 0, 0)) {
  44. err: errors::opaque =>
  45. fmt::fatal("Error: {}", errors::strerror(err)),
  46. cqe: nullable *io_uring::cqe => {
  47. assert(cqe != null);
  48. cqe: *io_uring::cqe;
  49. },
  50. };
  51. fmt::errorfln("result: {}", cqe.res)!;
  52. };
  53. ```
  54. The API here is a bit of a WIP, and it won't be available to users, anyway
  55. — the low-level io_uring API will be wrapped by a portable event loop
  56. interface (tentatively named "iobus") in the standard library. I'm planning on
  57. using this to write a [finger](https://datatracker.ietf.org/doc/html/rfc1288)
  58. server.