/redlang

A Tree Walking Interpreter in Typescript

Primary LanguageTypeScriptMIT LicenseMIT

Redlang

learning to make interpreted programming language,

HOW TO TOKENIZE

  • use switch case for single character symbols and keywords
  • use special function to parse keywords of language
  • keep an index of line column and line number in scanLine
  • use an error reporting interface

Language Design

  • Like Javascript
  • Without
    • Type coercion (operations can only occur in same type)
    • this meaning what it should mean
    • Classes
    • switch with automatic break and fallthrough keyword
    • Block scoping and shouldn't be able to use variable before assignment
    • Standard Library

Things needed to do now

  • Array primitives
  • HashMap primitives
  • Class and OOP support
  • import/export support
  • Math lib
  • Fs lib
  • Os lib
  • UDP/TCP/HTTP lib
  • Buffer
  • Crypto
  • IO
  • Time/Date
  • timer
  • zlib