Live data from Hacker News

Ballerina Programing Language

ballerina.io

51–56 of 56 posts

Re: Ballerina Programing Language

#52
post #48

> 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 f…

Misunderstood 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…

Yes, 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."

Re: Ballerina Programing Language

#53
post #40

Earlier quoted context omitted.

Static typing

Static typing is a property of the programming language, not something you "do". Do you mean your clients want static type something? Static typing is a preference of the developer or development organization on whether they want speed or they need a bit of help to understand what they have before their eyes. It lets the compiler call you out on some of your transgressions at the cost of quirky type system and possib…

It doesn't really depend, static typing is objectively superior to dynamic typing, starting with the simple observation that all the mainstream dynamically typed languages are busy adding/retrofitting static typing.

Re: Ballerina Programing Language

#54
I 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.

Re: Ballerina Programing Language

#55

Earlier quoted context omitted.

The 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.

But 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…

I 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).

Post reply on HN