LuxSimpleLang – Manual

A small scripting language implemented in Python (SimpleLangInterpreter).

1. Introduction

LuxSimpleLang is a small educational scripting language with simple syntax. It supports variables, control structures, loops, functions, file I/O, list operations and built-in helpers.

2. Basics

print "Hello world"
x = 5
y = x * 2
print y

3. Control Structures

Conditional

if x > 10:
  print "x greater than 10"
else:
  print "x less or equal to 10"
end

While loop

i = 0
while i < 3:
  print "i = " + str(i)
  i = i + 1
end

Repeat n times

loop 5:
  print "repeated"
end

For loop

for i in 1..5:
  if i == 3:
    continue
  print i
  if i == 4:
    break
end

4. Functions

function greet:
  print "Hello from function"
end

call greet

Functions have no parameters in this simple interpreter (variables are global). Return values can be stored manually in variables if needed.

5. File and Directory Operations

writefile "log.txt", "First line\n"
appendfile "log.txt", "Another line\n"
readfile "log.txt"
print _lastread

6. Text Functions

name = "Antonin"
print upper(name)
words = split("one two three")
print words

7. Lists

mylist = [1,2,3]
append mylist, 4
remove mylist, 0
print mylist  # [2,3,4]

8. Built-in Values and Functions

print date
print rand(1, 100)
if exists("log.txt"):
  print "File exists"
end
sleep(1)

9. Input

You can request input from user:

name = input "Your name:"
print "Hello " + name

10. Comments

# single line

/* multi
line */