| Crates.io | jsonpiler |
| lib.rs | jsonpiler |
| version | 0.7.2 |
| created_at | 2025-04-16 03:28:46.283053+00 |
| updated_at | 2025-09-08 16:04:50.865872+00 |
| description | a Json syntax programming language for Windows |
| homepage | |
| repository | https://github.com/HAL-G1THub/jsonpiler.git |
| max_upload_size | |
| id | 1635749 |
| size | 868,481 |
Jsonpiler is a compiler and runtime for a programming language that uses JSON or JSPL (Jsonpiler Structured Programming Language) as its syntax. It converts a JSON-based program into x86_64 Windows PE machine code, links it, and executes the result. Jsonpiler bundles an assembler and linker purpose-built for its IR and PE output on Windows.
🚨 Windows only (x64) — Jsonpiler targets 64-bit Windows and produces native PE executables.
Jsonpiler now has a function to support GUI.

Zoom of the Mandelbrot set drawn by Jsonpiler
Source code of the program to draw the Julia set with GUI
Source code of the program to draw the Mandelbrot set with GUI
ret.break, continue.See CHANGELOG for full history and plans.
No external toolchains or libraries are required.
The following system DLLs must be available in C:\\Windows\\System32\\:
gdi32.dll(GUI, etc.)kernel32.dll(required)user32.dll(message, GUI, etc.)
These are present on standard Windows installations.cargo install jsonpiler
# Compile and execute a JSON program
jsonpiler <input.json | input.jspl> [args passed to the produced .exe]
<input.json> must be UTF-8 encoded.Browse ready-to-run samples in examples/
Minimal example:
{ "=": ["a", "title"], "message": [{"$": "a"}, "345"], "+": [1, 2, 3] }
"=" assigns the string "title" to the variable a."message" prints the value of a followed by "345"."+" computes the sum of 1, 2, and 3, i.e., 6.The program’s final expression value becomes the process exit code. Running under cargo run may look like this (Windows reports process exit code 6):
error: process didn't exit successfully: `jsonpiler.exe test.json` (exit code: 6)
This is expected behavior and not an error in Jsonpiler itself.
Jsonpiler can compile its own language, JSPL (Jsonpiler Structured Programming Language). JSPL is designed to express function definitions,conditionals, function calls, and variable assignments in a natural and intuitive form. All JSPL code is internally transformed into the same JSON-based intermediate representation (IR), ensuring full compatibility with the existing Jsonpiler compilation infrastructure while making programs easier to write and understand. For more details, see the language specification above. Example of the above sample code written in JSPL:
a = "title"
message($a, "345")
+(1, 2, 3)
| Differences from JSON | JSON | JSPL |
|---|---|---|
Curly braces {} |
Required | Optional for top-level blocks |
| Function call syntax | Explicit form like {"sum": [1,2,3]} |
Natural syntax like sum(1, 2, 3) |
| Identifier notation | All keys must be quoted "string" |
Unquoted identifiers are allowed |
| Infix notation | Not supported | 1 + 10 → expanded to { "+": [1, 10] } |
| Variable reference syntax | Explicit form like {"$": "name"} |
Can be written as $name |
| Comments | Not allowed (by spec) | Supported via # comment |
Input:
{ "message": ["title", { "$": "doesn't_exist" }] }
Output:
Compilation error: Undefined variables: `doesn't_exist`
Error occurred on line: 1
Error position:
{ "message": ["title", { "$": "doesn't_exist" }] }
^^^^^^^^^^^^^^^
graph TD
subgraph Read
A["file.json
{ "+": [1, 2] }"] --> B{Jsonpiler}
end
subgraph Parse
B --o C["AST
Json::Object([
Json::String("+"),
Json::Array([
Json::Int(1),
Json::Int(2)
])])"]
B --x PError[[ParseError]]
end
subgraph Compile
C --x CError[[CompileError]]
C --o E["Assembler IR
[
...Inst::MovQQ(Rax, 1),
Inst::MovQQ(Rcx, 2),
Inst::AddRR(Rax, Rcx)...
]"]
end
subgraph Evaluate
C --o D["Json::Int(Temporary Value)"]
C --x EError[[TypeError or ArityError]]
D -->|Detect Exit Code| E
end
subgraph Assemble
E --o G["Binary machine code
[...0x48, 0x89, 0o201]..."]
E --x AError[[InternalError]]
end
subgraph Link
G --o F["Portable Executable (PE)"]
G --x LError[[InternalError]]
end
subgraph Write
F --> H[file.exe]
end
subgraph Execution
H --> Exec[(Execute)]
end
subgraph DLL
S[C:\\Windows\\System32\\]
KERNEL32[kernel32.dll]
USER32[user32.dll]
S --> KERNEL32 --> F
S --> USER32 --> F
end
This project’s license is specified in the repository.
Issues and PRs are welcome! If you find a bug, please include the following information:
🚨 Please make sure you are running on Windows x64.