March 4th, 2020
A few months ago I read about Darklang. Hovering a bunch of Medium articles, I ended up signing up for the beta. Last evening, I received an e-mail telling me that I could access the beta. I replied to the e-mail telling the team that my desired username was vincentdnl. This lets me thinking that their sign-up process is not ready yet. That's is not a problem. Better focus on the product itself, right?
So here I am, with my access. I'll be making my first steps with Darklang, doing some research and tell you what I think of it.
Just for a bit of background: I'm a self-taught (previously studied physics) full stack developer who has been coding for around ten years. I've been doing various things on the backend side with PHP or Python and on the frontend side with Javascript, Typescript and React. I'm also very interested in functional programming (I don't know everything yet, I've been doing mostly OOP) and development practices like TDD (Test Driven Development) and DDD (Domain Driven Design). So this article will be about my perspective on Darklang.
Dark is a holistic programming language, editor, and infrastructure for building backends without accidental complexity.
The holistic side (with built-in IDE) reminds me of Smalltalk, except that it is for the web. One question I'm asking myself is: will it be flexible enough for developers to make their own tooling?
The menu on the left is composed of several items and a click in the middle of the screen opens a new modal:
Let's start with a New HTTP handler
!
My goal here is to create an API endpoint: a GET request that returns a JSON payload.
One thing that strikes me is that everything is well documented:
Here is how my final endpoint looks like:
If you click on the hamburger menu on the top right of the block, you have the option to export a cURL request (alongside with "open in a new tab" and "delete"). I pasted it on my terminal to check if everything works fine.
$ curl https://vincentdnl.builtwithdark.com/
{ "message": "Hello World!" }
That's it, fastest API "Hello World", straight to production! This is what the team from Dark calls "deployless".
Note: You can click the circles on the top left of the block to see the last requests made to this endpoint. This is very convenient for debugging.
The main stated goal of Dark is removing unnecessary complexity, especially in deployment. Closest thing seems to be cloud Lambdas. And even Lambdas require a bigger amount of work to get deployed.
On the other hand, you can run at least part of the code from your Lambdas locally.
Darklang seems to be for people who want to create APIs without the usual hassle backend development (deployment, devops, renting and configuring a server, etc.)
I think the typical user will be a small team or a solo founder who really needs to deliver fast and have a fast time to market. It would be frontend or mobile developers who would have otherwise used Firebase or Lambdas as their backend. I would also compare it to a headless CMS the you would use to store content on and access it with a web or mobile app.
Darklang is not open source for the moment here are some answers from their FAQ
Q I'm worried about vendor lock-in - what happens if Dark goes out of business?
A We're in this for the long haul, but if the worst should happen, we will open-source Dark, and will keep it running as long as possible so you can move off Dark.
We're committed to codifying the specifics in a legal framework so that you can confidently use Dark, regardless of what the future holds.
and
Q I'm worried about vendor lock-in - what happens if Dark stays in business but I still need to move off?
A We know that developers and companies will need to move off Dark for various reasons, and plan to support this. We have a couple of strategies planned, based on your needs.
We currently support exporting your data using regular Dark tooling. We intend to create an exporter that will generate a readable Go or NodeJS application that matches the structure and intention of your Dark program, that you can host yourself. This will not be a perfect substitute, but it should greatly simplify your migration.
Dark not being open-source could really be a deal-breaker for me. I'm a huge proponent of owning the business logic I create. If I've no guarantee that I can take my app somewhere else then I might think twice before using a solution.
The same problem goes with no-code/low-code tools. I saw someone tweet about how their 10 years old created an app with a few clicks on a no-code tool. The problem is that you don't own the end result. You are renting
it to a company that can decide if you stay in business or not. They can also raise their prices and you have no choice to go somewhere else. You are vendor locked.
Again, the Dark team is telling you that they would develop something so that you are not vendor locked if they go out of business but what is the incentive for them to do that?
You might want to trade time to market for the ownership of your be very careful.
As it's said in this article, Darklang is statically typed. Dynamic typing is a trend that seems to wear off (see how Typescript grew in popularity). People seem to prefer safety when writing their app (I do).
Functional programming offers a great way to model your domain. Pipes make your data flow very easy to read.
It is made with OCaml, and its frontend app (the web IDE) is made with ELM and ReasonML.
Unfortunately I haven't found how to do Unit Testing yet. That's too bad because I really wanted to do some TDD in Dark, but again, it's a beta.
Unit tests are mentioned here in the FAQ and there so we can expect to see them in Dark.
Here are a few resources that you can check if you want to go further with Darklang:
I would use Darklang as my main backend platform if it was open-source. It has some very interesting concepts as a language and is really easy to use and well done. Unfortunately, like most people creating businesses, I expect a minimum of control over my business logic. If you disagree and want to take the path of least resistance so that you can ship very fast, then go for it but be aware of the risk.
I think I'm going to keep an eye on Dark anyway, really hoping that they open-source parts of their software. It would be beneficial for them to get insight from the community and would create trust which is extremely valuable for any business!