Since we began working on the Opa language almost 8 years ago, we were obsessed with the idea of pushing the limits of Programming Languages, and taking inspiration from advances of research in functional languages to make web programming better.
Although we did a lot with Opa, and introduced things like embedded first-class HTML values in app code and strong static typing that people now know and finally love, it suffices to say that our vision fell short of what we could possibly achieve.
That’s why today, we are proud to unveil what can be the best programming language on earth. Just like Elon Musk did yesterday before showing out the actual car, let me digress on the desirable features of such a programming language.
First, we want conciseness. Beyond what we achieved with Opa. A nice hello world, up of now, would be:
import stdlib.themes.bootstrapfunction page() {
<div class=”well”>
<h2 id=”#msg”>Click the button:</h2>
<div class=”btn-success”>I’m the button</div>
</div>
}Server.start(
Server.http,
{ page: page, title: “Hello, world” }
)
But we can get smaller than that, as you will see in a moment. All with a nice, clean syntax that you already know and love.
The second property we desire is the ability to accept errors from the programmer. For years, using strong static typing, we were obliging developers to write correct code. For instance, we would reject “1” + 1 naming it a type error and bragging about how we are better than JavaScript which goes to 11. If the compiler would have been smarter, it would understand the original intent, correct the code and get confirmation that we wanted to cast the type of the string “1” and return 2 as an int.
To achieve this goal, we envisioned a future where the compiler will be able to discuss with the developer to help him achieve its grand vision, going from finding errors to finding solutions.
The third property is even more important. We all know that “Machine Learning” is taking the world over, replacing gazillions of jobs by tiny pieces of software that rely on a handful of libraries. So what’s best than a compiler that thinks beyond your own, sometime miserable, thoughts and that is able to imagine a software better that your initial idea; That is able to suggest new features automatically, and maybe even implement them before you’re able to think of them.
It’s now time to tell you that this ideal programming language, that brings ultimate conciseness, is able to discuss with you and invent the future for you, exists.
We named it: the Intern.
The Intern supports voice recognition. You can tell (or even yell):
write me a hello world using bootstrap
which is, you’ll admit, much shorter and nicer than our previous example. At any time, you could say in just 2 lines of code:
write me a hello world using bootstrap
also, add a button that we can click on
And he or she will come often back at you with the perfect results. For v1, we are proud to announce that the Intern is already capable of developing large pieces of software on his/her own. But rest assured, that for v2, we already envision the support of
write me a spreadsheet software in go
or even
write me a browser in Rust
Thank you, Intern!
This April 1st post is dedicated to all of the fantastic interns at MLstate who contributed greatly to Opa and Peps.