NOT RELEASED YET, NOT FINISHED!!

retro

A complete scripting language thats expressive and pragmatic -- all backed by Zig's performance.

[]

Clean Syntax

Function calls use [brackets], math uses (parens), blocks use {braces}. Clean, unambiguous syntax that reads naturally.

{}

Types & Protocols

Define typed maps with deftype, declare interfaces with defprotocol, implement them with defimpl. Clojure-style polymorphism.

=>

Pattern Matching

Destructure maps, lists, and types. Match on literals, type guards, regex, ranges, and more with the match expression.

||

Concurrency

Async tasks with await, coroutines with yield, one-shot timers, and defer for cleanup.

|>

Transducers

Clojure-style composable transformations. Compose, into, sequence, and transduce for efficient data pipelines.

::

Module System

Namespaced modules with import/as, from/import, visibility control, and module contracts via impls.

*

TUI Framework

Built-in TUI with panels, grids, textareas, overlays, and theming. Build terminal UIs natively.

VS

VSCode

Full VSCode extension with syntax highlighting.

M

Macros

Compile-time macro system with defmacro for powerful code generation and DSLs.

C

FFI

Call C libraries directly with ffi/load, ffi/call, and automatic type marshalling.

<>

App Server

Built-in HTTP server with routers, middleware, HTML templating, static files, and partials.

See it in action

Expressive, readable, and powerful -- from one-liners to full applications.

Functions & Types

            # Define a typed structure

deftype User %{
    name  %{ type "string" }
    email %{ type "string" }
    admin %{ type "boolean" }
}

# Create and use
set u %User{ name "Alice"
             email "alice@dev.io" 
             admin true }
             
echo "Welcome, $u~name!"
# => Welcome, Alice!    

            

HTTP Server + HTML Templating

def greet {|req res|
    set name $req~params~name
    [html 
    <h1>Hello name!</h1><p>Welcome to Deft</p>
    html]
}

def app %{
    routes @{
        %{ path "/greet/:name" method :GET handler greet }
    }
} |> [http/router]
    

Pattern Matching


[match $user {
    %{ name $n age $a } => "Name: $n, Age: $a"
    _ => "unknown user"
}]


[match $x {
    $n when $n > 100 => "big"
    $n when $n > 10 => "medium"
    _ => "small"
}]
            

Pipelines & HOFs

set nums @{ 1 2 3 4 5 6 7 8 9 10 }

set result (
$nums
|> [filter{nn}]
|> [map{nn}]
|> [reduce{abab}]
)
# => 84

MIT licensed

Ready to try Deft?

Get started in seconds with a single binary. MIT licensed — free for any use.