Skip to content

Little Cat is a modern dynamic typed interpreted language that allows you to write programs quickly and easily.

License

Notifications You must be signed in to change notification settings

lclang/LittleCat

Cat

Little Cat Language

Discord CircleCI

Little Cat is a modern dynamic typed interpreted language that allows you to write programs quickly and easily. It was influenced by Java, Kotlin, Python, PHP. Language abbreviation lclang. File extension - lcat.

Install

Windows

Download the latest release of EXE.

Debian (Ubuntu and others)

apt update & apt install wget
wget https://ft.vitiacat.xyz/download.php?id=lcdeb -O lclang.deb
dpkg -i lclang.deb

Executing

CLI

Open terminal and write:

lclang

Output:

image

File

lclang <relative or absolute path>

Code examples

Hello, World!

println("Hello, World!")

While loop

i = 0
while i < 20: {
    println(i++)
}

OR

i = 0 
while { 
    println(i++) 
    return i<20
}

Arrays

array = [1]
array[] = 5

[a, b] = array
println(a)
println(b)

Wait data from other thread

data = null
:Thread(-> {
  sleep(5000L)
  data = "New data!"
})

while data==null
println(data)

HTTP client on Connection and url

println(readInput(
    parseUrl("https://github.com")
      .openConnection()
      .getInput()
))

HTTP client on Sockets

url = "info.cern.ch"
path = "/"
requestMethod = "GET"

socket = :Socket(url, 80)

output = socket.getOutput()
output.println(requestMethod+" "+path+" HTTP/1.1")
output.println("Host: " + url)
output.println("")
output.flush()

println(readInput(socket.getInput()))

Map

map = :Map()
map.put("ads", "Zation is a social network")
println(map.get("ads"))
println(map.entries)

Contributions