Skip to content

W1LDN16H7/JPL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฅ JPL - JSON Programming Language

๐Ÿš€ Welcome to the worldโ€™s most ridiculous (and awesome) way to write code in JSON. Yes, you read that right. JSON. As code. Not just for configs or not just for data. But as a ridiculous programming language.

๐Ÿ‘พWhat is JPL?

{
  "language": "๐Ÿง  JPL (JSON as Programming Language) is what happens when you stare at too many curly braces and think, โ€œWhat if this was a real language?โ€",
  "type": "Fun JSON-Based Programming Language",
  "status": "๐Ÿ”ฅ Experimental, Minimal, For geeks",
  "features": [
    "โœ… Pure JSON syntax",
    "๐Ÿงฉ Print stuff (yes, really)",
    "๐Ÿ“ฆ Make variables like itโ€™s 1999",
    "๐Ÿ“œ Write loops, if/else, and functions",
    "๐Ÿš€ REPL + CLI",
    "๐Ÿ› ๏ธ Call system functions",
    "๐ŸŽญ Pretend youโ€™re living in a JSON utopia",
    "๐Ÿงช All in JSON. No kidding.",
    "๐Ÿง™ Are you afraid of braces? You should be.",
    "๐Ÿงช Experimental features like functions, loops, and conditionals"
  ],
  "warning": "โš ๏ธ If you're afraid of curly braces, step away!"
}

โš ๏ธ Warning for the Bracket-Phobic

โš ๏ธ ๐Ÿ Python devs, beware!

If curly braces {} or square brackets [] make you sweat, this JSON jungle isnโ€™t for you!

If you're afraid of {curly braces} or square brackets[], turn back now.

JPL is 99.9% JSON, 0.1% mercy.

Touch it only if you're brave enough to stare into the abyss of {} and live to tell the tale.


๐Ÿ“ฆ Installation

The Easy Way (Windows)

  • Download the latest JPL.exe
  • Double-click it, or run from terminal:
    jpl.exe --help

The Geek Way (Build from Source)

  1. Clone this chaotic project:
    git clone https://github.com/W1LDN16H7/JPL.git
    cd jpl
  2. Build it with Maven:
    mvn clean package
  3. Run it:
    java -jar target/JPL-1.0-SNAPSHOT.jar
  4. Build executable with GraalVM (Windows):
     .\native-image -cp picocli-4.7.7.jar  -jar jpl.jar

Or use the pre-built JAR:

๐ŸŽฎ Try it out

REPL mode (yes, it has a REPL ๐Ÿ˜ฑ):

jpl.exe or java -jar jpl.jar

Run a JPL program:

jpl.exe run examples/func.jpl

Compile JPL to real Java code:

jpl.exe compile may be in the future 

Print help + load some samples:

jpl.exe help loop

๐Ÿ“– Sample JPL Code (Yes, this is code)

[
  { "let": { "name": "JSON", "times": 3 } },
  {
    "for": {
      "var": "i",
      "from": 1,
      "to": "times",
      "do": [
        { "print": { "add": ["Hello ", "name"] } }
      ]
    }
  }
]

Output:

Hello JSON
Hello JSON
Hello JSON

๐Ÿฆ„ Mega Example

Save this as megaExample.jpl and run jpl.exe run megaExample.jpl:

[
  { "import": "system.jpl" },
  { "print": { "call": { "now": [] } } },
  { "print": { "call": { "osName": [] } } },
  { "print": { "call": { "cpuCount": [] } } },
  { "let": { "a": 9, "b": 4, "name": "JPL" } },
  { "print": { "add": ["\"a + b = \"", { "add": ["a", "b"] }] } },
  { "print": { "mul": ["a", "b"] } },
  { "print": { "div": ["a", "b"] } },
  { "print": { "mod": ["a", "b"] } },
  { "print": { "&": [6, 3] } },
  { "print": { "||": [false, true] } },
  { "print": { "gt": ["a", "b"] } },
  { "def": { "sq": { "params": ["x"], "body": [{ "return": { "mul": ["x", "x"] } }] } } },
  { "print": { "call": { "sq": [5] } } },
  { "def": { "greet": { "params": ["who"], "body": [{ "return": { "add": ["\"Hi, \"", "who"] } }] } } },
  { "print": { "call": { "greet": ["\"JSON Fan\""] } } },
  { "if": { "cond": { "<": ["b", "a"] }, "then": { "print": "\"b < a ๐Ÿ‘\"" }, "else": { "print": "\"b >= a ๐Ÿค”\"" } } },
  { "for": { "var": "i", "from": 1, "to": 3, "step": 1, "do": [ { "print": { "call": { "sq": ["i"] } } } ] } },
  { "print": "\"All features in one! ๐ŸŽ‰\"" }
]

Expected Output:

2025-07-09T15:30:00.123
Windows 10
8
"a + b = 13.0"
36.0
2.25
1.0
2
true
true
25
Hi, JSON Fan
b < a ๐Ÿ‘
1
4
9
All features in one! ๐ŸŽ‰

Example

[
// ๐Ÿš€ Welcome to JPL โ€” JSON Programming Language!

// Import system utilities for fun stuff
{ "import": "system.jpl" },

// Print system info
{ "print": { "call": { "now": [] } } },
{ "print": { "call": { "osName": [] } } },
{ "print": { "call": { "cpuCount": [] } } },

// Define a math function to square a number
{
  "def": {
    "square": {
      "params": ["x"],
      "body": [
        { "return": { "mul": ["x", "x"] } }
      ]
    }
  }
},

// Greet a user
{
  "def": {
    "greet": {
      "params": ["name"],
      "body": [
        { "return": { "add": ["Hello, ", "name"] } }
      ]
    }
  }
},

// Declare variables
{ "let": { "a": 7, "user": "Kapil" } },

// Use greet function and print
{ "print": { "call": { "greet": ["user"] } } },

// Conditional message
{
  "if": {
    "cond": { ">": ["a", 5] },
    "then": { "print": "a is greater than 5" },
    "else": { "print": "a is 5 or less" }
  }
},

// Loop with break and continue
{
  "for": {
    "var": "i",
    "from": 1,
    "to": 10,
    "step": 1,
    "do": [
      { "if": { "cond": { "eq": ["i", 3] }, "then": { "continue": true } } },
      { "if": { "cond": { "gt": ["i", 7] }, "then": { "break": true } } },
      { "print": { "call": { "square": ["i"] } } }
    ]
  }
},

// Fun ending message
{ "print": "๐ŸŽ‰ Done with curly braces and JSON fun!" }
]

๐Ÿ“š Examples & Help Topics

Type:

  • jpl.exe help basics โ†’ Intro & let/print
  • jpl.exe help math โ†’ Arithmetic & logic
  • jpl.exe help if โ†’ Conditionals
  • jpl.exe help loop โ†’ For-loops & controls
  • jpl.exe help func โ†’ Functions & returns
  • jpl.exe help system โ†’ System library

Or explore the /examples directory for ready-to-run scripts:

  • a1.jpl โ€“ Example script 1
  • a2.jpl โ€“ Example script 2
  • basic.jpl โ€“ Basic syntax and printing
  • bmath.jpl โ€“ More math operations
  • cmt.jpl โ€“ Comments usage
  • cond.jpl โ€“ Advanced conditionals
  • const.jpl โ€“ Constants
  • func.jpl โ€“ Functions and calls
  • if.jpl โ€“ If/else conditionals
  • loop.jpl โ€“ While loops
  • math.jpl โ€“ Math operations

To run all examples at once (Windows):

examples/run_all_examples.bat

Or run individually:

jpl.exe run examples/if.jpl

๐Ÿงฉ Built-in Libs (aka JPL "Standard Library")

You can import libs like this:

{ "import": "system.jpl" }

Available libraries:

  • system.jpl โœ… โ†’ OS info, time
  • string.jpl โŒ โ†’ String tricks
  • math.jpl โŒ โ†’ Power math
  • func.jpl โŒ โ†’ Sample functions
  • loop.jpl โŒ โ†’ Loop demo
  • basics.jpl โŒ โ†’ Print & let stuff

๐ŸŽฏ Who is this for?

  • JSON geeks who want to troll JavaScript
  • Devs who love abuse of data formats
  • Educators teaching ASTs / interpreters
  • Hackers who want a new esolang
  • People who just love chaos. ๐Ÿงจ

๐Ÿ”ง Future Features (If Weโ€™re Bored)

  • File IO (read JSON while writing JSON ๐Ÿ˜ต)
  • JPL โ†’ JVM bytecode (because why not)
  • Web-based playground (comingโ€ฆ maybe)
  • JPL transpiler to TypeScript, Python, Morse code

๐Ÿค Contribute & Fork

  • Fork on GitHub: https://github.com/W1LDN16H7/JPL
  • Add your own .jpl libraries in lib/
  • Create VSCode syntax plugins or web playgrounds
  • Write issues for bugs, features, or just to say hi
  • PRs: new features, docs, examples
  • Add your own JPL scripts to examples/
  • Write posts about your JPL adventures on X with #jpl
  • Fix/Add NEW things in README.md, examples, or code
  • Star the project and share it need your support to keep the madness alive!

Buy Me A Coffee


๐Ÿ“œ License & Thanks

MIT License โ€” code it, break it, share it. Built for JSON geeks who dare to dream in braces. โค๏ธ


Made with โค๏ธ and pure nonsense by Kapil.

Have fun, cause chaos, JPL forever! ๐ŸŽŠ