Skip to content

Built a full-featured interpreter with zero external dependencies, using Vaughan Pratt’s top-down operator precedence parsing technique

Notifications You must be signed in to change notification settings

kx0101/liakos-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • REPL (Read-Eval-Print Loop)
  • Primitive Types: int, bool, string
  • Data Structures: Arrays ([]) & Hash maps ({})
  • Arithmetic Expressions: +, -, *, /, <, >, ==, !=
  • Variables & Bindings: let statements
  • Control Flow: if-else, return
  • Functions:
    • First-class & higher-order
    • Closures & lexical scoping
    • Recursion supported
  • Built-in Functions: e.g. len(), first(), last(), push(), print()
  • Parser with Pratt Parsing for correct operator precedence
  • Error Handling with informative messages
  • Lexical Analyzer (Tokenizer) and recursive descent parser

🚀 Getting Started

1. Clone the repo

git clone https://github.com/kx0101/liakos-language.git
cd liakos-language

REPL

go run main.go

>> let add = fn(a, b) { return a + b; };
>> add(2, 3);
5

Run a File

You can also execute .liakos source files:

./liakos examples/main.liakos

About

Built a full-featured interpreter with zero external dependencies, using Vaughan Pratt’s top-down operator precedence parsing technique

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages