All Projects → hamler-lang → Hamler

hamler-lang / Hamler

Licence: bsd-3-clause
Haskell-style functional programming language running on Erlang VM.

Programming Languages

erlang
1774 projects

Labels

Projects that are alternatives of or similar to Hamler

J2cl
Java to Closure JavaScript transpiler
Stars: ✭ 773 (-7.98%)
Mutual labels:  compiler
Pyterminfo
A terminfo-to-python cross compiler
Stars: ✭ 5 (-99.4%)
Mutual labels:  compiler
Viper
[WIP] A Pythonesque language with a design that focuses on efficiency and expressiveness. Compiles to WebAssembly
Stars: ✭ 23 (-97.26%)
Mutual labels:  compiler
Numba
NumPy aware dynamic Python compiler using LLVM
Stars: ✭ 7,090 (+744.05%)
Mutual labels:  compiler
Rustc Dev Guide
A guide to how rustc works and how to contribute to it.
Stars: ✭ 789 (-6.07%)
Mutual labels:  compiler
Modiscript
Acche din aa gaye
Stars: ✭ 888 (+5.71%)
Mutual labels:  compiler
Caramel
🍬 a functional language for building type-safe, scalable, and maintainable applications
Stars: ✭ 756 (-10%)
Mutual labels:  compiler
Ldc
The LLVM-based D Compiler.
Stars: ✭ 937 (+11.55%)
Mutual labels:  compiler
Tvm
Open deep learning compiler stack for cpu, gpu and specialized accelerators
Stars: ✭ 7,494 (+792.14%)
Mutual labels:  compiler
Radon
A scripting language.
Stars: ✭ 22 (-97.38%)
Mutual labels:  compiler
Compiler
Compiler for Elm, a functional language for reliable webapps.
Stars: ✭ 6,672 (+694.29%)
Mutual labels:  compiler
Typescripttolua
Typescript to lua transpiler. https://typescripttolua.github.io/
Stars: ✭ 783 (-6.79%)
Mutual labels:  compiler
Gccrs
GCC Front-End for Rust
Stars: ✭ 875 (+4.17%)
Mutual labels:  compiler
Elm Platform
Bundle of all core development tools for Elm
Stars: ✭ 775 (-7.74%)
Mutual labels:  compiler
Diez
The Design Token Framework — Adopt a unified design language across platforms, codebases, and teams
Stars: ✭ 928 (+10.48%)
Mutual labels:  compiler
Pyret Lang
The Pyret language.
Stars: ✭ 771 (-8.21%)
Mutual labels:  compiler
Grin
GRIN is a compiler back-end for lazy and strict functional languages with whole program optimization support.
Stars: ✭ 834 (-0.71%)
Mutual labels:  compiler
Fly Coffee
☕️ Fly plugin for CoffeeScript
Stars: ✭ 7 (-99.17%)
Mutual labels:  compiler
Orcc
Open RVC-CAL Compiler
Stars: ✭ 26 (-96.9%)
Mutual labels:  compiler
Venom
venom - shellcode generator/compiler/handler (metasploit)
Stars: ✭ 904 (+7.62%)
Mutual labels:  compiler

The Hamler Programming Language

Hamler - Haskell-style functional programming language running on Erlang VM.

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

Hamler empowers industries to build the next generation of scalable, reliable, real-time 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 programmers better adapt to the coming wave of 5G, IoT, and edge-programming and attract more people to using BEAM.

  • Compile-time type checking and type reference
  • ADTs, Function Composition, Type Classes
  • More friendly syntax for prosperous communities
  • Functor, Applicative, and Monad...:)

Now all the features are available in the Hamler programming language.

Features

  • Functional programming
  • Haskell and ML style
  • Compile-time type Checking/Inference
  • Algebraic data type (ADT)
  • 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 compiler architecture is shown as below:

hamler-compiler

The Hamler 0.1 compiler was forked from PureScript 0.13.6. 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.

Installation

Get the installation package through Github Release

packages for windows will be coming soon...

Linux

$ tar zxvf hamler-$version.tgz -C /usr/lib/
$ ln -s /usr/lib/hamler/bin/hamler /usr/bin/hamler

Centos 7

$ rpm -ivh hamler-$version-1.el7.x86_64.rpm

Debian 8 / Debian 9 / Debian 10 / Ubuntu 16.04 / Ubuntu 18.04 / Ubuntu 20.04

$ dpkg -i hamler_$version_amd64.deb

Homebrew(macOS)

$ brew tap hamler-lang/hamler
$ brew install hamler

Project Layout

├── .github/workflows     # ci
├── app                   # hamler commands, such as `compile`, `repl`, ...
├── deploy
├── doc                   # link to hamler documents
├── lib                   # hamler standard libraries
∣   ├── Control           # common control structures, concurrent Process, and OTP behaviours. 
∣   ├── Data              # commonly used data structures and functions
∣   ├── Database          # common databases in erlang, such as ETS, DETS, and Mnesia
∣   ├── Foreign           
∣   ├── Network           # hamler network libraries.
∣   ├── System            # system libraries including IO, VM, OS, Env, File, Random, Timer, and Logger. 
∣   ├── Test              # hamler QuickCheck test framework
∣   ├── Foreign.hm        # hamler FFI functions
∣   └── Prelude.hm        # functions exported by default
├── repl
∣   └── replsrv           # hamler REPL server
├── src/Language          # hamler compiler source
∣   ├── Hamler
∣   ∣   ├── CodeGen.hs    # convert CoreFn to CoreErlang
∣   ∣   ├── Make
∣   ∣   ├── Make.hs
∣   ∣   └── Util.hs
∣   └── Hamler.hs
├── tests                 
∣   ├── Test              # test cases for hamler libraries
∣   ∣   ├── Control
∣   ∣   ├── Data          
∣   ∣   ├── Database
∣   ∣   ├── Network
∣   ∣   └── System 
∣   ├── Test.hm           # entrance to execute test cases
∣   └── Main.hs
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── Setup.hs
├── hamler.cabal
├── package.yaml         
└── stack.yaml

Build from source code

Required

Building

  1. Clone hamler from the git repo

    $ git clone https://github.com/hamler-lang/hamler.git
    $ cd hamler
    
  2. Configuring

    $ export LC_ALL=en_US.UTF-8
    
  3. Building

    $ make
    
  4. Testing

    $ make test
    
  5. Install hamler

    $ sudo make install
    

Create a project

$ mkdir demo-project
$ cd demo-project
$ hamler init
$ make
$ make run

Try the interpreter

$ hamler repl

> -- List, range and enums
> [1,2,3]
> [1..10]
> ['a'..'z']

> -- erlang style maps
> import Data.Map as Map
> -- New map
> m = #{"foo" => "bar", "bar" => "foo"}
> -- Match Map
> #{"foo" := a, "bar" := b} = m
> -- get, put
> Map.get "foo" m -- a = "bar"
> Map.get "bar" m -- b = "foo"
> m1 = Map.put "key" "val" m
> -- keys, values
> keys = Map.keys m
> values = Map.values m

Documentation

Community, discussion, and supports

You can reach the Hamler community and core team via the following channels:

Contributing

To contribute to Hamler project:

  • Report issues : submit any bugs, issues to hamler/issues
  • Contribute code: Reference roadmap as a guidance for new features. Fork the project, and submit feature requests to hamler-lang/hamler
  • Submit a proposal: Fork the hamler-wiki project and submit a pull request

Core Team

The Hamler core team comes from EMQ Technologies Co., Ltd. now:

License & Credits

We would like to express our great appreciation to the PureScript team and community for all years of efforts making its amazing compiler, especially CoreFn and its incredible adaptability.

The hamler language project is licensed under BSD3, see LICENSE.

About EMQ

EMQ is an open-source software company providing highly-scalable, real-time messaging and streaming platforms for IoT applications in the 5G Era.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].