/Lantern

Stack based programming language in C

Primary LanguageCGNU General Public License v3.0GPL-3.0

Lantern

License: GPL v3

Lantern Logo

Lantern is a stack based, interpreted programming language written in C. The goal of the project is creating a fast, bloatless and powerful programming tool that can be used for multiple purposes.

The language has access to the underlying memory structure and in general is desinged to be easily used as a low level programming language too.

Lantern is, due to the stackbased paradigm of the language it is written in reverse polish notation. wich sets it apart from a lot languages that work with AST or other structures.

Feature list

  • Conditions & loops
  • Heap Memory System
  • Stackframe System
  • Variables & Type checking
  • Stack Mechanics
  • Raw Memory Access
  • Functions
  • Else-If Functionality
  • Macros
  • Access to Syscalls
  • Defining Structs (C-Style)
  • Adding Fundamental Variable Types (float, double, char...)
  • String Concatenation & Equality Operators

Building

Linux

Requirements

  • GCC Compiler
  • Make command
mkdir bin
make

Windows

Requirements

  • GCC Compiler
mkdir bin
build.bat

Example Usage

A implentation of the FizzBuzz problem

0 = counter

while counter 10000 < run
    counter 3 % 0 == counter 5 % 0 == and if
        "fizzbuzz" println
    elif counter 3 % 0 == then
        "fizz" println
    elif counter 5 % 0 == then
        "buzz" println
    end
    counter println
    counter 1 + = counter
end

Inspiration

  • Forth, a stack based, imperative programming language
  • Python, a easy to used, interpreted programming language
  • C, a statically typed, low level programming language

Contributing

You can contribue to Lantern by: