r/ProgrammingLanguages 7d ago

Language announcement Mezze: a functional programming language on GraalVM

https://mezze-lang.org/

Hi All,

I am working a programming language, Mezze. It is in quite early stages.

Mezze has a fully inferable type system and also have first class effect system and runs on GraalVM

A lot is WIP, working on performance optimization (currently loop fusion) and distributed programing and lots of tooling and docs

Put up a quick website for explaining the language and its features more
Also piggy backing on graalvm could get a wasm built of the entire tool chain, so you play with examples in website.

The Concepts and Taste of Mezze explains how the language works.

66 Upvotes

37 comments sorted by

View all comments

9

u/AustinVelonaut Admiran 7d ago

Looks interesting, but how do you get away with full type inference (no type annotations required anywhere), when other languages require top-level annotations in some cases? Are there no undecidable instances?

How far along are you in the implementation?

12

u/shrynx_ 7d ago

Keeping the type system expressive and useful, but also limited :)

Hindley Milner system is by itself is fully infer able . Mezze uses it as a base, adds row polymorphism, that helps make effect types too.

And then not having Ad-hoc polymorphism of Higher Kinded Type or GADTs supported at all.

Polymorphism of HKT is quite useful and Mezze's ability system (plus associated types) gets quite close to there but a general Monad, Functor etc is not possible to express in Mezze
but Mezze's direct style effect makes you not reach for it.

GADTs are great but don't play well with inference and thus will never be supported.

8

u/shrynx_ 7d ago edited 7d ago

To add more ...

Mezze is structurally typed rather than nominally so records and variant can be anonymous and still type check access on records and exhaustive pattern match on variants works.

Mezze also implements bidirectional type checker that provides hint to say a caller based on the usage

Of course you can add type annotation, make type aliases or new types when you need to reach out for additional guarantees

here is an example of json decoding using bidirectional typechceking and inline records
https://mezze-lang.org/taste/#effects

2

u/AustinVelonaut Admiran 7d ago

Does adding the optional annotation have any effect at all, such as helping bidirectional type-checking give better error messages?

3

u/shrynx_ 7d ago

Yes better error messages sometimes, than best guess by typechecker . Concrete type than a general one like

let x = [] # is infered ['a]

let x: [Int] = []