Skip to content

cwang22/lean-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lean Script

a basic programming language implemented in TypeScript.

Syntax

# this is a comment

# assign
a = 1;
b = 2 + 3 * 4;

# string
c = "Hello World!"

# block scoped variable
let (a = 10, b = 20) {
  a + b;
}

# function
fib = func(n) if n < 2 then n else fib(n - 1) + fib(n - 2);

Usage

The language is packed as an UMD style library under namepsace LS

    <script src="path/to/lean-script.js"></script>
    <script>
        // 13
        console.log(LS('fib = func(n) if n < 2 then n else fib(n - 1) + fib(n - 2); fib(7);'))
    </script>

Try it out

https://cwang22.github.io/lean-script

About

a basic programming language implemented in TypeScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published