Skip to content
/ lako Public

Simple and Easy Interpreted & Bytecode compiled Language created in Rust based on Crafting Interpreters

License

Notifications You must be signed in to change notification settings

glella/lako

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lako

Build Status

Small & Easy Programming Language written in Rust based on the awesome book Crafting Interpreters

Follows closely the book to produce an Interpreted and a Bytecode Compiled version as an exercise to learn about Compilers in a practical way with a deeper understanding of Rust.

Whats in a name?

Did not want to name it Lox or Rlox too. While I might extend in future to make it moderately useful. Lako means Easy in Croatian/Bosnian - although I am not Croatian or Bosnian it seems a short and simple name to pronounce different from everything else.

Interpreted version

Status:

April 2023 update:

  • Resuming after a loooong period of inactivity. Forgot half of what I wrote.
  • Restarted from scratch evaluating and updating every piece of code:
    • Finished & tested scanner and tokenizer - OK.

Need to redo - have errors when supposedly this used to work fine:

  • Finished Expressions Syntax Tree and tested AST printer.
  • Finished & tested parser (chap 6). For now it just prints the parsed expression back handling precedence and associativity correctly.

Usage

As a repl. Just launch Lako. To exit Ctrl-c.

./lako

With source file. ie with "test.lak":

./lako test.lak

Bytecode compiled version

Not started yet...

Lako Language

For now it mirrors the basic capabilities of Lox

  • High level: dynamic typing, automatic memory management.
  • Data types: booleans, numbers, strings, nil (ugh).
  • Expressions: arithmetic, comparison / equality, logical operators, precedence / grouping.
  • Syntax, Statements & Control Flow: follows C based languages for familiarity.
  • Functions are first class.
  • OOP: Classes & Inheritance.
  • Minuscule Standard Library: starting off with just print & clock
  • Created in Rust

About

Simple and Easy Interpreted & Bytecode compiled Language created in Rust based on Crafting Interpreters

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published