Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

esbraff/moonlight-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hello, World!

print("Hello, World!");

Simple mathematics

print(1 + 2 * 5 / 30)

Hexademical numbers

print(0xFF - 0xAC)

Variable definition and initialization

foo <- "Hello,"
bar <- " World!"
baz <- foo + bar

Function definition

foo <- function (a b c) {
    a + b + c
}

Function returns last evaluated expression it the it's body so thing below will return sum of three arguments passed to it

Function Procedure call

result <- foo(1 2 3)

Single line function

pow2 <- function(a) a * a

print(pow2(3))

About

Simple scripting language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published