Code that tastes
like espresso.
Affogato is a JVM language designed to be
describe(value: Object): String { guard value is String else { return "other" } return value as String }
public String describe(Object value) {
if (!(value instanceof String)) {
return "other";
}
return ((String) value);
} class User { let name: String! var count: int init(name: String!, count: int) { this.name = name this.count = count } }
public class User {
public final String name;
public int count;
public User(String name, int count) {
this.name = name;
this.count = count;
}
} func loop() { var names = List<String>() names.add("a") for name in names { println(name) } }
public void loop() {
java.util.ArrayList<String> names =
new java.util.ArrayList<String>();
names.add("a");
for (var name : names) {
System.out.println(name);
}
} class Dog : Animal { override speak(): String { return "Woof!" } }
public class Dog extends Animal {
@Override
public String speak() {
return "Woof!";
}
} Brewed for developers.
Everything you need to write expressive, type-safe JVM code with zero friction.
Null Safety
First-class nullability with String? nullable and String! non-null markers. Compile-time enforcement with runtime annotations.
100% Java Interop
Seamless integration with any Java library. Call Java methods, use lambdas, method references, generics, and static imports.
Named Arguments
Reorder function arguments by name for maximum readability. Works across Affogato and Java calls with overload resolution.
Robust Parser
Robust grammar-based parser replaces fragile line-by-line parsing. Accurate diagnostics with stable error codes.
Gradle Integration
First-class Gradle plugin wires .aff compilation into your build. Configuration-cache compatible with cacheable tasks.
IntelliJ Plugin
Syntax highlighting, navigation, rename, and live compiler diagnostics directly in your editor. Built with Grammar-Kit.
Guard Clauses
Swift-inspired guard condition else for early exits. Clean, readable defensive programming built into the language.
Records & Enums
Compact record constructors like record Coord(x: int, y: int). Full enum and interface support with default methods.
Switch Expressions
Modern switch as both statements and expressions. Arrow syntax case … -> with multi-label arms and block bodies.
Expressive by design.
Affogato strips away the boilerplate while keeping everything familiar.
// Compact record constructors record Point(x: int, y: int) record User(name: String!, email: String?) // Inheritance with : operator class Animal { var name: String! init(name: String!) { this.name = name } speak(): String { return "..." } } class Dog : Animal { override speak(): String { return "Woof! I'm " + name } }
// Guard for early exits processOrder(id: int): String { guard id > 0 else { return "Invalid order ID" } // Switch expressions let status = switch id % 3 { case 0 -> "shipped" case 1 -> "pending" default -> "processing" } // For-in loops for item in items { println(item.name + ": " + status) } return status }
// Type! = non-null (compile-time check) // Type? = nullable var name: String! = "Alex" var email: String? = null // Compile error: null → non-null // var bad: String! = null ✗ // is = instanceof check var obj: Object = "hello" if obj is String { println("It's a String!") } // as = cast let s = obj as String println(s.toUpperCase())
import java.util.List import java.util.stream.Collectors import static java.util.Collections.sort demo(): List<String> { // Collection aliases var items: List<String> = List<String>() items.add("espresso") items.add("affogato") // Lambdas with Java functional interfaces var upper = items.stream() .map(s -> s.toUpperCase()) .collect(Collectors.toList()) sort(upper) return upper }
Ready in minutes.
Get Affogato running in your project with just a few lines of Gradle config.
Add the Gradle plugin
// build.gradle.kts plugins { id("dev.affogato") version "0.1.0" }
Write your first .aff file
// src/main/affogato/Hello.aff package com.example class Hello { static func main(args: String[]) { println("Hello from Affogato ☕") } }
Build and run
# Compiles .aff → Java → bytecode ./gradlew run # Or compile only ./gradlew compileAffogato
📂 Project Structure
The Gradle plugin auto-discovers .aff files and wires them into your build.
Read Gradle Docs →What's brewing.
The journey from MVP to a full-featured JVM language.
Replaced line-based parsing with robust grammar.
Project-wide class, field, method and constructor resolution.
URLClassLoader-based method param names and getter discovery.
Strict, loose and varargs phases with most-specific tie breaking.
Field/local initializers, return expressions, assignment checks.
Full support with compact constructors and default methods.
Arrow syntax, multi-label arms and block bodies.
Full exception handling with multi-catch via pipe syntax.
Configuration-cache and incremental build support.
Grammar-Kit, JFlex, live compiler errors in editor.
Move type-checker into a proper AST pass.
Target-typed poly expressions and capture conversion.
Import-aware references, code completion and formatting.
Direct bytecode generation beyond Java source transpilation.
Gradle Plugin Portal and JetBrains Marketplace distribution.
Start building with Affogato.
The language that makes JVM development feel like a perfectly pulled espresso shot.