Skip to content

A compiler and interpreter for CrabScript, my own programming language

Notifications You must be signed in to change notification settings

SigSeg-V/crabscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crabscript 🦀

A complete interpreter and compiler for a language based on Thorsten Ball's "Writing an Interpreter in Go" using only the standard library. The current implemented features are:

Interpreter

  • Tokeniser (AST)
  • Lexer
  • Parser
  • Evaluator
  • REPL
  • Files
  • Int
  • String
  • Bool
  • Variable binding
  • Functions
  • Closures
  • Arrays
  • Builtins (len, first, last, tail, puts)

Compiler

  • Compiler
  • Virtual Machine

About

The parser is using Pratt's algorithm, which is modular and easily extensible. The evaluator is an implementation of a tree-walking interpreter and no byte-code is generated. There are no primitive types - everything is an object a la Ruby.

The compiler is less complete than the interpreter - it doesn't fully support fns.

About

A compiler and interpreter for CrabScript, my own programming language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published