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
Integrated Haskell Platform v20201127 has been released. Link: Release Beta 27.11.2020 · digitallyinduced/ihp · GitHub
New
First poster: bot
phel-lang/phel-lang. Phel is a functional programming language that compiles to PHP. It is a dialect of Lisp inspired by Clojure and Jan...
New
First poster: bot
Node.js v15.10.0, v14.16.0 and v12.21.0 has been released. Link: https://github.com/nodejs/node/releases/tag/v15.10.0 Link: Release 2...
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: bot
V weekly.2021.13 has been released. Link: Release weekly.2021.13 · vlang/v · GitHub
New
First poster: bot
A new Ruby blog post/announcement has been posted! Get the full details here: CVE-2021-28966: Path traversal in Tempfile on Windows
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
A new Rust blog post/announcement has been posted! Get the full details here: Security advisory for the regex crate (CVE-2022-24713) | ...
New
First poster: bot
Julia v1.9.0-beta1 has been released. Link: Release v1.9.0-beta1 · JuliaLang/julia · GitHub
New
NewsBot
Node.js v22.15.0 has been released. Link: Release 2025-04-23, Version 22.15.0 'Jod' (LTS), @UlisesGascon prepared by @RafaelGSS · nodej...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
RobertRichards
Hair Salon Games for Girls Fun Girls Hair Saloon game is mainly developed for kids. This game allows users to select virtual avatars to ...
New
mindriot
Ok, well here are some thoughts and opinions on some of the ergonomic keyboards I have, I guess like mini review of each that I use enoug...
New