Skip to content

ilittlebig/little-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

little-lang

Compiler and tools for the Little programming language.

Examples

Hello World

fn main() : void {
  (printf "%s\n" "Hello, World!")
}

Add Two Numbers

fn add(int a, int b) : int {
  (return (+ a b))
}

fn main() : void {
  (defvar sum (add 5 10))
  (printf "%i\n" sum)
}

Building, Testing & Compiling

Building

To build the Little compiler, simply run:

make

Note: This will generate a binary file in the bin directory called little.

Testing

The test cases can be run with the --test flag:

bin/little --test

Note: They do not they all possible cases, but most of them are covered.

Compiling

To compile a file, use the generated binary from the build step:

bin/little test_file.lil

Note: This will generate another binary in the bin directory called a.

Features

  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)
  • Modulus (%)
  • Conditions
  • Function Definitions
  • Function Calls
  • Comments
  • Integers
  • Floats
  • Structs
  • Enums
  • Arrays
  • Scopes
  • If Statements
  • For-Loops
  • While-Loops
  • Variable Assignments

References

chibicc

About

A custom programming language made in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages