Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ballerina: An open-source programming language for the cloud (ballerina.io)
71 points by ljoshua on Oct 28, 2021 | hide | past | favorite | 27 comments


Some past threads:

Ballerina Programing Language - https://news.ycombinator.com/item?id=22401257 - Feb 2020 (50 comments)

Ballerina Programming Language Revamped, at 1.0 - https://news.ycombinator.com/item?id=20961269 - Sept 2019 (1 comment)

“Ballerina” Could Become the Programming Language of Integratio - https://news.ycombinator.com/item?id=20937058 - Sept 2019 (1 comment)

Ballerina, a language with structural type system - https://news.ycombinator.com/item?id=20924552 - Sept 2019 (120 comments)

Ballerina: An API-First Programming Language - https://news.ycombinator.com/item?id=17302812 - June 2018 (2 comments)

Show HN: Ballerina – Cloud Native Programming Language - https://news.ycombinator.com/item?id=16965616 - May 2018 (14 comments)

Ballerina – concurrent, typed language with textual and graphical syntax - https://news.ycombinator.com/item?id=14698132 - July 2017 (31 comments)

(I assume there is only one ballerina here.)


I've seen lots of articles about Ballerina on HN, but I've never seen the next step in a language's evolution: articles like "hey, look at this cool thing I built in Ballerina."


Yeah, it's surprising they don't even have any case studies or anything where a 3rd party would be saying: "We used Ballerina to solve $enterprise_dev_problem and it was awesome, here's how it happened."

They have a blog, a community section, and also a community blog. Every post seems to be about tech details: syntax, API updates... Might be a good idea to interview some users.


Also:

_Ballerina Swan Lake Beta Released_ https://news.ycombinator.com/item?id=27604222 - June, 2021 (1 comment)


I liked Ballerina at first, it brings numerous goodies that were previously available only in “enterprise” middleware to a simple programming language, with sane defaults.

For example, for network calls it has seamlessly configurable retries, timeouts, circuit breakers. It allows easy mappings from one to another message format, convenient payload standard manipulations, different endpoint configuration at the source code level, easy parallelization and many more features.

All of that comes handy when developing classic middleware services, and the code is cleaner and conciser that equivalent functionality written in Java, Go, Clojure, Node …

GUI editor for source code and easy switch from graphical to code view is also nice.

But, the language itself sucks. It's cumbersome, ugly, and unnecessary. All the Ballerina functionality should be in a Java (or JavaScript) library that would allow writing concise code in a language of choice. I wish someone, preferably WSO2, release such a library. Ballerina is already implemented in Java, so it would be possible to release it as a separate Java library.

The only reason Ballerina exists is to lock customers to WSO2 ecosystem.


The "Learn by Example" doesn't have a section on writing tests, which is a non-starter for me.

Everyone shrugs off writing tests and I can't tell you how many times it has saved my butt. Especially with brining new developers onboard a complicated system.

I'm building software that runs on thousands of machines. If it doesn't have automated tests, how can I reliably deploy it?


There's a lot of focus on testing in Ballerina: https://ballerina.io/learn/testing-ballerina-code/writing-te...


I stand corrected. Thank you.


yeah all the other stuff is fluff if a language doesn't have a compelling story about tests. As much as I love static typing and algebraic data types, they don't really prove that the behavior of the code is actually what is expected.

Doubly so with a language that attempts to bring distributed programming to the base level of the language. How do you test distributed programs in a way that simultaneously doesn't require everything to be an integration test but also gives you certainty that you aren't creating loads of bugs? This is an example of something Ballerina could have excelled at if it was given priority.


Ballerina is a standalone open source project and does not tie anyone to any WSO2 ecosystem.

Please compare processing JSON in Java vs. Ballerina, typing network data in Java vs. Ballerina, writing HTTP/GraphQL/WebSocket/gRPC etc. services etc. in Java vs. Ballerina, calling network services in Java vs. Ballerina and then you'll see the difference between whatever your favorite Java framework (or rather combination of them) vs. Ballerina.

(I'm the founder & CEO of WSO2 and one of the lead language designers.)


> Ballerina is a standalone open source project and does not tie anyone to any WSO2 ecosystem.

Except that Ballerina is created by WSO2 (the company) and used almost exclusively by that company. It's hard to find any usage outside (some of the) existing WSO2 customers. And the language itself is completely proprietary, developed by WSO2 and lock in by itself.

> Please compare processing JSON in Java vs. Ballerina, typing network data in Java vs. Ballerina, writing HTTP/GraphQL/WebSocket/gRPC etc. services etc. in Java vs. Ballerina, calling network services in Java vs. Ballerina and then you'll see the difference between whatever your favorite Java framework (or rather combination of them) vs. Ballerina.

Here I give you a credit. The ergonomic is much nicer than what exists today in Java frameworks.

What I don't agree is, that you need a language to have these features you listed. You could get 90% of them in Java (or Kotlin, or Clojure, or Scala, or Groovy, ...) if they were implemented as a standalone Java/JVM library, and not require Ballerina the language.


I think the coolest part of Ballerina is that it includes visualization[0] as an officially supported part of the language.

There are lots of random projects on Github to visualize Python or Java code, but I think having viz as an official part of the language (so every Ballerina developer is looking at the same diagram for a given piece of code) is much sexier.

[0] https://ballerina.io/learn/why-ballerina/graphical/


Wow! If we can go from code to diagram, can we also go the other way? It'll be awesome if I can draw seq. diagrams for my service and code gets generated from it.


Yes it can go both ways.


For anyone familiar with old style Apache/Java/Axis/Web Service stacks they know that feeling of bombastic claims, massive amount of Java classes and tons of 3rd party dependencies. This language has that vibe to it.

TBH I am not sure in world of sophisticated, lightweight Rust or Go based network/cloud libraries, frameworks and services this kind of anachronism would work.

One set of users I can think, who find it modern are those who do not know of any newer version of Java after maybe J2SE 1.4.2. And those who think EJB 2.1 are at cutting edge of enterprise programing.


One thing modern languages don't do is compiling to multiple targets intended to work together.

For example, you could have a single function include frontend, backend and database logic. The source code would be compiled into three pieces of software: a web page, a web service and a database plugin.


Huh, what does that mean? I can have Go text/html templates, normal business logic/ service and code to talk LDAP/RDBMS backend in single app / source file. I can not just compile but run this whole thing including web server as one single process.


I'm talking about a single function being compiled into three separate processes.

    fn onclick(ui, db, worker) {
      ui! { spinner = true };
      let value = db! {
        value = value + 1;
        value
      };
      worker! { notify(value) };
      ui! {
        spinner = false;
        value = true;
      };
    }


And now these 3 separate processes are deployable without any dependency other than OS?


Their lists of dependencies fully depend on the code, of course, it doesn't need to be magically agnostic of everything. But using something not available for a specific target should be a compilation error.

And there needs to be a build system that wraps the compiled outputs into deployables. It's not the compiler's job to know how to deploy the code, it only needs to know the target architectures that can be deployed.

(I'm not sure I fully understand the question.)


Aaand here it is: https://news.ycombinator.com/item?id=29034188

Haven't read the details yet and I don't think it's the exact same thing, but close enough.


I know everyone loves showing hello world but for a "cloud language" I though it would be a one liner builtin to make a rest api that returns hello world.

They actually just print hello world to stdout.



haha yeah this was pretty funny (and dumb), as in, how is this showing me any of the language's capabilities?


Right. It would be totally fair if it were just a tutorial for a first-time programmer. But most languages aren't advertising at that audience on their home page.


I've always thought of Go as C for the Cloud. Nothing else really comes close to it.


FreeBSD port needed btw :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: