Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- I really thought it was to plan musicals, and I thought it was cool!by jiehong
- Thanks for sharing this. I hadn't heard of choreographic programming.
Does it compile straight Java bytecode, or does it generate Java code which is then compiled by javac?
by elric - https://github.com/lovrosdu/klor
The authors did a great talk on this in the Heart of Clojure 2024
Still my favourite conference I've ever been to
by slifin - I only skimmed the page and it looks like a really cool idea, but I have a question about this:
If the client needs to know about all that stuff that happens after its call to Service, isn't Service a leaky abstraction? My idea of OO, which I got from GOOS[1], is that each object talks only to its neighbors and it shouldn't have to know about their neighbors' neighbors or their neighbors' implementation details because the messages sent between objects are at the level of the domain. Same with microservices, in principle. The benefit is that you can reason about each object/microservice in isolation. If you must know that A then B then C then D, why split the code/services in the first place?types to let you express things like “the Client communicates this to Service, then Service communicates that to the Login Provider, then […]”Sorry if the docs already answer this, I'll have a closer look later.
by groomlake - That's wishful OO thinking.
It's led to Mockito-style testing (some people call it 'unit', others call it 'integration'). You decide that the behaviour of file.read() is that it returns a string of its contents. You judge your software correct on the basis of how it processes the returned string. Then you launch, and in the real world, the behaviour of file.read() is to return a FileHandleNotOpen exception, so you fix your code, improve your mocks to cover the opening/closing scenario, and re-release it. Next time you run it, it throws a FileNotFound exception. So you fix your code, then extend your mocks to cover that scenario too. Later still, you call read() twice in prod, and hit a FileHandleAlreadyClosed exception (apparently the first read closed the file for you). Fix the mocks again.
You wanted Mockito to lead reality, but it lags it. Rather than Mockito being a useful tool to get your prod system working well, your prod system is actually a useful tool to get your Mockito mocks working well.
Choreographic programming lets you specify this protocol in one place. "The file will be opened, the file will be read, the file will be closed, etc." Then the different parties can't guess/assume or come up with their own half of the protocol incorrectly.
by mrkeen - This is from a vaguely interested outsider, I hope an expert chimes in.
My understanding is that in choreographic programming, the protocol/choreography is considered an explicit "thing". That explicit thing is explicitly defined in one place, as opposed to the implementation being divided up across multiple places, like the client, server, etc. This is the explicit opposite of "reason[ing] about each object/microservice in isolation", at least with regards to the protocol. Since the protocol is one "thing", there is no reason for abstraction: Abstraction is for when you combine multiple "things".
In the example, the client's network code may know about internals of the service's network code, but that's not a problem. This doesn't mean that the client's business logic knows about the service's business logic. It's also not a problem that the client knows that there is a separate login provider that could be communicated with. You may be thinking, "oh, if the client knows about the login provider, it might try to talk to it directly". But no, because the entire network code is generated based on the protocol specification, and the protocol specification doesn't include this.
You might take the generated network code and break it by hand. I guess the response to that is, "please don't".
Again, I hope someone can correct this or explain it better.
by derdi - Since HN is discovering choreographic programming today [1], I thought I’d share the compiler we’ve been working on for a few years now. Feel free to ask questions below and I’ll answer as best I can :)by dplyukhin
- It seems there are many projects trying to find idioms and languages to describe distributed concurrent logic without programming the data transport and synchronization.by jnpnj
- The docs link for for Wyzer give a 404 for https://wyzer-lang.vercel.app/docs/overview/01_introduction/by lenkite
- Hey Dan, nice to run into you on the internet. How are you? :)
For those curious, there are a lot of neat ways to implement choreographic programming! Choral uses a custom compiler which gives it very powerful analysis techniques. Some are libraries and have to rely more strongly on host language features to work. My library uses macros to embed the language directly into Elixir which gets you a bit of the advantages of both: https://github.com/utahplt/chorex
by ashton314