Skip to content

Our mission: To bring the power of Haskell to the users of Python and Javascript.

License

Notifications You must be signed in to change notification settings

enlightware/ferlium

Repository files navigation

Ferlium

Build Status

Created by Enlightware GmbH for use in Candli.

Our mission: To bring the power of Haskell to the users of Python and Javascript

Ferlium is a small functional scripting language with generics and static typing (à la Standard ML). It aims at bringing the convenience of writing of Python, the safety of Rust, and the expressiveness of Haskell. It achieves so by borrowing the type system from Haskell, the syntax from Rust, and a simple mutable value semantics from recent academic research. With that semantics, a function argument is either a value or a mutable reference to a value on the stack, and a simple borrow checker ensures memory safety. Functions always return values.

Ferlium aims at being lightweight and interfacing nicely with Rust. In particular, it tries hard not to duplicate existing Rust types and functions when not strictly necessary (e.g., it doesn't have a boolean type distinct of Rust's bool).

Getting started

We provide a playground here.

We also provide a REPL to play locally with the language:

cargo run --example ferlium

You can reach us on Zulip: ferlium.zulipchat.com

Key features

For users

  • Functional statically-typed scripting language
  • Type inference (Hindley-Milner style, HM(X) flavor)
  • Parametric polymorphism (generics)
  • Ad hoc polymorphism through type classes (traits)
  • Row polymorphism (subtyping for records and tuples)
  • Algebraic data types (including tagged unions)
  • Pattern matching
  • Mutable value semantics (a simplified version of Rust's ownership system)
  • Modules
  • Simple copy-on-write optimisation on arrays to maintain acceptable performance

For developers and integrators

  • A pragmatic language: e.g. provides a mutable value semantics
  • Avoid re-implementing native types in the IR (i.e., no int, bool, etc. explicit there)
  • Smooth binding with native Rust code
  • Rich integration possibilities with the native platform (e.g. for platform-managed values)

Scope and non-scope

The issues list the planned features.

The following features are out of scope:

  • Dynamic dispatch

Inspirations

Limitations

Currently the compiler can only be used from a single thread to avoid deadlocks when accessing the internized type universe. Currently the compiler will panic if the corresponding lock is held when being accessed in write.

License

Ferlium is copyrighted by Enlightware GmbH and licensed under the Apache 2.0 license. See CONTRIBUTING.md for details.

About

Our mission: To bring the power of Haskell to the users of Python and Javascript.

Resources

License

Stars

Watchers

Forks