#json #json-parser #windows

bin+lib jsompiler

a Json syntax programming language for Windows

Uses new Rust 2024

new 0.2.5 Apr 16, 2025
0.2.4 Apr 16, 2025
0.1.7 Apr 11, 2025

#111 in Programming languages

Download history 1068/week @ 2025-04-01 627/week @ 2025-04-08

1,695 downloads per month

Apache-2.0

54KB
1K SLoC

Rust 1K SLoC GNU Style Assembly 149 SLoC

Jsompiler - JSON Syntax Programming Language

Jsompiler is a compiler for the JSON Syntax Programming Language.

This program converts a JSON-based program into GNU Assembly, compiles it, and executes the result.

What's New

  • Add MerMaid to README.md
  • Optimize message box functions.
  • Fixed a bug in the evaluation order.

Prerequisites

Make sure the following tools are installed and available in your PATH environment variable:

  • ld (from MinGW-w64)
  • as (from MinGW-w64)

The following DLLs must be present in C:\Windows\System32 for the program to work correctly:

  • kernel32.dll
  • user32.dll
  • ucrtbase.dll

Installation & Usage

cargo install jsompiler
jsompiler (input_json_file in UTF-8)

Replace (input_json_file) with the actual JSON file you want to compile.

Example

["begin", ["=", "a", "title"], ["message", ["$", "a"], "345"]]

Execution order:

The jsompiler code consists of a single JSON object.

Expressions inside begin are evaluated sequentially.

The variable "a" is assigned the string "title" using "=".

A message box appears with the title (from variable "a") and the body "345", as specified by "message".

The program returns the integer ID of the pressed button in the message box
(currently only 1 is supported, which corresponds to IDOK in C/C++),
as the final value of the begin block.

Function Documentation

Function Reference (Markdown)

Execution

graph TD
  A[file.json] --> B{Jsompiler}
  B -->|Parse| C([AST])
  C -->|Compile| D[file.s]
  D --> |Assembling with GNU AS| E[file.obj]
  E --> |Linking with GNU LD| F[file.exe]
  S[C:\Windows\System32\] --> KERNEL32[kernel32.dll] --> F[file.exe]
  S --> USER32[user32.dll] --> F[file.exe]
  S --> UCRTBASE[ucrtbase.dll] --> F[file.exe]
  F --> Execute[(Execute!)]

No runtime deps