AstonJ

AstonJ

The Hamler Programming Language

Another BEAM language…

The Hamler Programming Language

Hamler is a strongly-typed language with compile-time typechecking and built-in support for concurrency and distribution.

Hamler empowers industries to build the next generation of scalable, reliable, realtime applications, especially for 5G, IoT and edge computing.

Why Hamler?

For almost a decade, we have been developing software systems based on Erlang/OTP, especially our main product EMQ X - the scalable open-source MQTT broker. So, we have always believed that Erlang is a masterpiece of engineering. With amazing concurrency, distribution and fault tolerance, it is one of the few general-purpose language platforms able to properly handle concurrency and soft realtime.

However, from all the experience writing Erlang, we believe that the following features can help Erlang programmer better adapt to the coming wave of 5G, IoT and edge-programming and attract more people for using BEAM.

  • Compile-time type checking and type reference
  • ADTs, Function Composition, Type Classes
  • More friendly syntax for prosperous communities
  • Functor, Applicative and Monad…:slight_smile:

Now all the features are avaliable in the Hamler programming language.

Features

  • Functional programming
  • Haskell and ML style
  • ADT and Type Checking/Inference
  • Functions, higher-order functions
  • Currying and partial application
  • Pattern matching, and Guards
  • List comprehension
  • Applicative and Monad
  • Advanced module system
  • Built-in concurrency

Design

The Hamler source code is parsed to generate CST, then CoreErlang’s IR is generated after CST → AST → CoreFn’s syntax tree transformation, syntax analysis and type checking. The code is then used by the Erlang compiler to generate the final Beam bytecode.

The Hamler compiler architecture is shown below:

hamler-compiler

The Hamler 0.1 compiler was initially attempted to be implemented based on the GHC 8.10.1, but was later changed to adapt from Purescript Compiler 0.13.6’s

Link:

Most Liked

lpil

lpil

Creator of Gleam

I would be very interested to learn why they have created a new PureScript backend rather than using Purerl, the existing PureScript backend for Erlang.

From reading the compiler’s source code it seems the only new thing is the Erlang generation, so I would suggest this PureScript with a different name rather than a new language. Perhaps more changes are to come later.

Qqwy

Qqwy

Very interesting!

How does Hamler compare to Haskell, PureScript and e.g. Gleam?

It is currently based on the PureScript compiler. Does this mean that its syntax/semantics are (essentially) the same as PureScript (with changes in what is available in the standard library to e.g. support the BEAM VM’s features)? Or something else entirely?

How do Hamler datatypes compile down to Erlang’s built-in datatypes, and how easy is it to communicate (using e.g. a foreign-function-interface) with pre-existing Erlang/Elixir/etc. code?

Where Next?

Popular Backend topics Top

First poster: bot
Kotlin v1.4.20 has been released. Link: Release Kotlin 1.4.20 · JetBrains/kotlin · GitHub
New
First poster: bot
Quarkus 1.10.3.Final has been released. Link: Release 1.10.3.Final · quarkusio/quarkus · GitHub
New
First poster: bot
Integrated Haskell Platform v0.9.0 has been released. Link: Release v0.9.0 (Beta 26.02.2021) · digitallyinduced/ihp · GitHub
New
First poster: AstonJ
A new Crystal blog post/announcement has been posted! Get the full details here: Crystal 1.0 - What to expect - The Crystal Programming...
New
First poster: bot
Cucumber cucumber-json-formatter/v7.0.0 has been released. Link: Release cucumber-json-formatter/v7.0.0 · cucumber/common · GitHub
New
First poster: dimitarvp
A new Rust blog post/announcement has been posted! Get the full details here: Announcing Rust 1.53.0 | Rust Blog
New
First poster: bot
Kotlin v1.6.10 has been released. Link: Release Kotlin 1.6.10 · JetBrains/kotlin · GitHub
New
First poster: bot
V weekly.2021.50.3 has been released. Link: Release weekly.2021.50.3 · vlang/v · GitHub
New
First poster: bot
Quarkus 2.7.0.CR1 has been released. Link: Release 2.7.0.CR1 · quarkusio/quarkus · GitHub
New
First poster: bot
Laravel v10.0.5 has been released. Link: Release v10.0.5 · laravel/laravel · GitHub
New

Other popular topics Top

AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New