Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 1.05 KB

types.md

File metadata and controls

78 lines (60 loc) · 1.05 KB

Types in TechScript

Status: Implemented & Canonical

TechScript is dynamically typed. Variables do not have fixed types, but values do.


🟢 Primitive Types

Int

Represents 64-bit signed integers:

count is 42
negative is -100

Float

Represents 64-bit floating-point numbers:

pi is 3.14159
temp is -12.5

Str

UTF-8 encoded string sequence:

message is "Welcome to TechScript"

Bool

Logical values:

is_running is true
has_errors is false

Null

Represents the absence of value:

data is null

🟡 Collection Types

List / Array

Ordered list of values (can contain mixed types):

items is [1, 2, "three", true]

Map / Dictionary

Key-value storage:

configs is {
    "host": "localhost",
    "port": 8080
}

🔴 Custom Types

Class

Objects instantiated using class and new:

class Dog:
    name is ""

    to init(name):
        self.name becomes name

my_dog is new Dog("Fido")

For more information, see Classes.