Tele - a new BEAM language / alternative syntax for Erlang

Hello everyone, I would like to share a project I’ve been working on for almost two years now!

I created a new programming language meant to be an alternative syntax for Erlang.

The BEAM is no stranger to new programming languages so why not make my own? In all seriousness, my goal
was to address what I felt were shortcomings with my experience coding in Erlang for the past 4-5 years.

What do I mean by alternative syntax? There is no standard library, no added semantics, it’s just Erlang. Well a subset of Erlang. So Erlanger’s should be able to pick it up quickly.
The main benefit of this is that there is seamless interoperability between Erlang and Tele. User’s of Tele libraries will treat them like they were written in Erlang.
Tooling wise there is just the compiler and a very basic formatter. Everything else shells out to Rebar3 (with some hacks on my side).

My overall design goal was to accentuate the parts of Erlang I like, and smooth over the rough edges of the parts I don’t like. Visually you will notice it looks a lot less like Prolog.
No more syntax errors for missing commas, periods, or semicolons. Tele is unique, but should feel somewhat familiar for people coming from other popular dynamic programming languages. I’m aware people have strong opinions about whitespace syntax (me being one of them), but Tele is much more forgiving and flexible than Python.

There is more to do, but at some point I had to “just ship it!”. Lately I’ve been enjoying writing Tele code instead of working on the compiler. Here is a small web app I’ve been working on.
It showcases Tele’s language features as well as Tele integration in an Erlang application.

I’m happy to finally share this project and I hope other people enjoy using Tele as much as I do.

P.S: The name Tele was inspired by the Fender Telecaster.

12 Likes

Congrats on the birth/launch of your new language Harely :tada:

Not sure if you’ve already got one but it might be worth putting a page up which shows side-by-side comparisons :icon_biggrin:

1 Like

I don’t have a good side by side comparison but that is a good idea. I’ll have to think about the best way to do that.

1 Like

You could use Elixir’s comparison page as an inspiration.

2 Likes

That’s a really cool project - congrats on shipping! :sign_of_the_horns::index_pointing_at_the_viewer::flexed_biceps:t2:

2 Likes

0.0.4 Release

New release for Tele. Found some confidence to have bolder opinions about features. Mostly meaning if I don’t feel 100% about them then I will remove them.

Removed support for Tele header files as well as include. include_lib is still included. First of all, I think include is a weird feature in most cases you really want include_lib anyways. While it is trivial to support header file parsing the actual compilation process requires a tighter integration with the build tool. This led to a user experience that felt incomplete so I decided to remove it for now.

I also removed export_type with instead exporting types from modules by default. Opaque and nominal types are always exported. To make a type private I introduced typep. Elixir has a similar setup and I think it makes a lot of sense.

The =:= and =/= are removed to be substituted with == (which was already supported) and != respectively. This aligns with other languages like Python and will be more intuitive to users coming from other languages.

Another feature taken from Elixir, andalso as well as orelse are removed. However, and and or compile to andalso and orelse respectively. This is because the short circuit behavior is preferred anyways.

Notably Tele now supports maybe expressions and nominal types.

A maybe expression in Tele looks like this:

maybe:
  #('ok, v) = some_function()
  #('ok, v2) = some_other_function(v)
  v2
else:
  #('error, _err) = e: e

Overall I think these updates make the language simpler and easier to use.

3 Likes