Skip to content

Latest commit

 

History

History
37 lines (33 loc) · 680 Bytes

README.md

File metadata and controls

37 lines (33 loc) · 680 Bytes

Javascript Execution Engine in Rust

Very simple JS Engine with basic expressions support:

  1. Binary expressions like 1+(3+5)*3*(3+10)
  2. Variables and changing variables:
let x = 10;
let b = 30 + 1;
b = b + 5;
x + b // evaluates to JSNumber { value: 46 }
  1. Strings
let x = "Hello World"
x //  evaluates to JSString  { value: "Hello World" }
  1. Block scoping
// its own scope
{
  let x = 1;
}
  1. Functions
function x(a, b) { 
  return a + b;
}

x(2, 3); // evaluates to 5
  1. Objects
let obj = {a: 3, b: "Hello World"}; // evaluates to JSObject { value: HashMap /w "a" - 3 as JSNumber and "b" - "Hello World" as JSString }