Today, I watched talk Alpaca Static Type Checking on the Beam. alpaca-lang is a statically typed functional programming language inspired by ML family of languages for the Erlang VM. It has strong type inference based on Hindley-Milner type system. Type checker will disallow adding String to an Integer. It looks like an interesting language.
Following are the main points from the talk:
- alpaca-lang uses Erlang as the target platform just like Scala uses JVM as the platform.
- alpaca is static typed whereas Erlang is dynamic typing.
- Testing in JVM language is much more involved compared to Erlang ecosystem
- Erlang has pattern matching at function level as well.
- Tests are written in the same file as the production source code
- Alpaca steals from both Erlang and Scala.
- Tests and types are two sides of the same coin. Type system also does a lot of tests for you automatically.
- This is what Alpaca code looks like as shown below
- A language should be consistent so that as a developer you don’t have to memorise a lot of stuff.
- Alpaca has strong pattern matching support