v0.1.0

Untold Lang Documentation

The complete reference for Untold Lang — the language without limits.

Installation

pip install untold-lang

Or clone and install from source:

git clone https://github.com/untold-lang/untold
cd untold
pip install -e .

Hello World

start main() {
    say("Hello, Untold World!")
}

Save as main.ut and run with untold run main.ut

CLI Commands

CommandDescription
untold run file.utRun an Untold source file
untold new <name> [template]Create a new project
untold buildBuild project to executable
untold install <pkg>Install a package
untold check file.utCheck syntax errors
untold infoShow project info

Variables

let name    = "Untold"        // mutable variable
let version : num  = 1.0      // typed variable
lock MAX    : num  = 100      // constant

Built-in types

TypeDescriptionExample
numInteger or float42, 3.14
textString"hello"
boolBooleantrue, false
listArraylist(1,2,3)
mapDictionary{key: value}
nullNo valuenull

Functions

fn add(a: num, b: num) -> num {
    return a + b
}

async fn fetch(url: text) -> text {
    wait res = http.get(url)
    return res.body
}

Control Flow

if x > 10 {
    say("big")
} elif x > 5 {
    say("medium")
} else {
    say("small")
}

loop i in 0..10 { say(i) }

while active { doWork() }

Classes

class Person {
    name : text
    age  : num

    fn greet() {
        say("Hi, I am " + self.name)
    }
}

let p = Person{ name: "Dev", age: 22 }
p.greet()

Error Handling

try {
    let data = fs.read("file.txt")
} catch err {
    say("Error: " + err.msg)
} finally {
    say("Done")
}

untold.fs — File System

use untold.fs

fs.write("file.txt", "hello")
let content = fs.read("file.txt")
fs.mkdir("myfolder")
fs.delete("file.txt")
say(fs.exists("file.txt"))

untold.web — HTTP

use untold.web

let res = http.get("https://api.example.com/data")
say(res.status)
say(res.body)

http.serve(8080)

untold.ai — AI & ML

use untold.ai

let result = ai.sentiment("This is amazing!")
let words  = ai.keywords(text, 5)
let summary= ai.summarize(text, 2)

untold.shell — System

use untold.shell

let r = shell.run("ls -la")
say(r.out)
say(shell.platform())
say(shell.env("HOME"))

untold.hack — Security

use untold.hack

say(hack.sha256("password"))
say(hack.b64_encode("hello"))
say(hack.port_scan("localhost", 80, 100))

untold.net — Network

use untold.net

let open = net.port_open("google.com", 443)
let ip   = net.resolve("google.com")
say(net.my_ip())

Package Manager

untold install colors
untold install uuid dotenv crypto
untold remove colors
untold list
untold search crypto

Building

untold build                      # Python script
untold build --target binary      # Standalone binary
untold build --optimize 2         # Max optimization

Project Templates

TemplateDescription
appGeneral purpose application
webHTTP web server
aiAI / ML project
hackSecurity toolkit
cliCommand line tool
scriptAutomation script