12 ms·
Ballerina, a language with structural type system
- aloknnikhil 7y agoVisual programming languages are great in concept until you actually start using them. Luna-lang, for example, promises so much but severely lacks in delivery. This claims to convert sequence diagrams to code, but is it really production quality? If not, is this purely for prototyping? Not that that's a bad thing. Honestly, these claims are all starting to sound very repetitive.
- Davidbrcz 7y agoSCADE provides textual and graphical views that are synchronized and it's widely used in industrial critical embedded software such as airplane in airbus.
- solarkraft 7y agoWhy (do you think) is it only used there and hasn't made its way too the main stream (yet)?
- Davidbrcz 7y agoDisclaimer: Huge personal hunch, might be down-voted to hell for writing this... I think that languages like this don't go mainstream because people like/want to write code, and anything that does not help to actually write code is seen as an hindrance. The main feedback I've heard about this kind of tool is "it's clunky, it's a pain to write code with". Guess what ? It's a good thing IMO. For this to go mainstream, the whole software industry would have to go through a major revolution by shifting its focus from "writing code" to "deliver a working product". We should acknowledge that "writing code" is one tool among others, and may be not even the primary one (I personally think that specification engineering is the most important one). In the field of critical embedded software, this has happened that's why it took off. Another clue of that is for instance the Event-B/Atelier B that is intensively used in the railway/metro world (Paris line 14 was made with it, 2 bugs found in 15 years). While doing B, you get a broad specification you refine along the way into smaller problems. Writing code is actually the last step you do, when you are sure that all pieces fit together.
- sanjiva 7y agoBallerina does NOT force you to write "visually". You can write normal code and NEVER look at a picture. However, after you're done, if to see the flow of your entire program (not just one function) as a sequence diagram then you can get that done. The language syntax is "normal" syntax and has all the power o a modern language. Try it and see- feedback welcome. Disclaimer: I'm the one who started the project and leading it as the product manager now.
- aloknnikhil 7y agoThen I'm struggling to understand the value proposition. If I did want to stick to implementing it visually through sequence diagrams, can I implement all the examples through a sequence diagram and have it run on Ballerina? Really curious. If yes, I'd really like to try it. There are no instructions/examples on doing that. EDIT: I found a link to using the graphical editor in the comments here. https://v1-0.ballerina.io/learn/tools-ides/vscode-plugin/graphical-editor/ https://v1-0.ballerina.io/learn/tools-ides/vscode-plugin/gra...
- imtringued 7y agoLearning how to write code isn't a significant barrier. It's just pressing buttons on a keyboard. Logical thinking and problem solving are far more important. Switching to a visual language doesn't actually help you with that. Worse, if clicking virtual buttons with a mouse is slower than pressing physical buttons you will waste mental capacity that could have been used for problem solving and logical thinking.
- Firadeoclus 7y agoLogical thinking and problem solving can greatly benefit from visual representations and feedback. I write code but I often wish the representation was much more visual than lines of dense monospaced text with a little bit of colour. Diagrams are often easier to parse and reason about. When trying to understand difficult code or figuring out a difficult problem before writing code I generally draw diagrams with pen and paper. These diagrams are much closer to my mental model than code, and I wish that a lot more of this translation could be automated. "Visual language" doesn't have to mean low-bandwidth interactions.
- pjmlp 7y agoI would consider EE, video production and game development mainstream, all domains are heavier users of visual languages.
- jlg23 7y agoThe only mature visual programming language I am aware of, DRAKON, has been used quite successfully : ttps://en.m.wikipedia.org/wiki/DRAKON
- brodo 7y agoNode-Red is a visual programming language and it is a joy to use.
- joatmon-snoo 7y ago> Yet, no current programming language lets you write your logic as a sequence diagram. This is not a bad thing per se. If I make a diagram, I want to be able to understand it. WTF is the sequence diagram for request hedging going to look like?
- haolez 7y agoIf the performance is good and if network/service errors can be handled and recovered easily and gracefully, I might consider it.
- gigatexal 7y agoBeen following this language for a while now. Good to see them hit 1.0
- 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.
- Kyragem 7y agoTypo in title.
- mkl 7y agoEvery time a new programming language is announced, I go look at some of the example programs. This time I didn't even make it through "hello world" as I can't read the grey on very slightly lighter grey code. Please, if the makers are reading this, just make it look like it does in your editor, when you're reading and writing it.
- sanjiva 7y agoYeah sorry .. the styling on examples https://v1-0.ballerina.io/learn/by-example/ https://v1-0.ballerina.io/learn/by-example/ might be a bit much. We'll work on it.
- nesadi 7y agoHave you tested the site on mobile? The examples page seems oddly unresponsive on Chrome on my Android.
- udkl 7y agoAlso the comments. They are unnecessary in many places in the examples and distracting. It’s obvious that the piece of code is “return string to caller”. The comment is just noise.
- sameerajayasoma 7y agoWe will do another pass on these examples pretty soon. Thanks for the feedback.
- udkl 7y agoAnd then please add quick sample syntax example on the front page as well as an example video of what you mean by the sequence diagram is the code which if I understand correctly is the languages main differentiator.
- yoz 7y agoExcerpted quote from their launch blog post ( https://blog.ballerina.io/posts/annoucing-1.0.0/ https://blog.ballerina.io/posts/annoucing-1.0.0/ ): > That obviously starts with the Enterprise Integrator team as that is where this baby was flirted with, dated and then conceived; This is what happens when people think that coding is hard but writing is easy. WSO2: Please, on behalf of innocent eyeball-owners everywhere, hire a dedicated content editor.
- skybrian 7y agoAlso, the front page ends with a picture of someone massaging a programmer's shoulders.
- afiori 7y agoI understand their idea, but that is not something to be expected by a ballerina
- rmilejczz 7y agoIt’s a visual metaphor, the ballerina represents the language and they are supporting / comforting the programmer. I’d say its pretty corny, especially when a bunch of literal engineers need it explained to them, but it’s not just a random picture of a back rub
- UncleMeat 7y agoIntention and interpretation are different. People who have already had rough gender experiences in software might read this image differently than you.
- _8ljf 7y agoYou don’t even need to read past the product name. Like a lot of geeks they just don’t have a clue how to sell, nor how to hire talent that can. There is no part of their branding that is not a straight disaster. (And that shoulder massage…oy.) Look, real ballerinas are totally hardcore badass atheletes who could easily kick all our flabby nerd asses while standing on one toe, and I take my hat off to them for what they do. But how many professional software developers will really want to self-identify as “ballerinas” when discussing between themselves, never mind pitching to board rooms? (Outside of the programmers-who-already-happily-self-identify-as-bronies subset, of course.) Doubly so when the actual product looks as agile and graceful as a household broom. Triply so when they can’t even do simple web pages right. (Just try the inline links on the Community page.) Or try the learn-by-example page, which spends seconds looking completely blank until some pointless Web 2.0 crap eventually loads in a perfectly static TOC. I mean, I was prepared to overlook the marketing catastrophe just to read about their much vaunted take on structural typing (which is highly relevant to my interests), but this simple lack of technical competence means I am not going to waste any more time. Money says the whole thing immediately sinks without trace, and none involved will ever be any the wiser why. What a pointless waste of effort.
- dgreensp 7y agoI've never heard of this language, but it looks like a cross between TypeScript and Java. The "Why Ballerina" points on the front page are intriguing, but none of the other materials seem to fill in the next level of detail. The diagram is the code... so this is a visual language? Where are the example diagrams? The language is built so that it's easy to access a service over a network? Tell me more. Show me something beautiful, dammit. The syntax isn't pretty. And why does every new programming language these days put "getting started" instructions above the fold, but not show you code or otherwise give you something concrete to latch onto? I'm speechless at the sheer amount of documentation and tooling that already exists. Editor plugins, a code formatter, a style guide, a build tool, a doc tool, a package manager, a package repository, a language spec, a standard library, a framework for writing services, deployment guides, and maybe 200 example programs. I am a major TypeScript fan and former major JVM fan, and I can see the appeal of mashing them up. I think my problem is that the front page is the only interesting page on the entire site, the only one that gives me some sense of why I might care about this obscure language, let alone use it.
- OJFord 7y agoThere's a link to 'by example' docs at the top, next to download: https://v1-0.ballerina.io/learn/by-example/ https://v1-0.ballerina.io/learn/by-example/
- Vivtek 7y agoIf that page has a single example with a diagram in it, I have yet to find it.
- sanjiva 7y agoIt doesn't. The primary reason is that VSCode cannot be hosted. We will soon publish a playground widget which will let you run the same code in the browser so you can see source and the diagram as you wish (or not!).
- IshKebab 7y ago> Be conservative in what you send, be liberal in what you accept. This is now widely considered a terrible idea because it encourages software that doesn't conform to specifications, e.g. HTML's "quirks mode". https://i.stack.imgur.com/teQdv.png https://i.stack.imgur.com/teQdv.png
- fanf2 7y agoThis Internet Architecture Board draft was initially titled “Postel was wrong” https://tools.ietf.org/html/draft-iab-protocol-maintenance https://tools.ietf.org/html/draft-iab-protocol-maintenance
- hhas01 7y agoLiberal ≠ Malformed; an atrociously common misconception amongst atrociously common code. The modern Web is the product of people who have so deeply and comprehensively misinterpreted and misunderstood every single facet that they are Not Even Wrong; then standardized, ratified, and protelyzed their own utter brokenness as The Right Way To Do It, and congratulated themselves on this marvellous job they have done. Just Yahoos all the way down.
- nickserv 7y agoPerhaps not the best introduction when the site gets an "unresponsive script" pop-up on mobile Firefox.
- kcmastrpc 7y agoI've been to several dozen technology conferences the past two years and these folks show up with a fancy large booth and nice swag and I'm simply amazed at the presentation and effort they've put into this undertaking. My understanding is that the primary motivation all of this is consultancy work in India.
- atarian 7y agoIt's a clever approach. Developers love to jump on new languages.
- jlg23 7y agoThey do, this is why I would never bring a consultant on board who suggests a new language could solve the problems. Everybody loves it but after the easy 90% are done I am stuck with a niche language. Thus, I am not sure that this marketing does not backfire.
- jamessteel 7y agoThat is often true that one of the consultant I had could focus on solving some gaps and the overhead is too high. One of the primary reasons, we need a general purpose programming language focused on both "better developer experience" and "flexibility" that would cover almost all ecosystems.
- sanjiva 7y agoI'm the founder of WSO2 which developed Ballerina. Also the person who started the project and lead it. WSO2 is an enterprise software product company with 500+ customers in 70+ countries and 600 employees globally. We promoted Ballerina like that because we are proud of the work we do and wanted to show it off to people. You may not like the work we produce but trying to say its to get "consultancy work in India" is rather racist.
- tasuki 7y ago> I'm the founder of WSO2 which developed Ballerina. Also the person who started the project and lead it. Congrats and thank you! > We promoted Ballerina like that because we are proud of the work we do and wanted to show it off to people. And rightly proud! > You may not like the work we produce but trying to say its to get "consultancy work in India" is rather racist. Saying it's to get "consultancy work in India" might be wrong (you promote Ballerina because you're proud of your work), but I fail to see how it's racist. Even if it was true, it wouldn't be racist.
- orthoxerox 7y agoLike other WSO2 stuff, Ballerina suffers from too many almost complete features. As I see it, they can hire dozens of coders in Sri Lanka, but don't have a good product management team that can turn a 95% complete feature into a market-ready one.
- sanjiva 7y agoI'm the founder of WSO2. I'm from Sri Lanka. We have 100s of coders from Sri Lanka (not dozens). I'm the creator of Ballerina. I'm now its product manager. Ballerina is in its first GA release. Please elaborate on what features you see as "almost complete"? And regards to your comment about WSO2's inability to produce market-ready products, we have 500+ customers from all over the world for our products. What do we need to become "market-ready"?
- rurban 7y agoHi Sanjiva, I'm impressed. Of the product, and that you have that many excellent Java coders in Sri Lanka. Didn't expect that. Java really needs a safe structurally typed product. What are the major differences to Scala?
- otobrglez 7y agoThis was exactly question in my mind as well when I saw Ballerina. What are the major differences to Scala with Akka?
- deleted 7y ago[deleted]
- mpfundstein 7y agoWhy didn’t you expect that Sri Lanka has excellent Java coders?
- rurban 7y ago
- alexashka 7y agoThe absence of meaningful code samples on the front page, and the request that I install software on my computer to try a few lines of code, makes me highly doubt the future of this endeavour, outside of academia.
- sanjiva 7y agoWe had a playground widget but had to take it down because we were a bit swamped last few weeks and couldn't get it updated for this release. A Go-like full screen online playground is coming.
- webkike 7y agoI can’t say much about the language, but I think the image at the bottom is somewhat inappropriate. Why is there a woman massaging a man while he uses a computer? I understand that this is to illustrate comfort, but this is not an appropriate way to illustrate that
- kensai 7y agoIs this some kind of snowflake joke I don't get? These are cartoons. Jesus, have become so sensitive to everything? (forgive me in advance, but I don't understand what the problem is... a man massaging a woman would have been better? a man massaging a man? a woman massaging a woman? two robots perhaps? what would not make people more comfortable?)
- kybernetikos 7y agoIn an entirely neutral culture it'd be fine. In a culture that says that women aren't programmers, it perpetuates a common narrative that women are for display and support but not for real work. It's not helped by the picture above it where the ballerina is pictured with batteries. Taken all together it seems to suggest that women are objects and that this is a product for men. Yes, we're all being hyper sensitive about it, and it's likely that nothing negative was intended but it's something that we could do with having a bit of sensitivity about, given that it costs us so little and our current level of sensitivity has made the culture so hostile to women.
- deamon_lang 7y agoAnother half baked wso2 product.
- rdhananjaya 7y agoCould you please elaborate a bit, which part of the language you think half baked?
- deamon_lang 7y agoCan you execute OS exec with this language? I tried to do the integration with a legacy app and gave up.
- rdhananjaya 7y agoHere you go, https://v1-0.ballerina.io/learn/api-docs/ballerina/system/index.html https://v1-0.ballerina.io/learn/api-docs/ballerina/system/in...
- llarsson 7y agoI browse with JavaScript off, and I can't scroll on that site. Could you degrade it more gracefully, please? It's a documentation site, after all, not something that should be design heavy.
- rdhananjaya 7y agoI created an issue for you https://github.com/ballerina-platform/ballerina-www/issues/1594 https://github.com/ballerina-platform/ballerina-www/issues/1...
- deamon_lang 7y agoCan you give a more elaborative example like how to print the output of ls command? Not a half baked example. BTW why is not there in the By Examples page?
- amitport 7y agoThey really should explain the motivation in the main site instead of just expecting me to download and experiment.
- udkl 7y agoYup, the front page is very text dense with abstract concepts but fails to address important questions their main target audience would want to know.
- chrisweekly 7y agoMods: typo in title langauge -> language
- aldanor 7y agohttps://v1-0.ballerina.io/learn/by-example/json-io.html https://v1-0.ballerina.io/learn/by-example/json-io.html returns @tainted json made me cringe a bit for some reason.
- vinok88 7y agoYou should be, that is expected by the language. You are going to receive some untrusted data, be careful when you use them.
- snaky 7y ago> Perl supported tainting from at least 1989 as the -T switch was included in Perl 3. https://en.wikipedia.org/wiki/Taint_checking https://en.wikipedia.org/wiki/Taint_checking
- vinodkd 7y agoAlways happy to see another language being born, especially one that's put together like this - assuming all of it works (have not yet downloaded or played with it, this is based on reading your website) That said: 1. This is bikeshedding, but you cannot make a statement like "diagram is the code, code is the diagram" and not show how to actually do that. The home page even has a sequence diagram. If you meant that the written code looks like a sequence diagram if you squint, then say that. 2. What makes this a Perlis language? I knew every term in the by example summary [1]. Is it annotating functions as services with metadata, or in-language support for xml/json, websockets/http2, etc? How is that different from other batteries-included languages like wolfram, for example? 3. Related: the problem with a batteries included language is that it gets bigger and bigger over time; hence the idea of "small language, large library base". What will you do with the language when its usage pivots over time - add more batteries as standard? 4. Minor: Many links to GH on the community guide page [2] end in 404s. [1] https://v1-0.ballerina.io/learn/by-example/ https://v1-0.ballerina.io/learn/by-example/ [2] https://v1-0.ballerina.io/community/ https://v1-0.ballerina.io/community/
- jclark_th 7y agoHere's what the spec [1] says about the sequence diagram aspect of the language: "[Ballerina's] abstractions and syntax for concurrency and network interaction have been designed so that there is a close correspondence with sequence diagrams. This enables a bidirectional mapping for any Ballerina function between its textual representation in the syntax described in this specification and its graphical representation as a sequence diagram, such that the sequence diagram fully shows the aspects of the behavior of that function that relate to concurrency and network interaction." The two biggest things that are different about Ballerina in my view are the language abstractions for providing and consuming network services, and the correspondence with sequence diagrams. [1] https://ballerina.io/spec/lang/2019R3/ https://ballerina.io/spec/lang/2019R3/
- vinodkd 7y agoCan you share a sample of code, its equivalent sequence diagram, and how one is converted to the other please? I see that the samples have caller->method() style code, but how is this a sequence diagram? And where's the actual bidi mapping? To be clear: I'm not critical; its good that ballerina attempts to bridge the visualization and the implementation. I'd like to see an actual sample, though. Edit: Never mind, found the other poster who discovered your IDE plugin that shows the sequence diagram equivalent. Not sure how this is part of the language, though.
- F-0X 7y agoI just need to say it. Thank you for putting types on the left.
- JaDogg 7y agoGood work
- StefanKarpinski 7y agoAs a co-creator of a language (Julia) with a name that is feminine in most of the world, let me give some friendly advice regarding the name "Ballerina", which means "a female ballet dancer". The way you talk about Ballerina comes off rather tone deaf to gender issues. In the post linked here and elsewhere on the language website, the female ballerina—and she is definitely a she—is talked about as an object of grace and beauty to be appreciated by the programmer, who is presumed to be male. In one cartoon on the site, the male programmer is getting a massage from the helpful, friendly, female Ballerina while he does his programming work. And then there is language like this (pointed out by @yoz): > That obviously starts with the Enterprise Integrator team as that is where this baby was flirted with, dated and then conceived This is really damaging: the Ballerina in question is referred to as "baby", she is flirted with and then conceived—weird because that's an unusual order of events, but I guess this means you knocked her up and then had a baby with her? I can't continue, even dissecting this sentence feels creepy. Just don't do this. It's weird and disturbing and it will put off most women and many men who might otherwise consider using or contributing to your language. Consider renaming the language to "Ballet", which is distinctly non-gendered and doesn't have these issues but still suggests the grace and beauty you are inspired by and aspiring to. Seriously, consider this. Yes, it's late in the game (post 1.0) and you like the name you have, but it's close enough to the current name that you won't lose much branding and you can keep the same nice logo that you already have. If you are going keep the name Ballerina, you cannot sexualize the name and you should have a rule that others in the community not do so either. Julia has a specific rule in the code of conduct saying "do not sexualize the name of the project"—we didn't originally think we'd need to say that, but it turns out people just cannot resist saying creepy, sexual shit about anything they perceive to be feminine.
- hombre_fatal 7y agoHonestly, this reads like the comment of someone who, themself, can't handle feminine/maternal naming nor material. For example, a motherly massage to a gender-amorphous cartoon in a chair is your hot-button? In an alternate dimension, this post is written about a language released in 2019 named "Python", an obvious phallic symbol. How are women supposed to take a programming language seriously that reminds them of a dong?! -- That's how ridiculous this "takedown" looks to me. Definitely takes guts to name a programming language "Ballerina" in 2019, though. And probably not worth the hassle if these comments are to tell us anything. We probably agree there.
- ScottPJones 7y agoI've been programming in the Julia language for the past 4.5 years, and as somebody who has lived through the problems with Julia's name (getting incessantly teased by coworkers, friends, even my wife and kids, because of how much I like the Julia language and tend to gush about my enthusiasm for it), I think @StefanKarpinski really has hit the nail on the head here. His suggestion of "Ballet" is very good, it still conveys all of the grace, elegance and beauty of ballet. Also, ballet dancers of all genders are pretty kickass athletes as well as incredible artists and performers. Come to think about it, maybe I shouldn't recomend them changing from "Ballerina" to "Ballet", because if I came up with a new language, "Ballet" would definitely be pretty cool, and I'd want to use it myself!
- reilly3000 7y agoI played with Ballerina about 6 months ago. I wasn't able to sell it to my team, but I was extremely impressed. Type safety, brilliant Kubernetes deployment, and a very rich API for integration tasks made it appealing for 'glue code'. If you're considering spending 5 mins to write a comment on why we don't need this language, please consider spending that time with their examples page instead. Its pretty impressive in breadth and depth. I do think that the whole diagram bit is noise, and I could never really get it to work as expected in VScode. Its just a solid language for service development.
- err4nt 7y agoI've had my eye on this for a while, it looks great! Co-designed by James Clarke (of SGML, DSSSL, and XML fame) and it uses XML as a built in native data type. I don't do cloud stuff but I can't wait to give this a spin and see if there's any way I can use it to my benefit.