Skip to content

EasyLang is an interpreted language with the aim to be as close as possible to clear, spoken, beginner-friendly English. All program structures explicitly use English words rather than symbols or cryptic keywords.

License

Notifications You must be signed in to change notification settings

greenbugx/EasyLang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyLang — Readable, English-like scripting for learning and prototyping

EasyLang is a compact educational scripting language whose syntax reads like English. It is optimized for clarity and teaching: you can write programs using short English phrases instead of dense punctuation.


Table of Contents


Getting Started

To get started with EasyLang, follow these steps:

Requirements

  • A computer running Windows (EasyLang is currently available for Windows only).
  • Python 3.10 or higher installed on your system. You can download it from the official Python website.
  • A Brain to understand and enjoy EasyLang!

Installation

  1. Download the EasyLang Interpreter: Visit the EasyLang GitHub Releases page and download the latest version for your operating system. [Note: EasyLang is currently available for Windows only.]

  2. Install the Interpreter: Follow the installation instructions provided in the downloaded package.

  3. Verify Installation: Open your command line interface and run:

    el --version
    

    You should see the installed version of EasyLang as:

    EasyLang version 0.1.x by GreenBugX(0xNA)
    

If you see this output, the installation was successful!

If not then you might need to add EasyLang to your system PATH.

  • For Windows, follow this guide. [Note: The PATH is where you have installed EasyLang, e.g., C:\EasyLang\]

  • For Mac/Linux, follow this guide. [Note: Not applicable yet as EasyLang is Windows only for now.]

  1. Create Your First EasyLang Script: Open a text editor and create a new file named hello.elang with the following content:

    print "Hello, EasyLang!"
    
  2. Run Your Script: Open your command line interface, navigate to the directory where you saved hello.elang, and run:

    el hello.elang
    

    You should see the output:

    Hello, EasyLang!
    
  3. Run Interactive Mode (REPL): You can also run EasyLang in interactive mode by simply typing:

    el --repl
    

    This will open the EasyLang REPL where you can type and execute EasyLang commands directly.

    For example:

    EasyLang 0.1.x REPL
    Type 'exit' or 'quit' to leave
    >>> print "Hello, EasyLang"
    Hello, EasyLang
    >>>
    

ELPM - EasyLang Package Manager

EasyLang comes with a built-in package manager called ELPM (EasyLang Package Manager) that allows you to easily install and manage Python libraries and use them in your ELANG code.

How to Use ELPM?

Verifying ELPM Installation

To verify that ELPM is installed correctly, run the following command in your command line interface: elpm --version

You should see the installed version of ELPM as: ELPM - EasyLang Package Manager v2025.x

If not, please ensure that you have installed EasyLang correctly and that ELPM is included in your installation. Otherwise add path/to/EasyLang/elpm to PATH.

Installing Packages

To install a package using ELPM, use the following command: elpm --install <package-name>

Command-Line Options

  • --install <package-name>: Installs the specified package.
  • --uninstall <package-name>: Uninstalls the specified package.
  • --list: Lists all installed packages.
  • --help: Displays all commands.
  • --version: Displays the current version of ELPM.
  • --freeze: Outputs a list of installed packages in requirements.txt format.
  • --search <query>: Searches for packages matching the query.
  • --upgrade <package>: Upgrades all installed packages to their latest versions.
  • --info <package>: Displays detailed information about the specified package.

Using Installed Packages in EasyLang

Once you have installed a package using ELPM, you can use it in your EasyLang scripts by importing it with the bring keyword. For example, if you installed the requests package, you can use it in your EasyLang script like this:

bring "requests" as req
print req.get("https://api.github.com").status_code

How ELPM Works?

ELPM works by leveraging Python's package management system pip to install and manage packages. When you run ELPM commands, it interacts with pip to perform the requested actions.


Language Features

Warning

EasyLang is currently in active development. Features may change, and new features are added regularly. Therefore, Language Features, Syntax & Reference, Examples and Docs are outdated.

EasyLang is an English-like, beginner-friendly scripting language designed for clarity, readability, and expressive flow. Its syntax avoids symbols wherever possible and favors natural-language keywords.

Below is the full list of core features supported by the current EasyLang interpreter.


✨ Key Highlights

  • English-like, readable syntax
  • Dynamic typing with simple variable declarations
  • Functions, classes, and object-oriented programming
  • Lists, dictionaries, and slicing
  • Pattern matching (match / when)
  • File handling and module imports
  • Rich built-in standard library
  • Pretty, Python-style error messages

Basic Syntax Example

let x = 10

if x greater 5 then [
    print "Greater"
] else [
    print "Smaller"
]

Variables & Data Types

Variables are declared using the let keyword:

let age = 20
let name = "John"
let active = true

Supported data types:

  • Integers
  • Floats
  • Text (strings)
  • Booleans
  • Lists
  • Dictionaries
  • Null

Constants can be defined using:

constant PI = 3.14

Expressions & Operators

Arithmetic Operators

  • plus or +
  • minus or -
  • mul or *
  • div or /
let total = 10 plus 20
let value = total mul 2

Comparison Operators

  • less
  • greater
  • equals or ==
  • not equals or !=
  • >=, <=

Logical Operators

  • and
  • or
  • not

Augmented Assignments

ELANG supports augmented assignments for convenience:

x += 1
x -= 2
x *= 3
x /= 4
x %= 2

Conditionals

Full conditional branching is supported:

if x greater 10 then [
    print "Large"
] else if x equals 10 then [
    print "Equal"
] else [
    print "Small"
]

Blocks are enclosed using [ ].


Loops

While Loop

repeat while x less 5: do [
    print x
    x += 1
]

Numeric For Loop

repeat from i = 1 to 10: do [
    print i
]

Functions

Functions are defined using define:

define greet(name): do [
    print "Hello " plus name
]

Functions can return values:

define add(a, b): do [
    return a plus b
]

Classes & Object-Oriented Programming

ELANG supports class-based OOP.

Defining a Class

define class Person:
[
    let name be ""
    let age be 0

    define method when_created(n, a):
    do [
        self.name be n
        self.age be a
    ]

    define method greet():
    do [
        print "Hello, I am " plus self.name
    ]
]

Creating Objects

make p be Person("John", 20)
p.greet()

Features:

  • Fields and methods
  • self keyword
  • Constructor via when_created
  • Method calls and property access

Lists, Dictionaries & Slices

Lists

let nums = [1, 2, 3, 4]
nums.push(5)
nums.pop()
print nums.length()

Dictionary

let person = { "name": "John", "age": 20 }
print person["name"]
print person.keys()

Slices

ELANG supports slicing for lists and strings:

nums[1:4]
nums[:3]
nums[2:]

Pattern Matching (match / when)

ELANG includes pattern matching similar to switch/case:

let x be 5
let y be 5

match x plus y with [
    when 10 then [
        print "Sum is 10"
    ]
    when 8 then [
        print "Sum is 8"
    ]
    otherwise [
        print "Sum is something else"
    ]
]
print ""

Modules (bring)

External ELANG modules can be imported using bring:

bring "math.elangh" as math
print math.sqrt(25)

Supports:

  • Aliases
  • Nested paths
  • Module caching

File I/O

Opening Files

open "data.txt" as f for read
open "log.txt" as log for write
open "out.txt" as out for append

Reading & Writing

readline f into line
writeline log with "Hello"
close f

Input & Output

Printing

print "Hello World"

User Input

read int age
read text name
read boolean active

Typed input is validated automatically.


Built-in Standard Library

Includes utilities for:

  • Math: sin, cos, sqrt, pow, log, floor, ceil
  • Random: random(), randint(), seed()
  • Strings: upper(), lower(), strip(), split(), substring()
  • Conversions: int(), float(), str()
  • Lists: len(), range(a,b)

Pretty Error System

ELANG features a clean, color-coded error system:

  • Shows error type and message
  • Displays surrounding source lines
  • Caret points to the exact error location
  • Works for syntax, runtime, and type errors

Syntax & Reference

Full Documentation is available here


Examples

Examples are available here


Full Roadmap

EasyLang development runs in phases. Core language features like let, functions, loops, modules, file I/O, lists, dicts, recursion and built-ins are already stable. Now focus shifts toward improving syntax, tooling and ecosystem.


Quick Summary Roadmap

  • PHASE 1 — Core Language Stability (Current Stage)
  • PHASE 2 — New Language Features (Switch, Try/Catch, Classes, Types)
  • PHASE 3 — Standard Library Expansion
  • PHASE 4 — Dev Tools (VSCode, Formatter, Debugger)
  • PHASE 5 — Ecosystem, Docs, Community

PHASE 1 — Core Language Stability (NOW)

✔ Already Completed

  • Lexer, Parser, Interpreter
  • let var be value / let x = n assignment syntax
  • PRINT keyword (print x)
  • Recursion now works reliably
  • Removed so from syntax to keep it clean
  • Functions, return values, scope handling
  • Loops: repeat while, repeat from i be 1 to n
  • Lists, dictionaries, indexing, methods (push, pop, ...)
  • Comparison logic, arithmetic & boolean operators
  • Pretty colored runtime/syntax error system
  • Module system (bring "file" as alias)
  • Built-ins: math, random, string, IO functions
  • File operations: open/write/read/append/close
  • REPL, command-line runner
  • Exponent operator expo + **
  • Better runtime error messages
  • Improve expression parsing precedence
  • Inline and Anonymous Functions

🔧 In Progress

  • Performance improvements in loops & evaluation

PHASE 2 — Feature Expansion

  • match/when statement
  • try / handle
  • Classes or prototype-style objects
  • const values support
  • String interpolation → "Hello {name}"
  • Loop enhancements
  • Type annotations & static hints

PHASE 3 — Standard Library Growth

Upcoming built-ins:

Library Planned Features
fs exists, mkdir, read/write utils
crypto hashing & random bytes
json parse / stringify
regex match, replace

ELPM integration continues.


PHASE 4 — Tooling

  • Formatter: el --format file.elang
  • Linter: el --lint file.elang
  • Debugger with stepping & breakpoints
  • AST visualizer

PHASE 5 — Ecosystem & Community

  • Full documentation website
  • Interactive examples & playground
  • Templates + starter projects
  • Discord / community hub

Contributing

Contributions are welcome! If you'd like to contribute to EasyLang, please follow these steps:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with clear messages.
  4. Push your changes to your forked repository.
  5. Open a pull request to the main EasyLang repository.

Please ensure your code adheres to the existing style and includes appropriate tests. For major changes, please open an issue first to discuss what you would like to change.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Outro

Thank you for checking out EasyLang! We hope you find it useful for learning and prototyping. If you have any questions or need help, feel free to open an issue on GitHub or join our community discussions.

Happy coding! 🚀

© 2025 GreenBugX(0xNA). All rights reserved.

About

EasyLang is an interpreted language with the aim to be as close as possible to clear, spoken, beginner-friendly English. All program structures explicitly use English words rather than symbols or cryptic keywords.

Topics

Resources

License

Stars

Watchers

Forks