A Different Way to Build Servers

Duso is a free open source server engine with zero dependencies. It features a simple scripting language and a powerful runtime written in Go. Built for great developer experience and better AI collaboration.

Building servers shouldn't be this hard

Messy Dependencies

npm install. pip install. Hundreds of packages, version conflicts, and security updates before you write a line.

Complex Toolchains

Build tools, configs, boilerplate. Hours of setup and learning curve before you can actually code.

Hidden Footguns

Languages built for humans write sloppy code. Unclear syntax and ambiguous patterns lead to costly AI mistakes.

Duso is Different

Download and Run

One 10MB binary. Everything inside. No npm, pip, or cargo needed.

Develop Fast

Hot-reloaded scripts with caching. No compile step, just edit and test.

Code Less

New script language features simple syntax with predictable behavior.

Things You Can Do with Duso

Make Web and API Servers

Templates, routing, JSON, SSL, JWT, CORS, RSA, websockets. Fully featured and built-in.

Use and Integrate AI

Let your AI code faster in a language made for it. Connect your app to popular AI agents.

Use Built-In NoSQL

ACID-compliant, powerful thread-safe datastores for process coordination, caching, and session state.

Connect to MySQL

Duso has built-in support for any MySQL-compatible database including MariaDB and TiDB.

Handle Massive Concurrency

Simple API backed by Go's efficient goroutines. Run thousands of parallel operations.

Secure Local Files

Sandbox mode restricts file access and uses virtual filesystem for safety.

Build as a Single Binary

App code, full runtime, all dependencies in a single, tiny executable.

Deploy Anywhere

Supports Linux, macOS, and Windows. One build, every platform.

Standout Features

Great Developer Experience

Hot reload, instant feedback, intuitive syntax. Development feels effortless and enjoyable.

Powerful Runtime

Markdown, regex, crypto, base64, UUID, date/time, math, HTTP client. Everything you need built in.

Embedded Module Library

Community script modules bundled in the binary including Anthropic, OpenAI, Ollama, CouchDB, and Stripe.

Built-in Documentation

120+ functions and library modules with integrated examples and guides. Learn as you build.

Integrated Debugging

Breakpoints, stack traces, code context. Even tames concurrent errors. Handle one issue at a time.

Editor Support

Full LSP support for VS Code, Zed, NeoVim, and more. Autocomplete, type hints, and diagnostics built in.

Powered by Go

Duso was written in Go, a battle-tested language made by Google to build efficient concurrent systems at scale.

Open Source

Apache 2.0 licensed. Community-driven and fully transparent.

Code Examples

Hook up your AI

Duso was designed to be quickly learned by most AI coding assistants. All Duso documentation and examples are included in its binary.

# start here!
duso -read
# look up a specific function or lib
duso -doc claude

Hook up your Human

Start with a simple sample project. Several are included to help you get started. Plus there are dozens of examples you can extract as well. Or jump into the interactive REPL to test code directly.

# pick from 5 starter projects
duso -init myproject
# extract examples to local directory
duso -extract examples /tmp
# interactive REPL to test code
duso -repl

Basic AI Prompt

One-shot Q&A style prompts are easy.

ai = require("ollama")
print(ai.prompt("sup?"))

Basic Chatbot

You can add system prompt and tools, but this will get you started. Displays a cute “busy” spinner while waiting for a response.

ai = require("openai")
chat = ai.session()

while true do
  prompt = input("\n\nYou: ")

  if lower(prompt) == "exit" then break end

  write("\n\nOpenAI: ")
  busy("thinking...")
  write(chat.prompt(prompt))
end

AI Workflow

Prompts experts in parallel, gathers their responses, then runs them through a summary prompt. Builtins like parallel() and spawn() are backed by simple and efficient goroutines. Multi-line strings and versatile string templates are built into Duso, making it easy to compose prompts, SQL, and other long strings.

ai = require("claude")

prompt = input("Ask the panel: ")
busy("asking...")

// build an array of functions to prompt
// each expert, then run them all in parallel
experts = ["Astronomer", "Astrologer", "Biologist", "Accountant"]
responses = parallel(map(experts, function(expert)
  return function()
    return ai.prompt(prompt, {
      system = """
        You are an expert {{expert}}. Always reason and
        interact from this mindset. Limit your field of
        knowledge to this expertise.
      """,
      max_tokens = 500
    })
  end
end))

// prepend the expert type into their response
for i = 0, 3 do
  responses[i] = """
    {{experts[i]}} says:
    {{replace(responses[i], "---", "")}}
  """
end

busy("summarizing...")
summary = ai.prompt("""
  Summarize these responses:

  {{join(responses, "\n\n---\n\n")}}

  List 3 the things they have in common.
  Then list the 3 things that are the most different.
""")

// format the markdown response for the terminal
print(markdown_ansi(summary))

One Line Web Server

You can run a web server from the command line.

# http://localhost:8080
duso -c 'http_server().start()'

Queue Workers

Spawn multiple worker scripts that process items from a datastore queue. Workers block on pop_wait() until tasks arrive, coordinate via shared datastore, and record results. Demonstrates concurrent processing with simple synchronization.

// queue-main.du
queue = datastore("tasks")
queue.set("done", 0)

// Spawn 3 workers
for i = 1, 3 do
  spawn("queue-worker.du", {id = i})
end

// Queue 5 tasks
for i = 1, 5 do
  queue.push("jobs", {name = "Task {{i}}"})
end

// Wait for all to complete
queue.wait("done", 5)

// Show results
work = queue.get("results")
for job in work do
  print("✓ {{job.name}} by worker {{job.id}}")
end
// queue-worker.du
ctx = context()
id = ctx.id
queue = datastore("tasks")

while true do
  job = queue.pop_wait("jobs", timeout = 5)
  if not job then break end

  sleep(random() * 2)

  queue.push("results", {id = id, name = job.name})
  queue.increment("done")
end

API Server

Build an HTTP API with routing and JSON responses. Best practice is one handler script per route to make each more manageable and efficient at runtime. Each time a route is triggered, http_server spawns a goroutine that runs a cached, pre-parsed instance of that script to handle it. It’s a simple pattern that’s also hyper efficient.

// server.du
port = 3000
server = http_server({port = port})

server.route("GET", "/api/user/:id", "user-get.du")
server.route("POST", "/api/user", "user-post.du")

// make users datastore use acid-compliant persistence
users = datastore("users", {
  persist = "/tmp/users.gob",
  wal = "/tmp/users.wal",
  wal_sync_interval = 900
})

print("Server running at http://localhost:{{port}}")
server.start()

// ...script blocks while server is running...

print("Server stopped.")
// user-get.du
ctx = context()
req = ctx.request()
res = ctx.response()

user = datastore("users").get(req.params.id)

if not user then res.error(404) end

res.json({
  success = true,
  data = user
}, 200)
// user-post.du
ctx = context()
req = ctx.request()
res = ctx.response()

id = uuid()
user = parse_json(req.body)

datastore("users").set(id, user)

res.json({
  id = id,
  name = user.name
}, 201)

Why I Made Duso

Most languages weren’t built for AI. They offer countless ways to solve the same problem, filled with hidden dependencies and subtle gotchas. Both Humans and AI struggle.

Duso is intentionally simple and predictable. No magic. No multiple ways to do the same thing. Every pattern is consistent so AI can reason about code reliably and write better scripts faster.

Duso is a joy to use. Everything including the runtime, libs, and docs is bundled in a single 10MB binary. No package management. No version conflicts. No stack building. Duso makes coding fun again.

We want to change how servers are made

Duso is still new and we need your help. Start building, join us on Discord, or dig into the documentation.

Download Discord Docs