4 ms·
> In Ballerina, every program is a sequence diagram that illustrates distributed and concurrent interactions automatically. The diagram is the code. The code is
by k_ 7y ago
> In Ballerina, every program is a sequence diagram that illustrates distributed and concurrent interactions automatically. The diagram is the code. The code is the diagram.
I'm not sure it's a feature I'm missing in current languages, but I sure am curious about this. Maybe "ballerina by example" should implement a toggle between diagram and code views?
- OJFord 7y agoGiven the end of your quote, what's to toggle between? (I think it means that the code does clearly enough the interactions that you don't need a separate diagram, rather than that there's built in tooling to generate one, if that's the confusion.)
- roonyh 7y agoThere actually is a built in tool to generate a sequence diagram. The language is designed with the idea that it should be possible to generate such a diagram for every program. The tool to generate diagram is currently part of the vscode extension for ballerina. It's documented here. https://v1-0.ballerina.io/learn/tools-ides/vscode-plugin/graphical-editor/ https://v1-0.ballerina.io/learn/tools-ides/vscode-plugin/gra...
- OJFord 7y agoAh, cool! Then I agree, more example services showing code + diagram side by side would be great.
- h0h0h0h0111 7y agoThe way I read the docs though, it sounded like you could generate code from a sequence diagram - generating a diagram from code isn't that new or unique (albeit, still a handy feature!)
- OJFord 7y agoIf you look at GP's link, you can see that the VSCode integration (perhaps others too) allows editing either the code or the diagram, and it's propagated to the other in real time. I'm not certain it's unique, but it's pretty neat, and I can see how designing the whole language around servicing network requests would make it easier to implement / more reliably work.