7 ms·
Ballerina Programing Language
- anigbrowl 7y agoThis is the best landing page/documentation I've seen in a while. The examples with detailed comments are really outstanding.
- blunte 7y agoIndeed. I wish every language/library site were at least this good.
- amitport 7y agoI sincerely disagree. The introduction requires way too much effort. It is difficult to read, it is not structured well enough, it is too wordy (but missing vital "to the point" examples), and with bad fonts and color choices.
- albertzeyer 7y agoI totally disagree. After reading the landing page, I have no idea what kind of programming language this is. Someone else mentioned this is based on JVM. There is no mention of JVM on the homepage. So, is it based on JVM? Or some interpreted language? Or compiled to native code? "The Network in the Language" What does this mean? "Sequence Diagrams for Programming" What does this mean? "Structural, Open-by-Default Typing" Looks pretty standard? "From Code to Cloud" What does this mean? Just some nice tooling? "Batteries Included" Like most other languages. "Developer First" What does this mean? What's different to other languages? This sounds all like marketing fuzz, without telling actually any information. Really. I have no idea what this language is about. Is this a competitor to other JVM languages? Or to system languages like C++/Rust/Nim/etc? Or to languages like Go/Erlang? Or to languages like Python/Ruby? And what's special about this language? mdasen summarized my complaints in a nice way: https://news.ycombinator.com/item?id=22402053 https://news.ycombinator.com/item?id=22402053
- throwaway894345 7y agoMy understanding is that Ballerina has semantics for defining multiple services in the same program, and it “compiles” to a set of containers and cloud configs that allow these programs to talk to each other. So very basically it’s like putting Kubernetes or AWS into a language. But there documentation is pretty unclear as many others have noted so I really doubt my interpretation is precisely accurate.
- gavinray 7y agoI have followed this language passively for ~1.5 years. I think it's revolutionary, and the big barrier for my adoption is the fact that I do not currently write services for the JVM. But the ability to define services as HTTP/Ingress endpoints, Docker containers, and Kubernetes/Openshift resources natively as part of the language is incredible. Add that to the fact that they have native support for things like tabular data and table queries as primitives, stream operations, distributed transactions baked in, multiple kinds of service-level auth natively, and a bunch of other goodies like observability/metrics primitives + support for Kafka/OpenAPI/etc etc and you have one hell of a language. Interoperability with the existing Java and JVM ecosystem is huge. I would be unpleasantly surprised if this does not take off, or at least similar concepts in other languages. Today, the closest thing you can get is Pulumi for defining infrastructure + deployments in code, and then your regular application codebase on the side. If you want to see a featureset that a modern language built for web-services & cloud-native architecture should strive for, check out their learn-by-example list (in particular, the items past basic grammar & syntax): https://ballerina.io/v1-1/learn/by-example/ https://ballerina.io/v1-1/learn/by-example/
- lmilcin 7y agoI looked through examples and I don't see what's so revolutionary about it. This is specialized language suited for more or less one task that has nothing specialized for that task which cannot be rolled in Clojure in a day or two. Challenge me, give one example that can't be done as easily with Clojure.
- tluyben2 7y agoI am curious as well; this still looks like too much plumbing to be revolutionary. It is too close to what we have been doing for years with mainstream languages and tools.
- gridlockd 7y agoGenerally, the big benefit of not using Clojure is to reduce the probability of having Clojure programmers on the project.
- mdasen 7y agoSo, the home page makes some big claims, but doesn't link to how Ballerina solves those issues. I'm not saying that it doesn't. I'm saying that it would be nice to have a link to what makes it different for that aspect. For example, "Structural, Open-by-Default Typing". It sounds really interesting, but the image next to it just looks like what you'd get in Go (except for nullability checks), C#, Kotlin, and many other languages. Yes, static typing (especially with nullability checks) can make life difficult. You have to make create-request objects that don't have an id in them or you have to make the id nullable. Responses might include different fields like an updatedAt. How do you convert between those types without requiring lots of boilerplate conversion code that you're likely to mess up. But it doesn't really say what it's solving. The saying about being liberal in what you accept and strict in what you send is nice, but doesn't tell me anything. How does it achieve that without lots of code and checking? From the struct on the left, it looks like I'll have to constantly check if id is filled out...or have a CompleteResult type where id isn't optional. A link to an example of what this means and how other languages don't solve it would be wonderful. Likewise, it says "The Network in the Language". Sounds like great marketing speak that doesn't mean anything. Ah yes, "the fallacies of distributed computing". How does it solve the fact that networks aren't reliable in a way that other languages don't? I guess I always want to know the "how". Claims are easy, but for many of these problems there's a reason why someone else hasn't solved them. Maybe you have figured out a better way, but the site hasn't said what that better way is. The example image for "Structural, Open-by-Default Typing" doesn't look different from a Kotlin data class: it has statically typed fields, some are nullable. Can I assign a string to an int field and it won't crash? What about when I try to read it? What does "Structural, Open-by-Default Typing" mean? From what I see in the image, lots of other languages have it and I don't see how it enables the robustness principle. Again, there might be great things in here, but the home page doesn't show anything and the quick tour shows error handling that's similar to Rust (or Go's with a short-cut to return the error like has been proposed for Go 2. Instead of linking to a description of the problem on Wikipedia, it would be great to link to a page with your solution and how it's a pain point in other languages. Like, how do you abstract away the fact that the network is unreliable? The quick tour shows a client requesting from an API, but the only thing I see is a `check` keyword which is similar to the `?` operator in Rust which just returns the error if there is one and unwraps the result if it succeeded. It's a short-cut over Go's `if err != nil` and more explicit than runtime exceptions, but it hasn't shown me how it's different from other languages. I guess I just need to know how someone solved a problem if they're saying they've solved it. Yea, we all know that networks are unreliable. We all know the pain of dealing with data that's slightly wrong over the wire. Link to how you're making that better and how other languages aren't handling it well.
- mkl 7y agoPrevious discussion from a few months ago: https://news.ycombinator.com/item?id=20924552 https://news.ycombinator.com/item?id=20924552
- darshanime 7y agogood janitor
- IshKebab 7y ago> Be conservative in what you send, be liberal in what you accept. I can't believe we haven't all learnt the lesson of how much of a bad idea this principle is. Has this guy not heard of HTML and quirks mode?
- erik_seaberg 7y agoOnly because nobody ever persuaded document authors to be conservative (strictly schema conforming) in what they send.
- endgame 7y agoIt's a great principle when you can ship one version every 18 months or so. A better maxim for today: "be strict in what you accept, and send garbage now-and-then to keep the others on their toes".
- goto11 7y agoThe principle makes sense for ambiguities in the specification. But input which is unambiguously illegal should be rejected.
- templain 7y agoIt's being deprecated everywhere to be honest.
- noelwelsh 7y agoI like the idea but I'm not impressed by the language. Syntactically there is a lot of noise (e.g. semicolons, function types are incredibly verbose). It seems to be missing generic types, pattern matching doesn't seem to express structural recursion, if is not an expression, etc. etc.
- jclark_th 7y agoThe language has a lot of syntactic compromises, because it has a design goal of being familiar to users of C-family languages like C, JavaScript, Java, C#, etc.
- noelwelsh 7y agoI don't really buy that argument. Even Java has simple lambdas now, for example.
- jclark_th 7y agoBallerina has simple lambdas e.g. x => x + 1.
- dragonwriter 7y agoBut several of the listed problems don't exist in many of the listed languages or close relatives (I wouldn't really call JavaScript C-family either, as, except maybe C-style for-loops, it has nothing that distinguishes C from other Algol-syntax languages, and other than Algol-style syntax it's more a blend of ideas from Lisp and Self than anything related to C), so those flaws cannot be necessary for familiarity to users of those languages (Java, C#, and several of JS’s statically-typed derivatives that are designed to be familiar to JS programmers, like TypeScript, have generics, so “missing generics” doesn't make sense as a familiarity compromise for users of those languages.)
- jclark_th 7y agoI didn't say that all the listed problems were caused by the goal of being familiar. It doesn't yet have generics because they are hard to get right and the language is still at an early stage. Many languages that subsequently added generics did not have them in the earliest versions of the language (C++, Java, C#, TypeScript, Go).
- hestefisk 7y ago“Network in the language” has to be a deliberate reference / kudos to Sun’s famous slogan “the network is the computer”.
- kalium_xyz 7y agoSession types do exist in other programming languages. Unlike what the site seems to imply.
- jb3689 7y agoThis is what the future of programming languages should look like. Not necessarily syntactically, but with full-fledged systems out of the box. We're not getting further as a community by just building new source code to plug into our Docker/Kubernetes/Chef/Terraform/gRPC monstrosities. Something needs to tame that complexity. I love that things like sequence diagrams are first class. I've made barely any of these since college and I'd love to see us be able to truly get to working at that level day-to-day
- kazinator 7y ago> Robustness Principle: Be conservative in what you send, be liberal in what you accept. That's a debunked principle that causes unintended harm. Programs should be conservative in accepting just their documented range of inputs, and loudly rejecting and diagnosing anything else. Any behavior that looks "liberal" should actually be so by a specified design, within exact limits, operation outside of which is ideally flagged and rejected.
- hhas01 7y agoMisunderstood principle. Liberal does NOT mean Malformed. As you say, all behaviors should be fully specced, and inputs that violate that spec should rightly be rejected. It’s the spec itself that should be forgiving. e.g. Don’t require fields for which sensible defaults can be assumed. Don’t be needlessly anal about case and white space variations. Maintain backwards-compatibility by continuing to accept older input formats alongside the latest and greatest. Accept ints where floats are expected. And so on. HTTP is a good application. Whereas the eejits who invented HTML have a helluva lot to answer for.
- kazinator 7y agoYes, the principle does actually mean that nonconforming inputs should be accepted. Well, only if someone has decided that their meaning is clear. But that is rarely so if you're outside of the spec. The intended meaning of a bunch of bits (syntax) can be anything, or nothing at all. Sensible defaults can't be assumed; they have to be specified. My sensible may be your silly. If a spec defines certain parameters, and neglects to say anything about their defaults, and an implemention assumes defaults, that will cause issues. Firstly, the user will break if they go to another implementation which rejects their data. It's not that implementation's fault; it's just catching the error of missing values with unspecified defaults. Worse, the user's data can silently be interpreted with some different defaults. You have to be exactly as anal about case and white space variations as the spec says. A C compiler or linker can't treat PrintF as printf just because the meaning seems clear enough, and PrintF has not been declared or defined. > Whereas the eejits who invented HTML have a helluva lot to answer for. In my original version of the comment I used HTML as an example, but decided to omit that. The problem wasn't the invention of it (though that doesn't escape criticism) but rather the fact that during early Web history and during the first Browser War era, browsers tried to accept non-conforming HTML and render it anyway. Thus people writing bad HTML had no feedback. The pages looked good with whatever browser they tested with. So browsers had to scramble to reverse engineer and imitate each other's handling of bad HTML as good. The effects of that situation persist; it's not fully resolved. That will happen with any interchange or storage format, if treated with Postel's principle. Postel's principle is from the point of view of keeping the internet working, in a situation where messages pass through multiple hosts, which are inaccessible to either the sender or the receiver. If something is rejected due to violating a rule, there is no diagnosis; the symptom looks the same like a severed cable at the bottom of the ocean. It's understandable where that came from. Postel's principle somewhat applies to intermediary data handlers. If you're just routing messages, and see a message that you don't understand, then just pass it along. The principle should be "have as little effect as possible; look at only the parts of data needed to do your job, and don't interpret and act on payloads that don't belong to you; try hard to route rather than drop."
- cryptonector 7y ago> Ballerina is an open source programming language and platform for cloud-era application programmers to easily write software that just works. Meaningless tagline. > Static typing is the network application programmer’s development headache and dynamic typing is the reliability engineer’s nightmare. Ballerina’s statically-typed, structural type system that is designed to be network data schema friendly allows application programmers to write code that adheres to the Robustness Principle: Be conservative in what you send, be liberal in what you accept. Nowadays we recognize that this is not necessarily a good idea. Se the very long ietf@ietf.org thread titled "deprecating Postel's principle - considered harmful".
- Piisamirotta 7y ago"Yet, no current programming language lets you write your logic as a sequence diagram." Welcome to automation (PLC) programming where sequence programming has been around since 80s.
- pnathan 7y agoI saw this at Kubecon 2018 and even got a sweater from the folks there. The idea of an all-in-one soup-to-nuts system is pretty unusual these days. So, this is a fascinating project. I don't know how I'd introduce it at a company though. Maybe in a skunkworks group or something. Possibly if I was working as some sort of middleware-integrator group. The JVM bits don't bother me, but it does make things heavierweight than I'd like. Curious if anyone is using it, it seems to have tons of potential.
- dead_man 7y agoI saw their demo at Kube-Con Barcelona. Pretty cool stuff. They deployed the sample into kubernetes by generating YAML and docker via the compiler. An aspect that other languages should think of.