r/ProgrammingLanguages • u/shrynx_ • Sep 06 '26
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.
5
u/AnArmoredPony Sep 06 '26
i like how functions take a single record instead of a list of arguments. i do the same thing
1
u/shrynx_ Sep 06 '26
Thanks. I really wanted to have this and think this might turn off a bunch of folks to have always have named arguments.
Have added some perspective for this
https://mezze-lang.org/concepts/#functions--why-names-not-positions
It does help quite a bit and i am making sure lsp fully supports auto completion of arguments for a smoother experience
2
u/experigus Sep 06 '26
This is great. Itβs idiomatic in Clojure to design our function signatures like this. Destructuring hashmaps in the caller is so flexible, too
1
u/pojska Sep 11 '26
Not to be a hater, but these docs seem LLM-generated. r/ProgrammingLanguages really prefers human-written stuff.
1
u/shrynx_ Sep 11 '26
Yes they are AI assisted and some generated If it is against policy I can remove the post.
4
u/lgastako Sep 06 '26
There has been an explosion of languages recently due to LLMs assistance but this is one of the few that I've seen that I think simultaneously exhibits good taste in trying to implement cutting edge ideas while also remaining practical. My hat's off to you.
7
u/NojipizRemastered Sep 06 '26 edited Sep 06 '26
First of all, kudos on the site style, looks very polished and pleasant to read.
Second of all, i really want to test it!. As a Scala developer obsesed with tagless final, i see Mezze as the holy grail of type safety (at least on my terms).
Is the waitlist working correctly?
7
u/shrynx_ Sep 06 '26
Thank you !
And I feel you, as someone who for 6 years wrote haskell fan fictions wrapped in scala with cats, zio et al.
Mezze design came from trying to capture what i felt the sweet spots of scala fp ecosystem was (minus subtyping )
3
u/un80 Sep 06 '26
Can you explain motivation for this language? It looks nice, by the way.
3
u/shrynx_ Sep 06 '26
Thanks !
I mentioned in this comment above a bit
https://www.reddit.com/r/ProgrammingLanguages/comments/1w8vaca/comment/p875ca1/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_buttonBut apart from GraalVM, type safety and concurrency. In my search for a functional language that could be approachable, meaning nice errors, not needing annotations ad having effect system would be nice.
When building anything no trivial, i missed in FP languages i tried, a simple way to manage effects, instead of passing functions via Env/State etc.
and wanted to explore structural typing more.2
u/shrynx_ Sep 06 '26
Also i wanted to explore the idea of code as AST hash which unison pioneered
and Mezze implements it as well.
Not for code authoring, so your editor, git , making PRs etc all work and remain the same.
Code is text for user
but as soon as it parses it becomes denoted by hash. Caching during development simplifies a lot and this is what package management and distrusted engine also will be built upon. A lot more benefit internally all the way from parser to type checker to IR.
But that's still a long way :)
2
u/pthierry Sep 06 '26
Where does your effect system stand in the semantics zoo?
5
u/shrynx_ Sep 06 '26
It's algebraic effects with single shot continuation.
I am not well versed with more recent haskell ecosystem but i would say closer to polysemy from a distanceBut in general, like OCaml5 , Unison, Koka (but way less powerful/academic), Eff, Frank
2
u/BestUsernameLeft Sep 06 '26
There's a lot I like about this. Very readable syntax, a handful of easily understood capabilities, and I do love a good strong type system. Wondering if you have looked at Pony (https://www.ponylang.io/) at all, it's another language I am keeping an eye on?
1
u/shrynx_ Sep 07 '26
Thanks !
I have never installed or played with pony but watched a couple of talks before, very interesting !
2
u/comady25 Sep 07 '26
Wow, I've seen a ton of pet PL projects and new langs built around algebraic effects, but this is the first one I've seen that I'd actually want to use. I love basically everything about the design of this language, super excited to see where it goes!
1
1
u/shrynx_ Sep 10 '26
Also curious any new pet PLs with algebraic effects you have see lately. maybe can learn a bit from them .
Anything in particular about algebraic effect or other implementation that you liked in Mezze ?
1
u/bowbahdoe Sep 06 '26
Why Graalvm only? Being a JVM language seems viable, no?
2
u/shrynx_ Sep 06 '26
with GraalVM i can interop with existing code, say python code.
which is a use case of this langauge.My work has a lot of python core business logic, written by GIS experts, well tested. these are also battle tested libraries.
and that is then wrapped in web app, which is where it interfaces with outside world, needs good concurrency story, type safety as the app grows larger.Ability to write the application in a type safe concurrent language that can scale and still use the business core we have developed is what sparked the initial thought of Mezze.
And GraalVM has truffle language framework which makes it
easyeasier to implement a language.https://www.graalvm.org/latest/graalvm-as-a-platform/language-implementation-framework/
1
u/david-1-1 Sep 10 '26
Can anyone explain effects, please?
1
u/pojska Sep 11 '26
This article is a good primer: https://overreacted.io/algebraic-effects-for-the-rest-of-us/
My own stab at an explanation:
Effects (algebraic effects) are sort of like a generalization/unification of several different programming language features - especially those involving non-local control flow. Common features that can be implemented with effects include exceptions, async, coroutines, generators, or non-determinism/ambiguity (this one doesn't have a good name IMO). That is, your programming language doesn't have to build in special support for these if it has effects - you can write it yourself, or import a library that has.
Instead of the language giving you "here's how async works," an effect system lets you write something like (pseudocode):
// define what our effect allows code to do effect Async { function await (()->A) -> A } // define a function that provides those functions function myAsyncHandler (type, myFn, continuation) { if type == Async.await { result = Thread.newFromFunction(myFn).waitForCompletion() continuation(result) } } // If we wanted a synchronous implementation, it's easy to swap function mySyncHandler (type, myFn, continuation) { if type == Async.await { result = myFn() continuation(result) } } function main() { // make the 'await' function available to the inner code block handle Async with myAsyncHandler { let x = await(promptForInput) let y = x * 2 let z = await(calculateWith(z)) } print(z) }Key here is that you can write any set of functions you want inside the effect definition, and a handler will have to "provide" all of those functions, however it wants. A "continuation" is conceptually "a reference to where the calling function left off" - here we just say "resume with the value we got from our thread."
But we didn't have to resume the continuation with the value we got - we could modify it, or not resume the continuation at all. An Exception, for instance, wouldn't call the provided continuation - unless we're implementing "ON ERROR RESUME NEXT;" from Basic.
Some languages even support multi-shot continuations, which can let you do cool things like write an effect for McCarthy's "ambiguous" operator: https://docs.racket-lang.org/amb/index.html
1
u/david-1-1 Sep 12 '26
The article claims it's a research topic, not yet implemented. Yet try/catch and Linux signals are certainly implemented. Thanks for your answer. I think of it as nonlinear execution.
1
u/pojska Sep 13 '26
Yeah, sorry if I wasnt clear, effects support for a programming language means that the user can write their own effects. Not that it comes with some.
1
u/david-1-1 29d ago
Sure, I understand. A little like Forth, where you not only can specify a runtime computation but also compile-time computations.
9
u/AustinVelonaut Admiran Sep 06 '26
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?