DashaScript programming language

DashaScript

  • Domain specific language
  • Based on TypeScript
  • Designed for conversations
  • Event-driven
  • Single-threaded

DashaScript is a Domain Specific Language designed to let you create human-like conversational experiences using voice as the interface. At its core, DashaScript consists of states representing AI actions and transitions or conditions representing conversation events (user actions).

A DashaScript application is referred to as a script. The script is a part of dashaapp folder which gets executed in the DashaCloud via API. The script determines the behavior of the Dasha app at runtime.

Language support

To get syntax analysis and highlighting, please install the Dasha Studio Extension in Microsoft Visual Studio Code and create a file with the .dsl extension. You can also follow the Quick Start Guide.

Basic Terminology

  • State A chunk of code which comprises a distinct phase in the DashaScript program execution. There are two types of states. A node is a state which is reached via a transition from a specified state. A digression is a state which can be reached from any state through conditional definition. Most states contain an interaction between AI and user; yet can avoid interaction altogether and instead be used to perform a calculation or to call an external function that progresses the execution of the program.
  • Node A sort of state which can only be reached by a direct transition from another state. The exception is the start node with which all DashaScript programs begin.
  • Transition Specifies to which node the program will go next and on which condition. Used in digressions or nodes but can only ever specify a node as target destination.
  • Digression A type of state which can be called up at any point in the DashaScript program execution. Digressions are executed when a specified condition is met. Most of the time the condition is that a specific intent(s) and/or named entity(ies) is/are identified.
  • Context A set of variables shared among states in a DashaScript file. These variables are preceded by a $ as such: $var1
    • Input context variables variables passed to the DashaScript file as arguments. In the current implementation, passed from the Node.js app you use to launch your Dasha app. Can also be used in other ways, e.g.: in a Zapier Dasha integration, you specify how you receive input variables.
    • Output context variables Variables returned by the Dasha app when it finishes its execution. In the current implementation, passed from Dasha app to the Node.js app. Can also be used in other ways, e.g.: in a Zapier Dasha integration, you specify how you want to use the generated output variables.
    • Internal context variables Storage variables available for use in the execution of your Dasha app.
  • External functions The ability to execute a Node.js function in the body of your .js file right from your DashaScript file. Is used to pass/retrieve data from external services via API or to perform data operations and/or calculations. Used to pass variables in/out of your Dasha app during the course of the app’s runtime (not in the beginning/end like input/output.
  • Block A self-sufficient set of context, states and transitions. The DashaScript file in its entirety is a block. You can also have blocks which are used as functions within your DashaScript file to perform tasks. You would use a block as any other function in any other programming language.
Found a mistake? Email us, and we'll send you a free t-shirt!

Enroll in beta

Request invite to our private Beta program for developers to join the waitlist. No spam, we promise.