Skip to content

The Square Programming Language. A tiny programming language under 200kb.

License

Notifications You must be signed in to change notification settings

square-lang/Square

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Square programming language

Build status Gitpod ready-to-code

What is Square

Square is a powerful programming language.

Features of Square

  • Simple Syntax
  • Highly Portable
  • Easy to learn
  • Small

How to run

Compile:

cd src
gcc -w main.c node.c parse.tab.c squ_run.c value.c squ_math.c -lm

Run with a file:

cd src
$ a.exe ../examples/helloworld.squ

Examples

Print "Hello World!" on the screen:

print "Hello World!"

A program to check whether it is an even number:

def a := 10
# You can replace "==" with "is" #
if a % 2 is 0 -> {
    print "This is a even number"
}

else -> {
    print "This is a odd number"
}

Result:

This is a even number

Contribution

Welcome to pull a request!

TODO

  • A tiny VM for square!

License

Copyright (c) 2020 Stepfen Shawn

The Author

Square was designed and developed by Stepfen Shawn in 2020.