Remix.run Logo
ttul a day ago

Type-safe message-passing is such a wonderful programming paradigm - and not just for distributed applications. I remember using QNX back in the 1990s. One of its fabulous features was a C message passing library allowing you to send arbitrary binary structs from one process to another. In the context of realtime software development, you often find yourself having one process that watches for events from a certain device, modify the information somehow, and then pass it on to another process that ends up doing something else. The message-passing idiom was far superior to what was available in Linux at the time (pipes and whatnot) because you were able to work with C structs. It was not strictly type safe (as is the case with FoundationDB’s library), but for the 1990s it was pretty great.

mrbnprck 21 hours ago | parent [-]

I remnber that ASN.1 does sth similar. You'd give a ASN.1 notation to a language generator (aka producing C) and not have to worry about parsing the actual structure anymore!

IshKebab 19 hours ago | parent [-]

Literally every schema-based serialisation format does this. ASN.1 is a pretty terrible option.

The best system for this I've ever used was Thrift, which properly abstracts data formats, transports and so on.

https://thrift.apache.org/docs/Languages.html

Unfortunately Thrift is a dead (AKA "Apache") project and it doesn't seem like anyone since has tried to do this. It probably didn't help that there are so many gaps in that support matrix. I think "Google have made a thing! Let's blindly use it!" also helped contribute to its downfall, despite Thrift being better than Protobuf (it even supports required fields!).

Actually I just took a look at the Thrift repo and there are a surprising number of commits from a couple of people consistently, so maybe it's not quite as dead as I thought. You never hear about people picking it for new projects though.

computably 17 hours ago | parent | next [-]

FB maintains a distinct version of Thrift from the one they gave to Apache. fbthrift is far from dead as it's actively used across FB. However in typical FB fashion it's not supported for external use, making it open source in name (license) only.

As an interesting historical note, Thrift was inspired by Protobuf.

mrbnprck 16 hours ago | parent | prev | next [-]

Very true. ASN.1 is mostly not a great fit, yet has been the choice for everything to do with certificates and telecommunication protocols (even the newer ones like 5G for things like RRC AND NGAP) Mostly for bit-level support and especially long-term stability. * and looking back in time ASN.1 has definetly proven its LTS.

actually never heard of thrift until today, thanks for the insight :)

p_l 14 hours ago | parent | prev [-]

Honestly, first time I've seen someone praising Thrift in a long time.

Wanted to do unspeakable and evil things to people responsible to choosing it as well as its authors last time I worked on a project that used Thrift extensively.

IshKebab 6 hours ago | parent [-]

How come? I haven't used it for like a decade but I remember it being good.