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?

Popular Backend topics Top

bot
Kotlin v1.4.20-M1 has been released. Link: Release Kotlin 1.4.20-M1 · JetBrains/kotlin · GitHub
New
First poster: bot
Quarkus 1.9.1.Final has been released. Link: Release 1.9.1.Final · quarkusio/quarkus · GitHub
New
First poster: bot
Integrated Haskell Platform v20201113 has been released. Link: Release Beta 13.11.2020 · digitallyinduced/ihp · GitHub
New
First poster: bot
Integrated Haskell Platform v20201213 has been released. Link: Release Beta 13.12.2020 · digitallyinduced/ihp · GitHub
New
First poster: bot
A new Haskell blog post/announcement has been posted! Get the full details here: Status update: GHC on Apple M1 hardware — The Glasgow ...
New
First poster: bot
Circle is a new programming language that extends C++ 17 to support data-driven imperative metaprogramming. Circle combines the immediacy...
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
NewsBot
Rocket v0.5.0-rc.1 has been released. Link: Release Rocket v0.5.0-rc.1 · rwf2/Rocket · GitHub
New
NewsBot
Gleam v0.16.0 and v0.16.0-rc4 has been released. Link: Release v0.16.0 · gleam-lang/gleam · GitHub Link: Release v0.16.0-rc4 · gleam-...
New
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
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
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
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
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
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
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New