→ Open the PLAIN Playground (open playground/index.html in your browser)
npm install -g plain-langCreate a file called hello.plain:
set name to "World"
say "Hello, " + name + "!"
Run it:
plain hello.plainOr start the interactive REPL:
plainset name to "Parth"
set age to 19
set price to 299.99
say "Hello, world!"
say "Value: " + myVar
ask "What is your name?" and store in username
say "Hi, " + username
set result to 10 + 5 * 2
set area to width * height
set power to 2 ^ 10 -- 1024
set remainder to 17 % 5 -- 2
calculate 3.14 * r ^ 2 and store in circle_area
if score >= 90 then
say "Grade A"
otherwise if score >= 75 then
say "Grade B"
otherwise
say "Try again"
end
Operators: = != > < >= <= and or not
-- Repeat N times
repeat 5 times
say "Hello!"
end
-- Counted loop
count from 1 to 10 as i
say i
end
-- Loop over a list
for each item in myList
say item
end
create list fruits
add "apple" to fruits
add "mango" to fruits
say count of fruits -- 2
say item 1 in fruits -- apple
define step greet with name
say "Hello, " + name + "!"
end step
define step add with a, b
give back a + b
end step
run step greet with "Parth"
set total to run step add with 10, 20
say total
create table students
set headers of students to "Name", "Score", "Grade"
add row "Parth", 95, "A" to students
add row "Vedant", 82, "B" to students
show table students
fetch "https://api.example.com/data" and store in response
say response
wait 2 -- pause 2 seconds
stop -- exit program
-- comment -- this is a comment
plain-lang/
├── playground/ # Browser-based IDE & landing page
│ ├── index.html # Landing page + playground app
│ ├── style.css # All styles
│ ├── interpreter.js # Browser build of interpreter
│ └── app.js # Playground UI logic
├── src/
│ ├── interpreter.js # Core language runtime
│ └── cli.js # CLI entry point (plain command)
├── examples/
│ ├── hello.plain
│ ├── calculator.plain
│ └── grades.plain
├── package.json
└── README.md
npm login
npm publishPush the playground/ folder to a gh-pages branch:
git subtree push --prefix playground origin gh-pagesSet the root directory to playground/ and deploy.
- Syntax highlighting VS Code extension
- File I/O (
read file,write file) - String manipulation (
length of,upper,lower) - Type checking (
is number,is text) - Multi-file imports
- WASM build for faster browser execution
Made with ❤️ by Parth Pradip Bhosale
MIT — free to use, share, and modify.