plain-lang
v1.0.1
Published
PLAIN — A programming language that reads like plain English. No brackets, no semicolons, no cryptic symbols.
Maintainers
Readme
PLAIN — Plain Language Programming
✨ Try it Online
→ Open the PLAIN Playground (open playground/index.html in your browser)
📦 Install the CLI
npm install -g plain-lang🚀 Quick Start
Create a file called hello.plain:
set name to "World"
say "Hello, " + name + "!"Run it:
plain hello.plainOr start the interactive REPL:
plain📖 Language Reference
Variables
set name to "Parth"
set age to 19
set price to 299.99Output & Input
say "Hello, world!"
say "Value: " + myVar
ask "What is your name?" and store in username
say "Hi, " + usernameMath
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_areaConditions
if score >= 90 then
say "Grade A"
otherwise if score >= 75 then
say "Grade B"
otherwise
say "Try again"
endOperators: = != > < >= <= and or not
Loops
-- 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
endLists
create list fruits
add "apple" to fruits
add "mango" to fruits
say count of fruits -- 2
say item 1 in fruits -- appleFunctions
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 totalData Tables
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 studentsWeb Requests
fetch "https://api.example.com/data" and store in response
say responseOther
wait 2 -- pause 2 seconds
stop -- exit program
-- comment -- this is a comment🗂️ Project Structure
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🌐 Publishing
npm
npm login
npm publishGitHub Pages (playground)
Push the playground/ folder to a gh-pages branch:
git subtree push --prefix playground origin gh-pagesVercel / Netlify
Set the root directory to playground/ and deploy.
💡 Roadmap
- [ ] 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
🧑💻 Author
Made with ❤️ by Parth Pradip Bhosale
📄 License
MIT — free to use, share, and modify.
