dryLang
docsplaygrounddownloadgithub

Getting Started

  • Home
  • Getting Started
  • Setup

Language Basics

  • Variables
  • Types
  • Operators
  • Comments
  • Strings

Control Flow

  • Control Flow
  • Loops

Advanced Concepts

  • Functions
  • Structs
  • Collections
  • Modules
  • HTTP Server
  • Database

Reference

  • Built-ins
  • Error Handling
  • Errors

Examples

  • Hello
  • Variables
  • Functions
  • Control Flow
  • Structs
  • Arrays Maps
  • Try Err
  • Imports
  • Math
  • Strings
  • Http Server
  • Database
  • File Io

Templates

  • Automation
  • Cli Tool
  • Crud
  • Fetch Json
  • File Server
  • Hello
  • Html Render
  • Rest Api
Docs Menu

Getting Started

  • Home
  • Getting Started
  • Setup

Language Basics

  • Variables
  • Types
  • Operators
  • Comments
  • Strings

Control Flow

  • Control Flow
  • Loops

Advanced Concepts

  • Functions
  • Structs
  • Collections
  • Modules
  • HTTP Server
  • Database

Reference

  • Built-ins
  • Error Handling
  • Errors

Examples

  • Hello
  • Variables
  • Functions
  • Control Flow
  • Structs
  • Arrays Maps
  • Try Err
  • Imports
  • Math
  • Strings
  • Http Server
  • Database
  • File Io

Templates

  • Automation
  • Cli Tool
  • Crud
  • Fetch Json
  • File Server
  • Hello
  • Html Render
  • Rest Api

Getting Started

Installation

Prerequisites

  • Go 1.21 or later

Build from Source

bash
git clone https://github.com/zakyislm/drylang.git
cd drylang
go build -o y.exe .

This produces the y binary — the dryLang compiler and runtime.

Verify Installation

bash
y

This prints the usage: y <file.y|folder|all>

Your First Program

Create a file called hello.y:

drylang
pt "Hello, World!"

Run it:

bash
y hello.y

Output:

drylang
Hello, World!

A More Complete Example

Create intro.y:

drylang
// Welcome to dryLang!

//  Variables — no keyword needed 
name "Zaky"
age 17
height 175,5

//  Print with string interpolation 
pt "Name: ${name}"
pt "Age: ${age}"
pt "Height: ${height} cm"

//  Constants 
cns pi 3,14
MAXLIFE 5

//  Array 
colors ["red", "green", "blue"]
pt colors
pt "Count: ${len(colors)}"

//  Function 
fn greet(who) {
  rev "Hello, " + who + "!"
}

pt greet("World")

//  Loop 
lp 3 {
  pt "Iteration ${i}"
}

//  Conditional 
score 85

if score >= 90 {
  pt "Grade: A"
} elif score >= 80 {
  pt "Grade: B"
} el {
  pt "Grade: C"
}

Run:

bash
y intro.y

File Extension

All dryLang source files use the .y extension.

  • Variables & Constants — how to store data
  • Data Types — what types exist
  • Functions — how to write functions
PreviousHomeNextSetup