GithubHelp home page GithubHelp logo

rustglass's Introduction

My top GitHub languages

Current Projects

Spigot plugin with over 17k downloads that allows customizable death messages.

App to teach special education students real-world financial skills.

Dynamically typed programming language written in rust.

rustglass's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

rustglass's Issues

Fix lexer to work with iter better

Since the lexer uses peeking, the position is usually (except for unclosed strings (in certain cases) is all I've noticed, maybe more) one character behind. It also stops lexing after multiple newlines in some scenarios

Remove memory hungry position fragment

Replace memory fragment with position class, give source code to it once and pass a borrowed copy around instead of cloning for each token (extremely memory inefficient)

Command line interpreter

Like python, create a interpreter to create a program line by line (or just as a quick utility ;) )

Unpacking

In the future I want unpacking to be a thing, for example:
[x, y] = [1, 2]

where x = 1 and y = 2

Change dispatch_error to macro

Change to macro that will retain functionality and expand to a placeholder panic that only prevents mismatched arm error

Fix error system

Change the arg slice to a wrapped enum with the string args, and replace it from the to_string method

Module trait

Use a trait named module for default implementations such as print, println, etc, and instead of replacing keywords with values, return a primitive of type module with a get method that returns the primitive the user will operate on. May help clean up code, but may also complicate things more than necessary, so this is still only potential

Replace i32 with usize

Position struct has fields for column and row as i32, it should be a usize. Remove casts from PositionFragment#to_string accordingly

Create documentation

  • Lexer documentation
  • Parser documentation
  • Interpreter documentation
  • Language general/overall documentation
  • Advanced documentation

Change dispatch_error to macro

Change to macro that will retain functionality and expand to a placeholder panic that only prevents mismatched arm error

Change Lexer to Iterator

More CPU and memory efficient and will cut down on code, will prevent unneeded consumption of tokens as well as be easier to use

Create compiler and decompiler

When I say compiler I mean a serialized ast, which can be run directly from the interpreter instead of lexing and parsing, and a decompiler which can turn it back into source code.

Lexer, Parser, and Interpreter

  • Create lexer
    • Range operator
    • Lex strings
      • Escape characters
      • Non terminated strings
    • Lex numbers
      • Decimals
      • Double decimals and ending in decimals
    • Lex identifiers
    • Lex operators
    • Lex single
    • Lex keywords
    • Implicit line joining
    • Create tests
    • Performance enchancements
  • Parser
    • Expression
    • Atom
    • Postfix
      Todo
  • Interpreter
    Todo

Improve lexer speed

Possible to improve speed by removing CharState because it runs if else statements, but then still has to be used in a match case which slightly increases lexing time. Despite being trivial, this could potentially drop the lexing time down a fair amount, especially when combined white improving the string cloning. (Or put the functions in a hashmap corresponding to the charstate, O(1) lookup time, and can just return an option from each)

Change dispatch_error to macro

Change to macro that will retain functionality and expand to a placeholder panic that only prevents mismatched arm error

Remove { expr }

My ternary (if statements) uses {} but i believe it's possible to leave that empty. (Potentially)

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.