DEV Community

Malik Whitten
Malik Whitten

Posted on

I created a framework called lazyjs based on json!

Lazy JS

LazyJS is a programming language that is designed to make it easier to write and manage complex code by reducing the amount of code needed to achieve the desired results. It is based on the JSON object-oriented language and is intended for use in large and complex workflows. LazyJS aims to provide a concise and organized way to write code, while still maintaining the flexibility and power of a full-featured programming language.

Syntax

lazyjs syntax is relatively simple if you understand json syntax:

{
  /* Variables can be declared for extensive use!*/
 "variable":{
  "main":{
   // there are two value setters currently in v1.0
   "value":"hello world"
   // this can also be used to add subtract, multiply and divide
   "value":"1+2*4/4"
  }
  // to get the variable value we can use return this is how we print stuff!
  "return":"main"
  // output --> 3
 }



}
Enter fullscreen mode Exit fullscreen mode

## Features

Note: as lazy keeps progressing overtime more will be added, here is what v1.0 has

  1. Http Web Server
// Simple way to serve html files via lazy js
{
  "variable":{
   "main":"index.html"
 }
  "http":{
   "port":8080,
   // routes is your webpages routing this sets binds /main to the ip
   "routes":{
    "1":"main",
  }
  // pages is how u bind html files to the router! it returns the variable.main! - note this only works if dom is not present in the file!
  "pages":{
  "1":"main"
 }
 }
}
Enter fullscreen mode Exit fullscreen mode
  1. Virtual Dom
"http":{
   "port":8080,
   "routes":{
    "1":"/main",
  }
  "pages":{
  "1":"main"
 }
 // when dom is in use regular static pages will not work!
 "dom":{
    // this is the main element when using vdom
    "div":{
      "1":"<center>",
      "2":"<p style='color:#938E8E; font-weight:400; font-size: 70px; font-family:Arial, Helvetica, sans-serif ; position:relative; top:120px '>505</p>",
      "3":"<p style=' font-family:Arial, Helvetica, sans-serif ; color:#dd6464; position:relative; top:50px;'>This is lazyjs v2.0 Virtual Dom</p>",
      "4":"</center>"
    }
   }
 }
Enter fullscreen mode Exit fullscreen mode

Currently still working on it :}

Release date: Sometime January!

Top comments (0)