InfiniteScript Documentation

Welcome to the InfiniteScript documentation. InfiniteScript is a readable programming language designed around a unified runtime and ecosystem.

Current version: v0.2.0

This documentation describes the current InfiniteScript architecture and implemented v0.2.0 language features.

Installation

InfiniteScript currently runs through the native Inf.exe runtime on Windows.

After downloading the project, open a terminal in the project directory and run the InfiniteScript executable.

terminal
Inf.exe version

Your First Program

Create a file ending in .infs. For example, create Hello.infs.

Hello.infs
/- My first InfiniteScript program

Say "Hello World!"

The Say command writes text to the program output.

Running InfiniteScript

terminal
Inf.exe run Hello.infs

You can also validate a program without running it:

terminal
Inf.exe check Hello.infs

Syntax

InfiniteScript uses readable command-based syntax. Blocks are closed using End.

Example.infs
If Money > 100
    Say "Rich!"
Else
    Say "Keep working."
End

Comments

Comments begin with /-.

Comments.infs
/- This is a comment

Say "Hello"

Variables

Variables can be created using Local Storage.

Variables.infs
Local Storage Money = 100
Local Storage PlayerName = "Adan"
Local Storage IsAdmin = true

Types

TypeExample
Number100
String"Hello"
Booleantrue / false

Expressions

InfiniteScript supports arithmetic and comparisons.

Expressions.infs
Set Money = Money + 50

If Money >= 100
    Say "Enough."
End

If Statements

Conditions.infs
If Money > 100
    Say "Over 100"
Else If Money == 100
    Say "Exactly 100"
Else
    Say "Under 100"
End

Logical conditions can use And and Or.

Loops

InfiniteScript supports While and For blocks.

Loop.infs
While Money < 500
    Change Money by 100
End

Break & Continue

Use Break to leave a loop and Continue to skip to the next iteration.

Functions

Functions allow reusable blocks of code.

Functions.infs
Local Function GiveMoney
    Change Money by 100
End

GiveMoney

Parameters

Parameters.infs
Function GiveMoney Amount
    Change Money by Amount
End

GiveMoney 50

Return Values

Return.infs
Function GiveMoney Amount
    Change Money by Amount
    Return Money
End

Say

Say.infs
Say "Hello World"

Set

Set.infs
Set Money = 500

Change

Change.infs
Change Money by 100

Input

Input.infs
Input PlayerName
Input Number Age
Input Boolean IsAdmin

Random

Random.infs
Random Number Roll = 1 to 6

Local Storage

Storage.infs
Local Storage Money = 100
Local Storage PlayerName = "Adan"

Infinite UI

Infinite UI allows InfiniteScript programs to describe native interfaces. The native runtime renders the interface directly on Windows.

Home.infs
UI
    Window Main
        Title "My App"
        Size 800, 600
    End
End

Window

Window.infs
Window Main
    Title "My Application"
End

Title

Title.infs
Title "InfiniteScript"

Size

Size.infs
Size 800, 600

Text

Text.infs
Text HeroTitle
    Content "Hello!"
End

Button

Button.infs
Button GetStarted
    Text "Get Started"
End

Events

UI events can be attached to elements.

Events.infs
Button GetStarted
    Text "Get Started"

    On Click
        Say "Button clicked!"
    End
End
⚠ Web Preview Notice

This documentation website is hosted as static HTML. It does not execute Infinite UI. Native Infinite UI runs through Inf.exe on Windows.