This is an automated archive made by the Lemmit Bot.

The original was posted on /r/programminglanguages by /u/faiface on 2024-10-08 13:35:09+00:00.


Hello, everyone!

I’d love to share something I made! It is related to programming language design because session types are something that hasn’t been much applied in practice, and if known about and used, I’m sure will lead to new exciting programming languages.

I’ve been fascinated by linear logic and session types for a while and found it sad it’s not really applied in practice. There is a lot of wonderful research on how concurrency can be made structured and robust this way, here are some papers I’d recommend:

The reason seems to be it’s hard to design libraries, or even languages, that employ these concepts in an ergonomic and easy to use way.

So, here’s my take on trying to do better. Let me show you a new library I made, which I shamelessly called ‘par’.

Let me know what you think! If you want to join and contribute, you’re very welcome as well!

Features

  • Specify full concurrent protocols — Sequencing, branching, recursion, higher-order patterns.
  • Type-checked protocol adherence — Expectations delivered, obligations fulfilled.
  • Deadlock freedom — Cyclic communication is statically ruled out.
  • Multiple concurrent participants.
  • Fits well with Rust’s type system:
    • Use enums for making choices.
    • Use recursion on types for cyclic protocols.
  • Built on top of async/.await. Runtime agnostic.
  • Ergonomic design — eg. atm.choose(Operation::CheckBalance)
  • Standard patterns in modules:
    • Queue — Transmit an arbitrary number of items in order.
    • Server — Handle a dynamic number of clients concurrently.
  • No unsafe!
  • Accessible documentation as a learning tool.