Drop

A zero-ceremony prototyping language

Write a .drop file. Run drop file.drop. Get a running prototype.

$ go install github.com/superciccio/drop-lang/cmd/drop@latest

Hello World

name = "World"
print "Hello, {name}!"

That's it. No imports. No main function. No semicolons. Just your idea.

A Complete Todo App

serve 8080
store "todos"

get "/"
  page "My Todos"
    each todo in load "todos"
      row
        text todo.name
        button "Delete" -> delete "/todos/{todo.id}"
    form "New Todo"
      input "name"
      submit "Add" -> post "/todos"

post "/todos"
  save "todos" body
  respond body 201

delete "/todos/:id"
  remove "todos" id
  respond "Deleted"

get "/api/todos"
  respond load "todos"

That's a full CRUD app with a UI. ~20 lines. No setup. No dependencies.

Features

Web Built-in

serve, get, post, respond, body, route params. Your prototype is a web app from line one.

Data Persistence

store, save, load, remove. JSON files on disk. No database to configure.

Auto UI

Your browser gets styled HTML pages. Lists become tables, maps become cards. No templates.

Page Blocks

Custom UI with page, text, row, each, button, form, input, submit. Layout without a framework.

Fetch

fetch "url" for external HTTP requests. Talk to any API in one line.

Hot Reload

Change your file, server restarts automatically. No manual restarts, no watchers to configure.

Syntax Overview

Variables & Interpolation

name = "Andrea"
age = 30
msg = "Hello {name}, age {age}"

Functions

do greet(name)
  return "Hello, {name}!"

Control Flow

if age > 18
  respond "Welcome"
else
  respond "Too young"

for user in users
  print user.name

Lists, Maps & Comments

tags = ["fast", "simple"]
user = {name: "Andrea"}

-- this is a comment

Install

$ go install github.com/superciccio/drop-lang/cmd/drop@latest

or download from GitHub Releases

Editor support: drop --editor vscode|vim|sublime|zed