The Mellifera Programming Language
Mellifera is a simple, batteries-included scripting language featuring value semantics, structural equality, copy-on-write data sharing, strong dynamic typing, explicit references, and a lightweight nominal type system with structural protocols.
Mellifera aims to be an enjoyable language for writing small scripts and CLI utilities while still providing reasonable tools to develop larger projects. Here is an example word counting program in Mellifera showcasing some of the syntax and semantics of the language.
Mellifera features value semantics, meaning assignment operations copy the
contents of a value when executed. After an assignment statement such as
a = b, a and b will contain
separate copies of the same value. Mellifera also performs equality comparisons
based on structural equality, so two values are considered to be equal if they
have the same contents.
Unlike most scripting languages, in which reference semantics are the default
way of assigning and passing around composite data, Mellifera uses value
semantics with explicit references. One may obtain a reference to a value using
the postfix .& operator, then later dereference that
reference-value to get the original referenced value using the postfix
.* operator.
Mellifera contains a small number of core built-in types, all of which have first-class language support: null, boolean, number, string, regular expression, vector, map, set, reference, and function. These built-in types are sufficient for most simple programs, but when the need arises for more structured data, users have the option to define custom types with specific behavior.
Mellifera is intended to be a practical language with reasonable exception-based error handling and pleasant top-level error traces for when things go wrong.
Mellifera is free and open-source software, made with love and care, by humans, for humans. You can find the source code, installation instructions, and development guide on GitHub.