monkey

command module
v0.0.0-...-6e8cd2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 12 Imported by: 0

README

Monkey

Yet another monkey-lang interpreter. Based off of Thorsten Ball's Writing an interpreter in Go. See also :monkeylang.org.

About

Don't use this, it is simply a side-project. There are much better interpretations available. See monkeylang.org.

Seemingly like most adaptations, this repo builds upon Thorsten's canonical version in this case by adding:

  • Addtional operators and operations
  • Additional builtin functions
  • A module system

Most of this could not have been achieved without additional help, in particular from referencing these implementations:

Roadmap

Done

  1. Additional operators and operations
    • modulus // 3 % 2 = 1
    • comments // single line comments only
    • boolean AND and OR // true && false || true
    • Array concatenation ([1,2] + [3] // [1,2,3])
  2. Additional Builtins
    • String functions
      • split(string, delimiter) // Array
    • Array functions
      • join(array, delimiter) // String
    • Hash functions
      • keys(hash) // Array
      • values(hash) // Array
  3. Add module system
    • uses absolute paths or paths relative to the importing file (or current working directory for interactive mode). I took this almost verbatim from prologic's version.
    • Note: importing executes the loaded module, so you should only import modules that don't have side-effects.
  4. Create a standard library of monkey functions implemented in monkey (requires a working module system)
    • Array functions (map, filter, reduce)

ToDo

  1. Add more builtins and operations - ONGOING
    • Dictionary concatenation?
    • file I/O e.g let f = open(filePath, ["r"|"w"|"a"])
    • Variable destructuring - this would be a great way to improve import syntax i.e. let {map, filter, reduce} = import("./stdlib/arrays.mo");
    • Build upon our new standard library
  2. Loops?
  3. Sets?
  4. Create a TCP Server
  5. Create a Web Server
  6. and - if no one else has done this by the time we get here - get some syntax highlighting going
  7. Port to Python :-)
  8. Port to Java :-(

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL