(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 - 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
Example
From https://github.com/hamler-lang/documentation/blob/master/guides/01_WhyHamler.md
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