Giter VIP home page Giter VIP logo

jsvm's Introduction

jsvm

A "javascript" "vm" project. Currently this is very imcomplete, but the goal for this project is to create something that turns a subset of javascript into jvm bytecode currently, but eventually different formats as well.

Rationale

This project came about as somewhat a joke (js -> java) and somewhat something I've really wanted to do for a large period of time. I've noticed in the Javascript ecosystem many people will ignore performance as a whole, leading to the overbloated and incredibly slow web (especially on lower end machines). This project, in a sense, seeks to remedy some of that, and make the web (or nodejs, etc.) faster and more versitile.

Goals

Eventually, I want this project to be completely compatible with all of javascript and beat V8 in terms of performance due to more strict typing, and other optimizations V8 simply can't make at runtime because of their cost.

Roadmap

Any features with a empty checkbox means they are currently in progress, any fully checked checkbox means the feature is complete (though might have bugs).

  • Parse javascript
    • Statements
      • Variable declarations
        • let, const, var
        • Destructuring
      • if
      • for
      • for .. in
      • for .. of
      • while
      • do .. while
      • try .. catch
      • try .. catch .. finally
      • switch
    • Expresions
      • Assignment
        • Increment/Decrement
      • Arithmetic
      • Logical
      • Binary
      • Comparision
      • Ternary
      • typeof
      • instanceof
      • Primatives
        • Number
        • String
        • Boolean
        • Object
        • Array
        • Undefined
        • Null
        • Symbol
    • Constructions
      • Classes
        • Fields
        • Methods
        • Access modifiers
      • Functions
        • Arguments
          • General
          • Rest
          • Default
        • Arrow
        • Generator
  • Run javascript
    • Primative Types
      • Number
      • Boolean
      • String
    • Arithmetic
    • Functions
      • Return
    • Variables
      • Scoping
    • Control flow
      • If
      • Loops
        • For
        • While
        • Break
        • Continue
    • Collections
      • Array
      • Object
    • Operators
      • Typeof
      • Instanceof
    • Prototypes
    • Finish Types
      • Symbol
      • Bigint
      • Undefined
      • Null
    • Arrow functions
    • Async
    • Anything else to pass test262
  • Optimizations
    • Detect monomorphic object literals and convert them into simple structs
      • Potenially create parent and children relationships between similar objects used in the same places
        • Example: { a: 1, b: 3 } { a: 1 } could be placed in the same container in some circumstances with instanceof checks as necessary
    • Detect strings used as enums
      • Might be very difficult to impossible once the input code is large enough
    • Double -> Float -> Int -> Byte when possible
    • Purity checks?
    • Turn datatypes into what they should be, i.e List -> Stack, Object -> Map, Object -> Set, etc.
  • Run typescript

Sources Referenced

jsvm's People

Contributors

bobvarioa avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

shuaibibobo

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.