Cangjie, a New Open-Source Compiled Language with Native Effect Handlers and Algebraic Data Types
Briefly

Cangjie, a New Open-Source Compiled Language with Native Effect Handlers and Algebraic Data Types
"Cangjie (CJ), a new application development language that features algebraic data types and effect handlers. The open-sourced language is positioned as a counterpart to Java, Kotlin, or Swift. Cangjie is taught by 80+ universities in China."
"Core features include static typing, pattern matching, concurrent garbage collection, algebraic data types (ADTs), and metaprogramming facilities such as macros and annotations. An example of pattern matching in Cangjie is as follows:"
"The most academically significant feature brought to the mainstream by Cangjie is arguably its native support for effect handlers. CJ's implementation of effect handlers generalizes exceptions and claims to simplify dynamic binding. Effect handlers in CJ introduce new perform and resume keywords. The standard try/catch/finally block becomes try/catch/handle/finally."
"Effect handlers can be used for many purposes, including nondeterminism and backtracking, scheduling, incremental computing, dependency injection and configuration (e.g., reader effect), mocking, and as shown before, exceptions. The following is an example of a CJ effect handler used for caching and memoization:"
Cangjie (CJ) is an open-sourced, general-purpose, high-level, expressive application development language positioned as a counterpart to Java, Kotlin, or Swift. It compiles to raw machine code and supports multiple backends for Linux, macOS, Windows, Android, iOS, and HarmonyOS. Core features include static typing, pattern matching, concurrent garbage collection, algebraic data types, and metaprogramming via macros and annotations. Its most academically significant feature is native support for effect handlers, which generalize exceptions and simplify dynamic binding. Effect handlers introduce perform and resume keywords, replacing try/catch/finally with try/catch/handle/finally. They can support nondeterminism, backtracking, scheduling, incremental computing, dependency injection, mocking, caching, memoization, and exceptions.
Read at InfoQ
Unable to calculate read time
[
|
]