Skip to content

georgiy-belyanin/slang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slang

About

slang - is a simple compiler, based on LLVM. S language is planned to be a clone of c, with some extra features.

HUGE NOTE - the compiler is in deep development, though it works, there are a lot of unsupported features, that would be implemented later.

Building

In order to build the project, you need to have LLVM installed and set its binaries in $PATH. After installing dependencies run

make

to build the compiler, or

make tests

to build the tests.

Usage

slang [filename]

generates result.o, object file that can be linked with gcc.

Examples

Fibonacci function

func fib(n: i32): i32 {
  if n <= 2 ret 1;
  ret fib(n - 1) + fib(n - 2);
}

Supported features

  • func definition
  • branching
  • let, ret keywords
  • int types

Planned features

  • float types
  • bool types
  • structs
  • interfaces
  • string support
  • type deduction
  • pointer and array type support
  • lots of more...

About

slang - is a simple compiler, for my own S(tudy) programming language

Topics

Resources

Stars

Watchers

Forks