# Hamler Programming Language

**URL:** <https://forum.elixirforum.com/t/hamler-programming-language/32297>\
**Category:** Chat / Discussions (archived)\
**Tags:** language, static-types\
**Created:** [June 12, 2020, 1:34am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297 "2020-06-12T01:34:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chulkilee](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chulkilee/32/6207_2.png) [@chulkilee](https://forum.elixirforum.com/u/chulkilee)\
**Post date:** [June 12, 2020, 1:34am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/1 "2020-06-12T01:34:30Z")

</div>

> **[The Hamler Programming Language](https://www.hamler-lang.org/)**
>
> Haskell-style functional programming language running on Erlang VM.

(copied from the website)

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

## **Why Hamler?**

For almost a decade, we have been developing software systems based on Erlang/OTP, especially our main product [EMQ X](https://github.com/emqx/emqx) - 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…🙂

* * *

## Links

- [GitHub - hamler-lang/hamler: Haskell-style functional programming language running on Erlang VM. · GitHub](https://github.com/hamler-lang/hamler)
- On HackerNews - [https://news.ycombinator.com/item?id=23491516](https://news.ycombinator.com/item?id=23491516)

## Example

From [docs/guides/01\_WhyHamler.md at master · hamler-lang/docs · GitHub](https://github.com/hamler-lang/documentation/blob/master/guides/01_WhyHamler.md)

```elixir
t :: IO ()
t = do
  pid0 <- selfPid
  pid100 <- seqio [spawn loop (State pid0) | x <- [1..1000]]
  seqio [send j (Next i) | (i,j) <- (zip pid100 [last pid100|init pid100]) ]
  send (head pid100) (Trans "great hamler! " 0)
  return ()

data Message = Next Pid
             | Trans String Integer

data State = State Pid

dealMessage :: State -> Message -> IO State
dealMessage (State pid) (Next p) = return (State p)
dealMessage (State pid) (Trans str 11111) = return (State pid)
dealMessage (State pid) (Trans str i) =
  do send pid (Trans str (i+1))
     pid0 <- selfPid
     println (show pid0 <> " -> " <> show pid <> ": " <> str <> show i)
     return (State pid)

loop :: State -> IO ()
loop s = do
  x <- receive
  s1 <- dealMessage s x
  loop s1

```

---

<div class="post-metadata">

**Author:** ![AstonJ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/astonj/32/15_2.png) [@AstonJ](https://forum.elixirforum.com/u/AstonJ)\
**Post date:** [June 12, 2020, 2:27am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/2 "2020-06-12T02:27:53Z")

</div>

Cross posted on Devtalk :003:

> **[The Hamler Programming Language](https://forum.devtalk.com/t/the-hamler-programming-language/777)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![stefanluptak](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stefanluptak/32/34398_2.png) [@stefanluptak](https://forum.elixirforum.com/u/stefanluptak)\
**Post date:** [June 12, 2020, 6:04am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/3 "2020-06-12T06:04:45Z")

</div>

All those attempts to improve typing in erlang/elixir looks really tempting to use. On the other hand it’s quite risky to use it in production. 🙂 I am really impatient to see what the Facebook team will come up with ([Facebook is writing a new, statically typed language to run on the BEAM?!](https://forum.elixirforum.com/t/facebook-is-writing-a-new-statically-typed-language-to-run-on-the-beam/29829)). Apparently having better typing in the BEAM is a really desired feature.

---

<div class="post-metadata">

**Author:** ![Qqwy](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/32/1349_2.png) [@Qqwy](https://forum.elixirforum.com/u/Qqwy)\
**Post date:** [June 12, 2020, 7:36am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/4 "2020-06-12T07:36:59Z")

</div>

> [@stefanluptak](#):
>
> On the other hand it’s quite risky to use it in production.

Do you mean risky because these languages are still very new? Or some other reason?

---

<div class="post-metadata">

**Author:** ![stefanluptak](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stefanluptak/32/34398_2.png) [@stefanluptak](https://forum.elixirforum.com/u/stefanluptak)\
**Post date:** [June 12, 2020, 7:42am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/5 "2020-06-12T07:42:26Z")

</div>

Exactly. I assume because those languages are not used so widely, they may be more prone to internal bugs. Also the rather simple tooling can be problematic when trying to find and fix a bug, etc.. But I guess it was the same with Elixir in it’s beginning. 🙂

---

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [June 12, 2020, 9:39am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/6 "2020-06-12T09:39:22Z")

</div>

This looks so eerily similar to OCaml. :107:

@chulkilee Are you affiliated?

---

<div class="post-metadata">

**Author:** ![chulkilee](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/chulkilee/32/6207_2.png) [@chulkilee](https://forum.elixirforum.com/u/chulkilee)\
**Post date:** [June 12, 2020, 11:44am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/7 "2020-06-12T11:44:27Z")

</div>

No, I just found it from HackerNews. Haven’t heard of it here so just sharing here 🙂

---

<div class="post-metadata">

**Author:** ![michallepicki](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@michallepicki](https://forum.elixirforum.com/u/michallepicki)\
**Post date:** [June 12, 2020, 12:07pm UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/8 "2020-06-12T12:07:49Z")

</div>

This is a fork of PureScript with minor syntax changes and an erlang backend added (similar to [purerl](https://github.com/purerl/purerl)). I would love to see a comparison between this and purerl.

---

<div class="post-metadata">

**Author:** ![lpil](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lpil/32/17492_2.png) [@lpil](https://forum.elixirforum.com/u/lpil)\
**Post date:** [June 12, 2020, 12:41pm UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/9 "2020-06-12T12:41:49Z")

</div>

What are the syntax changes? I couldn’t find any differences from regular PureScript.

From reading the compiler source I would be a little reluctant to call this language at present, more an alternative backend for the PureScript compiler. I wonder why they decided not to use the existing Erlang backend for the PureScript compiler, Purerl.

Very interested to see where this goes next!

---

<div class="post-metadata">

**Author:** ![michallepicki](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/5f9b8f/32.png) [@michallepicki](https://forum.elixirforum.com/u/michallepicki)\
**Post date:** [June 17, 2020, 11:21am UTC](https://forum.elixirforum.com/t/hamler-programming-language/32297/10 "2020-06-17T11:21:18Z")

</div>

There is now a [comparison between Hamler and Purescript in hamler docs on GitHub](https://github.com/hamler-lang/documentation/blob/master/guides/DifferencesFromPurescript.md)
