The Skript book · Chapter 1

Whetting Your Appetite

If you run a business on Skode — or build for people who do — you have almost certainly wished a computer would just do the obvious thing. A new lead arrives; somebody should look at it, decide whether it is promising, hand it to the right person, and send a friendly reply before the lead loses interest. None of that is hard. It is just relentless, and it happens fifty times a day.

You could wire it together with a general-purpose programming language. Python, JavaScript and their friends are wonderful tools, but they ask a lot in exchange: you must learn what a callback is, how to authenticate an HTTP request, why your string had the wrong kind of quotes in it, and what a stack trace is trying to tell you at eleven o'clock at night. For a five-line business rule, that is a heavy toll.

Skode Skript is a different bargain. It is a small, real programming language — with variables, data types, loops, conditionals and functions — whose grammar is deliberately shaped like the English sentence you would have said out loud anyway. The program below is the complete, runnable answer to the situation described in the first paragraph:

when a new lead arrives
  score it with ai
  if score is hot then
    assign to "Maya" and reply on whatsapp
      "Thanks! We'll call you in 10 minutes"

Read it once and you already know what it does. That is the entire design philosophy of the language: if you can say it, you can probably write it — and, just as important, anyone on your team can read it back six months later without archaeology.

Do not let the friendliness fool you into thinking Skript is a toy. Over the course of this tutorial you will use named variables and arithmetic, four kinds of data (numbers, strings, booleans and lists), three kinds of loop, user-defined functions that call each other, and an error system that answers back in plain English. Skript is also sandboxed: it runs inside guardrails — capped loops, capped recursion, no raw network access — so a typo in an automation can never take down anything else in your Skode workspace.

The language comes with a small command-line tool, skript, which runs your programs locally against simulated business events. You can write and test an automation on your laptop in any editor you like, watch exactly what it would do, and only then deploy the very same file to Skode, where the events, the AI scoring, and the WhatsApp messages become real.

This tutorial introduces the language informally, the way you would show it to a colleague: by typing things in and looking at what happens. Every example in this book was executed against the real interpreter while the book was being built, and the output you see printed is the output it genuinely produced. Nothing is mocked.

You do not need any prior programming experience. If you have some, you will move faster, and you may enjoy noticing which conventional ceremonies Skript simply refuses to have.

In the next chapter we install the interpreter and learn to drive it. After that, the language itself: values and variables, control flow, functions, and the built-in vocabulary of business actions. The later chapters cover testing, error messages, the package marketplace, and what changes when your skript leaves the simulator and goes to production. Two appendices — a formal language reference and a cookbook of complete programs — close the book.

It is a short language. It will not take long to learn all of it.