Micro Focus is now part of OpenText. Learn more >

You are here

You are here

Introducing a new programming language: Slooflirpa

public://pictures/Steven-Lowe-Principal-Consultant-Developer-ThoughtWorks.jpg
Steven A. Lowe Product Technology Manager, Google
 

What the world needs now... is a better programming language. One that doubles down on all of the best features from other languages and eliminates the worthless and weak features that don’t challenge your imagination, short-term memory, and keyboarding skills.

Gone are the overly-simplistic control statements, silly class definitions, unnecessary function scopes, and expensive method calls that clutter up the pure sequential beauty that is the very essence of programming. Not only is everything global, with no branching or loops, but two semicolons are required to separate each keyword in a statement, and all code must reside in a single file—which is so much easier to keep track of. In addition, we’ve taken the best features from all of the lesser languages, amplified them up to 11, and included them in an elegant new language intended for only the most l33t programmers: Slooflirpa!

What do we think of the new languages emerging in the industry? Name any language...

Scala?

Garbage. You spend all your time defining types, and very little time writing code that actually does something.

Rust?

Crap. Segfaults exist to remind you to be humble.

Go?

No. Channels are for televisions.

Swift?

Go back to sipping your latte macchiato you hipster.

APL?

Ok, that one’s kind of cool.

OCaml?

O god.

No! Please! No! Nooooooooo!!

Slooflirpa?

Best language ever invented.

Here are some features in other languages that inspired even better features in Slooflirpa.

JavaScript

Slooflirpa uses JavaScript-like string concatenation, which is to say “+” means “glue these strings together into one string, in order!” If a pesky integer is involved, so what!

Examples in JS:

var a = 10;
var b = 20;
console.log('result is ' + a + b);
> “result is 1020”

"5" - 3
> 2

"5" + 3
>'53'

It makes sense, right? You can’t subtract 3 from the string ‘5’ but you can add 3 to the string ‘5’.  JavaScript knows that when you use just one string, you really meant for everything to be strings, didn’t you?

But what if you still want to concatenate strings with minus signs too? Plus signs shouldn’t get to have all the fun!

In Slooflirpa, we took this behavior one step further. If you use the subtraction operator in our language, it concatenates your next item TO THE FRONT of the string.

Let me blow your mind right now.

'5' + 3
>'53'

'5' - 3
> 35

It’s like when Steve Jobs first introduced the iPhone. You didn’t know that you needed it, and now you can’t live without it! Seriously. Slooflirpa knows what you want. Just let it help you. Let it protect you from yourself.

PHP

PHP’s double equals operator ‘==’ has always been such an accepting part of the language. What is equality anyway, really? It’s a huge metaphysical discussion. Not knowing what '==' is going to give you is true to life. Uncertainty is what makes life worth living.

PHP favors numerical comparisons over what is actually specified in the statement, so it converts numerical strings (e.g. "53”) into numbers when using the ‘==’ operator. It’s like it can read your mind, and that’s why we wanted this behavior in our language.

PHP example:

true == “foobar”
> true

“foobar” == 0
> true

true == 0
> false

This behavior is both elegant and beautiful, but PHP has always had a fallback for picky developers: the triple equals ‘===’ operator, which tests whether two values are identical in type and value.

Real developers who know what they’re doing don’t need this crutch anymore, so Slooflirpa removes the ‘===’ operator so that you can take the time to contemplate the uncertainty of the universe and understand that nothing in this world is safe from the cold, uncaring abyss.

But hold on...

Slooflirpa is intended to be a positive experience, so we might start working on a feature to make it interpret any expression using '==' as ‘true’. Because we’re all equal, right?

This language is still in pre-alpha, so it’ll take about eight years to decide.

Perl

Perl is a beautiful language. It looks like an explosion at the ASCII factory… an explosion of awesomeness. Every variable type has its own special, single-character sign, which means your shift-key will definitely get a workout.

Scalar variables in Perl start with a dollar sign ($). Here's an integer assignment:

$age = 25;

A string:

$name = "John Paul";

A floating point:

$salary = 1445.50;

Array variables start with an ‘@’ symbol

@ages = (25, 30, 40);

Hash variables with a percent sign (%)

%data = ('John Paul', 45, 'Lisa', 30, 'Kumar', 40);

Programming languages should look enigmatic from an outsider’s perspective. Some developers will be amazed that you can understand this, causing them to both fear and admire you.

In Slooflirpa, we decided to squeeze even more special characters out of the keyboard and added symbols like yen “¥”, euros “€”, and letters with bold accents like the macron “ō”, the umlaut (diaeresis) “ü”, and the cedilla “ç”.

Take a look at this elegant Slooflirpa code:

Scalar variables

¥age = 25;;
฿name = "John Paul";;
€salary = 1445.50;;

Hash variables

Ådata = (ü[John Paul], ç[45], ü[Lisa], ç[30], ü[Kumar], ç[40]);;
çdata{John Paul} = 45
üdata{45} = John Paul

Array variables

Æages = (25, 30, 40);;

That last special character was a Latin ‘ae’, which is typed by hitting ALT+0198 in Microsoft Word. Word is a great choice if you’re in the market for a new code editor.

We hope you don’t mind when the paint rubs off on your shift, alt, and ctrl/cmd keys, because Slooflirpa is going to wear them out!

Java

After we nearly perfected Slooflirpa with those last three features, we knew it was missing one thing: enterpriseyness. It wasn’t an “enterprise” language yet. For that we turned to Java for inspiration—a language so enterprisey, you’d think it was captained by Jean-Luc Picard.

Java by itself is nearly useless, but luckily there’s an endless expanse of libraries and extensions for it. With enough annotations for property generation, dependency injection, et al., you can finally get it to do something useful. For Slooflirpa, we wanted it to be not just useful, but versatile, right out of the box.

So here’s what we did. We made every property automatically serializable to JSON, XML, and binary, with Java-bean wrapping and dynamic dependency injection on every variable. The best thing is, it uses “convention over configuration,” so all of this magic happens automatically based on configuration information found by the automatic, periodic network drive scans. Now you never have to annotate your code with those ugly @modifiers, and the runtime behavior of your code can be changed every time you (or anyone else) saves a file to disk!

Now that’s enterprise!

Getting started

Slooflirpa is in its pre- pre- pre-alpha days. But you should harbor no reservations about using it in production. Building the kernel is easy: just install Common Lisp, ANTLR, Hadoop, and TensorFlow, then follow the simple 700-step instructions in the README.MD file (not included).

Sign up for the Slooflirpa mailing list here.

Keep learning

Read more articles about: App Dev & TestingApp Dev