r/ProgrammingLanguages • • 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.

67 Upvotes

37 comments sorted by

View all comments

Show parent comment

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 Sep 13 '26

Sure, I understand. A little like Forth, where you not only can specify a runtime computation but also compile-time computations.