Giter VIP home page Giter VIP logo

yartbml's People

Contributors

babykangaroo117 avatar dineshumasankar avatar katherinerbanis avatar pwjensen avatar

Stargazers

 avatar

Watchers

 avatar  avatar

yartbml's Issues

Parser / AST Implementation

Implement the Parser by completing Chapter 2 of Thorsten Ball's Monkey Language
Pages 29-102

These implementations will be split up into several smaller PRs where each member will take upon themselves an implementation of each subchapter (2.1 to 2.9).

Is Null Needed?

A "Null" Object is created within our language whenever we do out-of-bounds accesses on our own array(s) / hashmap(s), and this was a decision made by Thorsten Ball.

As far as I know, we can return an error whenever an "out-of-bounds" access or allow the program to execute under the context of null.

However, this does open up the rabbit hole of our language being able to set the state of variables as null, but not giving that power to the end-user being a programmer.

Evaluator Code Context

func evalArrayIndexExpression(array, index object.Object) object.Object {
	arrayObject := array.(*object.Array)
	idx := index.(*object.Integer).Value
	max := int64(len(arrayObject.Elements) - 1)

	if idx < 0 || idx > max {
		return NULL <------
	}

	return arrayObject.Elements[idx]
}

func evalHashIndexExpression(hash, index object.Object) object.Object {
	hashObject := hash.(*object.Hash)

	key, ok := index.(object.Hashable)
	if !ok {
		return newError("unusable as hash key: %s", index.Type())
	}

	pair, ok := hashObject.Pairs[key.HashKey()]
	if !ok {
		return NULL <------
	}

	return pair.Value
}

This issue is meant to serve as a discussion.

Lexer / Tokenizer Implementation with Tests

Page 12-30 in TB's Book. Use the definitions provided from our teams chat for the tokens themselves. Discuss with me later regarding the tests for the lexer.

This will also create the initial implementation of the repl

Chapter 2.6 - 2.8 (Parsing Expressions)

Subtask of #13

Chapter 2.6 Subchapter Completion

  • Expressions in Monkey
  • Top Down Operator Precedence (or: Pratt Parsing)
  • Terminology
  • Preparing the AST
  • Implementing the Pratt Parser
  • Identifiers
  • Integer Literals
  • Prefix Operators
  • Infix Operators

Chapter 2.7

  • How Pratt Parsing Works

Chapter 2.8: Extending Parser

  • Boolean Literals
  • Grouped Expressions
  • If Expressions
  • Function Literals
  • Call Expressions
  • Removing TODOs (Skipping the Mock/Stub of the Lexer)

Setup Test Reporting Tools and Test Automation

  • Generate Go Coverage Report HTML File Locally
  • Generate Go Test Report HTML File Locally
  • Figure out how to setup Go in a GitHub Action
  • Create GH Action to generate test reports w/ Go-Test-Report and upload test artifact
  • #19
  • Upload Coverage Report into GH Pages to host coverage statistics of repository
  • Run tests across ubuntu, linux, and mac-os and upload test artifacts
  • Figure out how to host multiple reports into GH Pages (Coverage, Test-Linux, Test-Windows, Test-MacOS)
  • Test Plan Documentation

Functions do not render with braces

Description

When invoking a function identifier, the function does not have proper braces when returning a nested function definition.

Hello <DesktopUserName>! This is the YARTBML programming language!
Feel free to type in commands
>> let addWrapper = fn() { return fn (x, y) { return x + y; }; };
>> addWrapper;
fn() {
return fn(x, y) return (x + y);;
}

Create Initial TextMate Grammar for Syntax Highlighting in VSCode

  • Build the TextMate Grammar to properly highlight tokens within our language

  • Create a VSCode Extension to highlight tokens within VSCode

  • Research for other editors [NeoVim, Sublime]

    • Sublime-Syntax File [YAML]
  • Research Sprint: NeoVim Syntax highlighting [TreeSitter Integration]

  • Test Regex with Rubular in order to ensure regex is appropriate

  • Regex are based on oniguruma dialect for TextMate Engine.

TextMate Grammar
Setting up Extension Development on VSCODE
Managing Extension Manifest
Grammars Contribution Section Within Manifest
Syntax Highlighting Guide on VSCode
Example TextMate Grammar
Gleam Programming Language TextMate Grammar

Stretch Goal: Try it with shikijs for our browser-based interpreter version (later down the road)

Chapter 2.9 (REPL)

The goal of this REPL Chapter is to be a RPPL (Read Parse Print Loop), where each statement given to the REPL is immediately parsed and returned back in string form, in order to show us what our programming language currently parses and understands / stores when a statement is being parsed.

Evaluator / Object Implementation

We'll follow along with book in order to evaluate the AST generated from the Parser to actually interpret our programming language.

Below are the list of chapters as we continue to implement alongside sub-chapters. Please convert each sub-chapter and checkbox into an issue and create PRs to keep track of them.

There are reading material only chapter(s) only here as well. READ THEM. You will have to talk about them in the presentation briefly.

  • Giving Meaning to Symbols
  • Strategies of Evaluation
  • Tree-Walking Interpreter
  • Representing Objects
    • Foundation of our Object System
    • Integers
    • Boolean
    • Null
  • Evaluating Expressions
    • Integer Literals
    • Completing the REPL
    • Boolean Literals
    • Null
    • Prefix Expressions
    • Infix Expressions
  • Conditionals
  • Return Statements
  • Error Handling
  • Bindings & The Environment
  • Functions & Function Calls
  • Garbage Collection Discussion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.